Skip to content

Commit efd2783

Browse files
committed
restored JBossLoadTimeWeaver compability with JBoss AS 5.1 (SPR-9065)
1 parent 5b18fc4 commit efd2783

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

org.springframework.context/src/main/java/org/springframework/instrument/classloading/jboss/JBossLoadTimeWeaver.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,6 +36,7 @@
3636
* <p>Thanks to Ales Justin and Marius Bogoevici for the initial prototype.
3737
*
3838
* @author Costin Leau
39+
* @author Juergen Hoeller
3940
* @since 3.0
4041
*/
4142
public class JBossLoadTimeWeaver implements LoadTimeWeaver {
@@ -55,23 +56,18 @@ public JBossLoadTimeWeaver() {
5556
/**
5657
* Create a new instance of the {@link JBossLoadTimeWeaver} class using
5758
* the supplied {@link ClassLoader}.
58-
* @param classLoader the <code>ClassLoader</code> to delegate to for
59-
* weaving (must not be <code>null</code>)
59+
* @param classLoader the <code>ClassLoader</code> to delegate to for weaving
60+
* (must not be <code>null</code>)
6061
*/
6162
public JBossLoadTimeWeaver(ClassLoader classLoader) {
6263
Assert.notNull(classLoader, "ClassLoader must not be null");
63-
String loaderClassName = classLoader.getClass().getName();
64-
65-
if (loaderClassName.startsWith("org.jboss.classloader")) {
66-
// JBoss AS 5 or JBoss AS 6
67-
this.adapter = new JBossMCAdapter(classLoader);
68-
}
69-
else if (loaderClassName.startsWith("org.jboss.modules")) {
64+
if (classLoader.getClass().getName().startsWith("org.jboss.modules")) {
7065
// JBoss AS 7
7166
this.adapter = new JBossModulesAdapter(classLoader);
7267
}
7368
else {
74-
throw new IllegalArgumentException("Unexpected ClassLoader type: " + loaderClassName);
69+
// JBoss AS 5 or JBoss AS 6
70+
this.adapter = new JBossMCAdapter(classLoader);
7571
}
7672
}
7773

0 commit comments

Comments
 (0)