3 ms·
How do you define "business safe"? Java won't prevent you from sending a message to the wrong customer or something like that.
by bradstewart 5y ago
How do you define "business safe"? Java won't prevent you from sending a message to the wrong customer or something like that.
- shagie 5y agoI can look at the code and see if anyone is doing: Class cache = Integer.class.getDeclaredClasses()[0]; Field c = cache.getDeclaredField("cache"); c.setAccessible(true); I can examine to see that java.lang.{something} class is getting reflected on. I can check to see if anything is calling getDeclaredField and flag that. I can see the setAccessible and really flag that. This isn't about coding errors. This is about being able to analyze the code and see if the code is using prohibited methods. Through static analysis, I can verify if anyone is trying to do something tricky with the String class. Can I verify if a method is being modified added to an instance of a String in Ruby through static analysis?
- WJW 5y agoI don't know of anyone actually doing that, but all the code is right there. You could probably wrangle the linter into checking those things if you really want to. That said, many Ruby frameworks rely on being able to dynamically add methods to classes at runtime so I don't think such a thing would be all that beneficial.