Break doesn't work in try with resources, but work in try without resources
问题 Break doesn't work in try with resources, but work in try without resources! This is a simple example for this situation. I caught this "bug" in work project. When I use try without resources try { Resources resources = getResources() // some code here, look below } I have only one iteration of my cycle, and it's right because I have the condition "if true then break", but when I changed try without recourse on try WITH resources. try (Resources resources = getResources()) { // some code here