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

Prevent CCE NbGradleProjectImpl to DataObject #4943

Merged

Conversation

lkishalmi
Copy link
Contributor

Playing with Ernies composite build in #4865 I've encountered the following exception

java.lang.ClassCastException: class org.netbeans.modules.gradle.NbGradleProjectImpl cannot be cast to class org.openide.loaders.DataObject (org.netbeans.modules.gradle.NbGradleProjectImpl is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @512bad4a; org.openide.loaders.DataObject is in unnamed module of loader org.netbeans.StandardModule$OneModuleClassLoader @657680c2)
	at org.netbeans.modules.editor.hints.HintsControllerImpl.setErrors(HintsControllerImpl.java:68)
	at org.netbeans.spi.editor.hints.HintsController$1.run(HintsController.java:59)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)

It seems some other NetBeans parts expecting a DataObject in a Document Document.StreamDescriptionProperty as Stream descriptor. I used that property ages ago probably seen that on some other editor. This PR just change the property name used for the code completion provider.

It seems if this exception does not happen, then the registration of the JDPA listener would g through, fixing #4865 entirely.

@lkishalmi lkishalmi added this to the NB16 milestone Nov 9, 2022
@mbien
Copy link
Member

mbien commented Nov 9, 2022

gh might be having issues since I can't label this PR (or other PRs). Unfortunately this means the Gradle tests won't run.

nevermind. was a temporary issue. Restarted the build.

@mbien mbien added the Gradle [ci] enable "build tools" tests label Nov 9, 2022
@apache apache locked and limited conversation to collaborators Nov 9, 2022
@apache apache unlocked this conversation Nov 9, 2022
@mbien mbien added the kind:bug Bug report or fix label Nov 9, 2022
Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense + looks like a fairly low risk change

@lkishalmi
Copy link
Contributor Author

gh might be having issues since I can't label this PR (or other PRs). Unfortunately this means the Gradle tests won't run.

nevermind. was a temporary issue. Restarted the build.

Oh, I knew I forgot something! I'm sorry.

@sdedic
Copy link
Member

sdedic commented Nov 9, 2022

It seems some other NetBeans parts expecting a DataObject in a Document Document.StreamDescriptionProperty as Stream descriptor. I used that property ages ago probably seen that on some other editor. This PR just change the property

Yes,there's even an editor API for that.

Copy link
Member

@sdedic sdedic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that all occurrences are replaced.

@@ -60,6 +60,7 @@
*/
public final class GradleCommandLine implements Serializable {

private static final String GRADLE_PROJECT_PROPERTY = "gradle-project"; //NOI18N
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover ?
But maybe declare the property as public somewhere to have a shared constant.

Copy link
Contributor Author

@lkishalmi lkishalmi Nov 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kind of. Did not want to change the API so late in NB16 cycle, so marked that private and made the two now public non API one with a comment. Will pick that up for NB17

@neilcsmith-net
Copy link
Member

Great, thanks @lkishalmi . I've seen that exception a couple of times recently testing 16, but could never reproduce what triggered it. Should have opened an issue with it though.

@neilcsmith-net neilcsmith-net merged commit 33b4306 into apache:delivery Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gradle [ci] enable "build tools" tests kind:bug Bug report or fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants