Skip to content

Commit c752d9d

Browse files
authored
Merge pull request #3297 from JohnDumbell/jd/bugfix/types_bypassing_static_inits
Fix static initializers not being called on specific types
2 parents 28fd58d + c0d9350 commit c752d9d

18 files changed

+88
-2
lines changed
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package indirect;
2+
3+
public class IndirectVirtualCall {
4+
5+
public void main() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
6+
PrimaryInterface primary = (PrimaryInterface)Class.forName("PrimaryInstance").newInstance();
7+
boolean activated = primary.getState().isActive();
8+
}
9+
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package indirect;
2+
3+
public class PrimaryInstance extends SecondaryInstance implements PrimaryInterface {
4+
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package indirect;
2+
3+
public interface PrimaryInterface extends SecondaryInterface {
4+
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package indirect;
2+
3+
public abstract class SecondaryInstance extends ThirdInstance implements SecondaryInterface {
4+
}
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package indirect;
2+
3+
public interface SecondaryInterface extends ThirdInterface {
4+
}

0 commit comments

Comments
 (0)