Comments (5)
Thanks for following up on this. This was user error. I didn't have time to push a test project until now. It looks like it was throwing errors because the Object declaration inside the try block. The confusing thing for me was searching on stack overflow and finding many posts discussing the need to nested try finally blocks.
This change shows the user error that caused spotbugs to report the error: https://github.com/gardner/spotbugs-sandbox/pull/1/files
from discuss.
Is this code compilable? stmt is declared in try block then it cannot be referred in finally block in theory...
from discuss.
Thanks for your question. This code compiles and, by the nature of the java language constructs in use, it definitely does what the findbugs error says it may not do.
from discuss.
I'm sure that your code is not compilable, at least following code cannot be compiled:
public class A {
public void thing1() {
try {
Object obj = new Object();
} finally {
obj.hashCode();
}
}
}
You have another stmt
in your code, maybe it's field of your class or its ancestor, I guess.
from discuss.
Let me close this issue. Feel free to reopen.
from discuss.
Related Issues (20)
- Is there an API to obtain the messages in the messages.xml file? HOT 4
- Task :spotbugs:spotlessJavaCheck FAILED HOT 1
- 📢 We're migrating this repo to GitHub Discussion in each repo
- Ranks of abstract interpretation rules (for TIOBE quality indicator) needed.
- Detector for SEI Cert ERR08-J
- How can I analyze groovy source files? HOT 1
- New SEI-Cert Detectors
- BugPattern categories and plugin testing HOT 2
- limit build failure at parent level HOT 1
- EI_EXPOSE_REP and EI_EXPOSE_REP2 failures when using Immutable objects from Guava. How should this be corrected? HOT 3
- .
- Clarification requested regarding DMI: Random object created and used only once HOT 1
- Question about license HOT 5
- When does idea spotbugs plugin support spotbugs version 4.6.0? HOT 2
- Spotbugs sequential execution as gradle task HOT 5
- Is it possible to use -auxclasspath to ignore jars inside war files?
- Is there a way to get rid of JSR305 with SpotBugs annotations? HOT 1
- Privacy and Data Protection policy Plug-in HOT 4
- Eclipse marketplace plugin entry out of date
- Support for org.jetbrains.annotations?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discuss.