diff --git a/core/pom.xml b/core/pom.xml index fa496d794e..8d68eb0b13 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -736,7 +736,7 @@ THE SOFTWARE. net.java.sezpoz sezpoz - 1.5 + 1.7 org.jvnet.hudson diff --git a/core/src/main/java/hudson/Extension.java b/core/src/main/java/hudson/Extension.java index 9ef86d8562..66342a2b61 100644 --- a/core/src/main/java/hudson/Extension.java +++ b/core/src/main/java/hudson/Extension.java @@ -1,7 +1,7 @@ /* * The MIT License * - * Copyright (c) 2004-2009, Sun Microsystems, Inc. + * Copyright (c) 2004-2010, Sun Microsystems, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -78,4 +78,10 @@ public @interface Extension { * @since 1.306 */ double ordinal() default 0; + + /** + * If an extension is optional, don't log any class loading errors when reading it. + * @since 1.358 + */ + boolean optional() default false; } diff --git a/core/src/main/java/hudson/ExtensionFinder.java b/core/src/main/java/hudson/ExtensionFinder.java index 0f91edd5ad..cc924da4af 100644 --- a/core/src/main/java/hudson/ExtensionFinder.java +++ b/core/src/main/java/hudson/ExtensionFinder.java @@ -1,7 +1,7 @@ /* * The MIT License * - * Copyright (c) 2004-2009, Sun Microsystems, Inc. + * Copyright (c) 2004-2010, Sun Microsystems, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -125,10 +125,8 @@ public abstract class ExtensionFinder implements ExtensionPoint { result.add(new ExtensionComponent(type.cast(instance),item.annotation())); } } catch (InstantiationException e) { - LOGGER.log(Level.WARNING, "Failed to load "+item.className(),e); - } catch (LinkageError e) { - // work around for SEZPOZ-11: https://sezpoz.dev.java.net/issues/show_bug.cgi?id=11 - LOGGER.log(Level.WARNING, "Failed to load "+item.className(),e); + LOGGER.log(item.annotation().optional() ? Level.FINE : Level.WARNING, + "Failed to load "+item.className(), e); } }