Skip to content

Commit 7e93c94

Browse files
committed
修复spotbugs问题
1 parent 9c4c695 commit 7e93c94

File tree

4 files changed

+10
-7
lines changed
  • demo
    • demo-cse-v1/test-client/src/main/java/org/apache/servicecomb/samples
    • demo-spring-boot-transport/demo-spring-boot-pojo-client/src/main/java/org/apache/servicecomb/demo/pojo/client
    • demo-zeroconfig-schemadiscovery-registry/demo-zeroconfig-schemadiscovery-registry-server/src/main/java/org/apache/servicecomb/demo/zeroconfig/server

4 files changed

+10
-7
lines changed

demo/demo-cse-v1/test-client/src/main/java/org/apache/servicecomb/samples/HelloWorldIT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ private void testHelloWorldNoHeader() {
119119
}
120120
}
121121

122-
double ratio = oldCount / (float) (oldCount + newCount);
123-
TestMgr.check(ratio == 0.5, true);
122+
TestMgr.check(oldCount == newCount, true);
124123
}
125124

126125
private void testHelloWorldEmptyProtectionCloseWeight100() {

demo/demo-spring-boot-transport/demo-spring-boot-pojo-client/src/main/java/org/apache/servicecomb/demo/pojo/client/PojoClientTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ public class PojoClientTest {
4040
@RpcReference(microserviceName = "pojo")
4141
public static Test test;
4242

43-
public static Test testFromXml;
43+
private static Test testFromXml;
4444

45-
public static final byte[] buffer = new byte[1024];
45+
private static final byte[] buffer = new byte[1024];
4646

47-
public static final String SPLITPARAM_RESPONSE_USER_SUFFIX = "(modified by MyHandler)";
47+
private static final String SPLITPARAM_RESPONSE_USER_SUFFIX = "(modified by MyHandler)";
4848

4949
static {
5050
Arrays.fill(buffer, (byte) 1);

demo/demo-zeroconfig-schemadiscovery-registry/demo-zeroconfig-schemadiscovery-registry-server/src/main/java/org/apache/servicecomb/demo/zeroconfig/server/SelfServiceInvoker.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@ interface IServerEndpoint {
3333

3434
public CountDownLatch latch = new CountDownLatch(1);
3535

36-
public String result = "";
36+
private String result = "";
3737

3838
public void onAfterRegistry(BootEvent event) {
3939
result = endpoint.getName("hello");
4040
latch.countDown();
4141
}
42+
43+
public String getResult() {
44+
return result;
45+
}
4246
}

demo/demo-zeroconfig-schemadiscovery-registry/demo-zeroconfig-schemadiscovery-registry-server/src/main/java/org/apache/servicecomb/demo/zeroconfig/server/ServerApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static void main(final String[] args) throws Exception {
3333

3434
SelfServiceInvoker invoker = BeanUtils.getBean("SelfServiceInvoker");
3535
invoker.latch.await(10, TimeUnit.SECONDS);
36-
TestMgr.check(invoker.result, "hello");
36+
TestMgr.check(invoker.getResult(), "hello");
3737

3838
TestMgr.summary();
3939
if (!TestMgr.errors().isEmpty()) {

0 commit comments

Comments
 (0)