This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Surrounding statement with try-catch does not work | ||
---|---|---|---|
Product: | java | Reporter: | Marcoevich |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 8.0 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | IDE log |
Description
Marcoevich
2014-04-10 13:02:42 UTC
Created attachment 146670 [details]
IDE log
Could you please attach the code before and after surrounding, and reopen this issue after ? Thanks in advance. Hmm, I'am not sure if I can replicate the original bug. It looks like the command "surround statement with try-catch" works this time. However, surround BLOCK with try-catch still acts a little weird. In the following piece of code, if I surround the block with try-catch it'll look like this: try { // TODO add your handling code here: int tafelNr = Integer.parseInt(tafelNrTxt.getText()); ArrayList<String> rekeningRegels = m.geefRekening(tafelNr); //plak alle regels achter elkaar String rekeningRegelsString = ""; for(String rekregel : rekeningRegels){ rekeningRegelsString += rekregel; } //zet het in het rekeningveld rekeningTxt.setText(rekeningRegelsString); } As you see, there's no catch clause. Netbeans will suggest adding a catch clause in this case, but clicking on that suggestion does nothing at all. (In reply to Marcoevich from comment #3) > However, surround BLOCK with try-catch still acts a little weird. > > In the following piece of code, if I surround the block with try-catch it'll Works OK with 8.0.1; I've tried to surround the code sample (except the try {}) and NumberFormatException handler was generated. Please attach a code sample before applying the "Surroung" suggestion, so I can test the exact code. Ideally attach the whole file. Thanks. |