CloneSet3992


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
15201.000class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
115189
plugins/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketLaunchingConnectorImpl.java
21573
plugins/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/SocketUtil.java
Clone Instance
1
Line Count
15
Source Line
189
Source File
plugins/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/connect/SocketLaunchingConnectorImpl.java

        /**
         * Returns a free port number on localhost, or -1 if unable to find a free port.
         * 
         * @return a free port number on localhost, or -1 if unable to find a free port
         * @since 3.2
         */
        public static int findFreePort() {
                ServerSocket socket = null;
                try {
                        socket = new ServerSocket(0);
                        return socket.getLocalPort();
                } catch (IOException e) {
                  }
                  finally {
                        if (socket != null) {
                                try {
                                        socket.close();
                                } catch (IOException e) {
                                  }
                        }
                  }
                return -1;
        }


Clone Instance
2
Line Count
15
Source Line
73
Source File
plugins/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/SocketUtil.java

        /**
         * Returns a free port number on localhost, or -1 if unable to find a free port.
         * 
         * @return a free port number on localhost, or -1 if unable to find a free port
         * @since 3.0
         */
        public static int findFreePort() {
                ServerSocket socket = null;
                try {
                        socket = new ServerSocket(0);
                        return socket.getLocalPort();
                } catch (IOException e) {
                  }
                  finally {
                        if (socket != null) {
                                try {
                                        socket.close();
                                } catch (IOException e) {
                                  }
                        }
                  }
                return -1;
        }


Clone AbstractionParameter Count: 0Parameter Bindings

/**
         * Returns a free port number on localhost, or -1 if unable to find a free port.
         * 
         * @return a free port number on localhost, or -1 if unable to find a free port
         * @since 3.0
         */
/**
         * Returns a free port number on localhost, or -1 if unable to find a free port.
         * 
         * @return a free port number on localhost, or -1 if unable to find a free port
         * @since 3.2
         */
public static int findFreePort() {
  ServerSocket socket = null;
  try {
    socket = new ServerSocket(0);
    return socket.getLocalPort();
  }
  catch (IOException e) {
  }
  finally {
    if (socket != null) {
      try {
        socket.close();
      }
      catch (IOException e) {
      }
    }
  }
  return -1;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None