mirror of https://github.com/apache/openjpa.git
Return gracefully when no class found for enhancement. Without this check raises NPE.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@549405 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1921d6cc59
commit
a39a2dace9
|
@ -3639,6 +3639,10 @@ public class PCEnhancer {
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
log.info(_loc.get("running-all-classes"));
|
log.info(_loc.get("running-all-classes"));
|
||||||
classes = repos.getPersistentTypeNames(true, loader);
|
classes = repos.getPersistentTypeNames(true, loader);
|
||||||
|
if (classes == null) {
|
||||||
|
log.warn(_loc.get("no-class-to-enhance"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ClassArgParser cap = conf.getMetaDataRepositoryInstance().
|
ClassArgParser cap = conf.getMetaDataRepositoryInstance().
|
||||||
getMetaDataFactory().newClassArgParser();
|
getMetaDataFactory().newClassArgParser();
|
||||||
|
@ -3647,7 +3651,7 @@ public class PCEnhancer {
|
||||||
for (int i = 0; i < args.length; i++)
|
for (int i = 0; i < args.length; i++)
|
||||||
classes.addAll(Arrays.asList(cap.parseTypes(args[i])));
|
classes.addAll(Arrays.asList(cap.parseTypes(args[i])));
|
||||||
}
|
}
|
||||||
|
|
||||||
Project project = new Project();
|
Project project = new Project();
|
||||||
BCClass bc;
|
BCClass bc;
|
||||||
PCEnhancer enhancer;
|
PCEnhancer enhancer;
|
||||||
|
|
|
@ -30,6 +30,7 @@ running-all-classes: No targets were given. Running on all classes in your \
|
||||||
persistent classes list, or all metadata files in classpath directories if \
|
persistent classes list, or all metadata files in classpath directories if \
|
||||||
you have not listed your persistent classes. Use -help to display tool \
|
you have not listed your persistent classes. Use -help to display tool \
|
||||||
usage information.
|
usage information.
|
||||||
|
no-class-to-enhance: Found no class to enhance.
|
||||||
detach-custom-ser: Type "{0}" is set to detach on serialize, but implements \
|
detach-custom-ser: Type "{0}" is set to detach on serialize, but implements \
|
||||||
a custom readObject and/or writeObject method. You cannot use custom \
|
a custom readObject and/or writeObject method. You cannot use custom \
|
||||||
serialization with detachment.
|
serialization with detachment.
|
||||||
|
|
Loading…
Reference in New Issue