DongChunHao opened a new issue, #7298:
URL: https://github.com/apache/netbeans/issues/7298
### Apache NetBeans version
Apache NetBeans 21
### What happened
When I select " inlineMethod() " and perform the inline method refactoring,
and i click "OK", a syntax error occurs:
public class InlineMethodTest{
public void main() {
class T {
public T() {}
}
inlineMethod();
}
// inline method
public void inlineMethod() {
class T {
T t;
public T() {}
}
}
}
Refactoring result :

Inner class name conflict;
Expected result: Before inline methods, it is necessary to check for naming
conflicts. If so, the identifier name should be modified or syntax errors
should be reported
### Language / Project Type / NetBeans Component
_No response_
### How to reproduce
Perform the following actions on the following code:
selecet “inlineMethod() ”
click “Refactor-inline”
click “ok”
public class InlineMethodTest{
public void main() {
class T {
public T() {}
}
inlineMethod();
}
// inline method
public void inlineMethod() {
class T {
T t;
public T() {}
}
}
}
### Did this work correctly in an earlier version?
No / Don't know
### Operating System
Windows11
### JDK
20
### Apache NetBeans packaging
Apache NetBeans platform
### Anything else
_No response_
### Are you willing to submit a pull request?
No
--
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