Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: EE-3.0.0.GA, 3.1
-
Fix Version/s: EE-3.0.0.GA_P01, 3.2
-
Component/s: Framework
-
Labels:None
-
Environment:N/A
Description
Currently DomBasicRenderer.java class does not support detection of global String converters in an application. It is designed in such way that it always returns a String value before detecting a global custom String converter. (line 205@ DomBasicRenderer.java)
201 if (converter == null) {
202 if (currentValue == null) {
203 return "";
204 } else if (currentValue instanceof String) {
205 return (String) currentValue;
206 }
207
208 converter = getConverterForClass(currentValue.getClass());
209
210 if (converter == null) {
211 return currentValue.toString();
212 }
213 }
a fix below is proposed by one of our clients to allow detection of such converters in application:
...
if (converter == null) {
if (currentValue == null) {
return "";
} else if (currentValue instanceof String) {
// Addition for global String converter detection.
converter = getConverterForClass(currentValue.getClass());
if (converter == null) {
return (String) currentValue;
} else {
return converter.getAsString(facesContext, uiComponent, currentValue);
}
}
converter = getConverterForClass(currentValue.getClass());
if (converter == null) {
return currentValue.toString();
}
}
...
We need to review proposed fix and determine if it can be safely incorporated into our code.
201 if (converter == null) {
202 if (currentValue == null) {
203 return "";
204 } else if (currentValue instanceof String) {
205 return (String) currentValue;
206 }
207
208 converter = getConverterForClass(currentValue.getClass());
209
210 if (converter == null) {
211 return currentValue.toString();
212 }
213 }
a fix below is proposed by one of our clients to allow detection of such converters in application:
...
if (converter == null) {
if (currentValue == null) {
return "";
} else if (currentValue instanceof String) {
// Addition for global String converter detection.
converter = getConverterForClass(currentValue.getClass());
if (converter == null) {
return (String) currentValue;
} else {
return converter.getAsString(facesContext, uiComponent, currentValue);
}
}
converter = getConverterForClass(currentValue.getClass());
if (converter == null) {
return currentValue.toString();
}
}
...
We need to review proposed fix and determine if it can be safely incorporated into our code.
Activity
Evgheni Sadovoi
created issue -
Evgheni Sadovoi
made changes -
Field | Original Value | New Value |
---|---|---|
Salesforce Case | [5007000000NGgTm] |
Evgheni Sadovoi
made changes -
Description |
Currently DomBasicRenderer.java class does not support multiple spaces in a String: 201 if (converter == null) { 202 if (currentValue == null) { 203 return ""; 204 } else if (currentValue instanceof String) { 205 return (String) currentValue; 206 } 207 208 converter = getConverterForClass(currentValue.getClass()); 209 210 if (converter == null) { 211 return currentValue.toString(); 212 } 213 } a fix below is proposed to fix it: ... if (converter == null) { if (currentValue == null) { return ""; } else if (currentValue instanceof String) { // Additional overriding for ATOM String converter. // TODO : Remove it later. converter = getConverterForClass(currentValue.getClass()); if (converter == null) { return (String) currentValue; } else { return converter.getAsString(facesContext, uiComponent, currentValue); } } converter = getConverterForClass(currentValue.getClass()); if (converter == null) { return currentValue.toString(); } } ... NOTE: This JIRA is under construction. I will update it once I get more feedback from a client. |
Currently DomBasicRenderer.java class does not support detection of global String converters in an application. It is designed in such way that it is always returns String value before detecting a global custom String converter. (line 205@ . DomBasicRenderer.java) 201 if (converter == null) { 202 if (currentValue == null) { 203 return ""; 204 } else if (currentValue instanceof String) { 205 return (String) currentValue; 206 } 207 208 converter = getConverterForClass(currentValue.getClass()); 209 210 if (converter == null) { 211 return currentValue.toString(); 212 } 213 } a fix below is proposed to allow detection of such converters in application: ... if (converter == null) { if (currentValue == null) { return ""; } else if (currentValue instanceof String) { // Additional overriding for ATOM String converter. // TODO : Remove it later. converter = getConverterForClass(currentValue.getClass()); if (converter == null) { return (String) currentValue; } else { return converter.getAsString(facesContext, uiComponent, currentValue); } } converter = getConverterForClass(currentValue.getClass()); if (converter == null) { return currentValue.toString(); } } ... We need to review proposed fix and determine if it can be safely incorporated into our code. |
Evgheni Sadovoi
made changes -
Description |
Currently DomBasicRenderer.java class does not support detection of global String converters in an application. It is designed in such way that it is always returns String value before detecting a global custom String converter. (line 205@ . DomBasicRenderer.java) 201 if (converter == null) { 202 if (currentValue == null) { 203 return ""; 204 } else if (currentValue instanceof String) { 205 return (String) currentValue; 206 } 207 208 converter = getConverterForClass(currentValue.getClass()); 209 210 if (converter == null) { 211 return currentValue.toString(); 212 } 213 } a fix below is proposed to allow detection of such converters in application: ... if (converter == null) { if (currentValue == null) { return ""; } else if (currentValue instanceof String) { // Additional overriding for ATOM String converter. // TODO : Remove it later. converter = getConverterForClass(currentValue.getClass()); if (converter == null) { return (String) currentValue; } else { return converter.getAsString(facesContext, uiComponent, currentValue); } } converter = getConverterForClass(currentValue.getClass()); if (converter == null) { return currentValue.toString(); } } ... We need to review proposed fix and determine if it can be safely incorporated into our code. |
Currently DomBasicRenderer.java class does not support detection of global String converters in an application. It is designed in such way that it always returns a String value before detecting a global custom String converter. (line 205@ DomBasicRenderer.java) 201 if (converter == null) { 202 if (currentValue == null) { 203 return ""; 204 } else if (currentValue instanceof String) { 205 return (String) currentValue; 206 } 207 208 converter = getConverterForClass(currentValue.getClass()); 209 210 if (converter == null) { 211 return currentValue.toString(); 212 } 213 } a fix below is proposed by one of our clients to allow detection of such converters in application: ... if (converter == null) { if (currentValue == null) { return ""; } else if (currentValue instanceof String) { // Addition for global String converter detection. converter = getConverterForClass(currentValue.getClass()); if (converter == null) { return (String) currentValue; } else { return converter.getAsString(facesContext, uiComponent, currentValue); } } converter = getConverterForClass(currentValue.getClass()); if (converter == null) { return currentValue.toString(); } } ... We need to review proposed fix and determine if it can be safely incorporated into our code. |
Evgheni Sadovoi
made changes -
Issue Type | Improvement [ 4 ] | Bug [ 1 ] |
Ken Fyten
made changes -
Fix Version/s | EE-3.0.0.GA_P01 [ 10327 ] | |
Fix Version/s | 3.2 [ 10338 ] | |
Assignee Priority | P1 | |
Affects Version/s | 3.1 [ 10312 ] | |
Affects Version/s | 3.1.0.RC1 [ 10337 ] | |
Assignee | Deryk Sinotte [ deryk.sinotte ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #30537 | Thu Aug 16 15:31:13 MDT 2012 | deryk.sinotte | |
Files Changed | ||||
MODIFY
/icefaces3/branches/icefaces-3.0.x-maintenance/icefaces/compat/core/src/main/java/com/icesoft/faces/renderkit/dom_html_basic/DomBasicRenderer.java
|
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #30538 | Thu Aug 16 15:35:15 MDT 2012 | deryk.sinotte | |
Files Changed | ||||
MODIFY
/icefaces3/trunk/icefaces/compat/core/src/main/java/com/icesoft/faces/renderkit/dom_html_basic/DomBasicRenderer.java
|
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #30540 | Thu Aug 16 15:49:57 MDT 2012 | deryk.sinotte | |
Files Changed | ||||
MODIFY
/icefaces3/trunk/icefaces/compat/core/src/main/java/com/icesoft/faces/renderkit/dom_html_basic/DomBasicRenderer.java
|
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #30541 | Thu Aug 16 15:50:08 MDT 2012 | deryk.sinotte | |
Files Changed | ||||
MODIFY
/icefaces3/branches/icefaces-3.0.x-maintenance/icefaces/compat/core/src/main/java/com/icesoft/faces/renderkit/dom_html_basic/DomBasicRenderer.java
|
Deryk Sinotte
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee Priority | P1 [ 10010 ] |
I reviewed the change and the relevant section of the code. It looks reasonable to me. I changed the logic a bit to make it easier to follow and get rid of the repetitive bits:
197
{ 203 return converter.getAsString(facesContext, uiComponent, currentValue); 204 }198 // look to see whether there is a converter registered with the component
199 Converter converter = ((ValueHolder) uiComponent).getConverter();
200
201 // if there is a converter, then use it
202 if( converter != null )
205
206 // if there was no converter registered with the component then
207 // look for the converter associated with the class of the currentValue
208 String ret = "";
209 if (currentValue != null) {
210 converter = getConverterForClass(currentValue.getClass());
211 if (converter != null)
else
{ 214 ret = currentValue.toString(); 215 }216 }
217 return ret;
218 }
I'll await the test case before committing to branch and trunk?