CloneSet466


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
52210.999class_body_declarations[5]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
15258
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter.java
25259
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter2.java
Clone Instance
1
Line Count
52
Source Line
58
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter.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);
                          }
        }


Clone Instance
2
Line Count
52
Source Line
59
Source File
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 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);
                          }
        }


Clone AbstractionParameter Count: 1Parameter Bindings

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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#52e353c0]]
JarWriter 
12[[#52e353c0]]
JarWriter2