Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2011-01-11 11:02:04 -0500
committerkmoore2011-01-11 11:02:04 -0500
commit6c8358b3bb006b62aae6b83aedb2cbc844096d2f (patch)
tree8a126f79f346d54961adbde7a39afb1bb65e6a23
parenta6f284ce1f692bbf56d15d7fa56bdb4a0ddd3b47 (diff)
downloadwebtools.dali-6c8358b3bb006b62aae6b83aedb2cbc844096d2f.tar.gz
webtools.dali-6c8358b3bb006b62aae6b83aedb2cbc844096d2f.tar.xz
webtools.dali-6c8358b3bb006b62aae6b83aedb2cbc844096d2f.zip
Fixing NPEs in refactoring participants. Added null checks in case the persistence.xml file is null.
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaDeleteTypeParticipant.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaMoveJavaElementParticipant.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaRenameJavaElementParticipant.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaDeleteMappingFileParticipant.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaMoveFolderParticipant.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaMoveMappingFileParticipant.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaRenameFolderParticipant.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaRenameMappingFileParticipant.java3
8 files changed, 24 insertions, 0 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaDeleteTypeParticipant.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaDeleteTypeParticipant.java
index 1eca9a11a7..a31c836073 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaDeleteTypeParticipant.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaDeleteTypeParticipant.java
@@ -261,6 +261,9 @@ public abstract class AbstractJpaDeleteTypeParticipant
private PersistenceUnit getPersistenceUnit(JpaProject jpaProject) {
PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
+ if (persistenceXml == null) {
+ return null;
+ }
Persistence persistence = persistenceXml.getPersistence();
if (persistence == null) {
return null;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaMoveJavaElementParticipant.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaMoveJavaElementParticipant.java
index 894661ceb8..b11e68ea73 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaMoveJavaElementParticipant.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaMoveJavaElementParticipant.java
@@ -267,6 +267,9 @@ public abstract class AbstractJpaMoveJavaElementParticipant
private PersistenceUnit getPersistenceUnit(JpaProject jpaProject) {
PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
+ if (persistenceXml == null) {
+ return null;
+ }
Persistence persistence = persistenceXml.getPersistence();
if (persistence == null) {
return null;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaRenameJavaElementParticipant.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaRenameJavaElementParticipant.java
index b21ef88d77..dc5f5de333 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaRenameJavaElementParticipant.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/AbstractJpaRenameJavaElementParticipant.java
@@ -230,6 +230,9 @@ public abstract class AbstractJpaRenameJavaElementParticipant
private PersistenceUnit getPersistenceUnit(JpaProject jpaProject) {
PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
+ if (persistenceXml == null) {
+ return null;
+ }
Persistence persistence = persistenceXml.getPersistence();
if (persistence == null) {
return null;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaDeleteMappingFileParticipant.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaDeleteMappingFileParticipant.java
index fe3cf25933..bce7b65ef2 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaDeleteMappingFileParticipant.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaDeleteMappingFileParticipant.java
@@ -183,6 +183,9 @@ public class JpaDeleteMappingFileParticipant
private PersistenceUnit getPersistenceUnit(JpaProject jpaProject) {
PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
+ if (persistenceXml == null) {
+ return null;
+ }
Persistence persistence = persistenceXml.getPersistence();
if (persistence == null) {
return null;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaMoveFolderParticipant.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaMoveFolderParticipant.java
index e933786fe7..3534becbb2 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaMoveFolderParticipant.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaMoveFolderParticipant.java
@@ -211,6 +211,9 @@ public class JpaMoveFolderParticipant
private PersistenceUnit getPersistenceUnit(JpaProject jpaProject) {
PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
+ if (persistenceXml == null) {
+ return null;
+ }
Persistence persistence = persistenceXml.getPersistence();
if (persistence == null) {
return null;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaMoveMappingFileParticipant.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaMoveMappingFileParticipant.java
index 1133f581fe..eee8242f97 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaMoveMappingFileParticipant.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaMoveMappingFileParticipant.java
@@ -214,6 +214,9 @@ public class JpaMoveMappingFileParticipant
private PersistenceUnit getPersistenceUnit(JpaProject jpaProject) {
PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
+ if (persistenceXml == null) {
+ return null;
+ }
Persistence persistence = persistenceXml.getPersistence();
if (persistence == null) {
return null;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaRenameFolderParticipant.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaRenameFolderParticipant.java
index 9a50ebd17d..5f6e832f88 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaRenameFolderParticipant.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaRenameFolderParticipant.java
@@ -167,6 +167,9 @@ public class JpaRenameFolderParticipant
private PersistenceUnit getPersistenceUnit(JpaProject jpaProject) {
PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
+ if (persistenceXml == null) {
+ return null;
+ }
Persistence persistence = persistenceXml.getPersistence();
if (persistence == null) {
return null;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaRenameMappingFileParticipant.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaRenameMappingFileParticipant.java
index 68d08148cc..201ef60c96 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaRenameMappingFileParticipant.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/refactoring/JpaRenameMappingFileParticipant.java
@@ -162,6 +162,9 @@ public class JpaRenameMappingFileParticipant
private PersistenceUnit getPersistenceUnit(JpaProject jpaProject) {
PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
+ if (persistenceXml == null) {
+ return null;
+ }
Persistence persistence = persistenceXml.getPersistence();
if (persistence == null) {
return null;

Back to the top