Project: JDT
Bug 123356 [inline refactoring] Method inlining breaks runtime behavior.
Reported: 2006-01-10 19:11:14 | Status: resolved fixed

This program runs fine as is. But if the add(x,y) method is inlined, then the resulting logic compiles but throws an NPE at runtime. public class Bug { static String[]field; public static void main(String[]args){ add((field=args).length,field.hashCode()); } static int add(int x, int y){ return y+x; } }

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/bugs_in/Test_123356.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/bugs_out/Test_123356.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineMethodTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/CallInliner.java