Commit 57c21e31 authored by Vít Kabele's avatar Vít Kabele

Prepared to refactoring

parent 1973825e
Pipeline #3270 passed with stages
in 4 minutes and 1 second
......@@ -33,4 +33,16 @@ class ByteArrayClassLoader extends ClassLoader {
return defineClass (name, classBytes, offset, length);
}
/**
* Returns an class definition from given byte array,
* using whole array as class bytes.
* @param name Class name.
* @param classBytes Class bytes.
* @return Appropriate instance of the class.
*/
Class<?> createClass(String name, byte[] classBytes){
return defineClass (name,classBytes,0,classBytes.length);
}
}
......@@ -85,7 +85,7 @@ final class InstrumentationJar {
while((je = jis.getNextJarEntry ()) != null){
if(
!je.isDirectory () &&
dislClasses.contains (je.getName ())
dislClasses.contains (je.getName().replace("/",".") )
){
ClassNodes.add ( ClassNodeHelper.SNIPPET.unmarshal (jis));
}
......
......@@ -612,7 +612,7 @@ abstract class AbstractParser {
}
static Class <?> getGuard (final Type guardType)
Class <?> getGuard (final Type guardType)
throws ReflectionException {
if (guardType == null) {
return null;
......
package ch.usi.dag.disl.classparser;
import java.lang.reflect.Method;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import org.objectweb.asm.Type;
......@@ -107,7 +103,7 @@ class SnippetParser extends AbstractParser {
final Marker marker = getMarker (data.marker, data.args);
final Scope scope = ScopeMatcher.forPattern (data.scope);
final Method guard = GuardHelper.findAndValidateGuardMethod (
AbstractParser.getGuard (data.guard), GuardHelper.snippetContextSet ()
getGuard (data.guard), GuardHelper.snippetContextSet ()
);
final SnippetUnprocessedCode template = new SnippetUnprocessedCode (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment