Skip to content

IllegalArgumentException with Refactor Move Members #9630

Description

@bernard01

Apache NetBeans version

Apache NetBeans 31

What happened

In a Java file, I selected a method. Then I selected Refactor from the menu. The aim was to move a method into a class that I had created as a target. I created in that target class the same static field that the method depended on. I selected package and class of the target. I realized that the dialog allowed me to select multiple methods so I selected more. When I finally clicked the "Refactor" button, the exception was thrown and the operation could not complete.

Language / Project Type / NetBeans Component

Java Maven Project

How to reproduce

messages.log

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 10

JDK

JDK 26

Apache NetBeans packaging

Community provided installer

Anything else

No response

Are you willing to submit a pull request?

No

Activity

  1. homberghp commented on Sep 21, 2026

    @homberghp
    Contributor

    Hello Bernard01,

    I can't reproduce the issue.
    I have created a sample project (a minimal working project), see the attached zip file.
    When I select the (static) method foo and move that, including other members, it works as intended.
    Could you please modify the sample project and re-attache it, so that it shows the effect you observe?
    Thank you.

    issue9630.zip

  2. bernard01 commented on Sep 21, 2026

    @bernard01
    Author

    Thanks for making the test case project for me. This issue is not easy to reproduce by making a project for it from the ground up. Instead, I have taken a copy of my project and removed some files and dependencies to be manageable. This reproduces at my end. Steps to reproduce:

    Open ZeroHedgeWebClient and locate cursor on method deserializeCommentsChunk1

    Menu|Refactor|Move...
    Package: bt.zerohedgescraper.parser
    To Class: JsonParser
    Members to be moved:
    deserializeArticleDetail ... deserializeToken (19 methods)

    Click button [Refactor]

    Refactor.zip

  3. added
    Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)
    on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)kind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions