Closed yiming-tang-cs closed 6 years ago
I'm not sure I understand the question, but, currently, this exception is caught here: https://github.com/ponder-lab/Java-8-Stream-Refactoring/blob/bb7adad2d8b88972c7cc8025c61e65db46da11a1/edu.cuny.hunter.streamrefactoring.core/src/edu/cuny/hunter/streamrefactoring/core/analysis/Stream.java#L629-L634
Are you saying it should not be caught here?
Are you saying it should not be caught here?
Yes. I found in some code snippets, the exceptions are caught immediately following the throwing. However, in some code snippets, the exceptions are caught in the other methods instead of the method where the exceptions are thrown. How can I decide the location to catch the exceptions?
Why do you feel that it should not be caught here?
In my code,
NoEnclosingMethodNodeFoundException
is caught in the methodreportDeadEntryPoints()
, but it should be caught in the code of high level.I've tried to throw it in the high level code, but why https://github.com/ponder-lab/Java-8-Stream-Refactoring/blob/bb7adad2d8b88972c7cc8025c61e65db46da11a1/edu.cuny.hunter.streamrefactoring.core/src/edu/cuny/hunter/streamrefactoring/core/refactorings/ConvertToParallelStreamRefactoringProcessor.java#L279 is the highest place where I can throw the exception.