mirror of https://github.com/apache/openjpa.git
OPENJPA-9 not all configuration files are XML, so have getAnchorsInResource and getAnchorsInFile just return null if it isn't able to parse the specific configuration resources as XML
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@598557 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5018dfaa88
commit
1946a9b036
|
@ -207,8 +207,13 @@ public class PersistenceProductDerivation
|
||||||
@Override
|
@Override
|
||||||
public List getAnchorsInFile(File file) throws IOException {
|
public List getAnchorsInFile(File file) throws IOException {
|
||||||
ConfigurationParser parser = new ConfigurationParser(null);
|
ConfigurationParser parser = new ConfigurationParser(null);
|
||||||
parser.parse(file);
|
try {
|
||||||
return getUnitNames(parser);
|
parser.parse(file);
|
||||||
|
return getUnitNames(parser);
|
||||||
|
} catch (IOException e) {
|
||||||
|
// not all configuration files are XML; return null if unparsable
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> getUnitNames(ConfigurationParser parser) {
|
private List<String> getUnitNames(ConfigurationParser parser) {
|
||||||
|
@ -222,8 +227,13 @@ public class PersistenceProductDerivation
|
||||||
@Override
|
@Override
|
||||||
public List getAnchorsInResource(String resource) throws Exception {
|
public List getAnchorsInResource(String resource) throws Exception {
|
||||||
ConfigurationParser parser = new ConfigurationParser(null);
|
ConfigurationParser parser = new ConfigurationParser(null);
|
||||||
parser.parse(resource);
|
try {
|
||||||
return getUnitNames(parser);
|
parser.parse(resource);
|
||||||
|
return getUnitNames(parser);
|
||||||
|
} catch (IOException e) {
|
||||||
|
// not all configuration files are XML; return null if unparsable
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue