1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug Fixing

This commit is contained in:
Hoda Amer 2004-06-09 18:17:03 +00:00
parent 1b4fc963a7
commit e7bd887fae
3 changed files with 26 additions and 24 deletions

View file

@ -1,3 +1,6 @@
2004-06-09 Hoda Amer
Fix for PR 62656 : [Saving] a cpp file after copying/renaming a function in front of a constructor locks Eclipse
2004-06-09 David Inglis
added new ICDescriptor manager method to get a descriptor with the option of creating

View file

@ -83,6 +83,15 @@ public interface ICElementDelta {
*/
public int F_MOVED_TO = 0x0020;
/**
* Change flag indicating that the element has changed position relatively to its siblings.
* If the element is an <code>IPackageFragmentRoot</code>, a classpath entry corresponding
* to the element has changed position in the project's classpath.
*
* @since 2.1
*/
public int F_REORDER = 0x00100;
/**
* Change flag indicating that the underlying <code>IProject</code> has been
* opened.

View file

@ -1,4 +1,3 @@
package org.eclipse.cdt.internal.core.model;
/**********************************************************************
* Copyright (c) 2002,2003 Rational Software Corporation and others.
* All rights reserved. This program and the accompanying materials
@ -9,6 +8,7 @@ package org.eclipse.cdt.internal.core.model;
* Contributors:
* Rational Software - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.internal.core.model;
import java.util.ArrayList;
import java.util.HashMap;
@ -175,8 +175,7 @@ private void findChangesInPositioning(ICElement element, int depth) throws CMode
return;
if (!isPositionedCorrectly(element)) {
this.delta.removed(element);
this.delta.added(element);
this.delta.changed(element, ICElementDelta.F_REORDER);
}
if (element instanceof IParent) {
@ -287,28 +286,19 @@ private boolean isIdentical(CElement e1, CElement e2) {
*/
private boolean isPositionedCorrectly(ICElement element) {
ListItem oldListItem = this.getOldPosition(element);
if (oldListItem == null)
return false;
ICElement oldPrevious = oldListItem.previous;
if (oldListItem == null) return false;
ListItem newListItem = this.getNewPosition(element);
if (newListItem == null)
return false;
ICElement newPrevious = newListItem.previous;
if (oldPrevious == newPrevious)
return true;
ICElement lastNewPrevious = null;
while(lastNewPrevious != newPrevious) {
if (isIdentical((CElement)oldPrevious, (CElement)newPrevious))
return true;
ICElement tempLastPrevious = lastNewPrevious; //JOHNC added this
lastNewPrevious = newPrevious;
// if newPrevious is null at this time we should exit the loop.
if (newPrevious == null) break;
ICElement tempPrevious = (this.getNewPosition(newPrevious)).previous; //JOHNC added this
if( tempLastPrevious == tempPrevious ) break; // JOHNC added this
newPrevious = tempPrevious;
}
return false;
if (newListItem == null) return false;
ICElement oldPrevious = oldListItem.previous;
ICElement newPrevious = newListItem.previous;
if (oldPrevious == null) {
return newPrevious == null;
} else {
return oldPrevious.equals(newPrevious);
}
}
private void putElementInfo(ICElement element, CElementInfo info) {
this.infos.put(element, info);