Exemple #1
0
  /**
   * Returns the complete represntation of this Id, in hex.
   *
   * @return The complete representation of this Id, in hexadecimal
   */
  public String toStringFull() {
    StringBuffer buffer = new StringBuffer();

    int n = IdBitLength / 4;
    for (int i = n - 1; i >= 0; i--) buffer.append(tran[getDigit(i, 4)]);

    return buffer.toString();
  }
 @Override
 public String toString() {
   StringBuffer buffer = new StringBuffer("{"); // $NON-NLS-1$
   for (int i = 0, length = this.values.length; i < length; i++) {
     HashedReference<T> value = this.values[i];
     if (value != null) {
       Object ref = value.get();
       if (ref != null) {
         buffer.append(ref.toString());
         buffer.append(", "); // $NON-NLS-1$
       }
     }
   }
   buffer.append("}"); // $NON-NLS-1$
   return buffer.toString();
 }
  /* We look for System property sun.jvm.hotspot.jdi.<vm version>.
   * This property should have the value of JDK HOME directory for
   * the given <vm version>.
   */
  private static String getSAClassPathForVM(String vmVersion) {
    final String prefix = "sun.jvm.hotspot.jdi.";
    // look for exact match of VM version
    String jvmHome = System.getProperty(prefix + vmVersion);
    if (DEBUG) {
      System.out.println("looking for System property " + prefix + vmVersion);
    }

    if (jvmHome == null) {
      // omit chars after first '-' in VM version and try
      // for example, in '1.5.0-b55' we take '1.5.0'
      int index = vmVersion.indexOf('-');
      if (index != -1) {
        vmVersion = vmVersion.substring(0, index);
        if (DEBUG) {
          System.out.println("looking for System property " + prefix + vmVersion);
        }
        jvmHome = System.getProperty(prefix + vmVersion);
      }

      if (jvmHome == null) {
        // System property is not set
        if (DEBUG) {
          System.out.println("can't locate JDK home for " + vmVersion);
        }
        return null;
      }
    }

    if (DEBUG) {
      System.out.println("JDK home for " + vmVersion + " is " + jvmHome);
    }

    // sa-jdi is in $JDK_HOME/lib directory
    StringBuffer buf = new StringBuffer();
    buf.append(jvmHome);
    buf.append(File.separatorChar);
    buf.append("lib");
    buf.append(File.separatorChar);
    buf.append("sa-jdi.jar");
    return buf.toString();
  }