CloneSet982


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
25230.960class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
12546
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSUtil.java
227292
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaCompareUtilities.java
Clone Instance
1
Line Count
25
Source Line
46
Source File
plugins/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSUtil.java

        /**
         * Returns null if an error occurred.
         * closes the stream 
         */
        public static String readString(InputStream is) {
                if (is == null)
                        return null;
                BufferedReader reader = null;
                try {
                        StringBuffer buffer = new StringBuffer();
                        char[] part = new char[2048];
                        int read = 0;
                        reader = new BufferedReader(new InputStreamReader(is, "8859_1")); //$NON-NLS-1$

                        while ((read = reader.read(part)) != -1)
                                buffer.append(part, 0, read);

                        return buffer.toString();
                }
                  catch (IOException ex) {
                  }
                  finally {
                        if (reader != null) {
                                try {
                                        reader.close();
                                } catch (IOException ex) {
                                  }
                        }
                  }
                return null;
        }


Clone Instance
2
Line Count
27
Source Line
292
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaCompareUtilities.java

        /**
         * Reads the contents of the given input stream into a string.
         * The function assumes that the input stream uses the platform's default encoding
         * (<code>ResourcesPlugin.getEncoding()</code>).
         * Returns null if an error occurred.
         */
        private static String readString(InputStream is, String encoding) {
                if (is == null)
                        return null;
                BufferedReader reader = null;
                try {
                        StringBuffer buffer = new StringBuffer();
                        char[] part = new char[2048];
                        int read = 0;
                        reader = new BufferedReader(new InputStreamReader(is, encoding));

                        while ((read = reader.read(part)) != -1)
                                buffer.append(part, 0, read);

                        return buffer.toString();
                }
                  catch (IOException ex) {
                        // NeedWork
                  }
                  finally {
                        if (reader != null) {
                                try {
                                        reader.close();
                                } catch (IOException ex) {
                                        // silently ignored
                                  }
                        }
                  }
                return null;
        }


Clone AbstractionParameter Count: 3Parameter Bindings

 [[#variableb26a4b00]]static String readString( [[#variableb26a4a80]]) {
  if (is == null)
    return null;
  BufferedReader reader = null;
  try {
    StringBuffer buffer = new StringBuffer();
    char[] part = new char[2048];
    int read = 0;
    reader = new BufferedReader(new InputStreamReader(is,  [[#variableb26a4a00]])); //$NON-NLS-1$
    while ((read = reader.read(part)) != -1)
      buffer.append(part, 0, read);
    return buffer.toString();
  }
  catch (IOException ex) {
  // NeedWork
  }
  finally {
    if (reader != null) {
      try {
        reader.close();
      }
      catch (IOException ex) {
      // silently ignored
      }
    }
  }
  return null;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b26a4b00]]
/**
 * Returns null if an error occurred.
 * closes the stream 
 */
public 
12[[#b26a4b00]]
/**
 * Reads the contents of the given input stream into a string.
 * The function assumes that the input stream uses the platform's default encoding
 * (<code>ResourcesPlugin.getEncoding()</code>).
 * Returns null if an error occurred.
 */
private 
21[[#b26a4a80]]
InputStream is 
22[[#b26a4a80]]
InputStream is, String encoding 
31[[#b26a4a00]]
"8859_1" 
32[[#b26a4a00]]
encoding