apache / apache/netbeans

After compiling and cleaning, bug with comments and after delete commented code text, the bug still exist

Open
#8,320 2 comments 0 reactions 0 assignees View on GitHub
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

I wrote this code:

```java
package Lesson24;

public class Test5_2 {
}
interface I1{
default void abc(){System.out.println("eto metod abc");}
static void def(){System.out.println("Static method");}
}

interface I2 extends I1{
default void abc(){System.out.println("abc metod ot I2 интерфейса");}
}

class R implements I1,I2{
public static void main(String [] args) {
I1.def();
R r1 = new R();
r1.abc();
}
}

//class Z2 implements I1{
// public void abc(){System.out.println("eto metod abc");}
// public static void main(String [] args) {
// Z2 z = new Z2();
// z.abc();
// I1.def(); // к статическим методам интерфейса можно обратиться только через название самого интерфейса.
// z.ghi();
// }
// public void ghi(){System.out.println("eto metod ghi");}
//}

```

---------------------------------------
after that i try to comment this lines:
```java
interface I2 extends I1{
default void abc(){System.out.println("abc metod ot I2 интерфейса");}
}
```

the code was this:

```java
package Lesson24;

public class Test5_2 {
}
interface I1{
default void abc(){System.out.println("eto metod abc");}
static void def(){System.out.println("Static method");}
}

//interface I2 extends I1{
// default void abc(){System.out.println("abc metod ot I2 интерфейса");}
//}

class R implements I1,I2{
public static void main(String [] args) {
I1.def();
R r1 = new R();
r1.abc();
}
}

//class Z2 implements I1{
// public void abc(){System.out.println("eto metod abc");}
// public static void main(String [] args) {
// Z2 z = new Z2();
// z.abc();
// I1.def(); // к статическим методам интерфейса можно обратиться только через название самого интерфейса.
// z.ghi();
// }
// public void ghi(){System.out.println("eto metod ghi");}
//}

```

-----------------------
and then I saw the same output like this important line "abc metod ot I2 интерфейса" which after rebuilding and cleaning project in NetBeans was still appear:

```
run:
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -Dconsole.encoding=UTF-8
Static method
abc metod ot I2 интерфейса
BUILD SUCCESSFUL (total time: 0 seconds)
```

### Language / Project Type / NetBeans Component

Java

### How to reproduce

Please try to comment this lines:

```java
//interface I2 extends I1{
// default void abc(){System.out.println("abc metod ot I2 интерфейса");}
//}
```

and then compile and run,
than if bug still appear, try to delete this code lines and try to clean and rebuild and run.

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Windows 11 Pro, 24H2

### JDK

23

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

Today I try to continue learn the lesson, and... this problem was occurred.

I think, that after first compiling the program code, some compiled files was created, and then, they didn't want to be replaced with new compiled code, or something like that...

### Are you willing to submit a pull request?

Yes

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the report in Apache NetBeans 25 with the Java source shown, then compare the clean, build, and run actions after commenting or deleting I2. Check whether the launched class and project output reflect the current source; done means the removed I2 implementation no longer produces its message and the resulting compile/run behavior is consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.