I want to make the number of continue in the for statement one in java
I'm analyzing using sonarqube, but I get an error asking to make the number of continue one, but I don't know how to deal with it
I would appreciate it if you could let me know the implementation as follows.
for (line:List) {
if(isAAAA(line)){
Execution statement;
continue;
}
if(isBBB(line)){
Execution statement;
continue;
}
if(isCCC(line)){
Execution statement;
continue;
}
if(isDDD(line)){
Execution statement;
continue;
}
}
Additional
Also, I would like to know about patterns that do not have execution statements.
for (line:List) {
if(isAAAA(line)){
continue;
}
if(isBBB(line)){
continue;
}
if(isCCC(line)){
continue;
}
if(isDDD(line)){
continue;
}
}
Please use if... else if... in this form.Continue is not required.
If the contents of if are only continue, you can combine these conditions with or into one if.
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
916 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.