/** * Return the source file for the given instance. By default, checks * to see if the instance implements {@link SourceTracker}. */ protected File getSourceFile(Object obj) { if (obj instanceof SourceTracker) return ((SourceTracker) obj).getSourceFile(); return null; }
/** * Return the source file for the given instance. By default, checks * to see if the instance implements {@link SourceTracker}. */ protected File getSourceFile(Object obj) { if (obj instanceof SourceTracker) return ((SourceTracker) obj).getSourceFile(); return null; }
/** * Return the source file for the given instance. By default, checks * to see if the instance implements {@link SourceTracker}. */ protected File getSourceFile(Object obj) { if (obj instanceof SourceTracker) return ((SourceTracker) obj).getSourceFile(); return null; }
/** * Return the source file for the given instance. By default, checks * to see if the instance implements {@link SourceTracker}. */ protected File getSourceFile(Object obj) { if (obj instanceof SourceTracker) return ((SourceTracker) obj).getSourceFile(); return null; }
/** * Create a message appropriate for display to the user describing * the location(s) that <code>trackers</code> were loaded from. * * @param trackers the source-trackers for which location info should * be provided. */ public static String getSourceLocationMessage(SourceTracker[] trackers) { StringBuffer buf = new StringBuffer(20 * (trackers.length + 1)); buf.append(_loc.get("source-trackers-location-header")).append(SEP); String sourceFilePath; for (int i = 0; i < trackers.length; i++) { sourceFilePath = (trackers[i].getSourceFile() == null ? _loc.get("source-tracker-file-unknown").getMessage() : (String) AccessController.doPrivileged( J2DoPrivHelper.getAbsolutePathAction( trackers[i].getSourceFile()))); buf.append(" ").append(_loc.get( "source-trackers-location-line-item", trackers[i].getResourceName(), sourceFilePath)); if (i < trackers.length - 1) buf.append(SEP); } return buf.toString(); } }
/** * Create a message appropriate for display to the user describing * the location(s) that <code>trackers</code> were loaded from. * * @param trackers the source-trackers for which location info should * be provided. */ public static String getSourceLocationMessage(SourceTracker[] trackers) { StringBuilder buf = new StringBuilder(20 * (trackers.length + 1)); buf.append(_loc.get("source-trackers-location-header")).append(SEP); String sourceFilePath; for (int i = 0; i < trackers.length; i++) { sourceFilePath = (trackers[i].getSourceFile() == null ? _loc.get("source-tracker-file-unknown").getMessage() : AccessController.doPrivileged( J2DoPrivHelper.getAbsolutePathAction( trackers[i].getSourceFile()))); buf.append(" ").append(_loc.get( "source-trackers-location-line-item", trackers[i].getResourceName(), sourceFilePath)); if (i < trackers.length - 1) buf.append(SEP); } return buf.toString(); } }
/** * Create a message appropriate for display to the user describing * the location(s) that <code>trackers</code> were loaded from. * * @param trackers the source-trackers for which location info should * be provided. */ public static String getSourceLocationMessage(SourceTracker[] trackers) { StringBuilder buf = new StringBuilder(20 * (trackers.length + 1)); buf.append(_loc.get("source-trackers-location-header")).append(SEP); String sourceFilePath; for (int i = 0; i < trackers.length; i++) { sourceFilePath = (trackers[i].getSourceFile() == null ? _loc.get("source-tracker-file-unknown").getMessage() : AccessController.doPrivileged( J2DoPrivHelper.getAbsolutePathAction( trackers[i].getSourceFile()))); buf.append(" ").append(_loc.get( "source-trackers-location-line-item", trackers[i].getResourceName(), sourceFilePath)); if (i < trackers.length - 1) buf.append(SEP); } return buf.toString(); } }
/** * Create a message appropriate for display to the user describing * the location(s) that <code>trackers</code> were loaded from. * * @param trackers the source-trackers for which location info should * be provided. */ public static String getSourceLocationMessage(SourceTracker[] trackers) { StringBuilder buf = new StringBuilder(20 * (trackers.length + 1)); buf.append(_loc.get("source-trackers-location-header")).append(SEP); String sourceFilePath; for (int i = 0; i < trackers.length; i++) { sourceFilePath = (trackers[i].getSourceFile() == null ? _loc.get("source-tracker-file-unknown").getMessage() : AccessController.doPrivileged( J2DoPrivHelper.getAbsolutePathAction( trackers[i].getSourceFile()))); buf.append(" ").append(_loc.get( "source-trackers-location-line-item", trackers[i].getResourceName(), sourceFilePath)); if (i < trackers.length - 1) buf.append(SEP); } return buf.toString(); } }