org.eclipse.team.core_3.6.0.I20110525-0800

   112: arraylength
    //   113: if_icmplt -93 -> 20
    //   116: goto +14 -> 130
    //   119: astore 5
    //   121: aload_1
    //   122: invokeinterface 90 1 0
    //   127: aload 5
    //   129: athrow
    //   130: aload_1
    //   131: invokeinterface 90 1 0
    //   136: return
    // Line number table:
    //   Java source line #84	-> byte code offset #0
    //   Java source line #85	-> byte code offset #15
    //   Java source line #86	-> byte code offset #20
    //   Java source line #87	-> byte code offset #27
    //   Java source line #88	-> byte code offset #47
    //   Java source line #89	-> byte code offset #57
    //   Java source line #90	-> byte code offset #68
    //   Java source line #92	-> byte code offset #94
    //   Java source line #85	-> byte code offset #104
    //   Java source line #96	-> byte code offset #119
    //   Java source line #97	-> byte code offset #121
    //   Java source line #98	-> byte code offset #127
    //   Java source line #97	-> byte code offset #130
    //   Java source line #99	-> byte code offset #136
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	137	0	this	3
    //   0	137	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   16	92	2	i	int
    //   26	6	3	delta	IDiff
    //   45	54	4	s	org.eclipse.core.runtime.IStatus
    //   119	9	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	119	119	finally
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.mapping.provider.MergeContext.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core.mapping.provider;

import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.core.diff.IThreeWayDiff;

