Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
riseclipse-metamodel-cim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
RiseClipseGroup
riseclipse-metamodel-cim
Commits
6a4f4e3e
Commit
6a4f4e3e
authored
7 years ago
by
Dominique Marcadet
Browse files
Options
Downloads
Patches
Plain Diff
add a check for null prefix in CimXMLHandler.getFeature()
parent
47296702
No related branches found
No related tags found
1 merge request
!10
Resolve "CimXMLHandler. getFeature() may be called with a null prefix"
Pipeline
#1105
passed
6 years ago
Stage: build
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fr.centralesupelec.edf.riseclipse.cim.util/src/fr/centralesupelec/edf/riseclipse/cim/util/cimxml/CimXMLHandler.java
+13
-10
13 additions, 10 deletions
...supelec/edf/riseclipse/cim/util/cimxml/CimXMLHandler.java
with
13 additions
and
10 deletions
fr.centralesupelec.edf.riseclipse.cim.util/src/fr/centralesupelec/edf/riseclipse/cim/util/cimxml/CimXMLHandler.java
+
13
−
10
View file @
6a4f4e3e
...
...
@@ -155,21 +155,24 @@ public abstract class CimXMLHandler extends SAXXMLHandler {
@Override
protected
void
handleUnknownFeature
(
String
prefix
,
String
name
,
boolean
isElement
,
EObject
peekObject
,
String
value
)
{
// TODO
// TODO
: some RiseClipse specific message ?
super
.
handleUnknownFeature
(
prefix
,
name
,
isElement
,
peekObject
,
value
);
}
@Override
protected
EStructuralFeature
getFeature
(
EObject
object
,
String
prefix
,
String
name
,
boolean
isElement
)
{
String
uri
=
helper
.
getURI
(
prefix
);
if
(
CimConstants
.
rdfURI
.
equals
(
uri
)
&&
CimConstants
.
nameRdfAbout
.
equals
(
name
))
{
// We consider that rdf:about is the same as rdf:ID for the purpose of reading files.
// But, such an object will have to be merged with the real object when all
// resources are loaded.
// This is only valid for CimObject, not for FullModel in header !
if
(
object
.
eClass
().
getEPackage
()
!=
ModelDescriptionPackage
.
eINSTANCE
)
{
((
CimResourceImpl
)
xmlResource
).
addForeignObject
(
object
);
name
=
CimConstants
.
nameRdfID
;
// May be called with null prefix (see XMLHandler.handleFeature(String prefix, String name))
if
(
prefix
!=
null
)
{
String
uri
=
helper
.
getURI
(
prefix
);
if
(
CimConstants
.
rdfURI
.
equals
(
uri
)
&&
CimConstants
.
nameRdfAbout
.
equals
(
name
))
{
// We consider that rdf:about is the same as rdf:ID for the purpose of reading files.
// But, such an object will have to be merged with the real object when all
// resources are loaded.
// This is only valid for CimObject, not for FullModel in header !
if
(
object
.
eClass
().
getEPackage
()
!=
ModelDescriptionPackage
.
eINSTANCE
)
{
((
CimResourceImpl
)
xmlResource
).
addForeignObject
(
object
);
name
=
CimConstants
.
nameRdfID
;
}
}
}
return
super
.
getFeature
(
object
,
prefix
,
name
,
isElement
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment