'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 ...
随机推荐
- 【学习笔记】兄弟连LINUX视屏教程(沈超 李明)
发现自己的linux水平楞个瓜皮,找个视屏教程学习一哈 1 linux系统简介 1.1 UNIX和Linux发展史 unix发展历史:1969年,美国贝尔实验室的肯.汤普森开发出unix系统,1971 ...
- Linux内存管理(最透彻的一篇)【转】
转自:https://www.cnblogs.com/ralap7/p/9184773.html 摘要:本章首先以应用程序开发者的角度审视Linux的进程内存管理,在此基础上逐步深入到内核中讨论系统物 ...
- requests---session简介
http协议是无状态的,也就是每个请求都是独立的.那么登录后的一系列动作,都需要用cookie来验证身份是否是登录状态,为了高效的管理会话,保持会话,于是就有了session session简介 se ...
- 使用hutool工具类进行导出
引入依赖为: <dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</ ...
- 使用 HuTool时候,遇到Cannot add merged region A1:C1 to sheet because it overlaps with an existing merged region (A1:C1).
java.lang.IllegalStateException: Cannot add merged region A1:C1 to sheet because it overlaps with an ...
- mysql字段约束-索引-外键---3
本节所讲内容: 字段修饰符 清空表记录 索引 外键 视图 一:字段修饰符 (约束) 1:null和not null修饰符 我们通过这个例子来看看 mysql> create table wo ...
- 【视频技术】EasyDarwin
- spark写入空值到Oracle
转自:https://blog.csdn.net/qq_33792843/article/details/83750025 val nullStr = org.apache.spark.sql.fun ...
- selenium 定位 页面上两个完全一样的元素
在测试过程中发现页面上有两个保存按钮的元素的xpath一模一样,如下图: google了好久才找到解决办法,发现自己还是比较弱!!!解决方法如下: selenium.click("xpath ...
- zz2017-2018年AI技术前沿进展与趋势
2017年AI技术前沿进展与趋势 人工智能最近三年发展得如火如荼,学术界.工业界.投资界各方一起发力,硬件.算法与数据共同发展,不仅仅是大型互联网公司,包括大量创业公司以及传统行业的公司都开始涉足人工 ...