org.eclipse.pde.core_3.7.1.v20120103_r372

e.pde.internal.core.build;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Status;
import org.eclipse.pde.core.build.IBuildModel;
import org.eclipse.pde.internal.core.PDECoreMessages;

public class BuildObject
  implements IBuildObject
{
  private IBuildModel fModel;
  private boolean fInTheModel;
  
  public boolean isInTheModel()
  {
    return fInTheModel;
  }
  
  public void setInTheModel(boolean inTheModel)
  {
    fInTheModel = inTheModel;
  }
  
  protected void ensureModelEditable()
    throws CoreException
  {
    if (!fModel.isEditable()) {
      throwCoreException(PDECoreMessages.BuildObject_readOnlyException);
    }
  }
  
  public IBuildModel getModel()
  {
    return fModel;
  }
  
  void setModel(IBuildModel model)
  {
    fModel = model;
  }
  
  protected void throwCoreException(String message)
    throws CoreException
  {
    Status status = new Status(4, "org.eclipse.pde.core", 0, message, null);
    throw new CoreException(status);
  }
  
  public void restoreProperty(String name, Object oldValue, Object newValue)
    throws CoreException
  {}
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.core.build.BuildObject
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.core.build;

import java.io.File;

public class ExternalBuildModel
  extends BuildModel
{
  private static final long serialVersionUID = 1L;
  private String fInstallLocation;
  
  public ExternalBuildModel(String installLocation)
  {
    fInstallLocation = installLocation;
  }
  
  public String getInstallLocation()
  {
    return fInstallLocation;
  }
  
  public boolean isEditable()
  {
    return false;
  }
  
  /* Error */
  public void load()
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_1
    //   2: aconst_null
    //   3: astore_2
    //   4: new 49	java/io/File
    //   7: dup
    //   8: aload_0
    //   9: invokevirtual 116	org/eclipse/pde/internal/core/build/ExternalBuildModel:getInstallLocation	()Ljava/lang/String;
    //   12: invokespecial 99	java/io/File:<init>	(Ljava/lang/String;)V
    //   15: astore_3
    //   16: aload_3
    //   17: invokevirtual 97	java/io/File:isFile	()Z
    //   20: ifeq +38 -> 58
    //   23: new 53	java/net/URL
    //   26: dup
    //   27: new 52	java/lang/StringBuffer
    //   30: dup
    //   31: ldc 4
    //   33: invokespecial 103	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   36: aload_3
    //   37: invokevirtual 98	java/io/File:getAbsolutePath	()Ljava/lang/String;
    //   40: invokevirtual 105	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   43: ldc 1
    //   45: invokevirtual 105	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   48: invokevirtual 102	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   51: invokespecial 107	java/net/URL:<init>	(Ljava/lang/String;)V
    //   54: astore_2
    //   55: goto +40 -> 95
    //   58: new 53	java/net/URL
    //   61: dup
    //   62: new 52	java/lang/StringBuffer
    //   65: dup
    //   66: ldc 3
    //   68: invokespecial 103	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   71: aload_3
    //   72: invokevirtual 98	java/io/File:getAbsolutePath	()Ljava/lang/String;
    //   75: invokevirtual 105	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   78: bipush 47
    //   80: invokevirtual 104	java/lang/StringBuffer:append	(C)Ljava/lang/StringBuffer;
    //   83: ldc 2
    //   85: invokevirtual 105	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   88: invokevirtual 102	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   91: invokespecial 107	java/net/URL:<init>	(Ljava/lang/String;)V
    //   94: astore_2
    //   95: aload_2
    //   96: invokevirtual 106	java/net/URL:openStream	()Ljava/io/InputStream;
    //   99: astore_1
    //   100: aload_0
    //   101: aload_1
    //   102: iconst_0
    //   103: invokevirtual 115	org/eclipse/pde/internal/core/build/ExternalBuildModel:load	(Ljava/io/InputStream;Z)V
    //   106: goto +72 -> 178
    //   109: pop
    //   110: aload_0
    //   111: new 55	org/eclipse/pde/internal/core/build/Build
    //   114: dup
    //   115: invokespecial 109	org/eclipse/pde/internal/core/build/Build:<init>	()V
    //   118: putfield 96	org/eclipse/pde/internal/core/build/ExternalBuildModel:fBuild	Lorg/eclipse/pde/internal/core/build/Build;
    //   121: aload_0
    //   122: getfield 96	org/eclipse/pde/internal/core/build/ExternalBuildModel:fBuild	Lorg/eclipse/pde/internal/core/build/Build;
    //   125: aload_0
    //   126: invokevirtual 110	org/eclipse/pde/internal/core/build/Build:setModel	(Lorg/eclipse/pde/core/build/IBuildModel;)V
    //   129: aload_0
    //   130: iconst_1
    //   131: invokevirtual 112	org/eclipse/pde/internal/core/build/ExternalBuildModel:setLoaded	(Z)V
    //   134: aload_1
    //   135: ifnull +61 -> 196
    //   138: aload_1
    //   139: invokevirtual 101	java/io/InputStream:close	()V
    //   142: goto +54 -> 196
    //   145: astore 5
    //   147: aload 5
    //   149: invokestatic 108	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   152: goto +44 -> 196
    //   155: astore 4
    //   157: aload_1
    //   158: ifnull +17 -> 175
    //   161: aload_1
    //   162: invokevirtual 101	java/io/InputStream:close	()V
    //   165: goto +10 -> 175
    //   168: astore 5
    //   170: aload 5
    //   172: invokestatic 108	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   175: aload 4
    //   177: athrow
    //   178: aload_1
    //   179: ifnull +17 -> 196
    //   182: aload_1
    //   183: invokevirtual 101	java/io/InputStream:close	()V
    //   186: goto +10 -> 196
    //   189: astore 5
    //   191: aload 5
    //   193: invokestatic 108	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   196: return
    // Line number table:
    //   Java source line #38	-> byte code offset #0
    //   Java source line #40	-> byte code offset #2
    //   Java source line #41	-> byte code offset #4
    //   Java source line #42	-> byte code offset #16
    //   Java source line #43	-> byte code offset #23
    //   Java source line #45	-> byte code offset #58
    //   Java source line #47	-> byte code offset #95
    //   Java source line #48	-> byte code offset #100
    //   Java source line #49	-> byte code offset #109
    //   Java source line #50	-> byte code offset #110
    //   Java source line #51	-> byte code offset #121
    //   Java source line #52	-> byte code offset #129
    //   Java source line #55	-> byte code offset #134
    //   Java source line #56	-> byte code offset #138
    //   Java source line #57	-> byte code offset #145
    //   Java source line #58	-> byte code offset #147
    //   Java source line #53	-> byte code offset #155
    //   Java source line #55	-> byte code offset #157
    //   Java source line #56	-> byte code offset #161
    //   Java source line #57	-> byte code offset #168
    //   Java source line #58	-> byte code offset #170
    //   Java source line #60	-> byte code offset #175
    //   Java source line #55	-> byte code offset #178
    //   Java source line #56	-> byte code offset #182
    //   Java source line #57	-> byte code offset #189
    //   Java source line #58	-> byte code offset #191
    //   Java source line #61	-> byte code offset #196
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	197	0	this	ExternalBuildModel
    //   1	182	1	stream	java.io.InputStream
    //   3	93	2	url	java.net.URL
    //   15	57	3	file	File
    //   155	21	4	localObject	Object
    //   145	3	5	e	java.io.IOException
    //   168	3	5	e	java.io.IOException
    //   189	3	5	e	java.io.IOException
    //   109	1	8	localIOException1	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   2	106	109	java/io/IOException
    //   134	142	145	java/io/IOException
    //   2	134	155	finally
    //   157	165	168	java/io/IOException
    //   178	186	189	java/io/IOException
  }
  
  protected void updateTimeStamp()
  {
    updateTimeStamp(getLocalFile());
  }
  
  private File getLocalFile()
  {
    File file = new File(getInstallLocation());
    return file.isFile() ? file : new File(file, "build.properties");
  }
  
  public boolean isInSync()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.core.build.ExternalBuildModel
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.core.build;

public abstract interface IBuildObject
{
  public abstract boolean isInTheModel();
  
  public abstract void setInTheModel(boolean paramBoolean);
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.core.build.IBuildObject
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.core.build;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.pde.core.IEditableModel;
import org.eclipse.pde.core.IModelChangedEvent;
import org.eclipse.pde.core.build.IBuild;
import org.eclipse.pde.internal.core.PDECore;

public class WorkspaceBuildModel
  extends BuildModel
  implements IEditableModel
{
  private static final long serialVersionUID = 1L;
  private IFile fUnderlyingResource;
  private boolean fDirty;
  private boolean fEditable = true;
  
  public WorkspaceBuildModel(IFile file)
  {
    fUnderlyingResource = file;
  }
  
  public void fireModelChanged(IModelChangedEvent event)
  {
    setDirty(event.getChangeType() != 99);
    super.fireModelChanged(event);
  }
  
  public String getContents()
  {
    StringWriter swriter = new StringWriter();
    PrintWriter writer = new PrintWriter(swriter);
    save(writer);
    writer.flush();
    try
    {
      swriter.close();
      writer.close();
    }
    catch (IOException e)
    {
      PDECore.logException(e);
    }
    return swriter.toString();
  }
  
  public IResource getUnderlyingResource()
  {
    return fUnderlyingResource;
  }
  
  public boolean isDirty()
  {
    return fDirty;
  }
  
  public boolean isEditable()
  {
    return fEditable;
  }
  
  /* Error */
  public void load()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 154	org/eclipse/pde/internal/core/build/WorkspaceBuildModel:fUnderlyingResource	Lorg/eclipse/core/resources/IFile;
    //   4: invokeinterface 178 1 0
    //   9: ifeq +93 -> 102
    //   12: aconst_null
    //   13: astore_1
    //   14: aload_0
    //   15: getfield 154	org/eclipse/pde/internal/core/build/WorkspaceBuildModel:fUnderlyingResource	Lorg/eclipse/core/resources/IFile;
    //   18: iconst_1
    //   19: invokeinterface 179 2 0
    //   24: astore_1
    //   25: aload_0
    //   26: aload_1
    //   27: iconst_0
    //   28: invokevirtual 174	org/eclipse/pde/internal/core/build/WorkspaceBuildModel:load	(Ljava/io/InputStream;Z)V
    //   31: goto +50 -> 81
    //   34: astore_2
    //   35: aload_2
    //   36: invokestatic 166	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   39: aload_1
    //   40: ifnull +86 -> 126
    //   43: aload_1
    //   44: invokevirtual 158	java/io/InputStream:close	()V
    //   47: goto +79 -> 126
    //   50: astore 4
    //   52: aload 4
    //   54: invokestatic 166	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   57: goto +69 -> 126
    //   60: astore_3
    //   61: aload_1
    //   62: ifnull +17 -> 79
    //   65: aload_1
    //   66: invokevirtual 158	java/io/InputStream:close	()V
    //   69: goto +10 -> 79
    //   72: astore 4
    //   74: aload 4
    //   76: invokestatic 166	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   79: aload_3
    //   80: athrow
    //   81: aload_1
    //   82: ifnull +44 -> 126
    //   85: aload_1
    //   86: invokevirtual 158	java/io/InputStream:close	()V
    //   89: goto +37 -> 126
    //   92: astore 4
    //   94: aload 4
    //   96: invokestatic 166	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   99: goto +27 -> 126
    //   102: aload_0
    //   103: new 89	org/eclipse/pde/internal/core/build/Build
    //   106: dup
    //   107: invokespecial 167	org/eclipse/pde/internal/core/build/Build:<init>	()V
    //   110: putfield 155	org/eclipse/pde/internal/core/build/WorkspaceBuildModel:fBuild	Lorg/eclipse/pde/internal/core/build/Build;
    //   113: aload_0
    //   114: getfield 155	org/eclipse/pde/internal/core/build/WorkspaceBuildModel:fBuild	Lorg/eclipse/pde/internal/core/build/Build;
    //   117: aload_0
    //   118: invokevirtual 168	org/eclipse/pde/internal/core/build/Build:setModel	(Lorg/eclipse/pde/core/build/IBuildModel;)V
    //   121: aload_0
    //   122: iconst_1
    //   123: invokevirtual 172	org/eclipse/pde/internal/core/build/WorkspaceBuildModel:setLoaded	(Z)V
    //   126: return
    // Line number table:
    //   Java source line #64	-> byte code offset #0
    //   Java source line #65	-> byte code offset #12
    //   Java source line #67	-> byte code offset #14
    //   Java source line #68	-> byte code offset #25
    //   Java source line #69	-> byte code offset #34
    //   Java source line #70	-> byte code offset #35
    //   Java source line #73	-> byte code offset #39
    //   Java source line #74	-> byte code offset #43
    //   Java source line #75	-> byte code offset #50
    //   Java source line #76	-> byte code offset #52
    //   Java source line #71	-> byte code offset #60
    //   Java source line #73	-> byte code offset #61
    //   Java source line #74	-> byte code offset #65
    //   Java source line #75	-> byte code offset #72
    //   Java source line #76	-> byte code offset #74
    //   Java source line #78	-> byte code offset #79
    //   Java source line #73	-> byte code offset #81
    //   Java source line #74	-> byte code offset #85
    //   Java source line #75	-> byte code offset #92
    //   Java source line #76	-> byte code offset #94
    //   Java source line #78	-> byte code offset #99
    //   Java source line #80	-> byte code offset #102
    //   Java source line #81	-> byte code offset #113
    //   Java source line #82	-> byte code offset #121
    //   Java source line #84	-> byte code offset #126
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	127	0	this	WorkspaceBuildModel
    //   13	73	1	stream	java.io.InputStream
    //   34	2	2	e	Exception
    //   60	20	3	localObject	Object
    //   50	3	4	e	IOException
    //   72	3	4	e	IOException
    //   92	3	4	e	IOException
    // Exception table:
    //   from	to	target	type
    //   14	31	34	java/lang/Exception
    //   39	47	50	java/io/IOException
    //   14	39	60	finally
    //   61	69	72	java/io/IOException
    //   81	89	92	java/io/IOException
  }
  
  public boolean isInSync()
  {
    return true;
  }
  
  protected void updateTimeStamp()
  {
    updateTimeStamp(fUnderlyingResource.getLocation().toFile());
  }
  
  /* Error */
  public void save()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 154	org/eclipse/pde/internal/core/build/WorkspaceBuildModel:fUnderlyingResource	Lorg/eclipse/core/resources/IFile;
    //   4: ifnonnull +4 -> 8
    //   7: return
    //   8: aconst_null
    //   9: astore_1
    //   10: aload_0
    //   11: invokevirtual 176	org/eclipse/pde/internal/core/build/WorkspaceBuildModel:getContents	()Ljava/lang/String;
    //   14: astore_2
    //   15: new 75	java/io/ByteArrayInputStream
    //   18: dup
    //   19: aload_2
    //   20: ldc 2
    //   22: invokevirtual 165	java/lang/String:getBytes	(Ljava/lang/String;)[B
    //   25: invokespecial 157	java/io/ByteArrayInputStream:<init>	([B)V
    //   28: astore_1
    //   29: aload_0
    //   30: getfield 154	org/eclipse/pde/internal/core/build/WorkspaceBuildModel:fUnderlyingResource	Lorg/eclipse/core/resources/IFile;
    //   33: invokeinterface 178 1 0
    //   38: ifeq +19 -> 57
    //   41: aload_0
    //   42: getfield 154	org/eclipse/pde/internal/core/build/WorkspaceBuildModel:fUnderlyingResource	Lorg/eclipse/core/resources/IFile;
    //   45: aload_1
    //   46: iconst_0
    //   47: iconst_0
    //   48: aconst_null
    //   49: invokeinterface 182 5 0
    //   54: goto +15 -> 69
    //   57: aload_0
    //   58: getfield 154	org/eclipse/pde/internal/core/build/WorkspaceBuildModel:fUnderlyingResource	Lorg/eclipse/core/resources/IFile;
    //   61: aload_1
    //   62: iconst_0
    //   63: aconst_null
    //   64: invokeinterface 181 4 0
    //   69: aload_1
    //   70: invokevirtual 156	java/io/ByteArrayInputStream:close	()V
    //   73: goto +76 -> 149
    //   76: astore_2
    //   77: aload_2
    //   78: invokestatic 166	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   81: aload_1
    //   82: ifnull +85 -> 167
    //   85: aload_1
    //   86: invokevirtual 156	java/io/ByteArrayInputStream:close	()V
    //   89: goto +78 -> 167
    //   92: astore 4
    //   94: aload 4
    //   96: invokestatic 166	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   99: goto +68 -> 167
    //   102: astore_2
    //   103: aload_2
    //   104: invokestatic 166	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   107: aload_1
    //   108: ifnull +59 -> 167
    //   111: aload_1
    //   112: invokevirtual 156	java/io/ByteArrayInputStream:close	()V
    //   115: goto +52 -> 167
    //   118: astore 4
    //   120: aload 4
    //   122: invokestatic 166	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   125: goto +42 -> 167
    //   128: astore_3
    //   129: aload_1
    //   130: ifnull +17 -> 147
    //   133: aload_1
    //   134: invokevirtual 156	java/io/ByteArrayInputStream:close	()V
    //   137: goto +10 -> 147
    //   140: astore 4
    //   142: aload 4
    //   144: invokestatic 166	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   147: aload_3
    //   148: athrow
    //   149: aload_1
    //   150: ifnull +17 -> 167
    //   153: aload_1
    //   154: invokevirtual 156	java/io/ByteArrayInputStream:close	()V
    //   157: goto +10 -> 167
    //   160: astore 4
    //   162: aload 4
    //   164: invokestatic 166	org/eclipse/pde/internal/core/PDECore:logException	(Ljava/lang/Throwable;)V
    //   167: return
    // Line number table:
    //   Java source line #95	-> byte code offset #0
    //   Java source line #96	-> byte code offset #7
    //   Java source line #97	-> byte code offset #8
    //   Java source line #99	-> byte code offset #10
    //   Java source line #100	-> byte code offset #15
    //   Java source line #101	-> byte code offset #29
    //   Java source line #102	-> byte code offset #41
    //   Java source line #104	-> byte code offset #57
    //   Java source line #106	-> byte code offset #69
    //   Java source line #107	-> byte code offset #76
    //   Java source line #108	-> byte code offset #77
    //   Java source line #113	-> byte code offset #81
    //   Java source line #114	-> byte code offset #85
    //   Java source line #115	-> byte code offset #92
    //   Java source line #116	-> byte code offset #94
    //   Java source line #109	-> byte code offset #102
    //   Java source line #110	-> byte code offset #103
    //   Java source line #113	-> byte code offset #107
    //   Java source line #114	-> byte code offset #111
    //   Java source line #115	-> byte code offset #118
    //   Java source line #116	-> byte code offset #120
    //   Java source line #111	-> byte code offset #128
    //   Java source line #113	-> byte code offset #129
    //   Java source line #114	-> byte code offset #133
    //   Java source line #115	-> byte code offset #140
    //   Java source line #116	-> byte code offset #142
    //   Java source line #118	-> byte code offset #147
    //   Java source line #113	-> byte code offset #149
    //   Java source line #114	-> byte code offset #153
    //   Java source line #115	-> byte code offset #160
    //   Java source line #116	-> byte code offset #162
    //   Java source line #119	-> byte code offset #167
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	168	0	this	WorkspaceBuildModel
    //   9	145	1	stream	java.io.ByteArrayInputStream
    //   14	6	2	contents	String
    //   76	2	2	e	org.eclipse.core.runtime.CoreException
    //   102	2	2	e	IOException
    //   128	20	3	localObject	Object
    //   92	3	4	e	IOException
    //   118	3	4	e	IOException
    //   140	3	4	e	IOException
    //   160	3	4	e	IOException
    // Exception table:
    //   from	to	target	type
    //   10	73	76	org/eclipse/core/runtime/CoreException
    //   81	89	92	java/io/IOException
    //   10	73	102	java/io/IOException
    //   107	115	118	java/io/IOException
    //   10	81	128	finally
    //   102	107	128	finally
    //   129	137	140	java/io/IOException
    //   149	157	160	java/io/IOException
  }
  
  public void save(PrintWriter writer)
  {
    getBuild().write("", writer);
    fDirty = false;
  }
  
  public void setDirty(boolean dirty)
  {
    fDirty = dirty;
  }
  
  public void setEditable(boolean editable)
  {
    fEditable = editable;
  }
  
  public String getInstallLocation()
  {
    return fUnderlyingResource.getLocation().toOSString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.core.build.WorkspaceBuildModel
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.core.builders;

import java.util.HashMap;

class BuildErrorReporter$BuildProblem
{
  String fEntryToken;
  String fEntryName;
  String fMessage;
  String fCategory;
  int fFixId;
  int fSeverity;
  HashMap attributes;
  int fExtraBuntryEntryIndex;
  final BuildErrorReporter this$0;
  
  BuildErrorReporter$BuildProblem(BuildErrorReporter paramBuildErrorReporter, String name, String token, String message, int fixId, int severity, String category)
  {
    this$0 = paramBuildErrorReporter;
    fEntryName = name;
    fEntryToken = token;
    fMessage = message;
    fFixId = fixId;
    fSeverity = severity;
    fCategory = category;
    fExtraBuntryEntryIndex = 0;
  }
  
  public boolean equals(Object obj)
  {
    if (!(obj instanceof BuildProblem)) {
      return false;
    }
    BuildProblem bp = (BuildProblem)obj;
    if (!fEntryName.equals(fEntryName)) {
      return false;
    }
    if ((fEntryToken != null) && (!fEntryToken.equals(fEntryToken))) {
      return false;
    }
    if (fFixId != fFixId) {
      return false;
    }
    return true;
  }
  
  public void addExtraBuildEntryTokenAttribute(String entry, String value)
  {
    addAttribute("buildEntry.key." + fExtraBuntryEntryIndex, entry);
    addAttribute("buildEntry.tokenValue." + fExtraBuntryEntryIndex, value);
    fExtraBuntryEntryIndex += 1;
  }
  
  public void addAttribute(String attributeName, String value)
  {
    if (attributes == null) {
      attributes = new HashMap(1);
    }
    attributes.put(attributeName, value);
  }
  
  public void addAttributes(HashMap attributes)
  {
    if (attributes == null) {
      attributes = new HashMap(1);
    }
    attributes.putAll(attributes);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.core.builders.BuildErrorReporter.BuildProblem
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.core.builders;

import java.io.File;
import java.io.FilenameFilter;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.pde.internal.core.util.PatternConstructor;

class BuildErrorReporter$WildcardFilenameFilter
  implements FilenameFilter
{
  private Pattern pattern;
  final BuildErrorReporter this$0;
  
  public BuildErrorReporter$WildcardFilenameFilter(BuildErrorReporter paramBuildErrorReporter, String file)
  {
    this$0 = paramBuildErrorReporter;
    pattern = PatternConstructor.createPattern(file, false);
  }
  
  public boolean accept(File dir, String name)
  {
    Matcher matcher = pattern.matcher(name);
    return matcher.matches();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.internal.core.builders.BuildErrorReporter.WildcardFilenameFilter
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.internal.core.builders;

import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.util.NLS;
import org.eclipse.pde.core.build.IBuild;
import org.eclipse.pde.core.build.IBuildEntry;
import org.eclipse.pde.core.build.IBuildModel;
import org.eclipse.pde.core.plugin.IPluginBase;
import org.eclipse.pde.core.plugin.IPluginLibrary;
import org.eclipse.pde.core.plugin.IPluginModelBase;
import org.eclipse.pde.core.plugin.PluginRegistry;
import org.eclipse.pde.internal.build.IBuildPropertiesConstants;
import org.eclipse.pde.internal.core.ClasspathUtilCore;
import org.eclipse.pde.internal.core.PDECore;
import org.eclipse.pde.internal.core.PDECoreMessages;
import org.eclipse.pde.internal.core.build.WorkspaceBuildModel;
import org.eclipse.pde.internal.core.ibundle.IBundle;
import org.eclipse.pde.internal.core.ibundle.IBundleFragmentModel;
import org.eclipse.pde.internal.core.ibundle.IBundleModel;
import org.eclipse.pde.internal.core.ibundle.IBundlePluginModelBase;
import org.eclipse.pde.internal.core.ibundle.IManifestHeader;
import org.eclipse.pde.internal.core.project.PDEProject;
import org.eclipse.pde.internal.core.text.build.BuildEntry;
import org.eclipse.pde.internal.core.text.build.BuildModel;
import org.eclipse.pde.internal.core.util.CoreUtility;
import org.eclipse.pde.internal.core.util.PatternConstructor;

public class BuildErrorReporter
  extends ErrorReporter
  implements IBuildPropertiesConstants
{
  private static final String DEF_SOURCE_ENTRY = "source..";
  private static final String[] RESERVED_NAMES = { "meta-inf", "osgi-inf", "build.properties", "plugin.xml", "plugin.properties" };
  private static final String ASSERT_IDENTIFIER = "assertIdentifier";
  private static final String ENUM_IDENTIFIER = "enumIdentifier";
  private static final String JRE_1_1 = "JRE-1.1";
  private static final String J2SE_1_2 = "J2SE-1.2";
  private static final String J2SE_1_3 = "J2SE-1.3";
  private static final String J2SE_1_4 = "J2SE-1.4";
  private static final String J2SE_1_5 = "J2SE-1.5";
  private static final String JavaSE_1_6 = "JavaSE-1.6";
  private static final String JavaSE_1_7 = "JavaSE-1.7";
  
  private class BuildProblem
  {
    String fEntryToken;
    String fEntryName;
    String fMessage;
    String fCategory;
    int fFixId;
    int fSeverity;
    HashMap attributes;
    int fExtraBuntryEntryIndex;
    
    BuildProblem(String name, String token, String message, int fixId, int severity, String category)
    {
      fEntryName = name;
      fEntryToken = token;
      fMessage = message;
      fFixId = fixId;
      fSeverity = severity;
      fCategory = category;
      fExtraBuntryEntryIndex = 0;
    }
    
    public boolean equals(Object obj)
    {
      if (!(obj instanceof BuildProblem)) {
        return false;
      }
      BuildProblem bp = (BuildProblem)obj;
      if (!fEntryName.equals(fEntryName)) {
        return false;
      }
      if ((fEntryToken != null) && (!fEntryToken.equals(fEntryToken))) {
        return false;
      }
      if (fFixId != fFixId) {
        return false;
      }
      return true;
    }
    
    public void addExtraBuildEntryTokenAttribute(String entry, String value)
    {
      addAttribute("buildEntry.key." + fExtraBuntryEntryIndex, entry);
      addAttribute("buildEntry.tokenValue." + fExtraBuntryEntryIndex, value);
      fExtraBuntryEntryIndex += 1;
    }
    
    public void addAttribute(String attributeName, String value)
    {
      if (attributes == null) {
        attributes = new HashMap(1);
      }
      attributes.put(attributeName, value);
    }
    
    public void addAttributes(HashMap attributes)
    {
      if (attributes == null) {
        attributes = new HashMap(1);
      }
      attributes.putAll(attributes);
    }
  }
  
  class WildcardFilenameFilter
    implements FilenameFilter
  {
    private Pattern pattern;
    
    public WildcardFilenameFilter(String file)
    {
      pattern = PatternConstructor.createPattern(file, false);
    }
    
    public boolean accept(File dir, String name)
    {
      Matcher matcher = pattern.matcher(name);
      return matcher.matches();
    }
  }
  
  protected ArrayList fProblemList = new ArrayList();
  protected int fBuildSeverity;
  protected int fClasspathSeverity;
  protected int fJavaComplianceSeverity;
  protected int fJavaCompilerSeverity;
  protected int fSrcInclSeverity;
  protected int fBinInclSeverity;
  protected int fMissingOutputLibSeverity;
  protected int fSrcLibSeverity;
  protected int fOututLibSeverity;
  protected int fEncodingSeverity;
  
  public BuildErrorReporter(IFile buildFile)
  {
    super(buildFile);
    fBuildSeverity = CompilerFlags.getFlag(fFile.getProject(), "compilers.p.build");
    fClasspathSeverity = CompilerFlags.getFlag(fFile.getProject(), "compilers.p.unresolved-import");
    fMissingOutputLibSeverity = CompilerFlags.getFlag(fFile.getProject(), "compilers.p.build.missing.output");
    fSrcLibSeverity = CompilerFlags.getFlag(fFile.getProject(), "compilers.p.build.source.library");
    fOututLibSeverity = CompilerFlags.getFlag(fFile.getProject(), "compilers.p.build.output.library");
    fJavaComplianceSeverity = CompilerFlags.getFlag(fFile.getProject(), "compilers.p.build.java.compliance");
    fJavaCompilerSeverity = CompilerFlags.getFlag(fFile.getProject(), "compilers.p.build.java.compiler");
    fSrcInclSeverity = CompilerFlags.getFlag(fFile.getProject(), "compilers.p.build.src.includes");
    fBinInclSeverity = CompilerFlags.getFlag(fFile.getProject(), "compilers.p.build.bin.includes");
    fEncodingSeverity = CompilerFlags.getFlag(fFile.getProject(), "compilers.p.build.encodings");
  }
  
  public void validate(IProgressMonitor monitor)
  {
    WorkspaceBuildModel wbm = new WorkspaceBuildModel(fFile);
    wbm.load();
    if (!wbm.isLoaded()) {
      return;
    }
    validateBuild(wbm.getBuild(true));
    if (fProblemList.size() > 0) {
      reportErrors(prepareTextBuildModel(monitor));
    }
  }
  
  private void validateBuild(IBuild build)
  {
    IBuildEntry binIncludes = null;
    IBuildEntry binExcludes = null;
    IBuildEntry srcIncludes = null;
    IBuildEntry srcExcludes = null;
    IBuildEntry jarsExtra = null;
    IBuildEntry bundleList = null;
    IBuildEntry javacSource = null;
    IBuildEntry javacTarget = null;
    IBuildEntry jreCompilationProfile = null;
    IBuildEntry javaProjectWarnings = null;
    ArrayList javacWarnings = new ArrayList();
    ArrayList javacErrors = new ArrayList();
    ArrayList sourceEntries = new ArrayList(1);
    ArrayList sourceEntryKeys = new ArrayList(1);
    ArrayList outputEntries = new ArrayList(1);
    Map encodingEntries = new HashMap();
    IBuildEntry[] entries = build.getBuildEntries();
    for (int i = 0; i < entries.length; i++)
    {
      String name = entries[i].getName();
      if (entries[i].getTokens().length == 0)
      {
        prepareError(name, null, PDECoreMessages.BuildErrorReporter_emptyEntry, 8197, "fatal");
      }
      else if (name.equals("bin.includes"))
      {
        binIncludes = entries[i];
      }
      else if (name.equals("bin.excludes"))
      {
        binExcludes = entries[i];
      }
      else if (name.equals("src.includes"))
      {
        srcIncludes = entries[i];
      }
      else if (name.equals("src.excludes"))
      {
        srcExcludes = entries[i];
      }
      else if (name.equals("javacSource"))
      {
        javacSource = entries[i];
      }
      else if (name.equals("javacTarget"))
      {
        javacTarget = entries[i];
      }
      else if (name.equals("javacProjectSettings"))
      {
        javaProjectWarnings = entries[i];
      }
      else if (name.equals("jre.compilation.profile"))
      {
        jreCompilationProfile = entries[i];
      }
      else if (name.startsWith("javacWarnings."))
      {
        javacWarnings.add(entries[i]);
      }
      else if (name.startsWith("javacErrors."))
      {
        javacErrors.add(entries[i]);
      }
      else if (name.startsWith("source."))
      {
        sourceEntries.add(entries[i]);
      }
      else if (name.startsWith("output."))
      {
        outputEntries.add(entries[i]);
      }
      else if (name.startsWith("javacDefaultEncoding."))
      {
        encodingEntries.put(entries[i].getName(), entries[i].getTokens()[0]);
      }
      else if (name.equals("jars.extra.classpath"))
      {
        jarsExtra = entries[i];
      }
      else if (name.equals("additional.bundles"))
      {
        bundleList = entries[i];
      }
      else if (name.equals("custom"))
      {
        String[] tokens = entries[i].getTokens();
        if ((tokens.length == 1) && (tokens[0].equalsIgnoreCase("true"))) {
          return;
        }
      }
      if (name.startsWith("source.")) {
        sourceEntryKeys.add(entries[i].getName());
      }
    }
    if ((fClasspathSeverity != 2) && 
      (bundleList != null)) {
      validateDependencyManagement(bundleList);
    }
    if (jarsExtra != null) {
      validateJarsExtraClasspath(jarsExtra);
    }
    validateIncludes(binIncludes, sourceEntryKeys, fBinInclSeverity);
    validateIncludes(binExcludes, sourceEntryKeys, fBinInclSeverity);
    validateIncludes(srcIncludes, sourceEntryKeys, fSrcInclSeverity);
    validateIncludes(srcExcludes, sourceEntryKeys, fSrcInclSeverity);
    validateSourceFoldersInSrcIncludes(srcIncludes);
    try
    {
      IJavaProject jp = JavaCore.create(fProject);
      if (jp.exists())
      {
        IClasspathEntry[] cpes = jp.getRawClasspath();
        validateMissingLibraries(sourceEntryKeys, cpes);
        validateSourceEntries(sourceEntries, srcExcludes, cpes);
        SourceEntryErrorReporter srcEntryErrReporter = new SourceEntryErrorReporter(fFile, build);
        srcEntryErrReporter.initialize(sourceEntries, outputEntries, cpes, fProject);
        srcEntryErrReporter.validate();
        ArrayList problems = srcEntryErrReporter.getProblemList();
        for (int i = 0; i < problems.size(); i++) {
          if (!fProblemList.contains(problems.get(i))) {
            fProblemList.add(problems.get(i));
          }
        }
      }
    }
    catch (JavaModelException localJavaModelException) {}
    validateMissingSourceInBinIncludes(binIncludes, sourceEntryKeys, build);
    validateBinIncludes(binIncludes);
    validateExecutionEnvironment(javacSource, javacTarget, jreCompilationProfile, javacWarnings, javacErrors, getSourceLibraries(sourceEntries));
    validateJavaCompilerSettings(javaProjectWarnings);
  }
  
  private List getSourceLibraries(List sourceEntries)
  {
    List libraries = new ArrayList();
    for (Iterator iterator = sourceEntries.iterator(); iterator.hasNext();)
    {
      IBuildEntry sourceEntry = (IBuildEntry)iterator.next();
      String libName = sourceEntry.getName().substring("source.".length());
      libraries.add(libName);
    }
    return libraries;
  }
  
  private void validateExecutionEnvironment(IBuildEntry javacSourceEntry, IBuildEntry javacTargetEntry, IBuildEntry jreCompilationProfileEntry, ArrayList javacWarningsEntries, ArrayList javacErrorsEntries, List libraryNames)
  {
    IJavaProject project = JavaCore.create(fProject);
    if (project.exists())
    {
      IClasspathEntry[] classpath = (IClasspathEntry[])null;
      try
      {
        classpath = project.getRawClasspath();
      }
      catch (JavaModelException e)
      {
        PDECore.log(e);
        return;
      }
      boolean source = false;
      for (int i = 0; i < classpath.length; i++)
      {
        IClasspathEntry cpe = classpath[i];
        if (cpe.getEntryKind() == 3) {
          source = true;
        }
      }
      if (!source) {
        return;
      }
      String projectComplianceLevel = project.getOption("org.eclipse.jdt.core.compiler.compliance", false);
      if (projectComplianceLevel != null)
      {
        IPluginModelBase model = PluginRegistry.findModel(fProject);
        String[] execEnvs = (String[])null;
        if (model != null)
        {
          BundleDescription bundleDesc = model.getBundleDescription();
          if (bundleDesc != null) {
            execEnvs = bundleDesc.getExecutionEnvironments();
          }
        }
        if ((execEnvs == null) || (execEnvs.length == 0)) {
          return;
        }
        String execEnv = execEnvs[0];
        
        String projectSourceCompatibility = project.getOption("org.eclipse.jdt.core.compiler.source", true);
        String projectClassCompatibility = project.getOption("org.eclipse.jdt.core.compiler.codegen.targetPlatform", true);
        if ((projectComplianceLevel.equals(findMatchingEE(projectSourceCompatibility, projectClassCompatibility, false))) && (execEnv.equals(findMatchingEE(projectSourceCompatibility, projectClassCompatibility, true)))) {
          return;
        }
        Map defaultComplianceOptions = new HashMap();
        JavaCore.setComplianceOptions(projectComplianceLevel, defaultComplianceOptions);
        
        String projectJavaCompatibility = findMatchingEE(projectSourceCompatibility, projectClassCompatibility, true);
        String message = null;
        if (projectJavaCompatibility != null)
        {
          if (jreCompilationProfileEntry == null)
          {
            message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceMissingEntry, "jre.compilation.profile", PDECoreMessages.BuildErrorReporter_CompilercomplianceLevel);
            prepareError("jre.compilation.profile", projectJavaCompatibility, message, 8199, fJavaComplianceSeverity, "ee");
          }
          else if (!projectJavaCompatibility.equalsIgnoreCase(jreCompilationProfileEntry.getTokens()[0]))
          {
            message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceDifferentToken, "jre.compilation.profile", PDECoreMessages.BuildErrorReporter_CompilercomplianceLevel);
            prepareError("jre.compilation.profile", projectJavaCompatibility, message, 8198, fJavaComplianceSeverity, "ee");
          }
        }
        else
        {
          if (projectSourceCompatibility.equals(defaultComplianceOptions.get("org.eclipse.jdt.core.compiler.source")))
          {
            if (javacSourceEntry != null)
            {
              message = NLS.bind(PDECoreMessages.Bui
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

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-2019. Infinite Loop Ltd