'while' statement cannot complete without throwing an exception
2024-09-08 15:10:39
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() {
...
}
最新文章
- Fiddler-1 安装
- gulpfile.js 合并压缩 requirejs 的配置文件
- 1.1 让CPU占用率曲线听你指挥[cpu manager]
- PHP 解压zip文件的函数封装
- Contest2037 - CSU Monthly 2013 Oct (problem D :CX and girls)
- Navicat for MySQL之MySQL客户端的下载、安装和使用
- 再造轮子之网易彩票-第一季(IOS 篇 by sixleaves)
- OpenCV中的KNN
- MySQL server has gone away错误的解决办法
- mysql学习笔记--数据库内置函数
- 为创世纪图书馆(Library Genesis)作镜像
- 如何在DataTemplate中绑定RadioButton的Checked事件
- 从匿名函数(闭包特性)到 PHP 设计模式之容器模式
- 一次Flannel和Docker网络不通定位问题
- PAT1018 (dijkstra+dfs)
- springmvc学习总结(二) -- maven+springmvc+spring+mybatis+mysql详细搭建整合过程讲解
- 微信小程序与java后台交互
- HDU 4300 Clairewd’s message(扩展KMP)题解
- hdu 5206 Four Inages Strategy 判断是否是正方形
- keras channels_last、preprocess_input、全连接层Dense、SGD优化器、模型及编译
热门文章
- 读《TCP/IP详解》:TCP
- 一条SELECT查询语句在数据库里执行时都经历了什么
- Shel脚本-初步入门之《04》
- JAVAWEB复习笔记-day02
- 201871010133-赵永军《面向对象程序设计(java)》第八周学习总结
- 使用构造函数 Boolean 创造的对象不是布尔值,而是对象,typeof new Boolean(1) == 'object'
- luoguP4294 [WC2008]游览计划
- appium--多进程启动多设备
- [LeetCode] 885. Spiral Matrix III 螺旋矩阵之三
- [LeetCode] 22. Generate Parentheses 生成括号