Skip to content

Commit

Permalink
Merge branch '3.3' into dependabot/maven/io.micrometer-micrometer-bom…
Browse files Browse the repository at this point in the history
…-1.13.6
  • Loading branch information
AlbumenJ authored Oct 22, 2024
2 parents ff903a1 + 542479b commit 8fc7d44
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ jobs:
strategy:
fail-fast: false
env:
ZOOKEEPER_VERSION: 3.7.3
ZOOKEEPER_VERSION: 3.7.2
steps:
- name: "Cache zookeeper binary archive"
uses: actions/cache@v3
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
env:
DISABLE_FILE_SYSTEM_TEST: true
CURRENT_ROLE: ${{ matrix.case-role }}
ZOOKEEPER_VERSION: 3.7.3
ZOOKEEPER_VERSION: 3.7.2
steps:
- name: "Checkout code"
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-scheduled-3.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
matrix:
os: [ ubuntu-latest, windows-latest ]
env:
ZOOKEEPER_VERSION: 3.7.3
ZOOKEEPER_VERSION: 3.7.2
steps:
- uses: actions/cache@v3
name: "Cache zookeeper binary archive"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-scheduled-3.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
matrix:
os: [ ubuntu-latest, windows-latest ]
env:
ZOOKEEPER_VERSION: 3.7.3
ZOOKEEPER_VERSION: 3.7.2
steps:
- uses: actions/cache@v3
name: "Cache zookeeper binary archive"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-scheduled-3.3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
matrix:
os: [ ubuntu-latest, windows-latest ]
env:
ZOOKEEPER_VERSION: 3.7.3
ZOOKEEPER_VERSION: 3.7.2
steps:
- uses: actions/cache@v3
name: "Cache zookeeper binary archive"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
matrix:
os: [ ubuntu-latest, windows-latest ]
env:
ZOOKEEPER_VERSION: 3.7.3
ZOOKEEPER_VERSION: 3.7.2
steps:
- uses: actions/cache@v3
name: "Cache zookeeper binary archive"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.dubbo.rpc.model.StubMethodDescriptor;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class MethodMetadata {

Expand Down Expand Up @@ -64,18 +65,18 @@ private static MethodMetadata doResolveReflection(ReflectionMethodDescriptor met
case CLIENT_STREAM:
case BI_STREAM:
actualRequestTypes = new Class<?>[] {
(Class<?>)
((ParameterizedType) method.getMethod().getGenericReturnType()).getActualTypeArguments()[0]
obtainActualTypeInStreamObserver(
((ParameterizedType) method.getMethod().getGenericReturnType()).getActualTypeArguments()[0])
};
actualResponseType =
(Class<?>) ((ParameterizedType) method.getMethod().getGenericParameterTypes()[0])
.getActualTypeArguments()[0];
actualResponseType = obtainActualTypeInStreamObserver(
((ParameterizedType) method.getMethod().getGenericParameterTypes()[0])
.getActualTypeArguments()[0]);
return new MethodMetadata(actualRequestTypes, actualResponseType);
case SERVER_STREAM:
actualRequestTypes = new Class[] {method.getMethod().getParameterTypes()[0]};
actualResponseType =
(Class<?>) ((ParameterizedType) method.getMethod().getGenericParameterTypes()[1])
.getActualTypeArguments()[0];
actualResponseType = obtainActualTypeInStreamObserver(
((ParameterizedType) method.getMethod().getGenericParameterTypes()[1])
.getActualTypeArguments()[0]);
return new MethodMetadata(actualRequestTypes, actualResponseType);
case UNARY:
actualRequestTypes = method.getParameterClasses();
Expand All @@ -84,4 +85,11 @@ private static MethodMetadata doResolveReflection(ReflectionMethodDescriptor met
}
throw new IllegalStateException("Can not reach here");
}

static Class<?> obtainActualTypeInStreamObserver(Type typeInStreamObserver) {
return (Class<?>)
(typeInStreamObserver instanceof ParameterizedType
? ((ParameterizedType) typeInStreamObserver).getRawType()
: typeInStreamObserver);
}
}

0 comments on commit 8fc7d44

Please sign in to comment.