-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing CiperSuiteId from single to multiple resource #1404
Changing CiperSuiteId from single to multiple resource #1404
Conversation
leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapConfig.java
Outdated
Show resolved
Hide resolved
leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapConfig.java
Show resolved
Hide resolved
leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapConfig.java
Outdated
Show resolved
Hide resolved
leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapConfig.java
Outdated
Show resolved
Hide resolved
leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapConfig.java
Outdated
Show resolved
Hide resolved
leshan-core/src/main/java/org/eclipse/leshan/core/node/LwM2mSingleResource.java
Outdated
Show resolved
Hide resolved
leshan-core/src/main/java/org/eclipse/leshan/core/node/LwM2mSingleResource.java
Outdated
Show resolved
Hide resolved
About the title of the PR, better to find a title explaining the content of the PR instead of name of your branch. About the description, this seems to not really describe the content of the PR (by the way it point to an issue which doesn't exist) About your git config, you still don't change your it like asked at (#1326 (comment), #1377 (comment)) Do not hesitate to ask for help (to me or maybe @JaroslawLegierski), if you face any issue. |
I looked at you last commit, still some (new?) unnecessary comment format changes. |
This moves forward 🙂 but still missing some point :
Like I said at #1402 (comment) , maybe javadoc could be a bit improved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments about javadoc.
You should also review your PR, I guess you will find some unexpected code changes. 🙂
leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapConfig.java
Outdated
Show resolved
Hide resolved
leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapConfig.java
Outdated
Show resolved
Hide resolved
leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapConfig.java
Outdated
Show resolved
Hide resolved
leshan-server-core/src/main/java/org/eclipse/leshan/server/bootstrap/BootstrapConfig.java
Outdated
Show resolved
Hide resolved
String binaryString = Long.toBinaryString(valueFromSecurityObject.longValue()); | ||
this.firstByte = (byte) Integer.parseInt(binaryString.substring(0, 8), 2); | ||
this.secondByte = (byte) Integer.parseInt(binaryString.substring(9, 17), 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using String is maybe not the best idea.
Should be better to play with binary operator like :
- shift operator :
>>
You can create unit test to check your code.
We should also check that valueFromSecurityObject
is a 16-bit unsigned integer.
* @return Integer number concatenated from 2 bytes. | ||
*/ | ||
public ULong getValueForSecurityObject() { | ||
return ULong.valueOf(Byte.toUnsignedInt(firstByte) * 256 + Byte.toUnsignedInt(secondByte)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using floating point number and multiplication are maybe not best idea.
Should be better to play with binary operator like :
- bitMask operator :
&
- binary notation : 0b00000
- shift operator :
<<
You can create unit test to check your code.
You didn't work on it ? is it on purpose ?
Do you plan to create junit test about it ? (mainly to test conversion and bad inputs) Tell me when you reviewed your own code and consider I need to review it again. 🙂 |
ℹ️ Some tips :
If documentation or those automatic comments are not clear enough, please create a new issue to discus about how to enhance it. |
❌ Java Import are not sorted ! (more details) Ensure your code build locally using:
Or just validate java import with :
You can sort Java import with :
See also How configure your IDE. |
@Warmek ignore the I don't get it locally, I don't understand the problem for now 😬 |
Let me know when you review your code and you satisfy about it and so it is ready for a review. You could do that by posting a comment or requesting a review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbernard31 I reviewed changes and there seems to be no issues. Let me know what you think about it
Changing CipherSuiteId field in BootstrapConfig.java from single resource to multiple resource as to match OMA specification.
It aims to implement #1402