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/05/24 19:31:38 UTC

[GitHub] [netbeans] istinnstudio opened a new issue, #4145: Error parsing file (red mark) when having 2 or more java classes in the same java file, inside the same package, that share same class names (e.g after cloning/copying)

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

   ### Apache NetBeans version
   
   Apache NetBeans 13
   
   ### What happened
   
   Error parsing file (red mark) when having 2 or more java classes in the same java file, inside the same package, that share same class names (e.g after cloning/copying).
   If public class then we give the file name of the class.  If other classes (more than the main one) exist in the same java file (nested or separate non public), then we get this error without any guidance to resolve the naming conflict.
   Background scanning of projects could then be triggered, and this scanning time period, will be long.
   
   ### How to reproduce
   
   Create a public class, rename the New Class to the class name
   Create a non public class inside the same file, nested and/or separated.
   Copy Paste the Java file to the same package from projects list.
   
   ### Did this work correctly in an earlier version?
   
   No
   
   ### Operating System
   
   windows 7
   
   ### JDK
   
   17
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request?
   
   No
   
   ### 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] AnderDMV commented on issue #4145: Error parsing file (red mark) when having 2 or more java classes in the same java file, inside the same package, that share same class names (e.g after cloning/copying)

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

   
   Create a project and create some classes, delete the project and create a new one with the same name.
   
   Later:
   Toolbar -- team -- history -- revert deleted, it will show all the classes deleted from the project.
   
   I think this is part of the problem
   


-- 
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


Re: [I] Error parsing file (red mark) when having 2 or more java classes in the same java file, inside the same package, that share same class names (e.g after cloning/copying) [netbeans]

Posted by "istinnstudio (via GitHub)" <gi...@apache.org>.
istinnstudio commented on issue #4145:
URL: https://github.com/apache/netbeans/issues/4145#issuecomment-1875192327

   Experimenting with some same name classes gives again the error, deleting them brings system back to no error state. I also have to note that even "refactoring" does not work when classes with the same belong to the same project (or package, I am not sure). But they could be related, refactoring the class in the second directory, changes code in the other one.  So this issue has a bit more depth that it looks like.
   ![2024-01-02 20_45_57-fleen_ant1 - Apache NetBeans IDE 20](https://github.com/apache/netbeans/assets/36081997/f8a8327a-6d85-4360-ac5a-3fd9f60efc8a)
   


-- 
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] istinnstudio commented on issue #4145: Error parsing file (red mark) when having 2 or more java classes in the same java file, inside the same package, that share same class names (e.g after cloning/copying)

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

   This error is appearing at random times, but when triggered activates background scanning of projects that takes much time to complete and sometimes an other error like this one can be found, I guess the background scanning does not scan everything at once.
   
   It  would be nice to see a better approach on multi-class files in the same package.
   The red mark appears only on file names in project/package files list, never inside the actual text of the file. Random is also which one of the involved files will be marked (between 2+ conflicting files in the same package).
   
   To sum up, this error has random behavior witch is odd, it appears to be in conjunction with background scanning of projects that sometimes finds or misses the same conflict, and marks randomly the parsing file error to a file.


-- 
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 #4145: Error parsing file (red mark) when having 2 or more java classes in the same java file, inside the same package, that share same class names (e.g after cloning/copying)

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

   this sounds like a very specific issue which rarely occurs. I am not sure if the time investment would be worth it to teach the parser to deal with invalid files containing duplicated class names. But contributions welcome.


-- 
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


Re: [I] Error parsing file (red mark) when having 2 or more java classes in the same java file, inside the same package, that share same class names (e.g after cloning/copying) [netbeans]

Posted by "BMOM (via GitHub)" <gi...@apache.org>.
BMOM commented on issue #4145:
URL: https://github.com/apache/netbeans/issues/4145#issuecomment-1822481311

   May I ask if your current problem has been resolved?


-- 
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] istinnstudio commented on issue #4145: Error parsing file (red mark) when having 2 or more java classes in the same java file, inside the same package, that share same class names (e.g after cloning/copying)

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

   It is not critical for sure. Files are not invalid if stand alone. Only if there is an other file with same class name in the same package. It would be ok if we could get a better message to focus on what the problem is. I figured this out when opening the same project in intelij, the error message was pointing to the names, here this is just a parsing error without details.


-- 
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


Re: [I] Error parsing file (red mark) when having 2 or more java classes in the same java file, inside the same package, that share same class names (e.g after cloning/copying) [netbeans]

Posted by "istinnstudio (via GitHub)" <gi...@apache.org>.
istinnstudio commented on issue #4145:
URL: https://github.com/apache/netbeans/issues/4145#issuecomment-1822523435

   I have deleted/renamed all those same name classes, so I do not know if it this rare issue still exist, if other changes have been placed around source, if someone can create some classes that are being described in "How to reproduce" hold them there in a temp package and never blow up, I guess it is solved, if not you can keep the package until it shows the error and confuse the scanning mechanism. There is not an immediate effect if I remember correctly, but it did came up and stayed there after in a project reopen.


-- 
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


Re: [I] Error parsing file (red mark) when having 2 or more java classes in the same java file, inside the same package, that share same class names (e.g after cloning/copying) [netbeans]

Posted by "BMOM (via GitHub)" <gi...@apache.org>.
BMOM commented on issue #4145:
URL: https://github.com/apache/netbeans/issues/4145#issuecomment-1822545994

   I have encountered a problem similar to yours. After a long period of project scanning, strange code parsing errors may occur. And it's not always the case with every scan, it's sporadic.


-- 
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