Skip to content

Commit f4a5dd3

Browse files
committed
fix: context not found test not work
1 parent 3e70d4a commit f4a5dd3

32 files changed

+37
-37
lines changed

generator/src/main/java/com/reajason/javaweb/memshell/injector/apusic/ApusicFilterInjector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public ApusicFilterInjector() {
4444
} catch (Throwable throwable) {
4545
msg += "context error: " + getErrorMessage(throwable);
4646
}
47-
if (contexts == null) {
47+
if (contexts == null || contexts.isEmpty()) {
4848
msg += "context not found";
4949
} else {
5050
for (Object context : contexts) {

generator/src/main/java/com/reajason/javaweb/memshell/injector/apusic/ApusicListenerInjector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public ApusicListenerInjector() {
4040
} catch (Throwable throwable) {
4141
msg += "context error: " + getErrorMessage(throwable);
4242
}
43-
if (contexts == null) {
43+
if (contexts == null || contexts.isEmpty()) {
4444
msg += "context not found";
4545
} else {
4646
for (Object context : contexts) {

generator/src/main/java/com/reajason/javaweb/memshell/injector/apusic/ApusicServletInjector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public ApusicServletInjector() {
4040
} catch (Throwable throwable) {
4141
msg += "context error: " + getErrorMessage(throwable);
4242
}
43-
if (contexts == null) {
43+
if (contexts == null || contexts.isEmpty()) {
4444
msg += "context not found";
4545
} else {
4646
for (Object context : contexts) {

generator/src/main/java/com/reajason/javaweb/memshell/injector/bes/BesFilterInjector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public BesFilterInjector() {
4040
} catch (Throwable throwable) {
4141
msg += "context error: " + getErrorMessage(throwable);
4242
}
43-
if (contexts == null) {
43+
if (contexts == null || contexts.isEmpty()) {
4444
msg += "context not found";
4545
} else {
4646
for (Object context : contexts) {
@@ -105,7 +105,7 @@ public Set<Object> getContext() throws Exception {
105105
return contexts;
106106
}
107107

108-
private ClassLoader getWebAppClassLoader(Object context) {
108+
private ClassLoader getWebAppClassLoader(Object context) throws Exception {
109109
try {
110110
return ((ClassLoader) invokeMethod(context, "getClassLoader", null, null));
111111
} catch (Exception e) {

generator/src/main/java/com/reajason/javaweb/memshell/injector/bes/BesListenerInjector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public BesListenerInjector() {
3636
} catch (Throwable throwable) {
3737
msg += "context error: " + getErrorMessage(throwable);
3838
}
39-
if (contexts == null) {
39+
if (contexts == null || contexts.isEmpty()) {
4040
msg += "context not found";
4141
} else {
4242
for (Object context : contexts) {

generator/src/main/java/com/reajason/javaweb/memshell/injector/bes/BesValveInjector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public BesValveInjector() {
3535
} catch (Throwable throwable) {
3636
msg += "context error: " + getErrorMessage(throwable);
3737
}
38-
if (contexts == null) {
38+
if (contexts == null || contexts.isEmpty()) {
3939
msg += "context not found";
4040
} else {
4141
for (Object context : contexts) {

generator/src/main/java/com/reajason/javaweb/memshell/injector/glassfish/GlassFishFilterInjector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public GlassFishFilterInjector() {
4343
} catch (Throwable throwable) {
4444
msg += "context error: " + getErrorMessage(throwable);
4545
}
46-
if (contexts == null) {
46+
if (contexts == null || contexts.isEmpty()) {
4747
msg += "context not found";
4848
} else {
4949
for (Object context : contexts) {

generator/src/main/java/com/reajason/javaweb/memshell/injector/glassfish/GlassFishValveInjector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public GlassFishValveInjector() {
3636
} catch (Throwable throwable) {
3737
msg += "context error: " + getErrorMessage(throwable);
3838
}
39-
if (contexts == null) {
39+
if (contexts == null || contexts.isEmpty()) {
4040
msg += "context not found";
4141
} else {
4242
for (Object context : contexts) {

generator/src/main/java/com/reajason/javaweb/memshell/injector/inforsuite/InforSuiteFilterInjector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public InforSuiteFilterInjector() {
4141
} catch (Throwable throwable) {
4242
msg += "context error: " + getErrorMessage(throwable);
4343
}
44-
if (contexts == null) {
44+
if (contexts == null || contexts.isEmpty()) {
4545
msg += "context not found";
4646
} else {
4747
for (Object context : contexts) {
@@ -95,7 +95,7 @@ public Set<Object> getContext() throws Exception {
9595
return contexts;
9696
}
9797

98-
private ClassLoader getWebAppClassLoader(Object context) {
98+
private ClassLoader getWebAppClassLoader(Object context) throws Exception {
9999
try {
100100
return ((ClassLoader) invokeMethod(context, "getClassLoader", null, null));
101101
} catch (Exception e) {

generator/src/main/java/com/reajason/javaweb/memshell/injector/jetty/JettyFilterInjector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public JettyFilterInjector() {
4242
} catch (Throwable throwable) {
4343
msg += "context error: " + getErrorMessage(throwable);
4444
}
45-
if (contexts == null) {
45+
if (contexts == null || contexts.isEmpty()) {
4646
msg += "context not found";
4747
} else {
4848
for (Object context : contexts) {

0 commit comments

Comments
 (0)