class MergeContext$4
  implements IWorkspaceRunnable
{
  final MergeContext this$0;
  private final IThreeWayDiff val$diff;
  private final IStatus[] val$result;
  
  MergeContext$4(MergeContext paramMergeContext, IThreeWayDiff paramIThreeWayDiff, IStatus[] paramArrayOfIStatus)
  {
    this$0 = paramMergeContext;val$diff = paramIThreeWayDiff;val$result = paramArrayOfIStatus;
  }
  
  /* Error */
  public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
    throws org.eclipse.core.runtime.CoreException
  {
    // Byte code:
    //   0: aload_1
    //   1: aconst_null
    //   2: bipush 100
    //   4: invokeinterface 190 3 0
    //   9: aload_0
    //   10: getfield 168	org/eclipse/team/core/mapping/provider/MergeContext$4:val$diff	Lorg/eclipse/team/core/diff/IThreeWayDiff;
    //   13: invokeinterface 194 1 0
    //   18: checkcast 90	org/eclipse/team/core/mapping/IResourceDiff
    //   21: astore_2
    //   22: aload_0
    //   23: getfield 168	org/eclipse/team/core/mapping/provider/MergeContext$4:val$diff	Lorg/eclipse/team/core/diff/IThreeWayDiff;
    //   26: invokeinterface 195 1 0
    //   31: checkcast 90	org/eclipse/team/core/mapping/IResourceDiff
    //   34: astore_3
    //   35: aload_0
    //   36: getfield 169	org/eclipse/team/core/mapping/provider/MergeContext$4:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
    //   39: getstatic 166	org/eclipse/team/core/mapping/provider/MergeContext:class$0	Ljava/lang/Class;
    //   42: dup
    //   43: ifnonnull +28 -> 71
    //   46: pop
    //   47: ldc 1
    //   49: invokestatic 171	java/lang/Class:forName	(Ljava/lang/String;)Ljava/lang/Class;
    //   52: dup
    //   53: putstatic 166	org/eclipse/team/core/mapping/provider/MergeContext:class$0	Ljava/lang/Class;
    //   56: goto +15 -> 71
    //   59: new 77	java/lang/NoClassDefFoundError
    //   62: dup_x1
    //   63: swap
    //   64: invokevirtual 174	java/lang/Throwable:getMessage	()Ljava/lang/String;
    //   67: invokespecial 172	java/lang/NoClassDefFoundError:<init>	(Ljava/lang/String;)V
    //   70: athrow
    //   71: invokevirtual 177	org/eclipse/team/core/mapping/provider/MergeContext:getAdapter	(Ljava/lang/Class;)Ljava/lang/Object;
    //   74: checkcast 91	org/eclipse/team/core/mapping/IStorageMerger
    //   77: astore 4
    //   79: aload 4
    //   81: ifnonnull +8 -> 89
    //   84: invokestatic 176	org/eclipse/team/core/mapping/DelegatingStorageMerger:getInstance	()Lorg/eclipse/team/core/mapping/IStorageMerger;
    //   87: astore 4
    //   89: aload_2
    //   90: invokeinterface 197 1 0
    //   95: checkcast 80	org/eclipse/core/resources/IFile
    //   98: astore 5
    //   100: aload_1
    //   101: getstatic 170	org/eclipse/team/internal/core/Messages:MergeContext_5	Ljava/lang/String;
    //   104: aload 5
    //   106: invokeinterface 185 1 0
    //   111: invokeinterface 187 1 0
    //   116: invokestatic 175	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   119: invokeinterface 189 2 0
    //   124: aload 5
    //   126: invokeinterface 184 1 0
    //   131: astore 6
    //   133: aload_2
    //   134: invokeinterface 199 1 0
    //   139: astore 7
    //   141: aload_3
    //   142: invokeinterface 198 1 0
    //   147: astore 8
    //   149: aload 7
    //   151: ifnull +21 -> 172
    //   154: aload 7
    //   156: aload_1
    //   157: bipush 30
    //   159: invokestatic 183	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   162: invokeinterface 196 2 0
    //   167: astore 9
    //   169: goto +6 -> 175
    //   172: aconst_null
    //   173: astore 9
    //   175: aload 8
    //   177: aload_1
    //   178: bipush 30
    //   180: invokestatic 183	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   183: invokeinterface 196 2 0
    //   188: astore 10
    //   190: aload_0
    //   191: getfield 169	org/eclipse/team/core/mapping/provider/MergeContext$4:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
    //   194: aload 5
    //   196: invokestatic 179	org/eclipse/team/core/mapping/provider/MergeContext:access$0	(Lorg/eclipse/team/core/mapping/provider/MergeContext;Lorg/eclipse/core/resources/IFile;)Ljava/io/OutputStream;
    //   199: astore 11
    //   201: aload 4
    //   203: aload 11
    //   205: aload 6
    //   207: aload 9
    //   209: aload 5
    //   211: aload 10
    //   213: aload_1
    //   214: bipush 30
    //   216: invokestatic 183	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   219: invokeinterface 200 7 0
    //   224: astore 12
    //   226: aload 12
    //   228: invokeinterface 191 1 0
    //   233: ifeq +48 -> 281
    //   236: aload 5
    //   238: aload_0
    //   239: getfield 169	org/eclipse/team/core/mapping/provider/MergeContext$4:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
    //   242: aload 5
    //   244: aload 11
    //   246: invokestatic 181	org/eclipse/team/core/mapping/provider/MergeContext:access$2	(Lorg/eclipse/team/core/mapping/provider/MergeContext;Lorg/eclipse/core/resources/IFile;Ljava/io/OutputStream;)Ljava/io/InputStream;
    //   249: iconst_0
    //   250: iconst_1
    //   251: aload_1
    //   252: iconst_5
    //   253: invokestatic 183	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   256: invokeinterface 186 5 0
    //   261: aload_0
    //   262: getfield 169	org/eclipse/team/core/mapping/provider/MergeContext$4:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
    //   265: aload_0
    //   266: getfield 168	org/eclipse/team/core/mapping/provider/MergeContext$4:val$diff	Lorg/eclipse/team/core/diff/IThreeWayDiff;
    //   269: iconst_0
    //   270: aload_1
    //   271: iconst_5
    //   272: invokestatic 183	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   275: invokevirtual 178	org/eclipse/team/core/mapping/provider/MergeContext:markAsMerged	(Lorg/eclipse/team/core/diff/IDiff;ZLorg/eclipse/core/runtime/IProgressMonitor;)V
    //   278: goto +35 -> 313
    //   281: new 94	org/eclipse/team/core/mapping/provider/MergeStatus
    //   284: dup
    //   285: aload 12
    //   287: invokeinterface 193 1 0
    //   292: aload 12
    //   294: invokeinterface 192 1 0
    //   299: iconst_1
    //   300: anewarray 80	org/eclipse/core/resources/IFile
    //   303: dup
    //   304: iconst_0
    //   305: aload 5
    //   307: aastore
    //   308: invokespecial 182	org/eclipse/team/core/mapping/provider/MergeStatus:<init>	(Ljava/lang/String;Ljava/lang/String;[Lorg/eclipse/core/resources/IFile;)V
    //   311: astore 12
    //   313: aload_0
    //   314: getfield 167	org/eclipse/team/core/mapping/provider/MergeContext$4:val$result	[Lorg/eclipse/core/runtime/IStatus;
    //   317: iconst_0
    //   318: aload 12
    //   320: aastore
    //   321: goto +19 -> 340
    //   324: astore 13
    //   326: aload_0
    //   327: getfield 169	org/eclipse/team/core/mapping/provider/MergeContext$4:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
    //   330: aload 5
    //   332: aload 11
    //   334: invokestatic 180	org/eclipse/team/core/mapping/provider/MergeContext:access$1	(Lorg/eclipse/team/core/mapping/provider/MergeContext;Lorg/eclipse/core/resources/IFile;Ljava/io/OutputStream;)V
    //   337: aload 13
    //   339: athrow
    //   340: aload_0
    //   341: getfield 169	org/eclipse/team/core/mapping/provider/MergeContext$4:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
    //   344: aload 5
    //   346: aload 11
    //   348: invokestatic 180	org/eclipse/team/core/mapping/provider/MergeContext:access$1	(Lorg/eclipse/team/core/mapping/provider/MergeContext;Lorg/eclipse/core/resources/IFile;Ljava/io/OutputStream;)V
    //   351: aload_1
    //   352: invokeinterface 188 1 0
    //   357: return
    // Line number table:
    //   Java source line #189	-> byte code offset #0
    //   Java source line #190	-> byte code offset #9
    //   Java source line #191	-> byte code offset #22
    //   Java source line #192	-> byte code offset #35
    //   Java source line #193	-> byte code offset #79
    //   Java source line #194	-> byte code offset #84
    //   Java source line #195	-> byte code offset #89
    //   Java source line #196	-> byte code offset #100
    //   Java source line #197	-> byte code offset #124
    //   Java source line #198	-> byte code offset #133
    //   Java source line #199	-> byte code offset #141
    //   Java source line #201	-> byte code offset #149
    //   Java source line #202	-> byte code offset #154
    //   Java source line #204	-> byte code offset #172
    //   Java source line #205	-> byte code offset #175
    //   Java source line #206	-> byte code offset #190
    //   Java source line #208	-> byte code offset #201
    //   Java source line #209	-> byte code offset #226
    //   Java source line #210	-> byte code offset #236
    //   Java source line #211	-> byte code offset #261
    //   Java source line #213	-> byte code offset #281
    //   Java source line #215	-> byte code offset #313
    //   Java source line #216	-> byte code offset #324
    //   Java source line #217	-> byte code offset #326
    //   Java source line #218	-> byte code offset #337
    //   Java source line #217	-> byte code offset #340
    //   Java source line #219	-> byte code offset #351
    //   Java source line #220	-> byte code offset #357
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	358	0	this	4
    //   0	358	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   21	113	2	localDiff	org.eclipse.team.core.mapping.IResourceDiff
    //   34	108	3	remoteDiff	org.eclipse.team.core.mapping.IResourceDiff
    //   77	125	4	merger	org.eclipse.team.core.mapping.IStorageMerger
    //   98	247	5	file	org.eclipse.core.resources.IFile
    //   131	75	6	osEncoding	String
    //   139	16	7	ancestorState	org.eclipse.team.core.history.IFileRevision
    //   147	29	8	remoteState	org.eclipse.team.core.history.IFileRevision
    //   167	3	9	ancestorStorage	org.eclipse.core.resources.IStorage
    //   173	35	9	ancestorStorage	org.eclipse.core.resources.IStorage
    //   188	24	10	remoteStorage	org.eclipse.core.resources.IStorage
    //   199	148	11	os	java.io.OutputStream
    //   224	95	12	status	IStatus
    //   324	14	13	localObject	Object
    //   59	1	15	localClassNotFoundException	ClassNotFoundException
    // Exception table:
    //   from	to	target	type
    //   47	52	59	java/lang/ClassNotFoundException
    //   201	324	324	finally
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.mapping.provider.MergeContext.4
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core.mapping.provider;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.history.IFileRevision;

class MergeContext$5
  implements IWorkspaceRunnable
{
  final MergeContext this$0;
  private final IFile val$file;
  private final IFileRevision val$remote;
  private final IDiff val$diff;
  
  MergeContext$5(MergeContext paramMergeContext, IFile paramIFile, IFileRevision paramIFileRevision, IDiff paramIDiff)
  {
    this$0 = paramMergeContext;val$file = paramIFile;val$remote = paramIFileRevision;val$diff = paramIDiff;
  }
  
  /* Error */
  public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
    throws org.eclipse.core.runtime.CoreException
  {
    // Byte code:
    //   0: aload_1
    //   1: aconst_null
    //   2: bipush 100
    //   4: invokeinterface 130 3 0
    //   9: aload_1
    //   10: getstatic 113	org/eclipse/team/internal/core/Messages:MergeContext_6	Ljava/lang/String;
    //   13: aload_0
    //   14: getfield 109	org/eclipse/team/core/mapping/provider/MergeContext$5:val$file	Lorg/eclipse/core/resources/IFile;
    //   17: invokeinterface 122 1 0
    //   22: invokeinterface 127 1 0
    //   27: invokestatic 117	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   30: invokeinterface 129 2 0
    //   35: aload_0
    //   36: getfield 111	org/eclipse/team/core/mapping/provider/MergeContext$5:val$remote	Lorg/eclipse/team/core/history/IFileRevision;
    //   39: ifnull +15 -> 54
    //   42: aload_0
    //   43: getfield 111	org/eclipse/team/core/mapping/provider/MergeContext$5:val$remote	Lorg/eclipse/team/core/history/IFileRevision;
    //   46: invokeinterface 131 1 0
    //   51: ifne +35 -> 86
    //   54: aload_0
    //   55: getfield 109	org/eclipse/team/core/mapping/provider/MergeContext$5:val$file	Lorg/eclipse/core/resources/IFile;
    //   58: invokeinterface 121 1 0
    //   63: ifeq +23 -> 86
    //   66: aload_0
    //   67: getfield 109	org/eclipse/team/core/mapping/provider/MergeContext$5:val$file	Lorg/eclipse/core/resources/IFile;
    //   70: iconst_0
    //   71: iconst_1
    //   72: aload_1
    //   73: bipush 95
    //   75: invokestatic 120	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   78: invokeinterface 123 4 0
    //   83: goto +119 -> 202
    //   86: aload_0
    //   87: getfield 111	org/eclipse/team/core/mapping/provider/MergeContext$5:val$remote	Lorg/eclipse/team/core/history/IFileRevision;
    //   90: ifnull +112 -> 202
    //   93: aload_0
    //   94: getfield 112	org/eclipse/team/core/mapping/provider/MergeContext$5:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
    //   97: aload_0
    //   98: getfield 109	org/eclipse/team/core/mapping/provider/MergeContext$5:val$file	Lorg/eclipse/core/resources/IFile;
    //   101: aload_1
    //   102: invokevirtual 118	org/eclipse/team/core/mapping/provider/MergeContext:ensureParentsExist	(Lorg/eclipse/core/resources/IResource;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   105: aload_0
    //   106: getfield 111	org/eclipse/team/core/mapping/provider/MergeContext$5:val$remote	Lorg/eclipse/team/core/history/IFileRevision;
    //   109: aload_1
    //   110: invokeinterface 132 2 0
    //   115: invokeinterface 126 1 0
    //   120: astore_2
    //   121: new 46	java/io/BufferedInputStream
    //   124: dup
    //   125: aload_2
    //   126: invokespecial 114	java/io/BufferedInputStream:<init>	(Ljava/io/InputStream;)V
    //   129: astore_2
    //   130: aload_0
    //   131: getfield 109	org/eclipse/team/core/mapping/provider/MergeContext$5:val$file	Lorg/eclipse/core/resources/IFile;
    //   134: invokeinterface 121 1 0
    //   139: ifeq +24 -> 163
    //   142: aload_0
    //   143: getfield 109	org/eclipse/team/core/mapping/provider/MergeContext$5:val$file	Lorg/eclipse/core/resources/IFile;
    //   146: aload_2
    //   147: iconst_0
    //   148: iconst_1
    //   149: aload_1
    //   150: bipush 95
    //   152: invokestatic 120	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   155: invokeinterface 125 5 0
    //   160: goto +34 -> 194
    //   163: aload_0
    //   164: getfield 109	org/eclipse/team/core/mapping/provider/MergeContext$5:val$file	Lorg/eclipse/core/resources/IFile;
    //   167: aload_2
    //   168: iconst_0
    //   169: aload_1
    //   170: bipush 95
    //   172: invokestatic 120	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   175: invokeinterface 124 4 0
    //   180: goto +14 -> 194
    //   183: astore_3
    //   184: aload_2
    //   185: invokevirtual 115	java/io/InputStream:close	()V
    //   188: goto +4 -> 192
    //   191: pop
    //   192: aload_3
    //   193: athrow
    //   194: aload_2
    //   195: invokevirtual 115	java/io/InputStream:close	()V
    //   198: goto +4 -> 202
    //   201: pop
    //   202: aload_0
    //   203: getfield 112	org/eclipse/team/core/mapping/provider/MergeContext$5:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
    //   206: aload_0
    //   207: getfield 110	org/eclipse/team/core/mapping/provider/MergeContext$5:val$diff	Lorg/eclipse/team/core/diff/IDiff;
    //   210: aload_1
    //   211: iconst_5
    //   212: invokestatic 120	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   215: invokevirtual 119	org/eclipse/team/core/mapping/provider/MergeContext:makeInSync	(Lorg/eclipse/team/core/diff/IDiff;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   218: goto +14 -> 232
    //   221: astore 4
    //   223: aload_1
    //   224: invokeinterface 128 1 0
    //   229: aload 4
    //   231: athrow
    //   232: aload_1
    //   233: invokeinterface 128 1 0
    //   238: return
    // Line number table:
    //   Java source line #348	-> byte code offset #0
    //   Java source line #349	-> byte code offset #9
    //   Java source line #350	-> byte code offset #35
    //   Java source line #351	-> byte code offset #66
    //   Java source line #352	-> byte code offset #86
    //   Java source line #353	-> byte code offset #93
    //   Java source line #354	-> byte code offset #105
    //   Java source line #355	-> byte code offset #121
    //   Java source line #357	-> byte code offset #130
    //   Java source line #358	-> byte code offset #142
    //   Java source line #360	-> byte code offset #163
    //   Java source line #362	-> byte code offset #183
    //   Java source line #364	-> byte code offset #184
    //   Java source line #365	-> byte code offset #191
    //   Java source line #368	-> byte code offset #192
    //   Java source line #364	-> byte code offset #194
    //   Java source line #365	-> byte code offset #201
    //   Java source line #371	-> byte code offset #202
    //   Java source line #372	-> byte code offset #221
    //   Java source line #373	-> byte code offset #223
    //   Java source line #374	-> byte code offset #229
    //   Java source line #373	-> byte code offset #232
    //   Java source line #375	-> byte code offset #238
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	239	0	this	5
    //   0	239	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   120	75	2	stream	java.io.InputStream
    //   183	10	3	localObject1	Object
    //   221	9	4	localObject2	Object
    //   191	1	5	localIOException1	java.io.IOException
    //   201	1	6	localIOException2	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   130	183	183	finally
    //   184	188	191	java/io/IOException
    //   194	198	201	java/io/IOException
    //   0	221	221	finally
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.mapping.provider.MergeContext.5
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core.mapping.provider;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceRuleFactory;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
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.Status;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.MultiRule;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.diff.IThreeWayDiff;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.core.mapping.DelegatingStorageMerger;
import org.eclipse.team.core.mapping.IMergeContext;
import org.eclipse.team.core.mapping.IResourceDiff;
import org.eclipse.team.core.mapping.IResourceDiffTree;
import org.eclipse.team.core.mapping.IStorageMerger;
import org.eclipse.team.core.mapping.ISynchronizationScopeManager;
import org.eclipse.team.internal.core.Messages;
import org.eclipse.team.internal.core.Policy;
import org.eclipse.team.internal.core.TeamPlugin;
import org.eclipse.team.internal.core.mapping.SyncInfoToDiffConverter;

public abstract class MergeContext
  extends SynchronizationContext
  implements IMergeContext
{
  protected MergeContext(ISynchronizationScopeManager manager, int type, IResourceDiffTree deltaTree)
  {
    super(manager, type, deltaTree);
  }
  
  public void reject(IDiff[] diffs, IProgressMonitor monitor)
    throws CoreException
  {
    run(new IWorkspaceRunnable()
    {
      private final IDiff[] val$diffs;
      
      public void run(IProgressMonitor monitor)
        throws CoreException
      {
        for (int i = 0; i < val$diffs.length; i++)
        {
          IDiff node = val$diffs[i];
          reject(node, monitor);
        }
      }
    }, getMergeRule(diffs), 0, monitor);
  }
  
  public void markAsMerged(IDiff[] nodes, boolean inSyncHint, IProgressMonitor monitor)
    throws CoreException
  {
    run(new IWorkspaceRunnable()
    {
      private final IDiff[] val$nodes;
      private final boolean val$inSyncHint;
      
      public void run(IProgressMonitor monitor)
        throws CoreException
      {
        for (int i = 0; i < val$nodes.length; i++)
        {
          IDiff node = val$nodes[i];
          markAsMerged(node, val$inSyncHint, monitor);
        }
      }
    }, getMergeRule(nodes), 0, monitor);
  }
  
  public IStatus merge(IDiff[] deltas, boolean force, IProgressMonitor monitor)
    throws CoreException
  {
    List failedFiles = new ArrayList();
    run(new IWorkspaceRunnable()
    {
      private final IDiff[] val$deltas;
      private final boolean val$force;
      private final List val$failedFiles;
      
      /* Error */
      public void run(IProgressMonitor monitor)
        throws CoreException
      {
        // Byte code:
        //   0: aload_1
        //   1: aconst_null
        //   2: aload_0
        //   3: getfield 82	org/eclipse/team/core/mapping/provider/MergeContext$3:val$deltas	[Lorg/eclipse/team/core/diff/IDiff;
        //   6: arraylength
        //   7: bipush 100
        //   9: imul
        //   10: invokeinterface 91 3 0
        //   15: iconst_0
        //   16: istore_2
        //   17: goto +90 -> 107
        //   20: aload_0
        //   21: getfield 82	org/eclipse/team/core/mapping/provider/MergeContext$3:val$deltas	[Lorg/eclipse/team/core/diff/IDiff;
        //   24: iload_2
        //   25: aaload
        //   26: astore_3
        //   27: aload_0
        //   28: getfield 83	org/eclipse/team/core/mapping/provider/MergeContext$3:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
        //   31: aload_3
        //   32: aload_0
        //   33: getfield 80	org/eclipse/team/core/mapping/provider/MergeContext$3:val$force	Z
        //   36: aload_1
        //   37: bipush 100
        //   39: invokestatic 88	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
        //   42: invokevirtual 87	org/eclipse/team/core/mapping/provider/MergeContext:merge	(Lorg/eclipse/team/core/diff/IDiff;ZLorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IStatus;
        //   45: astore 4
        //   47: aload 4
        //   49: invokeinterface 93 1 0
        //   54: ifne +50 -> 104
        //   57: aload 4
        //   59: invokeinterface 92 1 0
        //   64: iconst_1
        //   65: if_icmpne +29 -> 94
        //   68: aload_0
        //   69: getfield 81	org/eclipse/team/core/mapping/provider/MergeContext$3:val$failedFiles	Ljava/util/List;
        //   72: aload 4
        //   74: checkcast 46	org/eclipse/team/core/mapping/IMergeStatus
        //   77: invokeinterface 94 1 0
        //   82: invokestatic 85	java/util/Arrays:asList	([Ljava/lang/Object;)Ljava/util/List;
        //   85: invokeinterface 89 2 0
        //   90: pop
        //   91: goto +13 -> 104
        //   94: new 43	org/eclipse/core/runtime/CoreException
        //   97: dup
        //   98: aload 4
        //   100: invokespecial 86	org/eclipse/core/runtime/CoreException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
        //   103: athrow
        //   104: iinc 2 1
        //   107: iload_2
        //   108: aload_0
        //   109: getfield 82	org/eclipse/team/core/mapping/provider/MergeContext$3:val$deltas	[Lorg/eclipse/team/core/diff/IDiff;
        //   112: arraylength
        //   113: if_icmplt -93 -> 20
        //   116: goto +14 -> 130
        //   119: astore 5
        //   121: aload_1
        //   122: invokeinterface 90 1 0
        //   127: aload 5
        //   129: athrow
        //   130: aload_1
        //   131: invokeinterface 90 1 0
        //   136: return
        // Line number table:
        //   Java source line #84	-> byte code offset #0
        //   Java source line #85	-> byte code offset #15
        //   Java source line #86	-> byte code offset #20
        //   Java source line #87	-> byte code offset #27
        //   Java source line #88	-> byte code offset #47
        //   Java source line #89	-> byte code offset #57
        //   Java source line #90	-> byte code offset #68
        //   Java source line #92	-> byte code offset #94
        //   Java source line #85	-> byte code offset #104
        //   Java source line #96	-> byte code offset #119
        //   Java source line #97	-> byte code offset #121
        //   Java source line #98	-> byte code offset #127
        //   Java source line #97	-> byte code offset #130
        //   Java source line #99	-> byte code offset #136
        // Local variable table:
        //   start	length	slot	name	signature
        //   0	137	0	this	3
        //   0	137	1	monitor	IProgressMonitor
        //   16	92	2	i	int
        //   26	6	3	delta	IDiff
        //   45	54	4	s	IStatus
        //   119	9	5	localObject	Object
        // Exception table:
        //   from	to	target	type
        //   0	119	119	finally
      }
    }, getMergeRule(deltas), 1, monitor);
    if (failedFiles.isEmpty()) {
      return Status.OK_STATUS;
    }
    return new MergeStatus("org.eclipse.team.core", Messages.MergeContext_0, (IFile[])failedFiles.toArray(new IFile[failedFiles.size()]));
  }
  
  public IStatus merge(IDiff diff, boolean ignoreLocalChanges, IProgressMonitor monitor)
    throws CoreException
  {
    Policy.checkCanceled(monitor);
    IResource resource = getDiffTree().getResource(diff);
    if (resource.getType() != 1)
    {
      if ((diff instanceof IThreeWayDiff))
      {
        IThreeWayDiff twd = (IThreeWayDiff)diff;
        if (((ignoreLocalChanges) || (getMergeType() == 2)) && 
          (resource.getType() == 2) && 
          (twd.getKind() == 1) && 
          (twd.getDirection() == 256) && 
          (((IFolder)resource).members().length == 0))
        {
          ((IFolder)resource).delete(false, monitor);
        }
        else if ((resource.getType() == 2) && 
          (!resource.exists()) && 
          (twd.getKind() == 1) && 
          (twd.getDirection() == 512))
        {
          ensureParentsExist(resource, monitor);
          ((IFolder)resource).create(false, true, monitor);
          makeInSync(diff, monitor);
        }
      }
      return Status.OK_STATUS;
    }
    if (((diff instanceof IThreeWayDiff)) && (!ignoreLocalChanges) && (getMergeType() == 3))
    {
      IThreeWayDiff twDelta = (IThreeWayDiff)diff;
      int direction = twDelta.getDirection();
      if (direction == 256) {
        return Status.OK_STATUS;
      }
      if (direction == 512)
      {
        performReplace(diff, monitor);
        return Status.OK_STATUS;
      }
      int type = twDelta.getKind();
      if (type == 2)
      {
        makeInSync(diff, monitor);
        return Status.OK_STATUS;
      }
      IResourceDiff remoteChange = (IResourceDiff)twDelta.getRemoteChange();
      IFileRevision remote = null;
      if (remoteChange != null) {
        remote = remoteChange.getAfterState();
      }
      if ((remote == null) || (!getLocalFile(diff).exists())) {
        return new MergeStatus("org.eclipse.team.core", NLS.bind(Messages.MergeContext_1, new String[] { diff.getPath().toString() }), new IFile[] { getLocalFile(diff) });
      }
      return performThreeWayMerge(twDelta, monitor);
    }
    performReplace(diff, monitor);
    return Status.OK_STATUS;
  }
  
  protected IStatus performThreeWayMerge(IThreeWayDiff diff, IProgressMonitor monitor)
    throws CoreException
  {
    IStatus[] result = { Status.OK_STATUS };
    run(new IWorkspaceRunnable()
    {
      private final IThreeWayDiff val$diff;
      private final IStatus[] val$result;
      
      /* Error */
      public void run(IProgressMonitor monitor)
        throws CoreException
      {
        // Byte code:
        //   0: aload_1
        //   1: aconst_null
        //   2: bipush 100
        //   4: invokeinterface 190 3 0
        //   9: aload_0
        //   10: getfield 168	org/eclipse/team/core/mapping/provider/MergeContext$4:val$diff	Lorg/eclipse/team/core/diff/IThreeWayDiff;
        //   13: invokeinterface 194 1 0
        //   18: checkcast 90	org/eclipse/team/core/mapping/IResourceDiff
        //   21: astore_2
        //   22: aload_0
        //   23: getfield 168	org/eclipse/team/core/mapping/provider/MergeContext$4:val$diff	Lorg/eclipse/team/core/diff/IThreeWayDiff;
        //   26: invokeinterface 195 1 0
        //   31: checkcast 90	org/eclipse/team/core/mapping/IResourceDiff
        //   34: astore_3
        //   35: aload_0
        //   36: getfield 169	org/eclipse/team/core/mapping/provider/MergeContext$4:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
        //   39: getstatic 166	org/eclipse/team/core/mapping/provider/MergeContext:class$0	Ljava/lang/Class;
        //   42: dup
        //   43: ifnonnull +28 -> 71
        //   46: pop
        //   47: ldc 1
        //   49: invokestatic 171	java/lang/Class:forName	(Ljava/lang/String;)Ljava/lang/Class;
        //   52: dup
        //   53: putstatic 166	org/eclipse/team/core/mapping/provider/MergeContext:class$0	Ljava/lang/Class;
        //   56: goto +15 -> 71
        //   59: new 77	java/lang/NoClassDefFoundError
        //   62: dup_x1
        //   63: swap
        //   64: invokevirtual 174	java/lang/Throwable:getMessage	()Ljava/lang/String;
        //   67: invokespecial 172	java/lang/NoClassDefFoundError:<init>	(Ljava/lang/String;)V
        //   70: athrow
        //   71: invokevirtual 177	org/eclipse/team/core/mapping/provider/MergeContext:getAdapter	(Ljava/lang/Class;)Ljava/lang/Object;
        //   74: checkcast 91	org/eclipse/team/core/mapping/IStorageMerger
        //   77: astore 4
        //   79: aload 4
        //   81: ifnonnull +8 -> 89
        //   84: invokestatic 176	org/eclipse/team/core/mapping/DelegatingStorageMerger:getInstance	()Lorg/eclipse/team/core/mapping/IStorageMerger;
        //   87: astore 4
        //   89: aload_2
        //   90: invokeinterface 197 1 0
        //   95: checkcast 80	org/eclipse/core/resources/IFile
        //   98: astore 5
        //   100: aload_1
        //   101: getstatic 170	org/eclipse/team/internal/core/Messages:MergeContext_5	Ljava/lang/String;
        //   104: aload 5
        //   106: invokeinterface 185 1 0
        //   111: invokeinterface 187 1 0
        //   116: invokestatic 175	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
        //   119: invokeinterface 189 2 0
        //   124: aload 5
        //   126: invokeinterface 184 1 0
        //   131: astore 6
        //   133: aload_2
        //   134: invokeinterface 199 1 0
        //   139: astore 7
        //   141: aload_3
        //   142: invokeinterface 198 1 0
        //   147: astore 8
        //   149: aload 7
        //   151: ifnull +21 -> 172
        //   154: aload 7
        //   156: aload_1
        //   157: bipush 30
        //   159: invokestatic 183	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
        //   162: invokeinterface 196 2 0
        //   167: astore 9
        //   169: goto +6 -> 175
        //   172: aconst_null
        //   173: astore 9
        //   175: aload 8
        //   177: aload_1
        //   178: bipush 30
        //   180: invokestatic 183	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
        //   183: invokeinterface 196 2 0
        //   188: astore 10
        //   190: aload_0
        //   191: getfield 169	org/eclipse/team/core/mapping/provider/MergeContext$4:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
        //   194: aload 5
        //   196: invokestatic 179	org/eclipse/team/core/mapping/provider/MergeContext:access$0	(Lorg/eclipse/team/core/mapping/provider/MergeContext;Lorg/eclipse/core/resources/IFile;)Ljava/io/OutputStream;
        //   199: astore 11
        //   201: aload 4
        //   203: aload 11
        //   205: aload 6
        //   207: aload 9
        //   209: aload 5
        //   211: aload 10
        //   213: aload_1
        //   214: bipush 30
        //   216: invokestatic 183	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
        //   219: invokeinterface 200 7 0
        //   224: astore 12
        //   226: aload 12
        //   228: invokeinterface 191 1 0
        //   233: ifeq +48 -> 281
        //   236: aload 5
        //   238: aload_0
        //   239: getfield 169	org/eclipse/team/core/mapping/provider/MergeContext$4:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
        //   242: aload 5
        //   244: aload 11
        //   246: invokestatic 181	org/eclipse/team/core/mapping/provider/MergeContext:access$2	(Lorg/eclipse/team/core/mapping/provider/MergeContext;Lorg/eclipse/core/resources/IFile;Ljava/io/OutputStream;)Ljava/io/InputStream;
        //   249: iconst_0
        //   250: iconst_1
        //   251: aload_1
        //   252: iconst_5
        //   253: invokestatic 183	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
        //   256: invokeinterface 186 5 0
        //   261: aload_0
        //   262: getfield 169	org/eclipse/team/core/mapping/provider/MergeContext$4:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
        //   265: aload_0
        //   266: getfield 168	org/eclipse/team/core/mapping/provider/MergeContext$4:val$diff	Lorg/eclipse/team/core/diff/IThreeWayDiff;
        //   269: iconst_0
        //   270: aload_1
        //   271: iconst_5
        //   272: invokestatic 183	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
        //   275: invokevirtual 178	org/eclipse/team/core/mapping/provider/MergeContext:markAsMerged	(Lorg/eclipse/team/core/diff/IDiff;ZLorg/eclipse/core/runtime/IProgressMonitor;)V
        //   278: goto +35 -> 313
        //   281: new 94	org/eclipse/team/core/mapping/provider/MergeStatus
        //   284: dup
        //   285: aload 12
        //   287: invokeinterface 193 1 0
        //   292: aload 12
        //   294: invokeinterface 192 1 0
        //   299: iconst_1
        //   300: anewarray 80	org/eclipse/core/resources/IFile
        //   303: dup
        //   304: iconst_0
        //   305: aload 5
        //   307: aastore
        //   308: invokespecial 182	org/eclipse/team/core/mapping/provider/MergeStatus:<init>	(Ljava/lang/String;Ljava/lang/String;[Lorg/eclipse/core/resources/IFile;)V
        //   311: astore 12
        //   313: aload_0
        //   314: getfield 167	org/eclipse/team/core/mapping/provider/MergeContext$4:val$result	[Lorg/eclipse/core/runtime/IStatus;
        //   317: iconst_0
        //   318: aload 12
        //   320: aastore
        //   321: goto +19 -> 340
        //   324: astore 13
        //   326: aload_0
        //   327: getfield 169	org/eclipse/team/core/mapping/provider/MergeContext$4:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
        //   330: aload 5
        //   332: aload 11
        //   334: invokestatic 180	org/eclipse/team/core/mapping/provider/MergeContext:access$1	(Lorg/eclipse/team/core/mapping/provider/MergeContext;Lorg/eclipse/core/resources/IFile;Ljava/io/OutputStream;)V
        //   337: aload 13
        //   339: athrow
        //   340: aload_0
        //   341: getfield 169	org/eclipse/team/core/mapping/provider/MergeContext$4:this$0	Lorg/eclipse/team/core/mapping/provider/MergeContext;
        //   344: aload 5
        //   346: aload 11
        //   348: invokestatic 180	org/eclipse/team/core/mapping/provider/MergeContext:access$1	(Lorg/eclipse/team/core/mapping/provider/MergeContext;Lorg/eclipse/core/reso
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

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