You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/09/17 01:06:20 UTC

[GitHub] [netbeans] naotsugu opened a new issue, #4646: JavadocImports throws exception due to incorrect string trim

naotsugu opened a new issue, #4646:
URL: https://github.com/apache/netbeans/issues/4646

   ### Apache NetBeans version
   
   Apache NetBeans 15
   
   ### What happened
   
   An exception is raised if an attribute is specified in the JavaDoc to be trimmed.
   
   ```
   java.lang.StringIndexOutOfBoundsException: begin 0, end 7, length 6
   at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4604)
   at java.base/java.lang.String.substring(String.java:2707)
   at org.netbeans.modules.java.editor.base.javadoc.JavadocImports.processDocTreeNode(JavadocImports.java:824)
   at org.netbeans.modules.java.editor.base.javadoc.JavadocImports.access$100(JavadocImports.java:81)
   at org.netbeans.modules.java.editor.base.javadoc.JavadocImports$1.scan(JavadocImports.java:135)
   at org.netbeans.modules.java.editor.base.javadoc.JavadocImports$1.scan(JavadocImports.java:117)
   at com.sun.source.util.DocTreeScanner.scanAndReduce(DocTreeScanner.java:88)
   at com.sun.source.util.DocTreeScanner.scan(DocTreeScanner.java:103)
   at com.sun.source.util.DocTreeScanner.visitReturn(DocTreeScanner.java:419)
   ```
   
   ### How to reproduce
   
   An exception will be thrown if a character containing spaces such as `{@ ` is present in the JavaDoc.
   
   ```
   /**
    * {@ 
    */
   ```
   Note that this character contains spaces.
   
   The following incorrect trim process is the cause.
   
   
   org.netbeans.modules.java.editor.base.javadoc.JavadocImports.java
   
   ```java
   int errorBodyLength = body.trim().substring(0, body.length()).trim().length();
   ```
   
   I do not understand the intent of the above, but I speculate that the following is appropriate.
   
   ```java
   int errorBodyLength = body.trim().length();
   ```
   
   Added in this pull. [https://github.com/apache/netbeans/pull/2954](https://github.com/apache/netbeans/pull/2954)
   
   
   
   ### Did this work correctly in an earlier version?
   
   Apache NetBeans 12.4
   
   ### Operating System
   
   MacOS 12.5.1
   
   ### JDK
   
   OpenJDK 64-Bit Server VM Corretto-18.0.0.37.1
   
   ### Apache NetBeans packaging
   
   Apache NetBeans binary zip
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   Yes
   
   ### Code of Conduct
   
   Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing closed issue #4646: JavadocImports throws exception due to incorrect string trim

Posted by GitBox <gi...@apache.org>.
matthiasblaesing closed issue #4646: JavadocImports throws exception due to incorrect string trim
URL: https://github.com/apache/netbeans/issues/4646


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] mbien commented on issue #4646: JavadocImports throws exception due to incorrect string trim

Posted by GitBox <gi...@apache.org>.
mbien commented on issue #4646:
URL: https://github.com/apache/netbeans/issues/4646#issuecomment-1251370923

   thanks for looking into this. Just as note: no need to create an issue if you are working on a PR anyway. PRs are sufficient :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists