aledsage commented on a change in pull request #1046: allow the types of 
parameters to be extended programmatically
URL: https://github.com/apache/brooklyn-server/pull/1046#discussion_r258418699
 
 

 ##########
 File path: 
utils/common/src/main/java/org/apache/brooklyn/util/javalang/coerce/CommonAdaptorTryCoercions.java
 ##########
 @@ -46,16 +46,16 @@ public CommonAdaptorTryCoercions(TypeCoercerExtensible 
coercer) {
     }
 
     public CommonAdaptorTryCoercions registerAllAdapters() {
-        registerAdapter(new TryCoercerWithFromMethod());
-        registerAdapter(new TryCoercerToEnum());
-        registerAdapter(new TryCoercerToArray(coercer));
-        registerAdapter(new TryCoercerForPrimitivesAndStrings());
+        registerAdapter("11-with-from-method", new TryCoercerWithFromMethod());
+        registerAdapter("12-enum", new TryCoercerToEnum());
+        registerAdapter("13-toArray", new TryCoercerToArray(coercer));
+        registerAdapter("15-primitives", new 
TryCoercerForPrimitivesAndStrings());
 
 Review comment:
   On balance, I agree with this.
   
   However, looking at the code the numbers feel hard to understand - e.g. why 
is 14 missing, is that important or a distraction. Might any other class have 
also claimed the 10s? If another class is added that calls registerAdapter, how 
to know whether something has already claimed the 10s, 20s, 30s, etc.
   
   Where such numbering conventions work well, I think everything with those 
numbers is in a common place (e.g. init.d type of things), so you can tell at a 
glance if there is a conflict and where your number fits into the sequence.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to