DESCRIPTION

Bug 458334 - [CSS] Bug in CSSOneOfAttributeConditionImpl prevents correct matching of some elements

Fixed bug using a simple StringTokenizer, and added corresponding unit test.

Signed-off-by: Yandel Glass xxx@xxx.xxx

COMMENTS

author: Yandel Glass
date: 2015-01-26 14:51:09.000000000

Uploaded patch set 1.

-------------------------------------
author: Zaid Mosley
date: 2015-01-26 15:03:04.000000000

Patch Set 1:

Stefan, can you review this one?

-------------------------------------
author: Brenden Conley
date: 2015-01-26 16:50:40.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/4292/

-------------------------------------
author: Brenden Conley
date: 2015-01-26 17:10:02.000000000

Patch Set 1: Verified-1

Build Failed 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/4292/ : FAILURE

-------------------------------------
author: Clara Kelly
date: 2015-01-27 10:50:32.000000000

Patch Set 1: Code-Review-1

(5 comments)

@Lars: do you have a proposal how to add a proper file header comment to CSSOneOfAttributeConditionImpl.java?

Line:9, tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/CSSEngineTest.java -> You should insert a line with your name and the bug reference here.

Line:51, tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/CSSEngineTest.java -> The xxx@xxx.xxx annotation is missing. The test is never executed.

Line:64, tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/CSSEngineTest.java -> I would like it more to have the different test cases (set attribute and assert) split up into several methods, because it is cleaner and one failing case does not prevent the subsequent cases to be executed. 

You could move the common code setup into a helper method to simplify the single test cases.

Line:18, bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSOneOfAttributeConditionImpl.java -> You should add a file comment giving you name and the bug you fixed.

This is even more important because this is code copied from another project. A future reader would not expect this code to differ from the original.

(Obviously this bug is also present in Apache Batik. Please consider opening a bug there as well and contributing the fix to that project as well).

Line:56, bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSOneOfAttributeConditionImpl.java -> The line break is not optimal here. 
Either remove the line break completely, or do the line break after the semicolon (= before "tok")

-------------------------------------
author: Yandel Glass
date: 2015-01-27 12:42:34.000000000

Patch Set 1:

(2 comments)

Line:51, tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/CSSEngineTest.java -> Right. I had fixed the xxx@xxx.xxx right after the commit I pushed. Sorry I pushed the incomplete one..

Line:56, bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/sac/CSSOneOfAttributeConditionImpl.java -> I had left the code as formatted by the formatter (eventhough I too dislike the line breaking). Some projects insist on not changing the automatic formatting, so in doubt I left it.

-------------------------------------
