apache / apache/dubbo-spi-extensions

bug report: org.apache.dubbo.remoting.etcd.option.OptionUtil prefixEndOf

Open
#80 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
206
Forks
121
PR merge metrics
No merged PRs in 30d

Description

code branch : master
file : org.apache.dubbo.remoting.etcd.option.OptionUtil prefixEndOf
line :32
https://github.com/apache/dubbo/blob/84d355fb1b553c7c5f01357069b13d434f60e53c/dubbo-remoting/dubbo-remoting-etcd3/src/main/java/org/apache/dubbo/remoting/etcd/option/OptionUtil.java#L32
commit message 👍
[Dubbo-808] Support etcd registry (#3605) * Merge https://github.com/dubbo/dubbo-registry-etcd into incubator-dubbo * Add UT to ConfigurationUtilsTest

code:
public static final ByteSequence prefixEndOf(ByteSequence prefix) {
byte[] endKey = prefix.getBytes().clone();
for (int i = endKey.length - 1; i >= 0; i--) {
if (endKey[i] < 0xff) { //which is always true, please fix it
endKey[i] = (byte) (endKey[i] + 1);
return ByteSequence.from(Arrays.copyOf(endKey, i + 1));
}
}
return ByteSequence.from(NO_PREFIX_END);
}

Contributor guide

Open the contributing guide

Research direction

Start in dubbo-remoting/dubbo-remoting-etcd3/src/main/java/org/apache/dubbo/remoting/etcd/option/OptionUtil.java at line 32 and inspect prefixEndOf. Check the byte comparison and the expected prefix-end behavior, then verify the change against the surrounding etcd option handling. The issue does not name a test or specify the intended replacement behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.