'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 ... 
随机推荐
- Arcgis CreateFishnet工具,生成到FileGDB中要素类的格网大小不一致
			我的第一篇博客!哈哈 最近在做一些关于创建渔网的工作,发现一些问题,做个总结. 1.问题描述:如图1,设置好渔网的必要参数,输出目录为gdb里的矢量图层,(行列数比较大,渔网的地理范围较小),输出的格 ... 
- 99%的程序都没有考虑的网络异常?使用Fundebug.notify()主动上报
			近日看到一篇文章99%的程序都没有考虑的网络异常,开篇提到: 绝大多数程序只考虑了接口正常工作的场景,而用户在使用我们的产品时遇到的各类异常,全都丢在看似 ok 的 try catch 中.如果没有做 ... 
- 多任务学习Multi-task-learning  MTL
			https://blog.csdn.net/chanbo8205/article/details/84170813 多任务学习(Multitask learning)是迁移学习算法的一种,迁移学习可理 ... 
- 4-1 Matplotlib 概述
			Matplotlib概述 In [1]: import numpy as np import matplotlib.pyplot as plt #pyplot是matplotlib的画图的接口 ... 
- CnetOS6.7编译安装MariaDB
			--安装所需软件包 [root@localhost mariadb-10.1.14]# yum install bison bison-devel ncurses libxml2 libxml2-de ... 
- 201871010101-陈来弟《面向对象程序设计(JAVA)》 第13周学习总结
			201871010101-陈来弟<面向对象程序设计(JAVA)> 第13周学习总结 实验十一 图形界面事件处理技术 实验时间 2019-11-22 第一部分:理论知识 一.事件处理 1.事 ... 
- LeetCode 51. N-QueensN皇后 (C++)(八皇后问题)
			题目: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two que ... 
- [POJ1189][BZOJ1867][CODEVS1709]钉子和小球
			题目描述 Description 有一个三角形木板,竖直立放,上面钉着n(n+1)/2颗钉子,还有(n+1)个格子(当n=5时如图1).每颗钉子和周围的钉子的距离都等于d,每个格子的宽度也都等于d,且 ... 
- ajax与重定向
			网上有不少说法ajax的请求url浏览器不会重定向的说法是片面的,正常是这样的: 当服务器将302响应发给浏览器时,浏览器并不是直接进行ajax回调处理,而是先执行302重定向——从Response ... 
- 线段树模板(无lazy优化)
			区间修改与区间查询问题 模板: int ans; struct node{ int l,r,v; node(){v=;} }tree[LEN*]; int arr[LEN]; //建树 void bu ... 
