jherkel commented on PR #9802:
URL: https://github.com/apache/netbeans/pull/9802#issuecomment-6989609592
I finally understand (I hope) what you want to do. You simply don't want to
allow the user to perform a refactoring when they are doing something invalid,
such as moving a non-static, uninitialized field to an interface. Instead, the
user needs to fix the source code and return to the refactoring. Could you
confirm that?
I checked IntelliJ IDEA, and it doesn't allow pulling up a non-static field
(you cannot select field). If the field is uninitialized, it shows a "Conflict
Detected" window with a "Refactor Anyway" button. So, it has a different
workflow than NetBeans.
However, there is also another problem in NetBeans: it doesn't show multiple
warnings or errors at once. You only see the first warning or error. For
example, you might see "Error: Member 'value' cannot be pulled up to interface,
it is not initialized." but not "Member 'value' cannot be pulled up to
interface" at the same time. Also, if we prevent the user from selecting the
"value" variable in the Pull Up window, NetBeans cannot explain what is wrong
(though IDEA also doesn't explain why you cannot select the field).
So, I tried to fix the missing multiple warnings now (maybe later I can try
to add a "Refactor Anyway" button).
for source code
```
package org.javatest.javatest;
public interface I {
class C implements I {
boolean value;
}
}
```
Pull Up window look like this
<img width="560" height="510" alt="Screenshot From 2026-11-18 20-41-06"
src="https://github.com/user-attachments/assets/e1041a62-6088-464a-a0a7-5e1f9a9595c8"
/>
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists