'while' statement cannot complete without throwing an exception
You are probably using Android Studio or IntelliJ.
If so, you can add this above your method containing the infinite loop to suppress warnings:
@SuppressWarnings("InfiniteLoopStatement")
Or add this "magic" comment above the statement:
//noinspection InfiniteLoopStatement
This will tell the IDE that this is ok.
More generally, when you get a false positive warning, do Alt+Enter and do what showed on the screenshot below (select class only if your class is full of false positive, for the same warning)
有时候这个告警是多余的,例如我们手写的监控线程。
如果有消除告警强迫症。在线程的执行方法上加入注解。
@SuppressWarnings("InfiniteLoopStatement")
public void run() {
...
}
'while' statement cannot complete without throwing an exception的更多相关文章
- Intellij idea 告警:'while' statement cannot complete without throwing an exception
有时候这个告警是多余的,例如我们手写的监控线程. 如果有消除告警强迫症.在线程的执行方法上加入注解. @SuppressWarnings("InfiniteLoopStatement&quo ...
- retrofit框架接口调用时候报Throwing new exception
最近在开发的时候遇到了一个很坑的问题,在三星6.0手机上请求接口时候报了一个异常:Throwing new exception 'length=1658; index=3248' with unexp ...
- 并发安全 sync.Map
https://mp.weixin.qq.com/s/MqPm7QH3_D9roVkpTs9Xpw 谈谈Go的并发安全相关 原创 歪鼻子 歪鼻子 2020-12-27 package main ...
- Debug.Assert vs Exception Throwing(转载)
来源 Q: I've read plenty of articles (and a couple of other similar questions that were posted on Stac ...
- 【JUnit4.10源码分析】5 Statement
假设要评选JUnit中最最重要的类型.或者说核心,无疑是org.junit.runners.model.Statement.Runner等类型看起来热闹而已. package org.junit.ru ...
- How a C++ compiler implements exception handling
Introduction One of the revolutionary features of C++ over traditional languages is its support for ...
- Akka(26): Stream:异常处理-Exception handling
akka-stream是基于Actor模式的,所以也继承了Actor模式的“坚韧性(resilient)”特点,在任何异常情况下都有某种整体统一的异常处理策略和具体实施方式.在akka-stream的 ...
- Java中的异常Exception
涉及到异常类相关的文章: (1)异常类不能是泛型的 http://www.cnblogs.com/extjs4/p/8888085.html (2)Finally block may not comp ...
- Exception (2) Java Exception Handling
The Java programming language uses exceptions to handle errors and other exceptional events.An excep ...
随机推荐
- Android源码分析(一)-----如何快速掌握Android编译文件
一 : Android.mk文件概述 主要向编译系统指定相应的编译规则.会被解析一次或多次.因此尽量减少源码中声明变量,因为这些变量可能会被多次定义从而影响到后面的解析.这个文件的语法会把源代码组织成 ...
- 服务器Oracle数据库配置与客户端访问数据库的一系列必要设置
tips:所有路径请对应好自己电脑的具体文件路径. 一.服务器及Oracle数据库设置 1.刚装完的Oracle数据库中只有一个dba账户,首先需要创建一个用户. 2.配置监听,C:\app\Admi ...
- TensorFlow GPU版本的安装与调试
笔者采用python3.6.7+TensorFlow1.12.0+CUDA10.0+CUDNN7.3.1构建环境 PC端配置为GTX 1050+Intel i7 7700HQ 4核心8线程@2.8GH ...
- css 最后的终章
相对定位:参考点 相对原来的位置 1.如果是一个单独的文档流盒子,及你姐设置了相对定位,和普通盒子一样 2.相对定位后,如果调整位置,会留下坑 作用:微调元素 子绝父相 提升层级 绝对定位 参考点:父 ...
- 17-numpy笔记-莫烦pandas-5
代码 import pandas as pd import numpy as np left=pd.DataFrame({'key':['K0','K1','K2','K3'], 'A':['A0', ...
- OpenCV随机颜色,用于画图调试
static Scalar randomColor(int64 seed) { RNG rng(seed); int icolor = (unsigned)rng; return Scalar(ico ...
- volatile关键字及Java内存模式
参考文档:https://www.cnblogs.com/_popc/p/6096517.html volatile关键字虽然从字面上理解起来比较简单,但是要用好不是一件容易的事情.它与Java的内存 ...
- <binary search> 154 162
154. Find Minimum in Rotated Sorted Array II 当数组中存在大量的重复数字时,就会破坏二分查找法的机制,将无法取得 O(lgn) 的时间复杂度,又将会回到简单 ...
- [LeetCode] 545. Boundary of Binary Tree 二叉树的边界
Given a binary tree, return the values of its boundary in anti-clockwise direction starting from roo ...
- [LeetCode] 454. 4Sum II 四数之和之二
Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such t ...