org.eclipse.ltk.core.refactoring_3.5.201.r372_v20111101-0700

16:46:13.126 INFO  jd.cli.Main - Decompiling org.eclipse.ltk.core.refactoring_3.5.201.r372_v20111101-0700.jar
package org.eclipse.ltk.core.refactoring;

import org.eclipse.core.runtime.Assert;
import org.eclipse.text.edits.TextEdit;
import org.eclipse.text.edits.TextEditGroup;

public class CategorizedTextEditGroup
  extends TextEditGroup
{
  private GroupCategorySet fGroupCategories;
  
  public CategorizedTextEditGroup(String name, GroupCategorySet groupCategories)
  {
    super(name);
    Assert.isNotNull(groupCategories);
    fGroupCategories = groupCategories;
  }
  
  public CategorizedTextEditGroup(String name, TextEdit edit, GroupCategorySet groupCategories)
  {
    super(name, edit);
    Assert.isNotNull(groupCategories);
    fGroupCategories = groupCategories;
  }
  
  public CategorizedTextEditGroup(String name, TextEdit[] edits, GroupCategorySet groupCategories)
  {
    super(name, edits);
    Assert.isNotNull(groupCategories);
    fGroupCategories = groupCategories;
  }
  
  public GroupCategorySet getGroupCategorySet()
  {
    return fGroupCategories;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ltk.core.refactoring.CategorizedTextEditGroup
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ltk.core.refactoring;

import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IAdapterManager;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Platform;

public abstract class Change
  implements IAdaptable
{
  private Change fParent;
  private boolean fIsEnabled = true;
  
  public ChangeDescriptor getDescriptor()
  {
    return null;
  }
  
  public abstract String getName();
  
  public boolean isEnabled()
  {
    return fIsEnabled;
  }
  
  public void setEnabled(boolean enabled)
  {
    fIsEnabled = enabled;
  }
  
  public final void setEnabledShallow(boolean enabled)
  {
    fIsEnabled = enabled;
  }
  
  public Change getParent()
  {
    return fParent;
  }
  
  void setParent(Change parent)
  {
    if (parent != null) {
      Assert.isTrue(fParent == null);
    }
    fParent = parent;
  }
  
  public abstract void initializeValidationData(IProgressMonitor paramIProgressMonitor);
  
  public abstract RefactoringStatus isValid(IProgressMonitor paramIProgressMonitor)
    throws CoreException, OperationCanceledException;
  
  public abstract Change perform(IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public void dispose() {}
  
  public abstract Object getModifiedElement();
  
  public Object[] getAffectedObjects()
  {
    return null;
  }
  
  public Object getAdapter(Class adapter)
  {
    Object result = Platform.getAdapterManager().getAdapter(this, adapter);
    if (result != null) {
      return result;
    }
    if (fParent != null) {
      return fParent.getAdapter(adapter);
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ltk.core.refactoring.Change
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ltk.core.refactoring;

public abstract class ChangeDescriptor {}

/* Location:
 * Qualified Name:     org.eclipse.ltk.core.refactoring.ChangeDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ltk.core.refactoring;

import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.Assert;

public class CheckConditionsOperation
  implements IWorkspaceRunnable
{
  private Refactoring fRefactoring;
  private int fStyle;
  private RefactoringStatus fStatus;
  public static final int NONE = 0;
  public static final int INITIAL_CONDITONS = 2;
  public static final int FINAL_CONDITIONS = 4;
  public static final int ALL_CONDITIONS = 6;
  private static final int LAST = 8;
  
  public CheckConditionsOperation(Refactoring refactoring, int style)
  {
    Assert.isNotNull(refactoring);
    fRefactoring = refactoring;
    fStyle = style;
    Assert.isTrue(checkStyle(fStyle));
  }
  
  /* Error */
  public void run(org.eclipse.core.runtime.IProgressMonitor pm)
    throws org.eclipse.core.runtime.CoreException
  {
    // Byte code:
    //   0: aload_1
    //   1: ifnonnull +11 -> 12
    //   4: new 54	org/eclipse/core/runtime/NullProgressMonitor
    //   7: dup
    //   8: invokespecial 90	org/eclipse/core/runtime/NullProgressMonitor:<init>	()V
    //   11: astore_1
    //   12: aload_0
    //   13: aconst_null
    //   14: putfield 86	org/eclipse/ltk/core/refactoring/CheckConditionsOperation:fStatus	Lorg/eclipse/ltk/core/refactoring/RefactoringStatus;
    //   17: aload_0
    //   18: getfield 84	org/eclipse/ltk/core/refactoring/CheckConditionsOperation:fStyle	I
    //   21: bipush 6
    //   23: iand
    //   24: bipush 6
    //   26: if_icmpne +18 -> 44
    //   29: aload_0
    //   30: aload_0
    //   31: getfield 85	org/eclipse/ltk/core/refactoring/CheckConditionsOperation:fRefactoring	Lorg/eclipse/ltk/core/refactoring/Refactoring;
    //   34: aload_1
    //   35: invokevirtual 92	org/eclipse/ltk/core/refactoring/Refactoring:checkAllConditions	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/ltk/core/refactoring/RefactoringStatus;
    //   38: putfield 86	org/eclipse/ltk/core/refactoring/CheckConditionsOperation:fStatus	Lorg/eclipse/ltk/core/refactoring/RefactoringStatus;
    //   41: goto +62 -> 103
    //   44: aload_0
    //   45: getfield 84	org/eclipse/ltk/core/refactoring/CheckConditionsOperation:fStyle	I
    //   48: iconst_2
    //   49: iand
    //   50: iconst_2
    //   51: if_icmpne +18 -> 69
    //   54: aload_0
    //   55: aload_0
    //   56: getfield 85	org/eclipse/ltk/core/refactoring/CheckConditionsOperation:fRefactoring	Lorg/eclipse/ltk/core/refactoring/Refactoring;
    //   59: aload_1
    //   60: invokevirtual 94	org/eclipse/ltk/core/refactoring/Refactoring:checkInitialConditions	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/ltk/core/refactoring/RefactoringStatus;
    //   63: putfield 86	org/eclipse/ltk/core/refactoring/CheckConditionsOperation:fStatus	Lorg/eclipse/ltk/core/refactoring/RefactoringStatus;
    //   66: goto +37 -> 103
    //   69: aload_0
    //   70: getfield 84	org/eclipse/ltk/core/refactoring/CheckConditionsOperation:fStyle	I
    //   73: iconst_4
    //   74: iand
    //   75: iconst_4
    //   76: if_icmpne +27 -> 103
    //   79: aload_0
    //   80: aload_0
    //   81: getfield 85	org/eclipse/ltk/core/refactoring/CheckConditionsOperation:fRefactoring	Lorg/eclipse/ltk/core/refactoring/Refactoring;
    //   84: aload_1
    //   85: invokevirtual 93	org/eclipse/ltk/core/refactoring/Refactoring:checkFinalConditions	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/ltk/core/refactoring/RefactoringStatus;
    //   88: putfield 86	org/eclipse/ltk/core/refactoring/CheckConditionsOperation:fStatus	Lorg/eclipse/ltk/core/refactoring/RefactoringStatus;
    //   91: goto +12 -> 103
    //   94: astore_2
    //   95: aload_1
    //   96: invokeinterface 98 1 0
    //   101: aload_2
    //   102: athrow
    //   103: aload_1
    //   104: invokeinterface 98 1 0
    //   109: return
    // Line number table:
    //   Java source line #76	-> byte code offset #0
    //   Java source line #77	-> byte code offset #4
    //   Java source line #79	-> byte code offset #12
    //   Java source line #80	-> byte code offset #17
    //   Java source line #81	-> byte code offset #29
    //   Java source line #82	-> byte code offset #44
    //   Java source line #83	-> byte code offset #54
    //   Java source line #84	-> byte code offset #69
    //   Java source line #85	-> byte code offset #79
    //   Java source line #86	-> byte code offset #94
    //   Java source line #87	-> byte code offset #95
    //   Java source line #88	-> byte code offset #101
    //   Java source line #87	-> byte code offset #103
    //   Java source line #89	-> byte code offset #109
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	110	0	this	CheckConditionsOperation
    //   0	110	1	pm	org.eclipse.core.runtime.IProgressMonitor
    //   94	8	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   12	94	94	finally
  }
  
  public RefactoringStatus getStatus()
  {
    return fStatus;
  }
  
  public Refactoring getRefactoring()
  {
    return fRefactoring;
  }
  
  public int getStyle()
  {
    return fStyle;
  }
  
  private boolean checkStyle(int style)
  {
    return (style > 0) && (style < 8);
  }
  
  int getTicks(RefactoringTickProvider provider)
  {
    if ((fStyle & 0x6) == 6) {
      return provider.getCheckAllConditionsTicks();
    }
    if ((fStyle & 0x2) == 2) {
      return provider.getCheckInitialConditionsTicks();
    }
    if ((fStyle & 0x4) == 4) {
      return provider.getCheckFinalConditionsTicks();
    }
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ltk.core.refactoring.CheckConditionsOperation
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ltk.core.refactoring;

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.ltk.internal.core.refactoring.RefactoringCorePlugin;

class CompositeChange$1
  implements ISafeRunnable
{
  final CompositeChange this$0;
  private final Change val$changeToDispose;
  
  CompositeChange$1(CompositeChange paramCompositeChange, Change paramChange)
  {
    this$0 = paramCompositeChange;val$changeToDispose = paramChange;
  }
  
  public void run()
    throws Exception
  {
    val$changeToDispose.dispose();
  }
  
  public void handleException(Throwable exception)
  {
    RefactoringCorePlugin.log(exception);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ltk.core.refactoring.CompositeChange.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ltk.core.refactoring;

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.ltk.internal.core.refactoring.RefactoringCorePlugin;

class CompositeChange$2
  implements ISafeRunnable
{
  final CompositeChange this$0;
  private final Change val$change;
  
  CompositeChange$2(CompositeChange paramCompositeChange, Change paramChange)
  {
    this$0 = paramCompositeChange;val$change = paramChange;
  }
  
  public void run()
    throws Exception
  {
    val$change.dispose();
  }
  
  public void handleException(Throwable exception)
  {
    RefactoringCorePlugin.log(exception);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ltk.core.refactoring.CompositeChange.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ltk.core.refactoring;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.ltk.internal.core.refactoring.RefactoringCoreMessages;
import org.eclipse.ltk.internal.core.refactoring.RefactoringCorePlugin;

public class CompositeChange
  extends Change
{
  private String fName;
  private List fChanges;
  private boolean fIsSynthetic;
  private Change fUndoUntilException;
  
  public CompositeChange(String name)
  {
    this(name, new ArrayList(2));
  }
  
  public CompositeChange(String name, Change[] children)
  {
    this(name, new ArrayList(children.length));
    addAll(children);
  }
  
  private CompositeChange(String name, List changes)
  {
    Assert.isNotNull(name);
    Assert.isNotNull(changes);
    fName = name;
    fChanges = changes;
  }
  
  public boolean isSynthetic()
  {
    return fIsSynthetic;
  }
  
  public void markAsSynthetic()
  {
    fIsSynthetic = true;
  }
  
  public String getName()
  {
    return fName;
  }
  
  public void add(Change change)
  {
    if (change != null)
    {
      Assert.isTrue(change.getParent() == null);
      fChanges.add(change);
      change.setParent(this);
    }
  }
  
  public void addAll(Change[] changes)
  {
    for (int i = 0; i < changes.length; i++) {
      add(changes[i]);
    }
  }
  
  public void merge(CompositeChange change)
  {
    Change[] others = change.getChildren();
    for (int i = 0; i < others.length; i++)
    {
      Change other = others[i];
      change.remove(other);
      add(other);
    }
  }
  
  public boolean remove(Change change)
  {
    Assert.isNotNull(change);
    boolean result = fChanges.remove(change);
    if (result) {
      change.setParent(null);
    }
    return result;
  }
  
  public Change[] clear()
  {
    Change[] result = (Change[])fChanges.toArray(new Change[fChanges.size()]);
    fChanges.clear();
    return result;
  }
  
  public Change[] getChildren()
  {
    return (Change[])fChanges.toArray(new Change[fChanges.size()]);
  }
  
  public void setEnabled(boolean enabled)
  {
    super.setEnabled(enabled);
    for (Iterator iter = fChanges.iterator(); iter.hasNext();) {
      ((Change)iter.next()).setEnabled(enabled);
    }
  }
  
  public void initializeValidationData(IProgressMonitor pm)
  {
    pm.beginTask("", fChanges.size());
    for (Iterator iter = fChanges.iterator(); iter.hasNext();)
    {
      Change change = (Change)iter.next();
      change.initializeValidationData(new SubProgressMonitor(pm, 1));
      pm.worked(1);
    }
  }
  
  public RefactoringStatus isValid(IProgressMonitor pm)
    throws CoreException
  {
    RefactoringStatus result = new RefactoringStatus();
    pm.beginTask("", fChanges.size());
    for (Iterator iter = fChanges.iterator(); (iter.hasNext()) && (!result.hasFatalError());)
    {
      Change change = (Change)iter.next();
      if (change.isEnabled()) {
        result.merge(change.isValid(new SubProgressMonitor(pm, 1)));
      } else {
        pm.worked(1);
      }
      if (pm.isCanceled()) {
        throw new OperationCanceledException();
      }
    }
    pm.done();
    return result;
  }
  
  public Change perform(IProgressMonitor pm)
    throws CoreException
  {
    fUndoUntilException = null;
    List undos = new ArrayList(fChanges.size());
    pm.beginTask("", fChanges.size());
    pm.setTaskName(RefactoringCoreMessages.CompositeChange_performingChangesTask_name);
    Change change = null;
    boolean canceled = false;
    try
    {
      for (Iterator iter = fChanges.iterator(); iter.hasNext();)
      {
        change = (Change)iter.next();
        if ((!canceled) || (internalProcessOnCancel(change)))
        {
          if (change.isEnabled())
          {
            Change undoChange = null;
            try
            {
              undoChange = change.perform(new SubProgressMonitor(pm, 1));
            }
            catch (OperationCanceledException e)
            {
              canceled = true;
              if (!internalContinueOnCancel()) {
                throw e;
              }
              undos = null;
            }
            if (undos != null) {
              if (undoChange == null) {
                undos = null;
              } else {
                undos.add(undoChange);
              }
            }
          }
          iter.remove();
          
          Change changeToDispose = change;
          SafeRunner.run(new ISafeRunnable()
          {
            private final Change val$changeToDispose;
            
            public void run()
              throws Exception
            {
              val$changeToDispose.dispose();
            }
            
            public void handleException(Throwable exception)
            {
              RefactoringCorePlugin.log(exception);
            }
          });
        }
      }
      if (canceled) {
        throw new OperationCanceledException();
      }
      if (undos != null)
      {
        Collections.reverse(undos);
        return createUndoChange((Change[])undos.toArray(new Change[undos.size()]));
      }
      return null;
    }
    catch (CoreException e)
    {
      handleUndos(change, undos);
      internalHandleException(change, e);
      throw e;
    }
    catch (RuntimeException e)
    {
      handleUndos(change, undos);
      internalHandleException(change, e);
      throw e;
    }
  }
  
  private void handleUndos(Change failedChange, List undos)
  {
    if (undos == null)
    {
      fUndoUntilException = null;
      return;
    }
    if ((failedChange instanceof CompositeChange))
    {
      Change partUndoChange = ((CompositeChange)failedChange).getUndoUntilException();
      if (partUndoChange != null) {
        undos.add(partUndoChange);
      }
    }
    if (undos.size() == 0)
    {
      fUndoUntilException = new NullChange(getName());
      return;
    }
    Collections.reverse(undos);
    fUndoUntilException = createUndoChange((Change[])undos.toArray(new Change[undos.size()]));
  }
  
  protected void internalHandleException(Change change, Throwable t) {}
  
  protected boolean internalContinueOnCancel()
  {
    return false;
  }
  
  protected boolean internalProcessOnCancel(Change change)
  {
    return false;
  }
  
  public void dispose()
  {
    for (Iterator iter = fChanges.iterator(); iter.hasNext();)
    {
      Change change = (Change)iter.next();
      SafeRunner.run(new ISafeRunnable()
      {
        private final Change val$change;
        
        public void run()
          throws Exception
        {
          val$change.dispose();
        }
        
        public void handleException(Throwable exception)
        {
          RefactoringCorePlugin.log(exception);
        }
      });
    }
  }
  
  public Change getUndoUntilException()
  {
    return fUndoUntilException;
  }
  
  protected Change createUndoChange(Change[] childUndos)
  {
    return new CompositeChange(getName(), childUndos);
  }
  
  public Object[] getAffectedObjects()
  {
    if (fChanges.size() == 0) {
      return new Object[0];
    }
    List result = new ArrayList();
    for (Iterator iter = fChanges.iterator(); iter.hasNext();)
    {
      Change change = (Change)iter.next();
      Object[] affectedObjects = change.getAffectedObjects();
      if (affectedObjects == null) {
        return null;
      }
      result.addAll(Arrays.asList(affectedObjects));
    }
    return result.toArray();
  }
  
  public Object getModifiedElement()
  {
    return null;
  }
  
  public ChangeDescriptor getDescriptor()
  {
    for (Iterator iterator = fChanges.iterator(); iterator.hasNext();)
    {
      Change change = (Change)iterator.next();
      ChangeDescriptor descriptor = change.getDescriptor();
      if (descriptor != null) {
        return descriptor;
      }
    }
    return null;
  }
  
  public String toString()
  {
    StringBuffer buff = new StringBuffer();
    buff.append(getName());
    buff.append("\n");
    for (Iterator iter = fChanges.iterator(); iter.hasNext();) {
      buff.append("<").append(iter.next().toString()).append("/>\n");
    }
    return buff.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ltk.core.refactoring.CompositeChange
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ltk.core.refactoring;

public abstract class ContentStamp
{
  public abstract boolean isNullStamp();
}

/* Location:
 * Qualified Name:     org.eclipse.ltk.core.refactoring.ContentStamp
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ltk.core.refactoring;

import org.eclipse.ltk.internal.core.refactoring.RefactoringCoreMessages;
import org.eclipse.ltk.internal.core.refactoring.history.UnknownRefactoringDescriptor;

class CreateChangeOperation$1
  extends CompositeChange
{
  final CreateChangeOperation this$0;
  
  CreateChangeOperation$1(CreateChangeOperation paramCreateChangeOperation, String $anonymous0)
  {
    super($anonymous0);this$0 = paramCreateChangeOperation;
  }
  
  public final ChangeDescriptor getDescriptor()
  {
    String name = CreateChangeOperation.access$0(this$0).getName();
    if (name.length() == 0) {
      name = RefactoringCoreMessages.CreateChangeOperation_unknown_Refactoring;
    }
    UnknownRefactoringDescriptor unknownDescriptor = new UnknownRefactoringDescriptor(name);
    return new RefactoringChangeDescriptor(unknownDescriptor);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ltk.core.refactoring.CreateChangeOperation.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ltk.core.refactoring;

import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.Assert;
import org.eclipse.ltk.internal.core.refactoring.RefactoringCoreMessages;
import org.eclipse.ltk.internal.core.refactoring.history.UnknownRefactoringDescriptor;

public class CreateChangeOperation
  implements IWorkspaceRunnable
{
  private Refactoring fRefactoring;
  private CheckConditionsOperation fCheckConditionOperation;
  private int fConditionCheckingFailedSeverity;
  private Change fChange;
  
  public CreateChangeOperation(Refactoring refactoring)
  {
    Assert.isNotNull(refactoring);
    fRefactoring = refactoring;
  }
  
  public CreateChangeOperation(CheckConditionsOperation operation, int checkFailedSeverity)
  {
    Assert.isNotNull(operation);
    fCheckConditionOperation = operation;
    fRefactoring = operation.getRefactoring();
    Assert.isTrue((checkFailedSeverity > 0) && (checkFailedSeverity <= 4));
    fConditionCheckingFailedSeverity = checkFailedSeverity;
  }
  
  public int getConditionCheckingFailedSeverity()
  {
    return fConditionCheckingFailedSeverity;
  }
  
  /* Error */
  public void run(org.eclipse.core.runtime.IProgressMonitor pm)
    throws org.eclipse.core.runtime.CoreException
  {
    // Byte code:
    //   0: aload_1
    //   1: ifnonnull +11 -> 12
    //   4: new 72	org/eclipse/core/runtime/NullProgressMonitor
    //   7: dup
    //   8: invokespecial 146	org/eclipse/core/runtime/NullProgressMonitor:<init>	()V
    //   11: astore_1
    //   12: aload_0
    //   13: aconst_null
    //   14: putfield 140	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fChange	Lorg/eclipse/ltk/core/refactoring/Change;
    //   17: aload_0
    //   18: aconst_null
    //   19: putfield 140	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fChange	Lorg/eclipse/ltk/core/refactoring/Change;
    //   22: aload_0
    //   23: getfield 142	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fRefactoring	Lorg/eclipse/ltk/core/refactoring/Refactoring;
    //   26: invokevirtual 159	org/eclipse/ltk/core/refactoring/Refactoring:getRefactoringTickProvider	()Lorg/eclipse/ltk/core/refactoring/RefactoringTickProvider;
    //   29: astore_2
    //   30: aload_0
    //   31: getfield 141	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fCheckConditionOperation	Lorg/eclipse/ltk/core/refactoring/CheckConditionsOperation;
    //   34: ifnull +155 -> 189
    //   37: aload_0
    //   38: getfield 141	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fCheckConditionOperation	Lorg/eclipse/ltk/core/refactoring/CheckConditionsOperation;
    //   41: aload_2
    //   42: invokevirtual 155	org/eclipse/ltk/core/refactoring/CheckConditionsOperation:getTicks	(Lorg/eclipse/ltk/core/refactoring/RefactoringTickProvider;)I
    //   45: istore_3
    //   46: iload_3
    //   47: aload_2
    //   48: invokevirtual 162	org/eclipse/ltk/core/refactoring/RefactoringTickProvider:getCreateChangeTicks	()I
    //   51: iadd
    //   52: aload_2
    //   53: invokevirtual 163	org/eclipse/ltk/core/refactoring/RefactoringTickProvider:getInitializeChangeTicks	()I
    //   56: iadd
    //   57: istore 4
    //   59: aload_1
    //   60: ldc 1
    //   62: iload 4
    //   64: invokeinterface 168 3 0
    //   69: aload_1
    //   70: ldc 1
    //   72: invokeinterface 167 2 0
    //   77: aload_0
    //   78: getfield 141	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fCheckConditionOperation	Lorg/eclipse/ltk/core/refactoring/CheckConditionsOperation;
    //   81: new 73	org/eclipse/core/runtime/SubProgressMonitor
    //   84: dup
    //   85: aload_1
    //   86: iload_3
    //   87: invokespecial 147	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   90: invokevirtual 152	org/eclipse/ltk/core/refactoring/CheckConditionsOperation:run	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   93: aload_0
    //   94: getfield 141	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fCheckConditionOperation	Lorg/eclipse/ltk/core/refactoring/CheckConditionsOperation;
    //   97: invokevirtual 154	org/eclipse/ltk/core/refactoring/CheckConditionsOperation:getStatus	()Lorg/eclipse/ltk/core/refactoring/RefactoringStatus;
    //   100: astore 5
    //   102: aload 5
    //   104: ifnull +67 -> 171
    //   107: aload 5
    //   109: invokevirtual 161	org/eclipse/ltk/core/refactoring/RefactoringStatus:getSeverity	()I
    //   112: aload_0
    //   113: getfield 139	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fConditionCheckingFailedSeverity	I
    //   116: if_icmpge +55 -> 171
    //   119: aload_0
    //   120: aload_0
    //   121: getfield 142	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fRefactoring	Lorg/eclipse/ltk/core/refactoring/Refactoring;
    //   124: new 73	org/eclipse/core/runtime/SubProgressMonitor
    //   127: dup
    //   128: aload_1
    //   129: aload_2
    //   130: invokevirtual 162	org/eclipse/ltk/core/refactoring/RefactoringTickProvider:getCreateChangeTicks	()I
    //   133: invokespecial 147	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   136: invokevirtual 160	org/eclipse/ltk/core/refactoring/Refactoring:createChange	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/ltk/core/refactoring/Change;
    //   139: putfield 140	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fChange	Lorg/eclipse/ltk/core/refactoring/Change;
    //   142: aload_0
    //   143: getfield 140	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fChange	Lorg/eclipse/ltk/core/refactoring/Change;
    //   146: new 82	org/eclipse/ltk/internal/core/refactoring/NotCancelableProgressMonitor
    //   149: dup
    //   150: new 73	org/eclipse/core/runtime/SubProgressMonitor
    //   153: dup
    //   154: aload_1
    //   155: aload_2
    //   156: invokevirtual 163	org/eclipse/ltk/core/refactoring/RefactoringTickProvider:getInitializeChangeTicks	()I
    //   159: invokespecial 147	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   162: invokespecial 164	org/eclipse/ltk/internal/core/refactoring/NotCancelableProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   165: invokevirtual 149	org/eclipse/ltk/core/refactoring/Change:initializeValidationData	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   168: goto +101 -> 269
    //   171: aload_1
    //   172: aload_2
    //   173: invokevirtual 162	org/eclipse/ltk/core/refactoring/RefactoringTickProvider:getCreateChangeTicks	()I
    //   176: aload_2
    //   177: invokevirtual 163	org/eclipse/ltk/core/refactoring/RefactoringTickProvider:getInitializeChangeTicks	()I
    //   180: iadd
    //   181: invokeinterface 166 2 0
    //   186: goto +83 -> 269
    //   189: aload_1
    //   190: ldc 1
    //   192: aload_2
    //   193: invokevirtual 162	org/eclipse/ltk/core/refactoring/RefactoringTickProvider:getCreateChangeTicks	()I
    //   196: aload_2
    //   197: invokevirtual 163	org/eclipse/ltk/core/refactoring/RefactoringTickProvider:getInitializeChangeTicks	()I
    //   200: iadd
    //   201: invokeinterface 168 3 0
    //   206: aload_0
    //   207: aload_0
    //   208: getfield 142	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fRefactoring	Lorg/eclipse/ltk/core/refactoring/Refactoring;
    //   211: new 73	org/eclipse/core/runtime/SubProgressMonitor
    //   214: dup
    //   215: aload_1
    //   216: aload_2
    //   217: invokevirtual 162	org/eclipse/ltk/core/refactoring/RefactoringTickProvider:getCreateChangeTicks	()I
    //   220: invokespecial 147	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   223: invokevirtual 160	org/eclipse/ltk/core/refactoring/Refactoring:createChange	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/ltk/core/refactoring/Change;
    //   226: putfield 140	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fChange	Lorg/eclipse/ltk/core/refactoring/Change;
    //   229: aload_0
    //   230: getfield 140	org/eclipse/ltk/core/refactoring/CreateChangeOperation:fChange	Lorg/eclipse/ltk/core/refactoring/Change;
    //   233: new 82	org/eclipse/ltk/internal/core/refactoring/NotCancelableProgressMonitor
    //   236: dup
    //   237: new 73	org/eclipse/core/runtime/SubProgressMonitor
    //   240: dup
    //   241: aload_1
    //   242: aload_2
    //   243: invokevirtual 163	org/eclipse/ltk/core/refactoring/RefactoringTickProvider:getInitializeChangeTicks	()I
    //   246: invokespecial 147	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   249: invokespecial 164	org/eclipse/ltk/internal/core/refactoring/NotCancelableProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   252: invokevirtual 149	org/eclipse/ltk/core/refactoring/Change:initializeValidationData	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   255: goto +14 -> 269
    //   258: astore 6
    //   260: aload_1
    //   261: invokeinterface 165 1 0
    //   266: aload 6
    //   268: athrow
    //   269: aload_1
    //   270: invokeinterface 165 1 0
    //   275: return
    // Line number table:
    //   Java source line #110	-> byte code offset #0
    //   Java source line #111	-> byte code offset #4
    //   Java source line #112	-> byte code offset #12
    //   Java source line #114	-> byte code offset #17
    //   Java source line #115	-> byte code offset #22
    //   Java source line #116	-> byte code offset #30
    //   Java source line #117	-> byte code offset #37
    //   Java source line #118	-> byte code offset #46
    //   Java source line #119	-> byte code offset #59
    //   Java source line #120	-> byte code offset #69
    //   Java source line #121	-> byte code offset #77
    //   Java source line #122	-> byte code offset #93
    //   Java source line #123	-> byte code offset #102
    //   Java source line #124	-> byte code offset #119
    //   Java source line #125	-> byte code offset #142
    //   Java source line #126	-> byte code offset #150
    //   Java source line #125	-> byte code offset #165
    //   Java source line #128	-> byte code offset #171
    //   Java source line #131	-> byte code offset #189
    //   Java source line #132	-> byte code offset #206
    //   Java source line #133	-> byte code offset #229
    //   Java source line #134	-> byte code offset #237
    //   Java source line #133	-> byte code offset #252
    //   Java source line #136	-> byte code offset #258
    //   Java source line #137	-> byte code offset #260
    //   Java source line #138	-> byte code offset #266
    //   Java source line #137	-> byte code offset #269
    //   Java source line #139	-> byte code offset #275
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	276	0	this	CreateChangeOperation
    //   0	276	1	pm	org.eclipse.core.runtime.IProgressMonitor
    //   29	214	2	rtp	RefactoringTickProvider
    //   45	42	3	conditionTicks	int
    //   57	6	4	allTicks	int
    //   100	8	5	status	RefactoringStatus
    //   258	9	6	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   17	258	258	finally
  }
  
  public Change getChange()
  {
    if (fChange != null)
    {
      ChangeDescriptor descriptor = fChange.getDescriptor();
      if (descriptor == null)
      {
        CompositeChange composite = new CompositeChange(fChange.getName())
        {
          public final ChangeDescriptor getDescriptor()
          {
            String name = fChange.getName();
            if (name.length() == 0) {
              name = RefactoringCoreMessages.CreateChangeOperation_unknown_Refactoring;
            }
            UnknownRefactoringDescriptor unknownDescriptor = new UnknownRefactoringDescriptor(name);
            return new RefactoringChangeDescriptor(unknownDescriptor);
          }
        };
        composite.markAsSynthetic();
        composite.add(fChange);
        fChange = composite;
      }
    }
    return fChange;
  }
  
  public RefactoringStatus getConditionCheckingStatus()
  {
    if (fCheckConditionOperation != null) {
      return fCheckConditionOperation.getStatus();
    }
    return null;
  }
  
  public int getConditionCheckingStyle()
  {
    if (fCheckConditionOperation != null) {
      return fCheckConditionOperation.getStyle();
    }
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ltk.core.refactoring.CreateChangeOperation
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ltk.core.refactoring;

import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ltk.internal.core.refactoring.Lock;
import org.eclipse.text.edits.UndoEdit;

class DocumentChange$1
  implements Runnable
{
  final DocumentChange this$0;
  private final Lock val$completionLock;
  private final UndoEdit[] val$result;
  private final IDocument val$document;
  private final BadLocationException[] val$exception;
  
  DocumentChange$1(DocumentChange paramDocumentChange, Lock paramLock, UndoEdit[] paramArrayOfUndoEdit, IDocument paramIDocument, BadLocationException[] paramArrayOfBadLocationException)
  {
    this$0 = paramDocumentChange;val$completionLock = paramLock;val$result = paramArrayOfUndoEdit;val$document = paramIDocument;val$exception = paramArrayOfBadLocationException;
  }
  
  /* Error */
  public void run()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 49	org/eclipse/ltk/core/refactoring/DocumentChange$1:val$completionLock	Lorg/eclipse/ltk/internal/core/refactoring/Lock;
    //   4: dup
    //   5: astore_1
    //   6: monitorenter
    //   7: aload_0
    //   8: getfield 50	org/eclipse/ltk/core/refactoring/DocumentChange$1:val$result	[Lorg/eclipse/text/edits/UndoEdit;
    //   11: iconst_0
    //   12: aload_0
    //   13: getfield 48	org/eclipse/ltk/core/refactoring/DocumentChange$1:this$0	Lorg/eclipse/ltk/core/refactoring/DocumentChange;
    //   16: aload_0
    //   17: getfield 47	org/eclipse/ltk/core/refactoring/DocumentChange$1:val$document	Lorg/eclipse/jface/text/IDocument;
    //   20: invokestatic 54	org/eclipse/ltk/core/refactoring/DocumentChange:access$0	(Lorg/eclipse/ltk/core/refactoring/DocumentChange;Lorg/eclipse/jface/text/IDocument;)Lorg/eclipse/text/edits/UndoEdit;
    //   23: aastore
    //   24: goto +47 -> 71
    //   27: astore_2
    //   28: aload_0
    //   29: getfield 46	org/eclipse/ltk/core/refactoring/DocumentChange$1:val$exception	[Lorg/eclipse/jface/text/BadLocationException;
    //   32: iconst_0
    //   33: aload_2
    //   34: aastore
    //   35: aload_0
    //   36: getfield 49	org/eclipse/ltk/core/refactoring/DocumentChange$1:val$completionLock	Lorg/eclipse/ltk/internal/core/refactoring/Lock;
    //   39: iconst_1
    //   40: putfield 51	org/eclipse/ltk/internal/core/refactoring/Lock:fDone	Z
    //   43: aload_0
    //   44: getfield 49	org/eclipse/ltk/core/refactoring/DocumentChange$1:val$completionLock	Lorg/eclipse/ltk/internal/core/refactoring/Lock;
    //   47: invokevirtual 53	java/lang/Object:notifyAll	()V
    //   50: goto +36 -> 86
    //   53: astore_3
    //   54: aload_0
    //   55: getfield 49	org/eclipse/ltk/core/refactoring/DocumentChange$1:val$completionLock	Lorg/eclipse/ltk/internal/core/refactoring/Lock;
    //   58: iconst_1
    //   59: putfield 51	org/eclipse/ltk/internal/core/refactoring/Lock:fDone	Z
    //   62: aload_0
    //   63: getfield 49	org/eclipse/ltk/core/refactoring/DocumentChange$1:val$completionLock	Lorg/eclipse/ltk/internal/core/refactoring/Lock;
    //   66: invokevirtual 53	java/lang/Object:notifyAll	()V
    //   69: aload_3
    //   70: athrow
    //   71: aload_0
    //   72: getfield 49	org/eclipse/ltk/core/refactoring/DocumentChange$1:val$completionLock	Lorg/eclipse/ltk/internal/core/refactoring/Lock;
    //   75: iconst_1
    //   76: putfield 51	org/eclipse/ltk/internal/core/refactoring/Lock:fDone	Z
    //   79: aload_0
    //   80: getfield 49	org/eclipse/ltk/core/refactoring/DocumentChange$1:val$completionLock	Lorg/eclipse/ltk/internal/core/refactoring/Lock;
    //   83: invokevirtual 53	java/lang/Object:notifyAll	()V
    //   86: aload_1
    //   87: monitorexit
    //   88: goto +6 -> 94
    //   91: aload_1
    //   92: monitorexit
    //   93: athrow
    //   94: return
    // Line number table:
    //   Java source line #129	-> byte code offset #0
    //   Java source line #131	-> byte code offset #7
    //   Java source line #132	-> byte code offset #27
    //   Java source line #133	-> byte code offset #28
    //   Java source line #135	-> byte code offset #35
    //   Java source line #136	-> byte code offset #43
    //   Java source line #134	-> byte code offset #53
    //   Java source line #135	-> byte code offset #54
    //   Java source line #136	-> byte code offset #62
    //   Java source line #137	-> byte code offset #69
    //   Java source line #135	-> byte code offset #71
    //   Java source line #136	-> byte code offset #79
    //   Java source line #129	-> byte code offset #86
    //   Java source line #139	-> byte code offset #94
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	95	0	this	1
    //   5	87	1	Ljava/lang/Object;	Object
    //   27	7	2	e	BadLocationException
    //   53	17	3	localObject1	Object
    // Exception table:
    //   from	to	target	type
    //   7	24	27	org/eclipse/jface/text/BadLocationException
    //   7	35	53	finally
    //   7	88	91	finally
    //   91	93	91	finally
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ltk.core.refactoring.DocumentChange.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ltk.core.refactoring;

import org.eclipse.core.filebuffers.FileBuffers;
import org.eclipse.core.filebuffers.ITextFileBuffer;
import org.eclipse.core.filebuffers.ITextFileBufferManager;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ltk.internal.core.refactoring.Lock;
import org.eclipse.ltk.internal.core.refactoring.TextChanges;
import org.eclipse.ltk.internal.core.refactoring.UndoDocumentChange;
import org.eclipse.text.edits.MalformedTreeException;
import org.eclipse.text.edits.UndoEdit;

public class DocumentChange
  extends TextChange
{
  private IDocument fDocument;
  private int fLength;
  
  public DocumentChange(String name, IDocument document)
  {
    super(name);
    Assert.isNotNull(document);
    fDocument = document;
  }
  
  public Object getModifiedElement()
  {
    return fDocument;
  }
  
  public void initializeValidationData(IProgressMonitor pm)
  {
    fLength = fDocument.getLength();
  }
  
  public RefactoringStatus isValid(IProgressMonitor pm)
    throws CoreException
  {
    pm.beginTask("", 1);
    RefactoringStatus result = TextChanges.isValid(fDocument, fLength);
    pm.worked(1);
    return result;
  }
  
  protected IDocument acquireDocument(IProgressMonitor pm)
   
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd