Martin Mucha has posted comments on this change.

Change subject: userportal,webadmin:change Translator to interface
......................................................................


Patch Set 3:

(4 comments)

http://gerrit.ovirt.org/#/c/26596/3/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/EnumTranslator.java
File 
frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/EnumTranslator.java:

Line 23:     @Override
Line 24:     public String translate(Enum<?> key) {
Line 25:         if(key == null) {
Line 26:             logger.log(Level.INFO, "trying to localize null, probable 
error. " +
Line 27:                     "Exception is not thrown, returning '"+ 
constants.notAvailableLabel()+"'", new RuntimeException());
> Why do you add the RuntimeException() parameter?
I think, that in development mode it will give you stacktrace. Since when 
somebody tries to localize 'null' it does not help you much.
I'm not sure if anybody else would like this. I can remove it.
Line 28:             return constants.notAvailableLabel();
Line 29:         }
Line 30: 
Line 31:         try {


Line 41:         return notLocalizedKey(key, null);
Line 42:     }
Line 43: 
Line 44:     private String notLocalizedKey(Enum<?> key, 
MissingResourceException e) {
Line 45:          String logString = "Missing Enum resource '" + key + "'.";    
 //$NON-NLS-1$
> redundant spaces before the NLS comment.
Done
Line 46:         if (e != null) {
Line 47:             logString += e.getLocalizedMessage();
Line 48:         }
Line 49: 


Line 43: 
Line 44:     private String notLocalizedKey(Enum<?> key, 
MissingResourceException e) {
Line 45:          String logString = "Missing Enum resource '" + key + "'.";    
 //$NON-NLS-1$
Line 46:         if (e != null) {
Line 47:             logString += e.getLocalizedMessage();
> logString += " " + e.getLocalizedMessage();
Done
Line 48:         }
Line 49: 
Line 50:         logger.info(logString);
Line 51:         return key.name();


Line 47:             logString += e.getLocalizedMessage();
Line 48:         }
Line 49: 
Line 50:         logger.info(logString);
Line 51:         return key.name();
> Please run formatter on this method.
Done
Line 52:     }
Line 53: 
Line 54:     private String keyToTranslate(Enum<?> key) {
Line 55:         String className = key.getDeclaringClass().toString();


-- 
To view, visit http://gerrit.ovirt.org/26596
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib018c1faf0c2e1ebaa81217d5e3696d9c8de20cf
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Martin Mucha <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to