Skip to content

Commit ce1d90a

Browse files
committed
Replace hard-coded vetoed class with configurable version -- fixes
1 parent 22a5bcc commit ce1d90a

File tree

5 files changed

+9
-40
lines changed

5 files changed

+9
-40
lines changed

net.tascalate.javaflow.spi/src/main/java/org/apache/commons/javaflow/spi/ClassMatcherFileParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ ClassMatcher parse(URL url) throws IOException {
4343
continue;
4444
}
4545
String kind = s.substring(0, columnPos).trim();
46-
String variant = s.substring(columnPos + 1).trim();
46+
String variant = s.substring(columnPos + 1, equalsPos).trim();
4747
String target = s.substring(equalsPos + 1).trim();
4848
if (target.length() == 0) {
4949
// Invalid class name

net.tascalate.javaflow.spi/src/main/java/org/apache/commons/javaflow/spi/ClassMatchers.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public boolean matches(String name, String signature, String superName, String[]
9393
}
9494

9595
public static ClassMatcher byClassNamePattern(final String classNamePattern) {
96-
final Pattern pattern = Pattern.compile("^" + escapeDots(className(classNamePattern)) + "$");
96+
final Pattern pattern = Pattern.compile("^" + classNamePattern + "$");
9797
return new ClassMatcher() {
9898
@Override
9999
public boolean matches(String name, String signature, String superName, String[] interfaces) {
@@ -143,13 +143,7 @@ public boolean matches(String name, String signature, String superName, String[]
143143
};
144144
}
145145

146-
private static String escapeDots(String s) {
147-
return s != null ? MATCH_DOTS.matcher(s).replaceAll("\\.") : null;
148-
}
149-
150146
private static String className(String internalClassName) {
151-
return internalClassName != null ? internalClassName.replace('/', '.') : null;
147+
return internalClassName != null ? internalClassName.replace('.', '/') : null;
152148
}
153-
154-
private static final Pattern MATCH_DOTS = Pattern.compile("\\.");
155149
}

net.tascalate.javaflow.spi/src/main/java/org/apache/commons/javaflow/spi/ClasspathResourceLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public InputStream getResourceAsStream(String name) throws IOException {
4848

4949
public ClassMatcher createVeto() throws IOException {
5050
List<ClassMatcher> matchers = new ArrayList<ClassMatcher>();
51-
Enumeration<URL> allResources = classLoader.getResources("/META-INF/net.tascalate.javaflow.veto.cmf");
51+
Enumeration<URL> allResources = classLoader.getResources("META-INF/net.tascalate.javaflow.veto.cmf");
5252
ClassMatcherFileParser parser = new ClassMatcherFileParser();
5353
while (allResources.hasMoreElements()) {
5454
URL resource = allResources.nextElement();

net.tascalate.javaflow.spi/src/main/java/org/apache/commons/javaflow/spi/StopException.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
*/
1616
package org.apache.commons.javaflow.spi;
1717

18-
import java.util.Arrays;
19-
import java.util.HashSet;
20-
import java.util.Set;
21-
2218
public class StopException extends RuntimeException {
2319

2420
private static final long serialVersionUID = 1L;
@@ -32,26 +28,4 @@ public Throwable fillInStackTrace() {
3228
}
3329

3430
public static final StopException INSTANCE = new StopException();
35-
36-
private static boolean __dirtyCheckSkipContinuationsOnClass(int version, int access, String name, String signature, String superName, String[] interfaces) {
37-
if (null != interfaces) {
38-
for (String intf : interfaces) {
39-
if (PROXY_MARKER_INTERFACES.contains(intf)) {
40-
return true;
41-
}
42-
}
43-
}
44-
String lname = name.toLowerCase();
45-
if (lname.contains("$$enhancer") && lname.contains("cglib")) {
46-
return true;
47-
}
48-
return false;
49-
}
50-
51-
private static final Set<String> PROXY_MARKER_INTERFACES = new HashSet<String>(Arrays.asList(
52-
"org/apache/webbeans/proxy/OwbInterceptorProxy",
53-
"org/apache/webbeans/proxy/OwbNormalScopeProxy",
54-
"org/jboss/weld/bean/proxy/ProxyObject",
55-
"org/jboss/as/ee/component/serialization/WriteReplaceInterface"
56-
));
5731
}

net.tascalate.javaflow.spi/src/main/resources/META-INF/net.tascalate.javaflow.veto.cmf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
implements-interface:name=org.apache.webbeans.proxy.OwbInterceptorProxy
2-
implements-interface:name=org.apache.webbeans.proxy.OwbNormalScopeProxy
3-
implements-interface:name=org.jboss.weld.bean.prox.ProxyObject
4-
implements-interface:name=org.jboss.as.ee.component.serialization.WriteReplaceInterface
1+
implements-interface:name=org/apache/webbeans/proxy/OwbInterceptorProxy
2+
implements-interface:name=org/apache/webbeans/proxy/OwbNormalScopeProxy
3+
implements-interface:name=org/jboss/weld/bean/proxy/ProxyObject
4+
implements-interface:name=org/jboss/as/ee/component/serialization/WriteReplaceInterface
5+
class:name-pattern=.*\$\$EnhancerByCGLIB\$\$.*
56
# possible values are:
67
# implements-interface:name-part
78
# implements-interface:name-pattern

0 commit comments

Comments
 (0)