org.eclipse.egit.core_2.3.1.201302201838-r

16:43:17.985 INFO  jd.cli.Main - Decompiling org.eclipse.egit.core_2.3.1.201302201838-r.jar
package org.eclipse.egit.core.op;

import java.io.File;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.CoreText;
import org.eclipse.egit.core.internal.indexdiff.IndexDiffCache;
import org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry;
import org.eclipse.egit.core.internal.job.RuleUtil;
import org.eclipse.egit.core.internal.util.ResourceUtil;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.util.FileUtils;

public class DeletePathsOperation
  implements IEGitOperation
{
  private final Collection<IPath> paths;
  private final ISchedulingRule schedulingRule;
  
  public DeletePathsOperation(Collection<IPath> paths)
  {
    this.paths = paths;
    schedulingRule = calculateSchedulingRule();
  }
  
  public void execute(IProgressMonitor m)
    throws CoreException
  {
    IProgressMonitor monitor = m != null ? m : new NullProgressMonitor();
    IWorkspaceRunnable action = new IWorkspaceRunnable()
    {
      public void run(IProgressMonitor actMonitor)
        throws CoreException
      {
        DeletePathsOperation.this.deletePaths(actMonitor);
      }
    };
    ResourcesPlugin.getWorkspace().run(action, getSchedulingRule(), 
      1, monitor);
  }
  
  public ISchedulingRule getSchedulingRule()
  {
    return schedulingRule;
  }
  
  private void deletePaths(IProgressMonitor monitor)
    throws CoreException
  {
    monitor.beginTask(CoreText.DeleteResourcesOperation_deletingResources, 
      paths.size() + 1);
    boolean errorOccurred = false;
    
    boolean refreshAll = false;
    List<IPath> refreshCachePaths = new ArrayList();
    for (IPath path : paths)
    {
      IResource resource = ResourceUtil.getResourceForLocation(path);
      if ((resource != null) && (resource.exists()))
      {
        resource.delete(false, new SubProgressMonitor(monitor, 1));
      }
      else
      {
        File file = path.toFile();
        if (file.exists())
        {
          try
          {
            FileUtils.delete(file, 1);
          }
          catch (IOException e)
          {
            errorOccurred = true;
            String message = 
              MessageFormat.format(CoreText.DeleteResourcesOperation_deleteFailed, new Object[] {
              file.getPath() });
            Activator.logError(message, e);
          }
          refreshCachePaths.add(path);
          if (file.isDirectory()) {
            refreshAll = true;
          }
        }
        monitor.worked(1);
      }
    }
    if (!refreshCachePaths.isEmpty()) {
      refreshIndexDiffCache(refreshCachePaths, refreshAll);
    }
    monitor.worked(1);
    
    monitor.done();
    if (errorOccurred)
    {
      IStatus status = Activator.error(
        CoreText.DeleteResourcesOperation_deleteFailedSeeLog, null);
      throw new CoreException(status);
    }
  }
  
  private ISchedulingRule calculateSchedulingRule()
  {
    return RuleUtil.getRuleForContainers(paths);
  }
  
  private void refreshIndexDiffCache(List<IPath> refreshCachePaths, boolean refreshAll)
  {
    Map<Repository, Collection<String>> resourcesByRepository = ResourceUtil.splitPathsByRepository(refreshCachePaths);
    for (Map.Entry<Repository, Collection<String>> entry : resourcesByRepository.entrySet())
    {
      Repository repository = (Repository)entry.getKey();
      Collection<String> files = (Collection)entry.getValue();
      
      IndexDiffCache cache = Activator.getDefault().getIndexDiffCache();
      IndexDiffCacheEntry cacheEntry = cache.getIndexDiffCacheEntry(repository);
      if (cacheEntry != null) {
        if (refreshAll) {
          cacheEntry.refresh();
        } else {
          cacheEntry.refreshFiles(files);
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.egit.core.op.DeletePathsOperation
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.egit.core.op;

import java.io.IOException;
import java.util.Collection;
import java.util.Map;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.egit.core.internal.job.RuleUtil;
import org.eclipse.egit.core.internal.util.ResourceUtil;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.GitCommand;
import org.eclipse.jgit.api.ResetCommand;
import org.eclipse.jgit.api.RmCommand;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;

public class RemoveFromIndexOperation
  implements IEGitOperation
{
  private final Map<Repository, Collection<String>> pathsByRepository;
  
  public RemoveFromIndexOperation(Collection<IPath> paths)
  {
    pathsByRepository = ResourceUtil.splitPathsByRepository(paths);
  }
  
  @Deprecated
  public RemoveFromIndexOperation(Repository repo, IResource[] resources)
  {
    pathsByRepository = ResourceUtil.splitResourcesByRepository(resources);
  }
  
  /* Error */
  public void execute(org.eclipse.core.runtime.IProgressMonitor m)
    throws org.eclipse.core.runtime.CoreException
  {
    // Byte code:
    //   0: aload_1
    //   1: ifnull +7 -> 8
    //   4: aload_1
    //   5: goto +10 -> 15
    //   8: new 98	org/eclipse/core/runtime/NullProgressMonitor
    //   11: dup
    //   12: invokespecial 199	org/eclipse/core/runtime/NullProgressMonitor:<init>	()V
    //   15: astore_2
    //   16: aload_2
    //   17: getstatic 195	org/eclipse/egit/core/CoreText:RemoveFromIndexOperation_removingFilesFromIndex	Ljava/lang/String;
    //   20: aload_0
    //   21: getfield 196	org/eclipse/egit/core/op/RemoveFromIndexOperation:pathsByRepository	Ljava/util/Map;
    //   24: invokeinterface 222 1 0
    //   29: invokeinterface 230 3 0
    //   34: aload_0
    //   35: getfield 196	org/eclipse/egit/core/op/RemoveFromIndexOperation:pathsByRepository	Ljava/util/Map;
    //   38: invokeinterface 223 1 0
    //   43: invokeinterface 227 1 0
    //   48: astore 4
    //   50: goto +105 -> 155
    //   53: aload 4
    //   55: invokeinterface 221 1 0
    //   60: checkcast 94	java/util/Map$Entry
    //   63: astore_3
    //   64: aload_3
    //   65: invokeinterface 225 1 0
    //   70: checkcast 112	org/eclipse/jgit/lib/Repository
    //   73: astore 5
    //   75: aload_3
    //   76: invokeinterface 226 1 0
    //   81: checkcast 91	java/util/Collection
    //   84: astore 6
    //   86: aload 5
    //   88: aload 6
    //   90: invokestatic 206	org/eclipse/egit/core/op/RemoveFromIndexOperation:prepareCommand	(Lorg/eclipse/jgit/lib/Repository;Ljava/util/Collection;)Lorg/eclipse/jgit/api/GitCommand;
    //   93: astore 7
    //   95: aload 7
    //   97: invokevirtual 212	org/eclipse/jgit/api/GitCommand:call	()Ljava/lang/Object;
    //   100: pop
    //   101: aload_2
    //   102: iconst_1
    //   103: invokeinterface 229 2 0
    //   108: goto +39 -> 147
    //   111: astore 8
    //   113: aload 8
    //   115: invokevirtual 217	org/eclipse/jgit/api/errors/GitAPIException:getMessage	()Ljava/lang/String;
    //   118: aload 8
    //   120: invokestatic 200	org/eclipse/egit/core/Activator:logError	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   123: aload 5
    //   125: invokestatic 208	org/eclipse/egit/core/project/RepositoryMapping:findRepositoryMapping	(Lorg/eclipse/jgit/lib/Repository;)Lorg/eclipse/egit/core/project/RepositoryMapping;
    //   128: invokevirtual 207	org/eclipse/egit/core/project/RepositoryMapping:fireRepositoryChanged	()V
    //   131: goto +24 -> 155
    //   134: astore 9
    //   136: aload 5
    //   138: invokestatic 208	org/eclipse/egit/core/project/RepositoryMapping:findRepositoryMapping	(Lorg/eclipse/jgit/lib/Repository;)Lorg/eclipse/egit/core/project/RepositoryMapping;
    //   141: invokevirtual 207	org/eclipse/egit/core/project/RepositoryMapping:fireRepositoryChanged	()V
    //   144: aload 9
    //   146: athrow
    //   147: aload 5
    //   149: invokestatic 208	org/eclipse/egit/core/project/RepositoryMapping:findRepositoryMapping	(Lorg/eclipse/jgit/lib/Repository;)Lorg/eclipse/egit/core/project/RepositoryMapping;
    //   152: invokevirtual 207	org/eclipse/egit/core/project/RepositoryMapping:fireRepositoryChanged	()V
    //   155: aload 4
    //   157: invokeinterface 220 1 0
    //   162: ifne -109 -> 53
    //   165: aload_2
    //   166: invokeinterface 228 1 0
    //   171: return
    // Line number table:
    //   Java source line #67	-> byte code offset #0
    //   Java source line #69	-> byte code offset #16
    //   Java source line #70	-> byte code offset #17
    //   Java source line #71	-> byte code offset #20
    //   Java source line #69	-> byte code offset #29
    //   Java source line #73	-> byte code offset #34
    //   Java source line #74	-> byte code offset #64
    //   Java source line #75	-> byte code offset #75
    //   Java source line #77	-> byte code offset #86
    //   Java source line #80	-> byte code offset #95
    //   Java source line #81	-> byte code offset #101
    //   Java source line #82	-> byte code offset #108
    //   Java source line #83	-> byte code offset #113
    //   Java source line #85	-> byte code offset #123
    //   Java source line #84	-> byte code offset #134
    //   Java source line #85	-> byte code offset #136
    //   Java source line #86	-> byte code offset #144
    //   Java source line #85	-> byte code offset #147
    //   Java source line #73	-> byte code offset #155
    //   Java source line #89	-> byte code offset #165
    //   Java source line #90	-> byte code offset #171
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	172	0	this	RemoveFromIndexOperation
    //   0	172	1	m	org.eclipse.core.runtime.IProgressMonitor
    //   15	151	2	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   63	13	3	entry	java.util.Map.Entry<Repository, Collection<String>>
    //   48	108	4	localIterator	java.util.Iterator
    //   73	75	5	repository	Repository
    //   84	5	6	paths	Collection<String>
    //   93	3	7	command	GitCommand<?>
    //   111	8	8	e	org.eclipse.jgit.api.errors.GitAPIException
    //   134	11	9	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   95	108	111	org/eclipse/jgit/api/errors/GitAPIException
    //   95	123	134	finally
  }
  
  public ISchedulingRule getSchedulingRule()
  {
    return RuleUtil.getRuleForRepositories(pathsByRepository.keySet());
  }
  
  private static GitCommand<?> prepareCommand(Repository repository, Collection<String> paths)
  {
    Git git = new Git(repository);
    if (hasHead(repository))
    {
      ResetCommand resetCommand = git.reset();
      resetCommand.setRef("HEAD");
      for (String path : paths) {
        resetCommand.addPath(getCommandPath(path));
      }
      return resetCommand;
    }
    RmCommand rmCommand = git.rm();
    rmCommand.setCached(true);
    for (String path : paths) {
      rmCommand.addFilepattern(getCommandPath(path));
    }
    return rmCommand;
  }
  
  private static boolean hasHead(Repository repository)
  {
    try
    {
      Ref head = repository.getRef("HEAD");
      return (head != null) && (head.getObjectId() != null);
    }
    catch (IOException localIOException) {}
    return false;
  }
  
  private static String getCommandPath(String path)
  {
    if ("".equals(path)) {
      return ".";
    }
    return path;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.egit.core.op.RemoveFromIndexOperation
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.egit.core.op;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jgit.lib.Repository;

public abstract interface IEGitOperation$PreExecuteTask
{
  public abstract void preExecute(Repository paramRepository, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
}

/* Location:
 * Qualified Name:     org.eclipse.egit.core.op.IEGitOperation.PreExecuteTask
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.egit.core.op;

import java.util.Collection;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.egit.core.CoreText;

class CommitOperation$1
  implements IWorkspaceRunnable
{
  CommitOperation$1(CommitOperation paramCommitOperation) {}
  
  public void run(IProgressMonitor actMonitor)
    throws CoreException
  {
    if (CommitOperation.access$0(this$0))
    {
      CommitOperation.access$1(this$0);
    }
    else if ((CommitOperation.access$2(this$0)) || ((this$0.commitFileList != null) && 
      (this$0.commitFileList.size() > 0)) || (CommitOperation.access$3(this$0)))
    {
      actMonitor.beginTask(
        CoreText.CommitOperation_PerformingCommit, 
        20);
      actMonitor.setTaskName(CoreText.CommitOperation_PerformingCommit);
      CommitOperation.access$4(this$0);
      CommitOperation.access$5(this$0);
      actMonitor.worked(10);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.egit.core.op.CommitOperation.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.egit.core.op;

import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.jgit.lib.Repository;

public class SubmoduleSyncOperation
  implements IEGitOperation
{
  private final Repository repository;
  private final Collection<String> paths;
  
  public SubmoduleSyncOperation(Repository repository)
  {
    this.repository = repository;
    paths = new ArrayList();
  }
  
  public SubmoduleSyncOperation addPath(String path)
  {
    paths.add(path);
    return this;
  }
  
  public void execute(IProgressMonitor monitor)
    throws CoreException
  {
    IWorkspaceRunnable action = new IWorkspaceRunnable()
    {
      /* Error */
      public void run(IProgressMonitor pm)
        throws CoreException
      {
        // Byte code:
        //   0: aload_1
        //   1: ldc 1
        //   3: iconst_1
        //   4: invokeinterface 118 3 0
        //   9: aconst_null
        //   10: astore_2
        //   11: aload_0
        //   12: getfield 101	org/eclipse/egit/core/op/SubmoduleSyncOperation$1:this$0	Lorg/eclipse/egit/core/op/SubmoduleSyncOperation;
        //   15: invokestatic 104	org/eclipse/egit/core/op/SubmoduleSyncOperation:access$0	(Lorg/eclipse/egit/core/op/SubmoduleSyncOperation;)Lorg/eclipse/jgit/lib/Repository;
        //   18: invokestatic 106	org/eclipse/jgit/api/Git:wrap	(Lorg/eclipse/jgit/lib/Repository;)Lorg/eclipse/jgit/api/Git;
        //   21: invokevirtual 105	org/eclipse/jgit/api/Git:submoduleSync	()Lorg/eclipse/jgit/api/SubmoduleSyncCommand;
        //   24: astore_3
        //   25: aload_0
        //   26: getfield 101	org/eclipse/egit/core/op/SubmoduleSyncOperation$1:this$0	Lorg/eclipse/egit/core/op/SubmoduleSyncOperation;
        //   29: invokestatic 103	org/eclipse/egit/core/op/SubmoduleSyncOperation:access$1	(Lorg/eclipse/egit/core/op/SubmoduleSyncOperation;)Ljava/util/Collection;
        //   32: invokeinterface 113 1 0
        //   37: astore 5
        //   39: goto +22 -> 61
        //   42: aload 5
        //   44: invokeinterface 115 1 0
        //   49: checkcast 46	java/lang/String
        //   52: astore 4
        //   54: aload_3
        //   55: aload 4
        //   57: invokevirtual 108	org/eclipse/jgit/api/SubmoduleSyncCommand:addPath	(Ljava/lang/String;)Lorg/eclipse/jgit/api/SubmoduleSyncCommand;
        //   60: pop
        //   61: aload 5
        //   63: invokeinterface 114 1 0
        //   68: ifne -26 -> 42
        //   71: aload_3
        //   72: invokevirtual 107	org/eclipse/jgit/api/SubmoduleSyncCommand:call	()Ljava/util/Map;
        //   75: astore_2
        //   76: goto +54 -> 130
        //   79: astore_3
        //   80: new 59	org/eclipse/team/core/TeamException
        //   83: dup
        //   84: aload_3
        //   85: invokevirtual 109	org/eclipse/jgit/api/errors/GitAPIException:getLocalizedMessage	()Ljava/lang/String;
        //   88: aload_3
        //   89: invokevirtual 110	org/eclipse/jgit/api/errors/GitAPIException:getCause	()Ljava/lang/Throwable;
        //   92: invokespecial 112	org/eclipse/team/core/TeamException:<init>	(Ljava/lang/String;Ljava/lang/Throwable;)V
        //   95: athrow
        //   96: astore 6
        //   98: aload_2
        //   99: ifnull +22 -> 121
        //   102: aload_2
        //   103: invokeinterface 116 1 0
        //   108: ifne +13 -> 121
        //   111: aload_0
        //   112: getfield 101	org/eclipse/egit/core/op/SubmoduleSyncOperation$1:this$0	Lorg/eclipse/egit/core/op/SubmoduleSyncOperation;
        //   115: invokestatic 104	org/eclipse/egit/core/op/SubmoduleSyncOperation:access$0	(Lorg/eclipse/egit/core/op/SubmoduleSyncOperation;)Lorg/eclipse/jgit/lib/Repository;
        //   118: invokevirtual 111	org/eclipse/jgit/lib/Repository:notifyIndexChanged	()V
        //   121: aload_1
        //   122: invokeinterface 117 1 0
        //   127: aload 6
        //   129: athrow
        //   130: aload_2
        //   131: ifnull +22 -> 153
        //   134: aload_2
        //   135: invokeinterface 116 1 0
        //   140: ifne +13 -> 153
        //   143: aload_0
        //   144: getfield 101	org/eclipse/egit/core/op/SubmoduleSyncOperation$1:this$0	Lorg/eclipse/egit/core/op/SubmoduleSyncOperation;
        //   147: invokestatic 104	org/eclipse/egit/core/op/SubmoduleSyncOperation:access$0	(Lorg/eclipse/egit/core/op/SubmoduleSyncOperation;)Lorg/eclipse/jgit/lib/Repository;
        //   150: invokevirtual 111	org/eclipse/jgit/lib/Repository:notifyIndexChanged	()V
        //   153: aload_1
        //   154: invokeinterface 117 1 0
        //   159: return
        // Line number table:
        //   Java source line #63	-> byte code offset #0
        //   Java source line #64	-> byte code offset #9
        //   Java source line #66	-> byte code offset #11
        //   Java source line #67	-> byte code offset #21
        //   Java source line #66	-> byte code offset #24
        //   Java source line #68	-> byte code offset #25
        //   Java source line #69	-> byte code offset #54
        //   Java source line #68	-> byte code offset #61
        //   Java source line #70	-> byte code offset #71
        //   Java source line #71	-> byte code offset #76
        //   Java source line #72	-> byte code offset #80
        //   Java source line #73	-> byte code offset #88
        //   Java source line #72	-> byte code offset #92
        //   Java source line #74	-> byte code offset #96
        //   Java source line #75	-> byte code offset #98
        //   Java source line #76	-> byte code offset #111
        //   Java source line #77	-> byte code offset #121
        //   Java source line #78	-> byte code offset #127
        //   Java source line #75	-> byte code offset #130
        //   Java source line #76	-> byte code offset #143
        //   Java source line #77	-> byte code offset #153
        //   Java source line #79	-> byte code offset #159
        // Local variable table:
        //   start	length	slot	name	signature
        //   0	160	0	this	1
        //   0	160	1	pm	IProgressMonitor
        //   10	125	2	updates	java.util.Map<String, String>
        //   24	48	3	sync	org.eclipse.jgit.api.SubmoduleSyncCommand
        //   79	10	3	e	org.eclipse.jgit.api.errors.GitAPIException
        //   52	4	4	path	String
        //   37	25	5	localIterator	java.util.Iterator
        //   96	32	6	localObject	Object
        // Exception table:
        //   from	to	target	type
        //   11	76	79	org/eclipse/jgit/api/errors/GitAPIException
        //   11	96	96	finally
      }
    };
    ResourcesPlugin.getWorkspace().run(action, 
      monitor != null ? monitor : new NullProgressMonitor());
  }
  
  public ISchedulingRule getSchedulingRule()
  {
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.egit.core.op.SubmoduleSyncOperation
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.egit.core.op;

import org.eclipse.core.resources.IWorkspaceRunnable;

class StashDropOperation$1
  implements IWorkspaceRunnable
{
  StashDropOperation$1(StashDropOperation paramStashDropOperation) {}
  
  /* Error */
  public void run(org.eclipse.core.runtime.IProgressMonitor pm)
    throws org.eclipse.core.runtime.CoreException
  {
    // Byte code:
    //   0: aload_1
    //   1: ldc 1
    //   3: iconst_1
    //   4: invokeinterface 99 3 0
    //   9: aload_0
    //   10: getfield 83	org/eclipse/egit/core/op/StashDropOperation$1:this$0	Lorg/eclipse/egit/core/op/StashDropOperation;
    //   13: invokestatic 86	org/eclipse/egit/core/op/StashDropOperation:access$0	(Lorg/eclipse/egit/core/op/StashDropOperation;)Lorg/eclipse/jgit/lib/Repository;
    //   16: invokestatic 88	org/eclipse/jgit/api/Git:wrap	(Lorg/eclipse/jgit/lib/Repository;)Lorg/eclipse/jgit/api/Git;
    //   19: invokevirtual 87	org/eclipse/jgit/api/Git:stashDrop	()Lorg/eclipse/jgit/api/StashDropCommand;
    //   22: astore_2
    //   23: aload_2
    //   24: aload_0
    //   25: getfield 83	org/eclipse/egit/core/op/StashDropOperation$1:this$0	Lorg/eclipse/egit/core/op/StashDropOperation;
    //   28: invokestatic 85	org/eclipse/egit/core/op/StashDropOperation:access$1	(Lorg/eclipse/egit/core/op/StashDropOperation;)I
    //   31: invokevirtual 89	org/eclipse/jgit/api/StashDropCommand:setStashRef	(I)Lorg/eclipse/jgit/api/StashDropCommand;
    //   34: pop
    //   35: aload_2
    //   36: invokevirtual 90	org/eclipse/jgit/api/StashDropCommand:call	()Lorg/eclipse/jgit/lib/ObjectId;
    //   39: pop
    //   40: aload_0
    //   41: getfield 83	org/eclipse/egit/core/op/StashDropOperation$1:this$0	Lorg/eclipse/egit/core/op/StashDropOperation;
    //   44: invokestatic 86	org/eclipse/egit/core/op/StashDropOperation:access$0	(Lorg/eclipse/egit/core/op/StashDropOperation;)Lorg/eclipse/jgit/lib/Repository;
    //   47: new 46	org/eclipse/jgit/events/RefsChangedEvent
    //   50: dup
    //   51: invokespecial 95	org/eclipse/jgit/events/RefsChangedEvent:<init>	()V
    //   54: invokevirtual 96	org/eclipse/jgit/lib/Repository:fireEvent	(Lorg/eclipse/jgit/events/RepositoryEvent;)V
    //   57: goto +48 -> 105
    //   60: astore_3
    //   61: new 48	org/eclipse/team/core/TeamException
    //   64: dup
    //   65: aload_3
    //   66: invokevirtual 93	org/eclipse/jgit/api/errors/JGitInternalException:getLocalizedMessage	()Ljava/lang/String;
    //   69: aload_3
    //   70: invokevirtual 94	org/eclipse/jgit/api/errors/JGitInternalException:getCause	()Ljava/lang/Throwable;
    //   73: invokespecial 97	org/eclipse/team/core/TeamException:<init>	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   76: athrow
    //   77: astore_3
    //   78: new 48	org/eclipse/team/core/TeamException
    //   81: dup
    //   82: aload_3
    //   83: invokevirtual 91	org/eclipse/jgit/api/errors/GitAPIException:getLocalizedMessage	()Ljava/lang/String;
    //   86: aload_3
    //   87: invokevirtual 92	org/eclipse/jgit/api/errors/GitAPIException:getCause	()Ljava/lang/Throwable;
    //   90: invokespecial 97	org/eclipse/team/core/TeamException:<init>	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   93: athrow
    //   94: astore 4
    //   96: aload_1
    //   97: invokeinterface 98 1 0
    //   102: aload 4
    //   104: athrow
    //   105: aload_1
    //   106: invokeinterface 98 1 0
    //   111: return
    // Line number table:
    //   Java source line #53	-> byte code offset #0
    //   Java source line #54	-> byte code offset #9
    //   Java source line #55	-> byte code offset #23
    //   Java source line #57	-> byte code offset #35
    //   Java source line #58	-> byte code offset #40
    //   Java source line #59	-> byte code offset #57
    //   Java source line #60	-> byte code offset #61
    //   Java source line #61	-> byte code offset #69
    //   Java source line #60	-> byte code offset #73
    //   Java source line #62	-> byte code offset #77
    //   Java source line #63	-> byte code offset #78
    //   Java source line #64	-> byte code offset #86
    //   Java source line #63	-> byte code offset #90
    //   Java source line #65	-> byte code offset #94
    //   Java source line #66	-> byte code offset #96
    //   Java source line #67	-> byte code offset #102
    //   Java source line #66	-> byte code offset #105
    //   Java source line #68	-> byte code offset #111
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	112	0	this	1
    //   0	112	1	pm	org.eclipse.core.runtime.IProgressMonitor
    //   22	14	2	command	org.eclipse.jgit.api.StashDropCommand
    //   60	10	3	e	org.eclipse.jgit.api.errors.JGitInternalException
    //   77	10	3	e	org.eclipse.jgit.api.errors.GitAPIException
    //   94	9	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   35	57	60	org/eclipse/jgit/api/errors/JGitInternalException
    //   35	57	77	org/eclipse/jgit/api/errors/GitAPIException
    //   35	94	94	finally
  }
}

/* Location:
 * Qualified Name:     org.eclipse.egit.core.op.StashDropOperation.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.egit.core.op;

import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jgit.lib.Repository;

abstract class BaseOperation
  implements IEGitOperation
{
  protected final Repository repository;
  protected Collection<IEGitOperation.PreExecuteTask> preTasks;
  protected Collection<IEGitOperation.PostExecuteTask> postTasks;
  
  BaseOperation(Repository repository)
  {
    this.repository = repository;
  }
  
  protected void preExecute(IProgressMonitor monitor)
    throws CoreException
  {
    synchronized (this)
    {
      if (preTasks != null) {
        for (IEGitOperation.PreExecuteTask task : preTasks) {
          task.preExecute(repository, monitor);
        }
      }
    }
  }
  
  protected void postExecute(IProgressMonitor monitor)
    throws CoreException
  {
    synchronized (this)
    {
      if (postTasks != null) {
        for (IEGitOperation.PostExecuteTask task : postTasks) {
          task.postExecute(repository, monitor);
        }
      }
    }
  }
  
  public synchronized void addPreExecuteTask(IEGitOperation.PreExecuteTask task)
  {
    if (preTasks == null) {
      preTasks = new ArrayList();
    }
    preTasks.add(task);
  }
  
  public synchronized void addPostExecuteTask(IEGitOperation.PostExecuteTask task)
  {
    if (postTasks == null) {
      postTasks = new ArrayList();
    }
    postTasks.add(task);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.egit.core.op.BaseOperation
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.egit.core.op;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.CoreText;
import org.eclipse.egit.core.internal.util.ProjectUtil;
import org.eclipse.jgit.api.RebaseCommand.Operation;
import org.eclipse.jgit.api.RebaseResult;
import org.eclipse.jgit.api.RebaseResult.Status;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;

public class RebaseOperation
  implements IEGitOperation
{
  private final Repository repository;
  private final Ref ref;
  private final RebaseCommand.Operation operation;
  private RebaseResult result;
  
  public RebaseOperation(Repository repository, Ref ref)
  {
    this.repository = repository;
    operation = RebaseCommand.Operation.BEGIN;
    this.ref = ref;
  }
  
  public RebaseOperation(Repository repository, RebaseCommand.Operation operation)
  {
    this.repository = repository;
    this.operation = operation;
    ref = null;
  }
  
  public void execute(IProgressMonitor m)
    throws CoreException
  {
    if (result != null) {
      throw new CoreException(new Status(4, 
        Activator.getPluginId(), CoreText.OperationAlreadyExecuted));
    }
    IProgressMonitor monitor;
    IProgressMonitor monitor;
    if (m == null) {
      monitor = new NullProgressMonitor();
    } else {
      monitor = m;
    }
    final IProject[] validProjects = ProjectUtil.getValidOpenProjects(repository);
    IWorkspaceRunnable action = new IWorkspaceRunnable()
    {
      /* Error */
      public void run(IProgressMonitor actMonitor)
        throws CoreException
      {
        // Byte code:
        //   0: new 53	org/eclipse/jgit/api/Git
        //   3: dup
        //   4: aload_0
        //   5: getfield 112	org/eclipse/egit/core/op/RebaseOperation$1:this$0	Lorg/eclipse/egit/core/op/RebaseOperation;
        //   8: invokestatic 124	org/eclipse/egit/core/op/RebaseOperation:access$0	(Lorg/eclipse/egit/core/op/RebaseOperation;)Lorg/eclipse/jgit/lib/Repository;
        //   11: invokespecial 126	org/eclipse/jgit/api/Git:<init>	(Lorg/eclipse/jgit/lib/Repository;)V
        //   14: invokevirtual 125	org/eclipse/jgit/api/Git:rebase	()Lorg/eclipse/jgit/api/RebaseCommand;
        //   17: new 49	org/eclipse/egit/core/EclipseGitProgressTransformer
        //   20: dup
        //   21: aload_1
        //   22: invokespecial 118	org/eclipse/egit/core/EclipseGitProgressTransformer:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
        //   25: invokevirtual 130	org/eclipse/jgit/api/RebaseCommand:setProgressMonitor	(Lorg/eclipse/jgit/lib/ProgressMonitor;)Lorg/eclipse/jgit/api/RebaseCommand;
        //   28: astore_2
        //   29: aload_0
        //   30: getfield 112	org/eclipse/egit/core/op/RebaseOperation$1:this$0	Lorg/eclipse/egit/core/op/RebaseOperation;
        //   33: invokestatic 121	org/eclipse/egit/core/op/RebaseOperation:access$2	(Lorg/eclipse/egit/core/op/RebaseOperation;)Lorg/eclipse/jgit/api/RebaseCommand$Operation;
        //   36: getstatic 113	org/eclipse/jgit/api/RebaseCommand$Operation:BEGIN	Lorg/eclipse/jgit/api/RebaseCommand$Operation;
        //   39: if_acmpne +32 -> 71
        //   42: aload_0
        //   43: getfield 112	org/eclipse/egit/core/op/RebaseOperation$1:this$0	Lorg/eclipse/egit/core/op/RebaseOperation;
        //   46: aload_2
        //   47: aload_0
        //   48: getfield 112	org/eclipse/egit/core/op/RebaseOperation$1:this$0	Lorg/eclipse/egit/core/op/RebaseOperation;
        //   51: invokestatic 123	org/eclipse/egit/core/op/RebaseOperation:access$3	(Lorg/eclipse/egit/core/op/RebaseOperation;)Lorg/eclipse/jgit/lib/Ref;
        //   54: invokeinterface 135 1 0
        //   59: invokevirtual 128	org/eclipse/jgit/api/RebaseCommand:setUpstream	(Ljava/lang/String;)Lorg/eclipse/jgit/api/RebaseCommand;
        //   62: invokevirtual 127	org/eclipse/jgit/api/RebaseCommand:call	()Lorg/eclipse/jgit/api/RebaseResult;
        //   65: invokestatic 122	org/eclipse/egit/core/op/RebaseOperation:access$4	(Lorg/eclipse/egit/core/op/RebaseOperation;Lorg/eclipse/jgit/api/RebaseResult;)V
        //   68: goto +126 -> 194
        //   71: aload_0
        //   72: getfield 112	org/eclipse/egit/core/op/RebaseOperation$1:this$0	Lorg/eclipse/egit/core/op/RebaseOperation;
        //   75: aload_2
        //   76: aload_0
        //   77: getfield 112	org/eclipse/egit/core/op/RebaseOperation$1:this$0	Lorg/eclipse/egit/core/op/RebaseOperation;
        //   80: invokestatic 121	org/eclipse/egit/core/op/RebaseOperation:access$2	(Lorg/eclipse/egit/core/op/RebaseOperation;)Lorg/eclipse/jgit/api/RebaseCommand$Operation;
        //   83: invokevirtual 129	org/eclipse/jgit/api/RebaseCommand:setOperation	(Lorg/eclipse/jgit/api/RebaseCommand$Operation;)Lorg/eclipse/jgit/api/RebaseCommand;
        //   86: invokevirtual 127	org/eclipse/jgit/api/RebaseCommand:call	()Lorg/eclipse/jgit/api/RebaseResult;
        //   89: invokestatic 122	org/eclipse/egit/core/op/RebaseOperation:access$4	(Lorg/eclipse/egit/core/op/RebaseOperation;Lorg/eclipse/jgit/api/RebaseResult;)V
        //   92: goto +102 -> 194
        //   95: astore_3
        //   96: new 46	org/eclipse/core/runtime/CoreException
        //   99: dup
        //   100: aload_3
        //   101: invokevirtual 133	org/eclipse/jgit/api/errors/NoHeadException:getMessage	()Ljava/lang/String;
        //   104: aload_3
        //   105: invokestatic 117	org/eclipse/egit/core/Activator:error	(Ljava/lang/String;Ljava/lang/Throwable;)Lorg/eclipse/core/runtime/IStatus;
        //   108: invokespecial 115	org/eclipse/core/runtime/CoreException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
        //   111: athrow
        //   112: astore_3
        //   113: new 46	org/eclipse/core/runtime/CoreException
        //   116: dup
        //   117: aload_3
        //   118: invokevirtual 134	org/eclipse/jgit/api/errors/RefNotFoundException:getMessage	()Ljava/lang/String;
        //   121: aload_3
        //   122: invokestatic 117	org/eclipse/egit/core/Activator:error	(Ljava/lang/String;Ljava/lang/Throwable;)Lorg/eclipse/core/runtime/IStatus;
        //   125: invokespecial 115	org/eclipse/core/runtime/CoreException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
        //   128: athrow
        //   129: astore_3
        //   130: new 46	org/eclipse/core/runtime/CoreException
        //   133: dup
        //   134: aload_3
        //   135: invokevirtual 132	org/eclipse/jgit/api/errors/JGitInternalException:getMessage	()Ljava/lang/String;
        //   138: aload_3
        //   139: invokestatic 117	org/eclipse/egit/core/Activator:error	(Ljava/lang/String;Ljava/lang/Throwable;)Lorg/eclipse/core/runtime/IStatus;
        //   142: invokespecial 115	org/eclipse/core/runtime/CoreException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
        //   145: athrow
        //   146: astore_3
        //   147: new 46	org/eclipse/core/runtime/CoreException
        //   150: dup
        //   151: aload_3
        //   152: invokevirtual 131	org/eclipse/jgit/api/errors/GitAPIException:getMessage	()Ljava/lang/String;
        //   155: aload_3
        //   156: invokestatic 117	org/eclipse/egit/core/Activator:error	(Ljava/lang/String;Ljava/lang/Throwable;)Lorg/eclipse/core/runtime/IStatus;
        //   159: invokespecial 115	org/eclipse/core/runtime/CoreException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
        //   162: athrow
        //   163: astore 4
        //   165: aload_0
        //   166: getfield 112	org/eclipse/egit/core/op/RebaseOperation$1:this$0	Lorg/eclipse/egit/core/op/RebaseOperation;
        //   169: invokestatic 120	org/eclipse/egit/core/op/RebaseOperation:access$1	(Lorg/eclipse/egit/core/op/RebaseOperation;)Z
        //   172: ifeq +19 -> 191
        //   175: aload_0
        //   176: getfield 111	org/eclipse/egit/core/op/RebaseOperation$1:val$validProjects	[Lorg/eclipse/core/resources/IProject;
        //   179: new 47	org/eclipse/core/runtime/SubProgressMonitor
        //   182: dup
        //   183: aload_1
        //   184: iconst_1
        //   185: invokespecial 116	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
        //   188: invokestatic 119	org/eclipse/egit/core/internal/util/ProjectUtil:refreshValidProjects	([Lorg/eclipse/core/resources/IProject;Lorg/eclipse/core/runtime/IProgressMonitor;)V
        //   191: aload 4
        //   193: athrow
        //   194: aload_0
        //   195: getfield 112	org/eclipse/egit/core/op/RebaseOperation$1:this$0	Lorg/eclipse/egit/core/op/RebaseOperation;
        //   198: invokestatic 120	org/eclipse/egit/core/op/RebaseOperation:access$1	(Lorg/eclipse/egit/core/op/RebaseOperation;)Z
        //   201: ifeq +19 -> 220
        //   204: aload_0
        //   205: getfield 111	org/eclipse/egit/core/op/RebaseOperation$1:val$validProjects	[Lorg/eclipse/core/resources/IProject;
        //   208: new 47	org/eclipse/core/runtime/SubProgressMonitor
        //   211: dup
        //   212: aload_1
        //   213: iconst_1
        //   214: invokespecial 116	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
        //   217: invokestatic 119	org/eclipse/egit/core/internal/util/ProjectUtil:refreshValidProjects	([Lorg/eclipse/core/resources/IProject;Lorg/eclipse/core/runtime/IProgressMonitor;)V
        //   220: return
        // Line number table:
        //   Java source line #95	-> byte code offset #0
        //   Java source line #97	-> byte code offset #17
        //   Java source line #96	-> byte code offset #25
        //   Java source line #95	-> byte code offset #28
        //   Java source line #99	-> byte code offset #29
        //   Java source line #100	-> byte code offset #42
        //   Java source line #102	-> byte code offset #71
        //   Java source line #104	-> byte code offset #92
        //   Java source line #105	-> byte code offset #96
        //   Java source line #106	-> byte code offset #112
        //   Java source line #107	-> byte code offset #113
        //   Java source line #108	-> byte code offset #129
        //   Java source line #109	-> byte code offset #130
        //   Java source line #110	-> byte code offset #146
        //   Java source line #111	-> byte code offset #147
        //   Java source line #112	-> byte code offset #163
        //   Java source line #113	-> byte code offset #165
        //   Java source line #114	-> byte code offset #175
        //   Java source line #115	-> byte code offset #179
        //   Java source line #114	-> byte code offset #188
        //   Java source line #116	-> byte code offset #191
        //   Java source line #113	-> byte code offset #194
        //   Java source line #114	-> byte code offset #204
        //   Java source line #115	-> byte code offset #208
        //   Java source line #114	-> byte code offset #217
        //   Java source line #117	-> byte code offset #220
        // Local variable table:
        //   start	length	slot	name	signature
        //   0	221	0	this	1
        //   0	221	1	actMonitor	IProgressMonitor
        //   28	48	2	cmd	org.eclipse.jgit.api.RebaseCommand
        //   95	10	3	e	org.eclipse.jgit.api.errors.NoHeadException
        //   112	10	3	e	org.eclipse.jgit.api.errors.RefNotFoundException
        //   129	10	3	e	org.eclipse.jgit.api.errors.JGitInternalException
        //   146	10	3	e	org.eclipse.jgit.api.errors.GitAPIException
        //   163	29	4	localObject	Object
        // Exception table:
        //   from	to	target	type
        //   29	92	95	org/eclipse/jgit/api/err
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

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