Skip to content

Netbeans IDE Unexpected Exception occurs when performing refactor copy to a new package with a new class name. #8497

@FolsomHunter

Description

@FolsomHunter

Apache NetBeans version

Apache NetBeans 25

What happened

When copying a file from one package to another and renaming it in the same operation, a java.lang.IllegalArgumentException occurs.

The copied file appears in the target package but retains its original name.

Attempts to rename the copied file do not affect the new file but instead rename the original file it was copied from.

Language / Project Type / NetBeans Component

Java Ant Project

How to reproduce

Environment:

The project folder is accessed via a network drive mapped to a folder link.

Example Paths to Clarify Structure:

  • Projects Folder 1/Project A/ — Original project folder path

  • Projects Folder 2/Project A/ — Folder link pointing to Project A in Projects Folder 1

  • V:/Project A/ — Network drive V: mapped to Projects Folder 2


To reproduce:

  1. Create a test.java file in a package.
  2. Perform a Refactor Copy into another package, changing the name to test2.java.
  3. Exception will be thrown.
  4. A test.java file will appear in the target packet.
  5. (Optional) Attempt to rename again to test2.java. Rename will be applied to original test.java file in original package.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Edition Windows 11 Home Version 24H2 Installed on ‎4/‎22/‎2025 OS build 26100.3775 Experience Windows Feature Experience Pack 1000.26100.66.0

JDK

jdk-14.0.2

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

Every time.

Are you willing to submit a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    Java[ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)git[ci] enable versioning jobkind: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