| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 52 | 2 | 1 | 0.999 | class_body_declarations[5] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 52 | 58 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter.java |
| 2 | 52 | 59 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter2.java |
| ||||
private JarOutputStream fJarOutputStream;
private JarPackageData fJarPackage;
private Set fDirectories = new HashSet();
/**
* Creates an instance which is used to create a JAR based
* on the given JarPackage.
*
* @param jarPackage the JAR specification
* @param parent the shell used to display question dialogs,
* or <code>null</code> if "false/no/cancel" is the answer
* and no dialog should be shown
* @throws CoreException to signal any other unusual termination.
* This can also be used to return information
* in the status object.
*/
public JarWriter(JarPackageData jarPackage, Shell parent) throws CoreException {
Assert.isNotNull(jarPackage, "The JAR specification is null"); //$NON-NLS-1$
fJarPackage = jarPackage;
Assert.isTrue(fJarPackage.isValid(), "The JAR package specification is invalid"); //$NON-NLS-1$
if ( !canCreateJar(parent))
throw new OperationCanceledException();
try {
if (fJarPackage.usesManifest() && fJarPackage.areGeneratedFilesExported()) {
Manifest manifest = fJarPackage.getManifestProvider().create(fJarPackage);
fJarOutputStream = new JarOutputStream(new FileOutputStream(fJarPackage.getAbsoluteJarLocation().toOSString()), manifest);
}
else fJarOutputStream = new JarOutputStream(new FileOutputStream(fJarPackage.getAbsoluteJarLocation().toOSString()));
String comment = jarPackage.getComment();
if (comment != null)
fJarOutputStream.setComment(comment);
} catch (IOException ex) {
throw JarPackagerUtil.createCoreException(ex.getLocalizedMessage(), ex);
}
}
/**
* Closes the archive and does all required cleanup.
*
* @throws CoreException to signal any other unusual termination.
* This can also be used to return information
* in the status object.
*/
public void close() throws CoreException {
if (fJarOutputStream != null)
try {
fJarOutputStream.close();
registerInWorkspaceIfNeeded();
} catch (IOException ex) {
throw JarPackagerUtil.createCoreException(ex.getLocalizedMessage(), ex);
}
}
|
| ||||
private JarOutputStream fJarOutputStream;
private JarPackageData fJarPackage;
private Set fDirectories = new HashSet();
/**
* Creates an instance which is used to create a JAR based
* on the given JarPackage.
*
* @param jarPackage the JAR specification
* @param parent the shell used to display question dialogs,
* or <code>null</code> if "false/no/cancel" is the answer
* and no dialog should be shown
* @throws CoreException to signal any other unusual termination.
* This can also be used to return information
* in the status object.
*/
public JarWriter2(JarPackageData jarPackage, Shell parent) throws CoreException {
Assert.isNotNull(jarPackage, "The JAR specification is null"); //$NON-NLS-1$
fJarPackage = jarPackage;
Assert.isTrue(fJarPackage.isValid(), "The JAR package specification is invalid"); //$NON-NLS-1$
if ( !canCreateJar(parent))
throw new OperationCanceledException();
try {
if (fJarPackage.usesManifest() && fJarPackage.areGeneratedFilesExported()) {
Manifest manifest = fJarPackage.getManifestProvider().create(fJarPackage);
fJarOutputStream = new JarOutputStream(new FileOutputStream(fJarPackage.getAbsoluteJarLocation().toOSString()), manifest);
}
else fJarOutputStream = new JarOutputStream(new FileOutputStream(fJarPackage.getAbsoluteJarLocation().toOSString()));
String comment = jarPackage.getComment();
if (comment != null)
fJarOutputStream.setComment(comment);
} catch (IOException ex) {
throw JarPackagerUtil.createCoreException(ex.getLocalizedMessage(), ex);
}
}
/**
* Closes the archive and does all required cleanup.
*
* @throws CoreException to signal any other unusual termination.
* This can also be used to return information
* in the status object.
*/
public void close() throws CoreException {
if (fJarOutputStream != null)
try {
fJarOutputStream.close();
registerInWorkspaceIfNeeded();
} catch (IOException ex) {
throw JarPackagerUtil.createCoreException(ex.getLocalizedMessage(), ex);
}
}
|
| |||
private JarOutputStream fJarOutputStream;
private JarPackageData fJarPackage;
private Set fDirectories = new HashSet();
/**
* Creates an instance which is used to create a JAR based
* on the given JarPackage.
*
* @param jarPackage the JAR specification
* @param parent the shell used to display question dialogs,
* or <code>null</code> if "false/no/cancel" is the answer
* and no dialog should be shown
* @throws CoreException to signal any other unusual termination.
* This can also be used to return information
* in the status object.
*/
/**
* Creates an instance which is used to create a JAR based
* on the given JarPackage.
*
* @param jarPackage the JAR specification
* @param parent the shell used to display question dialogs,
* or <code>null</code> if "false/no/cancel" is the answer
* and no dialog should be shown
* @throws CoreException to signal any other unusual termination.
* This can also be used to return information
* in the status object.
*/
public [[#variable52e353c0]](JarPackageData jarPackage, Shell parent) throws CoreException {
Assert.isNotNull(jarPackage, "The JAR specification is null"); //$NON-NLS-1$
fJarPackage = jarPackage;
Assert.isTrue(fJarPackage.isValid(), "The JAR package specification is invalid"); //$NON-NLS-1$
if ( !canCreateJar(parent))
throw new OperationCanceledException();
try {
if (fJarPackage.usesManifest() && fJarPackage.areGeneratedFilesExported()) {
Manifest manifest = fJarPackage.getManifestProvider().create(fJarPackage);
fJarOutputStream = new JarOutputStream(new FileOutputStream(fJarPackage.getAbsoluteJarLocation().toOSString()), manifest);
}
else
fJarOutputStream = new JarOutputStream(new FileOutputStream(fJarPackage.getAbsoluteJarLocation().toOSString()));
String comment = jarPackage.getComment();
if (comment != null)
fJarOutputStream.setComment(comment);
}
catch (IOException ex) {
throw JarPackagerUtil.createCoreException(ex.getLocalizedMessage(), ex);
}
}
/**
* Closes the archive and does all required cleanup.
*
* @throws CoreException to signal any other unusual termination.
* This can also be used to return information
* in the status object.
*/
public void close() throws CoreException {
if (fJarOutputStream != null)
try {
fJarOutputStream.close();
registerInWorkspaceIfNeeded();
}
catch (IOException ex) {
throw JarPackagerUtil.createCoreException(ex.getLocalizedMessage(), ex);
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#52e353c0]] | JarWriter |
| 1 | 2 | [[#52e353c0]] | JarWriter2 |