[jira] [Commented] (TRINIDAD-2172) pseudo classes missing from CSSGenerationUtils
[ https://issues.apache.org/jira/browse/TRINIDAD-2172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13410079#comment-13410079 ] Anand V Nath commented on TRINIDAD-2172: Please use jira-2172-nested-pseudo.patch to commit instead of jira-2172-not-pseudo-fix.patch pseudo classes missing from CSSGenerationUtils -- Key: TRINIDAD-2172 URL: https://issues.apache.org/jira/browse/TRINIDAD-2172 Project: MyFaces Trinidad Issue Type: Improvement Components: Skinning Affects Versions: 2.0.0-core Reporter: Jeremy C. Hull Assignee: Scott O'Bryan Fix For: 2.0.1-core Attachments: bug-13253267-3.patch, jira-2172-nested-pseudo.patch, jira-2172-not-pseudo-fix.patch Only the following built-in pseudo classes are handled _BUILT_IN_PSEUDO_CLASSES.add(:first-child); _BUILT_IN_PSEUDO_CLASSES.add(:link); _BUILT_IN_PSEUDO_CLASSES.add(:visited); _BUILT_IN_PSEUDO_CLASSES.add(:hover); _BUILT_IN_PSEUDO_CLASSES.add(:active); _BUILT_IN_PSEUDO_CLASSES.add(:focus); There are a few CSS2.1 and a bunch of CSS3 pseudo classes that should be handled. first-letter, first-line, only-child, last-child, nth-child, nth-child-of-type, etc... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [VOTE] Release Tobago 1.5.7
+1 Am 07.07.12 00:44, schrieb Bernd Bohmann: Hello, I would like to release Tobago 1.5.7 For a detail list please consult the release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310273styleName=Htmlversion=12321444 The version is available at the nexus staging repository. Staging repository: https://repository.apache.org/content/repositories/orgapachemyfaces-037/ The Vote is open for 72h. [ ] +1 [ ] +0 [ ] -1 Regards Bernd
Re: [trinidad] javascript documentation using jsdoc
Hi Leo, also look at the myfaces core, I use the the jsdoc annotations extensively to describe our classes and methods. I am hiding the prototype construct there in favor of java like inheritance but I use the meta descriptions, for example: * @class * @name Messages_de * @extends myfaces._impl.i18n.Messages * @memberOf myfaces._impl.i18n */ _MF_CLS(_PFX_I18N + Messages_de, myfaces._impl.i18n.Messages, /** @lends myfaces._impl.i18n.Messages_de.prototype */ { This is a class myfaces._impl.Messages_de which extends myfaces._impl.i18n.Messages Problem there is jsdoc wont pick up the definitions in this case automatically (it probably will if you use straight prototype definitions) so I am giving it a helper push here by giving it some meta information * @class * @name Messages_de * @extends myfaces._impl.i18n.Messages * @memberOf myfaces._impl.i18n class the name of the class which class it extends and which namespace it is member of Since the methods and instance vars are described in a map I have to give jsdoc a helping hand there as well /** @lends myfaces._impl.i18n.Messages_de.prototype */ means that all definitions in the following map are mapped to myfaces._impl.i18n.Messages_de.prototype Not sure if you will need that in Trinidad since it seems to use raw prototype functionality and jsdoc is quite good at picking those things up, but i just wanted to add this info, in case you need it. Werner Am 06.07.12 11:01, schrieb Leonardo Uribe: Hi Blake, Yes that's exactly what I was looking for. So TrPanelPopup.prototype.getContent defines a non static method for thePopup.getContent(), the function TrPanelPopup() is the constructor and TrPanelPopup.staticGetContent is an static method from class TrPanelPopup. With that info, it shouldn't be hard to add the necessary annotations and generate the javascript documentation. regards, Leonardo Uribe 2012/7/5 Blake Sullivan blake.sulli...@oracle.com: Leonardo, I'm not sure what you are asking. Are you asking what prototype means in JavaScript? If that is what you are asking, then the quickie answer is that Javascript uses template-based inheritance. Every JS Object has a prototype property pointing to the instance that this JS Object will delegate to. Some JS frameworks simulate class-based inheritance by creating an instance representing a class and then making that instance the prototype of all of the instances of that class. Similarly a subclass would have it's superclass as its prototype. Putting this together: function TrPanelPopup() { //define object properties this._content = false; this._trigger = false; this._centered = false; this._modal = false; this._visible = false; } Is a constructor. new TrPanelPopup() would create an instance of TrPanelPopup. TrPanelPopup.prototype.getContent = function() Is assigning the getContent() function to the prototype of instances created through new TrPanelPopup(). getContent() ends up being similar to an instance method. You can also create something like a static method, like so: TrPanelPopup.staticGetContent = function() Notice the lack of the prototype. Callers would refer to this method (var myContent = TrPanelPopup.staticGetContent()) directly rather than through an instance: var thePopup = new TrPanelPopup(); var theContent = thePopup.getContent(); -- Blake Sullivan On 7/5/12 5:59 AM, Leonardo Uribe wrote: Hi I tried to add this to trinidad-impl pom.xml: profiles profile idgenerate-assembly/id build plugins plugin groupIdorg.apache.myfaces.buildtools/groupId artifactIdmyfaces-jsdoc-plugin/artifactId version1.0-beta-1/version executions execution idattach-jsdoc/id goals goaljar/goal /goals /execution /executions /plugin /plugins /build /profile /profiles It is the same we use in myfaces core to generate javascript doc. The good news is it works. We could add it as a report to generate it when the site is build or include it as a jar. But before do that, we need to add the proper jsdoc annotations. Unfortunately, I get lost in the pattern used to annotate classes. Does anybody knows which are the used code conventions in that part?. For example in TrPanelPopup for example: function TrPanelPopup() { //define object properties this._content = false; this._trigger = false; this._centered = false; this._modal = false; this._visible = false; } TrPanelPopup.prototype.getContent = function() What is prototype? the body of the class?. I think with the work already done to generate the jsdoc in myfaces core, generate the same info for trinidad is easy, but obviously jsdoc annotations are a little bit tricky. regards,
[jira] [Created] (TOBAGO-1172) Normalize filenames of the JavaScript and CSS resources
Udo Schnurpfeil created TOBAGO-1172: --- Summary: Normalize filenames of the JavaScript and CSS resources Key: TOBAGO-1172 URL: https://issues.apache.org/jira/browse/TOBAGO-1172 Project: MyFaces Tobago Issue Type: Task Reporter: Udo Schnurpfeil Assignee: Udo Schnurpfeil Priority: Minor JavaScript: calendar.js - tobago-calendar.js dateConverter.js - tobago-converter.js logging.js - tobago-logging.js CSS: style.css - tobago.css -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (TOBAGO-1173) Refactor Scripting of the Date/Time/Calender components
Udo Schnurpfeil created TOBAGO-1173: --- Summary: Refactor Scripting of the Date/Time/Calender components Key: TOBAGO-1173 URL: https://issues.apache.org/jira/browse/TOBAGO-1173 Project: MyFaces Tobago Issue Type: Task Components: Themes Reporter: Udo Schnurpfeil Assignee: Udo Schnurpfeil Priority: Minor - Using jQuery. - Removing Scripts and onXXX event handlers from the renderer classes. - using data-attributes (HTML5) instead of hidden fields. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (TOBAGO-616) DefaultCommand on subforms
[ https://issues.apache.org/jira/browse/TOBAGO-616?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Udo Schnurpfeil resolved TOBAGO-616. Resolution: Fixed Fix Version/s: 1.6.0-beta-1 1.6.0 DefaultCommand on subforms -- Key: TOBAGO-616 URL: https://issues.apache.org/jira/browse/TOBAGO-616 Project: MyFaces Tobago Issue Type: Improvement Components: Core Affects Versions: 1.0.14 Reporter: Rainer Rohloff Assignee: Udo Schnurpfeil Fix For: 1.6.0, 1.6.0-beta-1 Assume following situation on one page: tc:form ... tx:in label=Search value=#{searchBean.search}/ tc:button label=Search action=doSearch defaultCommand=true / /tc:form tc:form ... tx:in label=Name value=#{valueBean.name}/ tc:button label=New Customer action=doNew defaultCommand=true / /tc:form It would be nice to submit the focused form with the enter key. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (TOBAGO-1173) Refactor Scripting of the Date/Time/Calender components
[ https://issues.apache.org/jira/browse/TOBAGO-1173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Udo Schnurpfeil resolved TOBAGO-1173. - Resolution: Fixed Fix Version/s: 1.6.0 1.6.0-beta-3 Refactor Scripting of the Date/Time/Calender components --- Key: TOBAGO-1173 URL: https://issues.apache.org/jira/browse/TOBAGO-1173 Project: MyFaces Tobago Issue Type: Task Components: Themes Reporter: Udo Schnurpfeil Assignee: Udo Schnurpfeil Priority: Minor Fix For: 1.6.0-beta-3, 1.6.0 - Using jQuery. - Removing Scripts and onXXX event handlers from the renderer classes. - using data-attributes (HTML5) instead of hidden fields. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: Request for commit: JIRA issue TRINIDAD-2282
Thanks Scott. On 7/9/2012 10:45 PM, Scott O'Bryan wrote: Anshu, I'll try to review and commit this today. Sent from my iPhone On Jul 9, 2012, at 2:41 AM, Anshu Jain anshu.x.j...@oracle.com mailto:anshu.x.j...@oracle.com wrote: Hi, I have uploaded a patch for the JIRA bug TRINIDAD-2282 https://issues.apache.org/jira/browse/TRINIDAD-2282. Can someone among the commiters, please look into it and commit the patch. Thanks and Regards, Anshu
[jira] [Created] (EXTVAL-145) [perf] Cache renderer interceptors as list
Thomas Andraschko created EXTVAL-145: Summary: [perf] Cache renderer interceptors as list Key: EXTVAL-145 URL: https://issues.apache.org/jira/browse/EXTVAL-145 Project: MyFaces Extensions Validator Issue Type: Bug Components: Core Affects Versions: 2.0.5, 2.0.6 Reporter: Thomas Andraschko Attachments: EXTVAL-145.patch Caching of the renderer interceptors decrease the execution time from 51ms to 0.5ms for a big page/many invocations. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (EXTVAL-146) [perf] Reduce logging/string operations in ExtValRendererWrapper
Thomas Andraschko created EXTVAL-146: Summary: [perf] Reduce logging/string operations in ExtValRendererWrapper Key: EXTVAL-146 URL: https://issues.apache.org/jira/browse/EXTVAL-146 Project: MyFaces Extensions Validator Issue Type: Bug Components: Core Affects Versions: 2.0.5, 2.0.6 Reporter: Thomas Andraschko Attachments: EXTVAL-146.patch Improvement on a big page: encodeChilren: 634ms - 5ms encodeEnd: 141ms - 13.5ms encodeBegin: 139ms - 16.2ms -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2268) -tr-property-ref replacement needs to work with gradient settings
[ https://issues.apache.org/jira/browse/TRINIDAD-2268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13410538#comment-13410538 ] Prakash Udupa commented on TRINIDAD-2268: - Again... Not sure why this JIRA issue notes is not showing checkin details. Just for records... 'TRINIDAD-2268_over_trunk_part2.patch' is checked in... http://svn.apache.org/viewvc?view=revisionrevision=1359778 -tr-property-ref replacement needs to work with gradient settings - Key: TRINIDAD-2268 URL: https://issues.apache.org/jira/browse/TRINIDAD-2268 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Affects Versions: 1.2.12-core Environment: This is needed in 1.2.12.6.2 and other current versions Reporter: Dave Robinson Attachments: TRINIDAD-2268_over_trunk.patch, TRINIDAD-2268_over_trunk_part2.patch We need to be able to use -tr-property-ref to do color replacements for color gradient assignments, like the following (showing examples for all browsers): background: linear-gradient(top, #cce2f6 0%, #b1d2f2 100%); background: -moz-linear-gradient(top, #cce2f6 0%, #b1d2f2 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cce2f6), color-stop(100%,#b1d2f2)); background: -webkit-linear-gradient(top, #cce2f6 0%, #b1d2f2 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cce2f6', endColorstr='#b1d2f2',GradientType=0 ); background: -ms-linear-gradient(top, #cce2f6 0%, #b1d2f2 100%); -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2286) alias wrongly specified in base-desktop.css
[ https://issues.apache.org/jira/browse/TRINIDAD-2286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13410586#comment-13410586 ] Jeanne Waldman commented on TRINIDAD-2286: -- Anand tested the generated css files both in trinidad and ADF Rich Client (fusion and fusion-simple) before and after the change to check regressions. alias wrongly specified in base-desktop.css --- Key: TRINIDAD-2286 URL: https://issues.apache.org/jira/browse/TRINIDAD-2286 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Affects Versions: 2.0.1-core Reporter: Anand V Nath Priority: Minor Attachments: jira-2286.patch Many alias references in base-desktop.css misses the leading dot. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2286) alias wrongly specified in base-desktop.css
[ https://issues.apache.org/jira/browse/TRINIDAD-2286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13410608#comment-13410608 ] Jeanne Waldman commented on TRINIDAD-2286: -- I searched for VeryDarkExtraAccentForeground and found that it wasn't being used anywhere. I vote for deleting these aliases instead of fixing them. alias wrongly specified in base-desktop.css --- Key: TRINIDAD-2286 URL: https://issues.apache.org/jira/browse/TRINIDAD-2286 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Affects Versions: 2.0.1-core Reporter: Anand V Nath Priority: Minor Attachments: jira-2286.patch Many alias references in base-desktop.css misses the leading dot. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [VOTE] Release Tobago 1.5.7
Here is my +1 Regards Bernd On Tue, Jul 10, 2012 at 8:35 AM, Werner Punz werner.p...@gmail.com wrote: +1 Am 07.07.12 00:44, schrieb Bernd Bohmann: Hello, I would like to release Tobago 1.5.7 For a detail list please consult the release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310273styleName=Htmlversion=12321444 The version is available at the nexus staging repository. Staging repository: https://repository.apache.org/content/repositories/orgapachemyfaces-037/ The Vote is open for 72h. [ ] +1 [ ] +0 [ ] -1 Regards Bernd
[RESULT] [VOTE] Release Tobago 1.5.7
The vote has passed with the following results: +1 lofwyr (binding) weber (binding) werpu (binding) bommel (binding) I will proceed with the next steps. Regards, Bernd On Tue, Jul 10, 2012 at 11:47 PM, Bernd Bohmann bernd.bohm...@atanion.com wrote: Here is my +1 Regards Bernd On Tue, Jul 10, 2012 at 8:35 AM, Werner Punz werner.p...@gmail.com wrote: +1 Am 07.07.12 00:44, schrieb Bernd Bohmann: Hello, I would like to release Tobago 1.5.7 For a detail list please consult the release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310273styleName=Htmlversion=12321444 The version is available at the nexus staging repository. Staging repository: https://repository.apache.org/content/repositories/orgapachemyfaces-037/ The Vote is open for 72h. [ ] +1 [ ] +0 [ ] -1 Regards Bernd
[jira] [Resolved] (EXTVAL-145) [perf] Cache renderer interceptors as list
[ https://issues.apache.org/jira/browse/EXTVAL-145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gerhard Petracek resolved EXTVAL-145. - Resolution: Fixed [perf] Cache renderer interceptors as list -- Key: EXTVAL-145 URL: https://issues.apache.org/jira/browse/EXTVAL-145 Project: MyFaces Extensions Validator Issue Type: Improvement Components: Core Affects Versions: 2.0.5, 1.2.5 Reporter: Thomas Andraschko Assignee: Gerhard Petracek Fix For: 2.0.6, 1.2.6 Attachments: EXTVAL-145.patch Caching of the renderer interceptors decrease the execution time from 51ms to 0.5ms for a big page/many invocations. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (EXTVAL-146) [perf] Reduce logging/string operations in ExtValRendererWrapper
[ https://issues.apache.org/jira/browse/EXTVAL-146?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gerhard Petracek resolved EXTVAL-146. - Resolution: Fixed [perf] Reduce logging/string operations in ExtValRendererWrapper Key: EXTVAL-146 URL: https://issues.apache.org/jira/browse/EXTVAL-146 Project: MyFaces Extensions Validator Issue Type: Improvement Components: Core Affects Versions: 2.0.5, 1.2.5 Reporter: Thomas Andraschko Assignee: Gerhard Petracek Fix For: 2.0.6, 1.2.6 Attachments: EXTVAL-146.patch Improvement on a big page: encodeChilren: 634ms - 5ms encodeEnd: 141ms - 13.5ms encodeBegin: 139ms - 16.2ms -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
Re: [VOTE] Release Tobago 1.5.7
Here is my +1 Regards Bernd On Tue, Jul 10, 2012 at 8:35 AM, Werner Punz werner.p...@gmail.com wrote: +1 Am 07.07.12 00:44, schrieb Bernd Bohmann: Hello, I would like to release Tobago 1.5.7 For a detail list please consult the release notes: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310273styleName=Htmlversion=12321444 The version is available at the nexus staging repository. Staging repository: https://repository.apache.org/content/repositories/orgapachemyfaces-037/ The Vote is open for 72h. [ ] +1 [ ] +0 [ ] -1 Regards Bernd
[jira] [Created] (TRINIDAD-2287) atomicity violation bugs of misusing concurrent collections
Yu Lin created TRINIDAD-2287: Summary: atomicity violation bugs of misusing concurrent collections Key: TRINIDAD-2287 URL: https://issues.apache.org/jira/browse/TRINIDAD-2287 Project: MyFaces Trinidad Issue Type: Bug Affects Versions: 2.0.1-core Reporter: Yu Lin My name is Yu Lin. I'm a Ph.D. student in the CS department at UIUC. I'm currently doing research on mining Java concurrent library misusages. I found some misusages of ConcurrentHashMap in Trinidad 2.0.1, which may result in potential atomicity violation bugs or harm the performance. The code below is a snapshot of the code in file trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/PropertyKey.java from line 102 to 112 L102 PropertyKey cachedKey = _sDefaultKeyCache.get(name); L104 if (cachedKey == null) L105 { L106 cachedKey = new PropertyKey(name); L108 // we don't need putIfAbsent because we don't care about identity L109 _sDefaultKeyCache.put(name, cachedKey); L110 } L112 return cachedKey; In the code above, an atomicity violation may occur between line 105 and 109. Suppose a thread T1 executes line 102 and finds out the concurrent hashmap does not contain the key name. Before it gets to execute line 109, another thread T2 puts a pair name, v in the concurrent hashmap _sDefaultKeyCache. Now thread T1 resumes execution and it will overwrite the value written by thread T2. Thus, the code no longer preserves the put-if-absent semantics. I found some similar atomicity violations in other 17 places (I don't list them one by one. Please see the patch). Note that in trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/Cache.java, if we use putIfAbsent at line 89 and replace at line 115, we may remove the synchronized keyword at line 82. Similarly, in trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitBase.java, we may remove the synchronized by using putIfAbsent at line 192. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (TRINIDAD-2287) atomicity violation bugs of misusing concurrent collections
[ https://issues.apache.org/jira/browse/TRINIDAD-2287?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yu Lin updated TRINIDAD-2287: - Status: Patch Available (was: Open) atomicity violation bugs of misusing concurrent collections --- Key: TRINIDAD-2287 URL: https://issues.apache.org/jira/browse/TRINIDAD-2287 Project: MyFaces Trinidad Issue Type: Bug Affects Versions: 2.0.1-core Reporter: Yu Lin Original Estimate: 504h Remaining Estimate: 504h My name is Yu Lin. I'm a Ph.D. student in the CS department at UIUC. I'm currently doing research on mining Java concurrent library misusages. I found some misusages of ConcurrentHashMap in Trinidad 2.0.1, which may result in potential atomicity violation bugs or harm the performance. The code below is a snapshot of the code in file trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/PropertyKey.java from line 102 to 112 L102 PropertyKey cachedKey = _sDefaultKeyCache.get(name); L104 if (cachedKey == null) L105 { L106 cachedKey = new PropertyKey(name); L108 // we don't need putIfAbsent because we don't care about identity L109 _sDefaultKeyCache.put(name, cachedKey); L110 } L112 return cachedKey; In the code above, an atomicity violation may occur between line 105 and 109. Suppose a thread T1 executes line 102 and finds out the concurrent hashmap does not contain the key name. Before it gets to execute line 109, another thread T2 puts a pair name, v in the concurrent hashmap _sDefaultKeyCache. Now thread T1 resumes execution and it will overwrite the value written by thread T2. Thus, the code no longer preserves the put-if-absent semantics. I found some similar atomicity violations in other 17 places (I don't list them one by one. Please see the patch). Note that in trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/Cache.java, if we use putIfAbsent at line 89 and replace at line 115, we may remove the synchronized keyword at line 82. Similarly, in trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitBase.java, we may remove the synchronized by using putIfAbsent at line 192. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (TRINIDAD-2287) atomicity violation bugs of misusing concurrent collections
[ https://issues.apache.org/jira/browse/TRINIDAD-2287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13411194#comment-13411194 ] Blake Sullivan commented on TRINIDAD-2287: -- I don't understand why you think that no preserving put-if-absent semantics is important. The code says that it explicitly doesn't care about these semantics: // we don't need putIfAbsent because we don't care about identity _sDefaultKeyCache.put(name, cachedKey); Since we don't care about those semantics, put will always perform better than putIfAbsent atomicity violation bugs of misusing concurrent collections --- Key: TRINIDAD-2287 URL: https://issues.apache.org/jira/browse/TRINIDAD-2287 Project: MyFaces Trinidad Issue Type: Bug Affects Versions: 2.0.1-core Reporter: Yu Lin Attachments: trinidad-2.0.1.patch Original Estimate: 504h Remaining Estimate: 504h My name is Yu Lin. I'm a Ph.D. student in the CS department at UIUC. I'm currently doing research on mining Java concurrent library misusages. I found some misusages of ConcurrentHashMap in Trinidad 2.0.1, which may result in potential atomicity violation bugs or harm the performance. The code below is a snapshot of the code in file trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/PropertyKey.java from line 102 to 112 L102 PropertyKey cachedKey = _sDefaultKeyCache.get(name); L104 if (cachedKey == null) L105 { L106 cachedKey = new PropertyKey(name); L108 // we don't need putIfAbsent because we don't care about identity L109 _sDefaultKeyCache.put(name, cachedKey); L110 } L112 return cachedKey; In the code above, an atomicity violation may occur between line 105 and 109. Suppose a thread T1 executes line 102 and finds out the concurrent hashmap does not contain the key name. Before it gets to execute line 109, another thread T2 puts a pair name, v in the concurrent hashmap _sDefaultKeyCache. Now thread T1 resumes execution and it will overwrite the value written by thread T2. Thus, the code no longer preserves the put-if-absent semantics. I found some similar atomicity violations in other 17 places (I don't list them one by one. Please see the patch). Note that in trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/cache/Cache.java, if we use putIfAbsent at line 89 and replace at line 115, we may remove the synchronized keyword at line 82. Similarly, in trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/RenderKitBase.java, we may remove the synchronized by using putIfAbsent at line 192. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira