public static void subjoinPackagingData(StringBuilder builder, StackTraceElementProxy step) { if (step != null) { ClassPackagingData cpd = step.getClassPackagingData(); if (cpd != null) { if (!cpd.isExact()) { builder.append(" ~["); } else { builder.append(" ["); } builder.append(cpd.getCodeLocation()).append(':').append(cpd.getVersion()).append(']'); } } }
private ClassPackagingData calculateByExactType(Class type) { String className = type.getName(); ClassPackagingData cpd = cache.get(className); if (cpd != null) { return cpd; } String version = getImplementationVersion(type); String codeLocation = getCodeLocation(type); cpd = new ClassPackagingData(codeLocation, version); cache.put(className, cpd); return cpd; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final StackTraceElementProxy other = (StackTraceElementProxy) obj; if (!ste.equals(other.ste)) { return false; } if (cpd == null) { if (other.cpd != null) { return false; } } else if (!cpd.equals(other.cpd)) { return false; } return true; }
@Override protected void extraData(StringBuilder builder, StackTraceElementProxy step) { if (step != null) { ClassPackagingData pi = step.getClassPackagingData(); if (pi != null) { builder.append(" [").append(pi.getCodeLocation()).append(':').append( pi.getVersion()).append(']'); } } }
ClassPackagingData packaging = step.getClassPackagingData(); if (packaging != null) { String location = packaging.getCodeLocation(); if (location != null) { xml.attribute("location", location); String version = packaging.getVersion(); if (version != null) { xml.attribute("version", version);
public static void subjoinPackagingData(StringBuilder builder, StackTraceElementProxy step) { if (step != null) { ClassPackagingData cpd = step.getClassPackagingData(); if (cpd != null) { if (!cpd.isExact()) { builder.append(" ~["); } else { builder.append(" ["); } builder.append(cpd.getCodeLocation()).append(':').append( cpd.getVersion()).append(']'); } } }
private ClassPackagingData computeBySTEP(StackTraceElementProxy step, ClassLoader lastExactClassLoader) { String className = step.ste.getClassName(); ClassPackagingData cpd = cache.get(className); if (cpd != null) { return cpd; } Class type = bestEffortLoadClass(lastExactClassLoader, className); String version = getImplementationVersion(type); String codeLocation = getCodeLocation(type); cpd = new ClassPackagingData(codeLocation, version, false); cache.put(className, cpd); return cpd; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final StackTraceElementProxy other = (StackTraceElementProxy) obj; if (!ste.equals(other.ste)) { return false; } if (cpd == null) { if (other.cpd != null) { return false; } } else if (!cpd.equals(other.cpd)) { return false; } return true; }
public static void subjoinPackagingData(StringBuilder builder, StackTraceElementProxy step) { if (step != null) { ClassPackagingData cpd = step.getClassPackagingData(); if (cpd != null) { if (!cpd.isExact()) { builder.append(" ~["); } else { builder.append(" ["); } builder.append(cpd.getCodeLocation()).append(':').append(cpd.getVersion()).append(']'); } } }
private ClassPackagingData calculateByExactType(Class type) { String className = type.getName(); ClassPackagingData cpd = cache.get(className); if (cpd != null) { return cpd; } String version = getImplementationVersion(type); String codeLocation = getCodeLocation(type); cpd = new ClassPackagingData(codeLocation, version); cache.put(className, cpd); return cpd; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final StackTraceElementProxy other = (StackTraceElementProxy) obj; if (!ste.equals(other.ste)) { return false; } if (cpd == null) { if (other.cpd != null) { return false; } } else if (!cpd.equals(other.cpd)) { return false; } return true; }
public static void subjoinPackagingData(StringBuilder builder, StackTraceElementProxy step) { if (step != null) { ClassPackagingData cpd = step.getClassPackagingData(); if (cpd != null) { if (!cpd.isExact()) { builder.append(" ~["); } else { builder.append(" ["); } builder.append(cpd.getCodeLocation()).append(':').append(cpd.getVersion()).append(']'); } } }
private ClassPackagingData computeBySTEP(StackTraceElementProxy step, ClassLoader lastExactClassLoader) { String className = step.ste.getClassName(); ClassPackagingData cpd = cache.get(className); if (cpd != null) { return cpd; } Class type = bestEffortLoadClass(lastExactClassLoader, className); String version = getImplementationVersion(type); String codeLocation = getCodeLocation(type); cpd = new ClassPackagingData(codeLocation, version, false); cache.put(className, cpd); return cpd; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final StackTraceElementProxy other = (StackTraceElementProxy) obj; if (!ste.equals(other.ste)) { return false; } if (cpd == null) { if (other.cpd != null) { return false; } } else if (!cpd.equals(other.cpd)) { return false; } return true; }
static void appendPackagingData(StringBuilder builder, StackTraceElementProxy step) { if (step != null) { ClassPackagingData cpd = step.getClassPackagingData(); if (cpd != null) { if (!cpd.isExact()) { builder.append(" ~["); } else { builder.append(" ["); } builder.append(cpd.getCodeLocation()).append(':').append( cpd.getVersion()).append(']'); } } }
public ClassPackagingData makePackagingFromType(Class type, String className) { try { org.osgi.framework.Bundle bundle = org.osgi.framework.FrameworkUtil.getBundle(type); if (bundle != null) { org.osgi.framework.Version bundleVersion = bundle.getVersion(); String version = bundleVersion == org.osgi.framework.Version.emptyVersion ? "na" : bundleVersion.toString(); String codeLocation = bundle.getSymbolicName(); return new ClassPackagingData(codeLocation, version); } } catch (NoSuchMethodError e) { // this means that FrameworkUtil is older than v4.2.0. Give up. } catch (RuntimeException e) { // at minimum: IllegalStateException, SecurityException // go on to next strategy } return null; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final StackTraceElementProxy other = (StackTraceElementProxy) obj; if (!ste.equals(other.ste)) { return false; } if (cpd == null) { if (other.cpd != null) { return false; } } else if (!cpd.equals(other.cpd)) { return false; } return true; }
public static void subjoinPackagingData(StringBuilder builder, StackTraceElementProxy step) { if (step != null) { ClassPackagingData cpd = step.getClassPackagingData(); if (cpd != null) { if (!cpd.isExact()) { builder.append(" ~["); } else { builder.append(" ["); } builder.append(cpd.getCodeLocation()).append(':').append(cpd.getVersion()).append(']'); } } }
private ClassPackagingData makePackagingFromType(Class type, String className) { ClassPackagingData cpd = null; if (type != null) { for (PackagingDataStrategy strategy : dataStrategies) { cpd = strategy.makePackagingFromType(type, className); if (cpd != null) break; } } if (cpd == null) // should only happen if type == null cpd = new ClassPackagingData("na", "na"); cache.put(className, cpd); return cpd; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final StackTraceElementProxy other = (StackTraceElementProxy) obj; if (!ste.equals(other.ste)) { return false; } if (cpd == null) { if (other.cpd != null) { return false; } } else if (!cpd.equals(other.cpd)) { return false; } return true; }