Changeset 4167 in josm
- Timestamp:
- 2011-06-25T22:17:15+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r4159 r4167 940 940 * 941 941 * @param ex the exception 942 * @return the plugin; null, if the exception pro ably wasn't thrown from a plugin942 * @return the plugin; null, if the exception probably wasn't thrown from a plugin 943 943 */ 944 944 private static PluginProxy getPluginCausingException(Throwable ex) { 945 PluginProxy err = null; 946 StackTraceElement[] stack = ex.getStackTrace(); 947 /* remember the error position, as multiple plugins may be involved, 948 we search the topmost one */ 949 int pos = stack.length; 945 950 for (PluginProxy p : pluginList) { 946 951 String baseClass = p.getPluginInformation().className; 947 int i = baseClass.lastIndexOf(".");948 baseClass = baseClass.substring(0, i);949 for (StackTraceElement element : ex.getStackTrace()) {950 String c = element.getClassName();951 if (c.startsWith(baseClass))952 return p;953 } 954 } 955 return null;952 baseClass = baseClass.substring(0, baseClass.lastIndexOf(".")); 953 for (int elpos = 0; elpos < pos; ++elpos) { 954 if (stack[elpos].getClassName().startsWith(baseClass)) { 955 pos = elpos; 956 err = p; 957 } 958 } 959 } 960 return err; 956 961 } 957 962
Note:
See TracChangeset
for help on using the changeset viewer.