apache / apache/netbeans

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

Open
#8,497 1 comment 0 reactions 0 assignees Claimed by @FolsomHunter View on GitHub
git Java kind:bug needs:triage
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### 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

Contributor guide

Open the contributing guide

Research direction

Review linked pull request #8499 first, then reproduce the Refactor Copy flow in the described Java Ant project on Windows with the mapped network-drive folder link. Confirm that copying with a new name completes without the exception, creates the renamed file in the target package, and that later renames affect the copy rather than the original.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.