apache / apache/netbeans

Setting AbsoluteLayout using Mattise in Gradle project results in UnsupportedOperationException

Open
#8,785 1 comment 0 reactions 0 assignees View on GitHub
FormDesigner Gradle kind:bug
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 28 latest daily build

### What happened

IDE shows java.lang.UnsupportedOperationException editing JPanelForm with Matisse editor in Gradle project.
Also entire IDE window is blinks

### Language / Project Type / NetBeans Component

Matisse editor in Gradle project

### How to reproduce

Using IDE dev build: Apache NetBeans IDE DEV (Build dev-0216ca48bb4c1085270edc250b8c1d20f3cb0895)
Create new simple Gradle project
Add to project Simple JFrame or JPanel form
In Form editor invoke context menu and select Set Layout -> Absolute Layout
IDE blinks and Exception is thrown:
```
java.lang.UnsupportedOperationException: Project in D:\Work Files\NetBeans Projects\gradleproject1\app of class org.netbeans.modules.gradle.NbGradleProjectImpl has neither a ProjectClassPathModifierImplementation nor a ProjectClassPathExtender in its lookup
at org.netbeans.api.java.project.classpath.ProjectClassPathModifier.findExtensible(ProjectClassPathModifier.java:424)
at org.netbeans.api.java.project.classpath.ProjectClassPathModifier.addLibraries(ProjectClassPathModifier.java:82)
at org.netbeans.modules.nbform.project.ClassSourceResolver$LibraryEntry.addToProjectClassPath(ClassSourceResolver.java:208)
at org.netbeans.modules.form.project.ClassSource.addToProjectClassPath(ClassSource.java:91)
at org.netbeans.modules.form.project.ClassPathUtils$2.run(ClassPathUtils.java:245)
at org.netbeans.modules.progress.ui.RunOffEDTImpl$ProgressBackgroundRunner.runBackground(RunOffEDTImpl.java:465)
at org.netbeans.modules.progress.ui.AbstractWindowRunner.call(AbstractWindowRunner.java:86)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)
Caused: java.util.concurrent.ExecutionException
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
[catch] at org.netbeans.modules.progress.ui.RunOffEDTImpl.showProgressDialogAndRun(RunOffEDTImpl.java:361)
at org.netbeans.api.progress.BaseProgressUtils.showProgressDialogAndRun(BaseProgressUtils.java:189)
at org.netbeans.api.progress.ProgressUtils.showProgressDialogAndRun(ProgressUtils.java:220)
at org.netbeans.modules.form.project.ClassPathUtils.updateProject(ClassPathUtils.java:241)
at org.netbeans.modules.form.project.ClassPathUtils.updateProject(ClassPathUtils.java:213)
at org.netbeans.modules.form.MetaComponentCreator.prepareClass(MetaComponentCreator.java:1414)
at org.netbeans.modules.form.MetaComponentCreator.createComponent(MetaComponentCreator.java:120)
at org.netbeans.modules.form.MetaComponentCreator.createComponent(MetaComponentCreator.java:112)
at org.netbeans.modules.form.MetaComponentCreator.createComponent(MetaComponentCreator.java:91)
at org.netbeans.modules.form.actions.SelectLayoutAction$LayoutActionListener.actionPerformed(SelectLayoutAction.java:274)

```

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Windows 10 version 10.0 running on amd64; UTF-8; ru_RU (nb)

### JDK

Java: 18.0.2; Java HotSpot(TM) 64-Bit Server VM 18.0.2+9-61

### Apache NetBeans packaging

Own source build

### Anything else

Same functionality works for Ant or Maven based projects. Invoking same command for maven projects shows 'Update classpath' progress popup and also adds AbsoluteLayout dependency to project dependencies

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure by selecting Set Layout → Absolute Layout in a Gradle-based Matisse form, then start with ClassSourceResolver.java, ClassPathUtils.java, and the ProjectClassPathModifier stack-trace path. Compare the Gradle behavior with the working Ant and Maven flows; done means the layout action completes without the exception or IDE blinking and handles the dependency as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.