Skip to content

Commit a9c828f

Browse files
authored
Switched newProxyInstance to the correct class (#539)
1 parent f87bae2 commit a9c828f

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/main/java/com/uber/cadence/internal/sync/ActivityInvocationHandlerBase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
2+
* Modifications Copyright (c) 2017-2020 Uber Technologies Inc.
3+
* Portions of the Software are attributed to Copyright (c) 2020 Temporal Technologies Inc.
24
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
35
*
4-
* Modifications copyright (C) 2017 Uber Technologies, Inc.
5-
*
66
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
77
* use this file except in compliance with the License. A copy of the License is
88
* located at
@@ -40,7 +40,7 @@ abstract class ActivityInvocationHandlerBase implements InvocationHandler {
4040
static <T> T newProxy(Class<T> activityInterface, InvocationHandler invocationHandler) {
4141
return (T)
4242
Proxy.newProxyInstance(
43-
WorkflowInternal.class.getClassLoader(),
43+
activityInterface.getClassLoader(),
4444
new Class<?>[] {activityInterface, AsyncMarker.class},
4545
invocationHandler);
4646
}

src/main/java/com/uber/cadence/internal/sync/WorkflowClientInternal.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
2+
* Modifications Copyright (c) 2017-2020 Uber Technologies Inc.
3+
* Portions of the Software are attributed to Copyright (c) 2020 Temporal Technologies Inc.
24
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
35
*
4-
* Modifications copyright (C) 2017 Uber Technologies, Inc.
5-
*
66
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
77
* use this file except in compliance with the License. A copy of the License is
88
* located at
@@ -160,7 +160,7 @@ public <T> T newWorkflowStub(Class<T> workflowInterface, WorkflowOptions options
160160
workflowInterface, genericClient, options, dataConverter, interceptors);
161161
return (T)
162162
Proxy.newProxyInstance(
163-
WorkflowInternal.class.getClassLoader(),
163+
workflowInterface.getClassLoader(),
164164
new Class<?>[] {workflowInterface},
165165
invocationHandler);
166166
}
@@ -213,7 +213,7 @@ public <T> T newWorkflowStub(
213213
T result =
214214
(T)
215215
Proxy.newProxyInstance(
216-
WorkflowInternal.class.getClassLoader(),
216+
workflowInterface.getClassLoader(),
217217
new Class<?>[] {workflowInterface},
218218
invocationHandler);
219219
return result;

src/main/java/com/uber/cadence/internal/sync/WorkflowInternal.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
2+
* Modifications Copyright (c) 2017-2020 Uber Technologies Inc.
3+
* Portions of the Software are attributed to Copyright (c) 2020 Temporal Technologies Inc.
24
* Copyright 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
35
*
4-
* Modifications copyright (C) 2017 Uber Technologies, Inc.
5-
*
66
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
77
* use this file except in compliance with the License. A copy of the License is
88
* located at
@@ -179,7 +179,7 @@ public static <T> T newChildWorkflowStub(
179179
Class<T> workflowInterface, ChildWorkflowOptions options) {
180180
return (T)
181181
Proxy.newProxyInstance(
182-
WorkflowInternal.class.getClassLoader(),
182+
workflowInterface.getClassLoader(),
183183
new Class<?>[] {workflowInterface, WorkflowStubMarker.class, AsyncMarker.class},
184184
new ChildWorkflowInvocationHandler(
185185
workflowInterface, options, getWorkflowInterceptor()));
@@ -190,7 +190,7 @@ public static <T> T newExternalWorkflowStub(
190190
Class<T> workflowInterface, WorkflowExecution execution) {
191191
return (T)
192192
Proxy.newProxyInstance(
193-
WorkflowInternal.class.getClassLoader(),
193+
workflowInterface.getClassLoader(),
194194
new Class<?>[] {workflowInterface, WorkflowStubMarker.class, AsyncMarker.class},
195195
new ExternalWorkflowInvocationHandler(execution, getWorkflowInterceptor()));
196196
}
@@ -222,7 +222,7 @@ public static <T> T newContinueAsNewStub(
222222
Class<T> workflowInterface, ContinueAsNewOptions options) {
223223
return (T)
224224
Proxy.newProxyInstance(
225-
WorkflowInternal.class.getClassLoader(),
225+
workflowInterface.getClassLoader(),
226226
new Class<?>[] {workflowInterface},
227227
new ContinueAsNewWorkflowInvocationHandler(options, getWorkflowInterceptor()));
228228
}

0 commit comments

Comments
 (0)