Project: JDT
Bug 265448 [inline] Inlining long constants may change semantics
Reported: 2009-02-19 08:01:02 | Status: resolved fixed

If the variable "two" in the snippet below is inlined using "Refactor -> Inline...", the result will change from 2^32-2 to -2. The 2 should be suffixed with 'L' when inlined. This type of bug (in the code below, not the JDT bug) is quite tricky to spot. long two = 2; long much = two * Integer.MAX_VALUE; JDT Version: Eclipse Java Development Tools Version: 3.4.0.v20080603-2000-7o7tEAXEFpPqqoXxgaBhhhq Build id: I20080617-2000

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test31/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test31/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test32/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test32/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test5/in/PartOfDeclNameSelected.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineConstant/canInline/test5/out/PartOfDeclNameSelected.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test36_in.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineTemp/canInline/A_test36_out.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineConstantTests.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineTempTests.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineConstantRefactoring.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineTempRefactoring.java