Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor goes nuts adding a new line or adding to a comment #8157

Open
basven opened this issue Jan 15, 2025 · 2 comments
Open

Editor goes nuts adding a new line or adding to a comment #8157

basven opened this issue Jan 15, 2025 · 2 comments
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) kind:bug Bug report or fix needs:triage Requires attention from one of the committers

Comments

@basven
Copy link

basven commented Jan 15, 2025

Apache NetBeans version

Apache NetBeans 24

What happened

I noticed this with NB 23 as well, btw. Using java, when trying to insert a new line to add something like
Integer i = 2;,

the editor instead does something like

        I nteger a = 1;
        ;
        Agency agency = entityManager.find(Agency.class, agencyId);

You can see it starts with the capitalized 'I", followed by a space and then the following line gets appended so you are typing in the blind. This used to work with version 23 for a while but then this started happening. When I then first upgraded to 24, that 'bug' disappeared, but now re-appeared a few weeks ago again.
What I have tried:
Re-install NB with no JDK included. Tried running against java 17, 19, 21 and 23.
Re-Install NB with prepackaged JDK.
Deleted NB cache and restarted.
None of these worked. Not sure if I should completely wipe out my .netbeans folder and start from scratch.

I dropped a couple of screen recordings, since it is kind of hard to write-up the behavior of the IDE.

https://github.com/user-attachments/assets/2ea78adb-233f-43e5-8b1c-a474b33a373b
https://github.com/user-attachments/assets/10856a79-500e-403c-8daf-d33b5e01613a
https://github.com/user-attachments/assets/77f22128-6fbb-48b7-a42c-063488cc5468
https://github.com/user-attachments/assets/3e5a1911-f6e5-402c-adda-38481de28d4a

Language / Project Type / NetBeans Component

No response

How to reproduce

Like I said, this suddenly started happening for me. Since I am not seeing many reports, expect for very old versions of NB, it is probably not easily reproducible, but maybe you have some suggestions.

Did this work correctly in an earlier version?

Apache NetBeans 23

Operating System

Red Hat Enterprise Linux 8.10 (Ootpa) Kernel: Linux 4.18.0-553.16.1.el8_10.x86_64

JDK

Product Version: Apache NetBeans IDE 24 Java: 23.0.1; OpenJDK 64-Bit Server VM 23.0.1+11 Runtime: OpenJDK Runtime Environment 23.0.1+11 System: Linux version 4.18.0-553.16.1.el8_10.x86_64 running on amd64; UTF-8; en_US (nb)

Apache NetBeans packaging

Apache NetBeans provided installer, Apache NetBeans platform

Anything else

Currently happens all the time. I included the IDE log files

messages.log

Are you willing to submit a pull request?

No

@basven basven added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Jan 15, 2025
@mbien mbien added the Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) label Jan 15, 2025
@mbien
Copy link
Member

mbien commented Jan 15, 2025

Not sure if I should completely wipe out my .netbeans folder and start from scratch.

one easy way to quickly check something is to start netbeans with a fresh temporary config (this will put the cache into the same folder). Also don't import the settings on first start to exclude it as a possible cause.

netbeans --userdir /tmp/tmpusr1

your log doesn't look good though:

java.lang.NoSuchFieldError: Class com.sun.tools.javac.parser.Tokens$Comment$CommentStyle does not have member field 'com.sun.tools.javac.parser.Tokens$Comment$CommentStyle JAVADOC'
	at lombok.javac.Javac$JavadocOps_8$1.getStyle(Javac.java:364)
	at com.sun.tools.javac.parser.DocCommentParser.getTextKind(DocCommentParser.java:171)
	at com.sun.tools.javac.parser.DocCommentParser.<init>(DocCommentParser.java:164)
	at com.sun.tools.javac.parser.DocCommentParser.<init>(DocCommentParser.java:139)
	at com.sun.tools.javac.api.JavacTrees.getDocCommentTree(JavacTrees.java:1130)
...
	at org.netbeans.modules.java.editor.base.imports.UnusedImports.process(UnusedImports.java:85)
	at org.netbeans.modules.java.editor.base.imports.UnusedImports.computeUnusedImports(UnusedImports.java:69)
	at org.netbeans.modules.java.hints.Imports.unusedImport(Imports.java:83)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
[catch] at org.netbeans.modules.java.hints.providers.code.CodeHintProviderImpl$WorkerImpl.createErrors(CodeHintProviderImpl.java:305)

this is the unused imports hint failing. Wondering if turning it off helps (under Hint settings Imports -> Unused Imports).

WARNING [org.netbeans.modules.parsing.impl.indexing.LogContext]: Excessive indexing rate detected: 6 in 2mins, treshold is 5. Dumping suspicious contexts
SCAN_EXCEEDS_RATE ID: 1965, Type:INDEXER

this is also unusual. Are we dealing with huge projects or very big project groups? I could only reproduce things like this in load tests where I opened hundreds of projects on startup.

@basven
Copy link
Author

basven commented Jan 15, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) kind:bug Bug report or fix needs:triage Requires attention from one of the committers
Projects
None yet
Development

No branches or pull requests

2 participants