Community
Participate
Working Groups
Build 20020214 In the following method: public void restore() throws JavaModelException { if (!isDestroyed) { CompilationUnit original = (CompilationUnit) getOriginalElement (); getBuffer().setContents(original.getContents()); long timeStamp = ((IFile) original.getUnderlyingResource ()).getModificationStamp(); if (timeStamp == IResource.NULL_STAMP) { throw new JavaModelException( new JavaModelStatus (IJavaModelStatusConstants.INVALID_RESOURCE)); } ((CompilationUnitElementInfo) getElementInfo()).fTimestamp = timeStamp; makeConsistent(null); } } I selected the code snippet from 'long timeStamp ' to '.fTimestamp = timeStamp;' and I chose extract method. I got a dialog saying that the selected statements do not belong to the same category. Why this restriction?
in fact, the problem is different - modified summary this fails: public class A { A f; public A a() { /*[*/int y= 0; a().f= a();/*[*/ return null; } } as well as this: public class A { A f; public A a() { /*[*/a().f= a();/*[*/ return null; } }
The problem is a wrong position in the field reference (doesn't include the method invocation). Waiting for JCore to fix this.
Got fixed by JDT/Core.