Skip to content

Commit

Permalink
1. 优化import
Browse files Browse the repository at this point in the history
2. 升级到JDK1.8,解决ClassLoader的问题
  • Loading branch information
oldmanpushcart committed Jan 19, 2023
1 parent cdb72ce commit f7666e7
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 55 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.alibaba.jvm.sandbox.api.routing;

import com.alibaba.jvm.sandbox.api.routing.RoutingInfo.Type;

import org.junit.Test;

import static org.junit.Assert.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.alibaba.jvm.sandbox.api.routing;

import com.alibaba.jvm.sandbox.api.routing.RoutingInfo.Type;

import org.junit.Test;

import static org.junit.Assert.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@
import java.net.URLClassLoader;
import java.security.AccessControlContext;
import java.security.ProtectionDomain;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.*;
import java.util.jar.JarFile;

import static com.alibaba.jvm.sandbox.api.util.GaStringUtils.getJavaClassName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
package com.alibaba.jvm.sandbox.core.classloader;

import com.alibaba.jvm.sandbox.api.routing.LaunchedRouting;
import com.alibaba.jvm.sandbox.api.routing.RoutingExt;
import com.alibaba.jvm.sandbox.api.routing.RoutingInfo;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -10,16 +19,6 @@
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

import com.alibaba.jvm.sandbox.api.routing.LaunchedRouting;
import com.alibaba.jvm.sandbox.api.routing.RoutingExt;
import com.alibaba.jvm.sandbox.api.routing.RoutingInfo;

import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;

/**
* {@link SpecialRoutingHandler}
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.alibaba.jvm.sandbox.api.event.Event;
import com.alibaba.jvm.sandbox.core.enhance.weaver.asm.EventWeaver;
import com.alibaba.jvm.sandbox.core.manager.NativeMethodEnhanceAware;
import com.alibaba.jvm.sandbox.core.util.AsmUtils;
import com.alibaba.jvm.sandbox.core.util.ObjectIDs;
import org.objectweb.asm.ClassReader;
Expand All @@ -12,7 +11,6 @@

import java.io.File;
import java.io.IOException;
import java.lang.instrument.Instrumentation;
import java.util.Set;

import static org.apache.commons.io.FileUtils.writeByteArrayToFile;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
package com.alibaba.jvm.sandbox.core.enhance.weaver.asm;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import com.alibaba.jvm.sandbox.api.event.Event;
import com.alibaba.jvm.sandbox.core.enhance.weaver.CodeLock;

import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.*;
import org.objectweb.asm.commons.AdviceAdapter;
import org.objectweb.asm.commons.JSRInlinerAdapter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import static com.alibaba.jvm.sandbox.core.util.SandboxStringUtils.toInternalClassName;
import static com.alibaba.jvm.sandbox.core.util.SandboxStringUtils.toJavaClassName;
import static org.apache.commons.lang3.ArrayUtils.contains;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package com.alibaba.jvm.sandbox.core.enhance.weaver.asm;

import java.com.alibaba.jvm.sandbox.spy.Spy;

import com.alibaba.jvm.sandbox.core.enhance.weaver.CodeLock;

import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.commons.AdviceAdapter;

import java.com.alibaba.jvm.sandbox.spy.Spy;

/**
* 方法重写
* ReWriteJavaMethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,14 @@
import com.alibaba.jvm.sandbox.core.classloader.RoutingURLClassLoader.Routing;
import com.alibaba.jvm.sandbox.core.classloader.SpecialRoutingHandler;
import com.alibaba.jvm.sandbox.core.manager.CoreLoadedClassDataSource;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.*;

class ModuleJarLoader {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.alibaba.jvm.sandbox.api.Information;
import com.alibaba.jvm.sandbox.core.manager.CoreLoadedClassDataSource;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import com.alibaba.jvm.sandbox.api.event.Event.Type;
import com.alibaba.jvm.sandbox.api.listener.EventListener;
import com.alibaba.jvm.sandbox.core.enhance.EventEnhancer;
import com.alibaba.jvm.sandbox.core.enhance.weaver.asm.EventWeaver;
import com.alibaba.jvm.sandbox.core.manager.NativeMethodEnhanceAware;
import com.alibaba.jvm.sandbox.core.util.ObjectIDs;
import com.alibaba.jvm.sandbox.core.util.SandboxClassUtils;
import com.alibaba.jvm.sandbox.core.util.SandboxProtector;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package com.alibaba.jvm.sandbox.core.classloader;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.List;

import com.alibaba.jvm.sandbox.api.routing.RoutingInfo;
import com.alibaba.jvm.sandbox.api.routing.RoutingInfo.Type;
import com.alibaba.jvm.sandbox.core.classloader.SpecialRoutingHandler.RoutingYaml;

import org.junit.Before;
import org.junit.Test;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.List;

import static org.junit.Assert.*;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package com.alibaba.jvm.sandbox.module.debug;

import javax.servlet.http.HttpServletRequest;

import com.alibaba.jvm.sandbox.api.Information;
import com.alibaba.jvm.sandbox.api.Module;
import com.alibaba.jvm.sandbox.api.listener.ext.Advice;

import org.kohsuke.MetaInfServices;

import javax.servlet.http.HttpServletRequest;

/**
* {@link LogServletAccessModuleV2}
* <p>
Expand Down

0 comments on commit f7666e7

Please sign in to comment.