| Summary: | Possible editor bug - improperly parses try/catch/finally blocks | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Nick Radonic <big.rad> |
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | daniel_megert, markus.kell.r, remy.suen |
| Version: | 3.6 | ||
| Target Milestone: | --- | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
Please attach a screenshot of what you're seeing. In my web browser, the segment of code you've attached appears to contain a lot of special characters. Are you using non-default character set, key mapping, etc. that could be contributing to the problem? Any information you can provide about what might be special about your configuration, what you have tried in order to resolve or debug the problem, etc., will be helpful. (In reply to comment #2) > In my web browser, the segment of code you've attached appears to contain a lot > of special characters. Are you using non-default character set, key mapping, > etc. that could be contributing to the problem? Interesting observation, Walter. I see question marks (?) show up in comment 0 and I assumed that was intentional (as an example of malformed code). It did not occur to me that it might be my browser choking on the output. I think you gentlemen are correct about the special characters. I copied part of the try/catch code segment from a PDF file. In that case, is there a means to display 'special characters' in the editor, or a way to force it to ignore the extra characters? Or do I have to filter out my copied text in the future, before pasting it? This will be my workaround in the future. As for the display, it shows blank lines on the screen in the affected areas, except when running the cursor up and down, then there is a line of data displayed directly under the cursor. Thanks. Sorry, but there's not enough information here to reproduce a bug. Please reopen with more detailed steps if you can reproduce the problem using 3.7 M1 ( http://download.eclipse.org/eclipse/downloads/drops/S-3.7M1-201008051700/index.php). Please also see http://www.eclipse.org/eclipse/platform-text/development/bug-incomplete.htm. Probably a dup of bug 298698. Please reopen if you think it's not. *** This bug has been marked as a duplicate of bug 298698 *** Here is another sample of code taken from a powerpoint Java slide (Cay Horstman, Big Java). It looks ugly on my screen, and not so good here either.:
public class InsufficientFundsException extends RuntimeException { public InsufficientFundsException() {} public InsufficientFundsException(String message) { super(message); } }
Here's a hexdump of the string:
> hexdump -C
public class InsufficientFundsException ^K extends RuntimeException ^K{ ^K public InsufficientFundsException() {} ^K^K public InsufficientFundsException(String message) ^K { ^K super(message); ^K } ^K}
00000000 0a 70 75 62 6c 69 63 20 63 6c 61 73 73 20 49 6e |.public class In|
00000010 73 75 66 66 69 63 69 65 6e 74 46 75 6e 64 73 45 |sufficientFundsE|
00000020 78 63 65 70 74 69 6f 6e 20 0b 20 20 20 20 20 20 |xception . |
00000030 65 78 74 65 6e 64 73 20 52 75 6e 74 69 6d 65 45 |extends RuntimeE|
00000040 78 63 65 70 74 69 6f 6e 20 0b 7b 20 0b 20 20 20 |xception .{ . |
00000050 70 75 62 6c 69 63 20 49 6e 73 75 66 66 69 63 69 |public Insuffici|
00000060 65 6e 74 46 75 6e 64 73 45 78 63 65 70 74 69 6f |entFundsExceptio|
00000070 6e 28 29 20 7b 7d 20 0b 0b 20 20 20 70 75 62 6c |n() {} .. publ|
00000080 69 63 20 49 6e 73 75 66 66 69 63 69 65 6e 74 46 |ic InsufficientF|
00000090 75 6e 64 73 45 78 63 65 70 74 69 6f 6e 28 53 74 |undsException(St|
000000a0 72 69 6e 67 20 6d 65 73 73 61 67 65 29 20 0b 20 |ring message) . |
000000b0 20 20 7b 20 0b 20 20 20 20 20 20 73 75 70 65 72 | { . super|
000000c0 28 6d 65 73 73 61 67 65 29 3b 20 0b 20 20 20 7d |(message); . }|
^C
Note: the 0x0b is control-K the vertical tab function --- that explains a lot. Now how do I turn this off, or filter it out?
Really looks like a dup of bug 298698. >Now how do I turn this off, or filter it out? Use Find/Replace to change the offending character(s). *** This bug has been marked as a duplicate of bug 298698 *** Here is another sample of code taken from a powerpoint Java slide (Cay Horstman, Big Java). It looks ugly on my screen, and not so good here either.:
public class InsufficientFundsException extends RuntimeException { public InsufficientFundsException() {} public InsufficientFundsException(String message) { super(message); } }
Here's a hexdump of the string:
> hexdump -C
public class InsufficientFundsException ^K extends RuntimeException ^K{ ^K public InsufficientFundsException() {} ^K^K public InsufficientFundsException(String message) ^K { ^K super(message); ^K } ^K}
00000000 0a 70 75 62 6c 69 63 20 63 6c 61 73 73 20 49 6e |.public class In|
00000010 73 75 66 66 69 63 69 65 6e 74 46 75 6e 64 73 45 |sufficientFundsE|
00000020 78 63 65 70 74 69 6f 6e 20 0b 20 20 20 20 20 20 |xception . |
00000030 65 78 74 65 6e 64 73 20 52 75 6e 74 69 6d 65 45 |extends RuntimeE|
00000040 78 63 65 70 74 69 6f 6e 20 0b 7b 20 0b 20 20 20 |xception .{ . |
00000050 70 75 62 6c 69 63 20 49 6e 73 75 66 66 69 63 69 |public Insuffici|
00000060 65 6e 74 46 75 6e 64 73 45 78 63 65 70 74 69 6f |entFundsExceptio|
00000070 6e 28 29 20 7b 7d 20 0b 0b 20 20 20 70 75 62 6c |n() {} .. publ|
00000080 69 63 20 49 6e 73 75 66 66 69 63 69 65 6e 74 46 |ic InsufficientF|
00000090 75 6e 64 73 45 78 63 65 70 74 69 6f 6e 28 53 74 |undsException(St|
000000a0 72 69 6e 67 20 6d 65 73 73 61 67 65 29 20 0b 20 |ring message) . |
000000b0 20 20 7b 20 0b 20 20 20 20 20 20 73 75 70 65 72 | { . super|
000000c0 28 6d 65 73 73 61 67 65 29 3b 20 0b 20 20 20 7d |(message); . }|
^C
Note: the 0x0b is control-K the vertical tab function --- that explains a lot. Now how do I turn this off, or filter it out?
(In reply to comment #8) > Really looks like a dup of bug 298698. > > >Now how do I turn this off, or filter it out? > Use Find/Replace to change the offending character(s). > > *** This bug has been marked as a duplicate of bug 298698 *** The other bug is FF (control J?) while my problem is VT (control K), but they both move the cursor while the editor is formatting the display. Just another instance of bug 298698. Please don't reopen again. *** This bug has been marked as a duplicate of bug 298698 *** |
The editor behaves erratically when I am trying to edit try/catch/finally blocks. Sections of code don't show up as I scroll up and down through this short code block. Yes, the syntax is garbled on my part, but I still expect to be able to see the text and I can't edit what doesn't show up on the screen. Everything below the 'try' keyword is malformed as I scroll the cursor up and down, and things like auto-indent don't help. Nick public class tctest { private void readInFile() throws FileNotFoundException { JFileChooser chooser = new JFileChooser(); FileReader in = null; try ?{ ? File selectedFile = chooser.getSelectedFile(); if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) { FileReader reader = new FileReader(selectedFile); FileReader reader = new FileReader(filename); ? Scanner in = new Scanner(reader); ? readData(in); ?} ?finally ?{ ? reader.close(); // if an exception occurs, finally clause? // is also executed before exception // is passed to its handler ?} } } } } -- Configuration Details -- Product: Eclipse 1.3.0.20100617-0521 (org.eclipse.epp.package.jee.product) Installed Features: org.eclipse.jdt 3.6.0.v20100526-0800-7z8XFUJFMTfCWGoVuHImpms9H155