'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 ...
随机推荐
- vsftpd服务
vsftpd服务 文件传输协议(file transfer protocol,FTP),基于该协议FTP客户端与服务端可以实现共享文件,上传文件,下载文件.ftp基于TCP协议生成一个虚拟的连接,主要 ...
- Hibernate与Mybatis 对比
见知乎:https://www.zhihu.com/question/21104468 总结: 1:业务简单,不涉及多表关联查询的,用Hibernate更快,但是当业务量上去后,需要精通Hiberna ...
- linux下各文件夹的结构说明及用途介绍:Linux目录结构介绍
linux下各文件夹的结构说明及用途介绍: /bin:二进制可执行命令. /dev:设备特殊文件. /etc:系统管理和配置文件. /etc/rc.d:启动的配 置文件和脚本. /home:用户主目录 ...
- 几个python编程例子
作业 有如下值集合[11,22,33,44,55,66,77,88,99,90...],将所有大于 66 的值保存至字典的第一个key中,将小于 66 的值保存至第二个key的值中,结果为{'k1': ...
- vs在matlab生成的dll中,load treebigger错误
提示的错误:Warning: Variable 'model' originally saved as a TreeBagger cannot be instantiated as an object ...
- Excel-信息函数&数组公式
1.IS系列函数-逻辑函数 is函数是一个逻辑函数,可以用来判断一些特定的内容 Istext判断单元格是否是文本 Isnumber判断单元格是否为数值 Istext和isnumber的判断的结果相反 ...
- 怎么写Java项目?
我们通常说的Java项目也都是JavaWeb,J2ee项目;现在说的是JavaWeb. 最简单的办法 多看别人项目源码 在别人基础上修改,而现在要一点一点掰开看看. 1.立项: 要做什么东西,最后的要 ...
- elasticsearch 7.5.0 学习笔记
温馨提示:电脑端看不到右侧目录的话请减小缩放比例. API操作-- 新建或删除查询索引库 新建索引库 新建index,要向服务器发送一个PUT请求,下面是使用curl命令新建了一个名为test的ind ...
- [LeetCode] 926. Flip String to Monotone Increasing 翻转字符串到单调递增
A string of '0's and '1's is monotone increasing if it consists of some number of '0's (possibly 0), ...
- vue-lazyload 图片懒加载
vue-lazyload简单使用 github地址:https://github.com/hilongjw/vue-lazyload 1.安装插件 npm install vue-lazyload - ...