Community
Participate
Working Groups
FUP of bug 350652 class MultiCatch { void foo() { try { //... throw new Exception(); //... } catch (NullPointerException r ) { } catch () { } } } class SuperException extends Exception {} class SubException extends SuperException {} 1) Insert a | after NPE in the first catch block and hit ctrl+space, you'll see NPE again in the proposal list 2) Hit ctrl+space in the second catch block , see NPE in the list. => We should not show the Exceptions already caught in same or in other catch blocks.
I cannot reproduce this
(In reply to comment #1) > I cannot reproduce this Raksha, please confirm which version of the feature patch u were using. I could not reproduce using v20110714-1300.
(In reply to comment #2) > (In reply to comment #1) > > I cannot reproduce this I couldn't either.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=343637
Created attachment 200006 [details] Screenshot1 (In reply to comment #2) > (In reply to comment #1) > > I cannot reproduce this > > Raksha, please confirm which version of the feature patch u were using. I could > not reproduce using v20110714-1300. I'm using the same feature patch v20110714-1300. I have attached the screen shots.
Created attachment 200007 [details] Screenshot2
I also can't reproduce with the given source but as soon as I edit it a bit, it also happens. For example: void foo() { try { //... throw new Exception(); //... } catch (NullPointerException | e) { } catch (Null<content assist here>) } or: void foo() { try { //... throw new Exception(); //... } catch (NullPointerException r | Nu<content assist here>) { } catch () } Raksha, are you 100% sure that the source given in comment 0 is correct?
(In reply to comment #7) > I also can't reproduce with the given source but as soon as I edit it a bit, it > also happens. For example: > > void foo() { > try { > //... > throw new Exception(); > //... > } catch (NullPointerException | e) { > > } catch (Null<content assist here>) > } Are you saying you see NullPointerException as the proposal here? I still don't see it, with or without typing anything :(
> Are you saying you see NullPointerException as the proposal here? I still don't > see it, with or without typing anything :( I'm sorry, my bad, i didn't see the '|' in catch (NullPointerException | e). Yeah in this case I can see NPE in second catch, but i guess thats ok, since you do not 'really' have NPE declared properly in the first catch. :)
(In reply to comment #7) > > Raksha, are you 100% sure that the source given in comment 0 is correct? Yes. See attached screenshots. I'm trying again with a fresh install and set up.
> Are you saying you see NullPointerException as the proposal here? Yes, normally I mean what I say ;-) > Yeah in this case I can see NPE in second catch, but i guess thats ok, since > you do not 'really' have NPE declared properly in the first catch. :) I would agree on that but must admit that I have also seen Raksha's case but could not reproduce it yet out of the box but only after a while.
(In reply to comment #10) Ah! There's another step to reproduce. You need to fill in the first NPE using assist too. Then it stays on top of the list for the other steps in comment#0.
(In reply to comment #12) > (In reply to comment #10) > > > Ah! There's another step to reproduce. You need to fill in the first NPE using > assist too. Then it stays on top of the list for the other steps in comment#0. There you go! :) Ok this is coming from recent history which ( i guess) is computed in JDT/Text. This comes into play when there's no token and you press CTRL+SPC. We propose recently used stuff in the list, just in case. I think this isn't really too bad. As soon as you press N and use content assist, NPE is not proposed. Anyway, moving to JDT/Text for further comments.
We don't know whether we are completing code inside the catch clause. JDT Core should provide us with that CompletionContext.getTokenLocation(). Filed bug 353002 to track this. Once we know that, we can stop adding the types from our cache.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.