DESCRIPTION

TMF: Refactor XML model code, using factories to re-use element parsers

The same XML syntax (and thus parsing) can be used for many XML components'
element, like state providers and views, but the behavior of each component
may be different. We use a factory to define create the classes with the
various behaviors.

Change-Id: Iec5d54155b93a79b1ebc5ffeb8eaffef5e6569ca
Signed-off-by: Aryana Jones xxx@xxx.xxx


COMMENTS

author: Annalise Jimenez
date: 2014-03-17 14:38:50.000000000

Uploaded patch set 4.

-------------------------------------
author: Brenden Conley
date: 2014-03-17 14:38:58.000000000

Patch Set 4:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/5994/

-------------------------------------
author: Brenden Conley
date: 2014-03-17 15:31:32.000000000

Patch Set 4: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/5994/ : SUCCESS

-------------------------------------
author: Ivy Mitchell
date: 2014-03-17 18:50:10.000000000

Patch Set 4:

(6 comments)

initial comments for the first four files.

Line:38, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/ITmfXmlModelFactory.java -> Should this be specified as an attr (attribute)?

Line:52, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/ITmfXmlModelFactory.java -> Is there something more specific you can use here?

Line:81, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/internal/tmf/analysis/xml/core/stateprovider/model/TmfXmlStateAttribute.java -> this code is repeated, could you unify it?

Line:85, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/internal/tmf/analysis/xml/core/stateprovider/model/TmfXmlStateAttribute.java -> repeated

Line:89, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/internal/tmf/analysis/xml/core/stateprovider/model/TmfXmlStateAttribute.java -> repeated

Line:203, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/internal/tmf/analysis/xml/core/stateprovider/model/TmfXmlStateAttribute.java -> Should this be logged?

-------------------------------------
author: Annalise Jimenez
date: 2014-03-24 17:55:12.000000000

Patch Set 4:

(4 comments)

Matthew I just noticed your comments and answer now a bit late.

Line:38, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/ITmfXmlModelFactory.java -> What do you mean?

Line:52, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/ITmfXmlModelFactory.java -> More specific like what?

Line:81, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/internal/tmf/analysis/xml/core/stateprovider/model/TmfXmlStateAttribute.java -> 1- This code is gone ;-) ... somewhere else...

2- I thought so, but how do you unify code when one out of 2 statements is repeated in 3 out of 5 cases... I thought not unifying it was the clearest.

Line:203, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/internal/tmf/analysis/xml/core/stateprovider/model/TmfXmlStateAttribute.java -> I could add some warnings, at least for the double, but it may be perfectly normal if the state value is not set yet and logging this would just add noise.

-------------------------------------
author: Ivy Mitchell
date: 2014-03-27 14:39:23.000000000

Patch Set 4:

(2 comments)

Silly gerrit

Line:38, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/ITmfXmlModelFactory.java -> Attr http://docs.oracle.com/javase/7/docs/api/org/w3c/dom/Attr.html

Line:52, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/ITmfXmlModelFactory.java -> Not sure. I guess if attr is taken, this can be ok. I don't want a dev to accidentally add a state value as an attribute or vice versa by mistake,

-------------------------------------
author: Annalise Jimenez
date: 2014-03-27 14:49:35.000000000

Patch Set 4:

(2 comments)

Line:38, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/ITmfXmlModelFactory.java -> Oh no, actually, attribute refers to an attribute of the state system, but it is defined by an XML element.

Line:52, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/model/ITmfXmlModelFactory.java -> Then no, it IS an XML Element.

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