Skip to content

Commit 903da5b

Browse files
Revert fix/loadworkerjars
1 parent 09ffbaf commit 903da5b

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

src/main/java/com/microsoft/azure/functions/worker/broker/JavaFunctionBroker.java

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -89,33 +89,7 @@ public Map<String, TypedData> getTriggerMetadataMap(InvocationRequest request) {
8989
private void addSearchPathsToClassLoader(FunctionMethodDescriptor function) throws IOException {
9090
URL jarUrl = new File(function.getJarPath()).toURI().toURL();
9191
classLoaderProvider.addUrl(jarUrl);
92-
if(function.getLibDirectory().isPresent()) {
93-
registerWithClassLoaderProvider(function.getLibDirectory().get());
94-
} else {
95-
registerWithClassLoaderProviderWorkerLibOnly();
96-
}
97-
}
98-
99-
void registerWithClassLoaderProviderWorkerLibOnly() {
100-
try {
101-
if(SystemUtils.IS_JAVA_1_8 && !isTesting()) {
102-
String workerLibPath = System.getenv(Constants.FUNCTIONS_WORKER_DIRECTORY) + "/lib";
103-
File workerLib = new File(workerLibPath);
104-
verifyLibrariesExist (workerLib, workerLibPath);
105-
classLoaderProvider.addDirectory(workerLib);
106-
}
107-
} catch (Exception ex) {
108-
ExceptionUtils.rethrow(ex);
109-
}
110-
}
111-
112-
private boolean isTesting(){
113-
if(System.getProperty("azure.functions.worker.java.skip.testing") != null
114-
&& System.getProperty("azure.functions.worker.java.skip.testing").equals("true")) {
115-
return true;
116-
} else {
117-
return false;
118-
}
92+
function.getLibDirectory().ifPresent(d -> registerWithClassLoaderProvider(d));
11993
}
12094

12195
void registerWithClassLoaderProvider(File libDirectory) {

src/test/java/com/microsoft/azure/functions/worker/functional/tests/SimpleParamReturnTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public String ReturnStringFunction() {
2828
@Test
2929
public void testStringData() throws Exception {
3030
stringReturnValue = stringInput;
31-
System.setProperty("azure.functions.worker.java.skip.testing", "true");
3231
try (FunctionsTestHost host = new FunctionsTestHost()) {
3332
this.loadFunction(host, "returnStringTestId", "ReturnStringFunction");
3433
InvocationResponse stringResponse = host.call("getret", "returnStringTestId");

0 commit comments

Comments
 (0)