You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had searched in the issues and found no similar issues.
Enhancement Request
located at:
eventmesh-storage-plugin/eventmesh-storage-standalone/src/main/java/org/apache/eventmesh/storage/standalone/broker/MessageQueue.java line 32,68,87,105,129,152,178,
eventmesh-storage-plugin/eventmesh-storage-standalone/src/test/java/org/apache/eventmesh/storage/standalone/broker/MessageQueueTest.java line 46,53,60,67,74,81,94
analysis and explanation:
a. Public class variable fields do not respect the encapsulation principle and has three main disadvantages:
Additional behavior such as validation cannot be added.
The internal representation is exposed, and cannot be changed afterwards.
Member values are subject to change from anywhere in the code and may not meet the programmer’s assumptions.
By using private attributes and accessor methods (set and get), unauthorized modifications are prevented.
b. Overriding or shadowing a variable declared in an outer scope can strongly impact the readability, and therefore the maintainability, of a piece of code. Further, it could lead maintainers to introduce bugs because they think they’re using one variable but are really using another.
Describe the solution you'd like
a. Change to use the private final modifier.
b. 'lock' rename.
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Search before asking
Enhancement Request
located at:
eventmesh-storage-plugin/eventmesh-storage-standalone/src/main/java/org/apache/eventmesh/storage/standalone/broker/MessageQueue.java line 32,68,87,105,129,152,178,
eventmesh-storage-plugin/eventmesh-storage-standalone/src/test/java/org/apache/eventmesh/storage/standalone/broker/MessageQueueTest.java line 46,53,60,67,74,81,94
analysis and explanation:
a. Public class variable fields do not respect the encapsulation principle and has three main disadvantages:
Additional behavior such as validation cannot be added.
The internal representation is exposed, and cannot be changed afterwards.
Member values are subject to change from anywhere in the code and may not meet the programmer’s assumptions.
By using private attributes and accessor methods (set and get), unauthorized modifications are prevented.
b. Overriding or shadowing a variable declared in an outer scope can strongly impact the readability, and therefore the maintainability, of a piece of code. Further, it could lead maintainers to introduce bugs because they think they’re using one variable but are really using another.
Describe the solution you'd like
a. Change to use the private final modifier.



b. 'lock' rename.

Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: