diff options
author | kmoore | 2012-07-18 17:51:50 +0000 |
---|---|---|
committer | kmoore | 2012-07-18 17:51:50 +0000 |
commit | 56569e08caf8db9eed6467b873c7f0d092200948 (patch) | |
tree | 90f6165ad232679f6da4d7b659fef83762a739b5 | |
parent | 332f3582be71f0fe4f66a1f6d154039dd13e9219 (diff) | |
download | webtools.dali-56569e08caf8db9eed6467b873c7f0d092200948.tar.gz webtools.dali-56569e08caf8db9eed6467b873c7f0d092200948.tar.xz webtools.dali-56569e08caf8db9eed6467b873c7f0d092200948.zip |
change JavaResourceAnnotatedElement.removeAnnotation(String) api to not check first if the annotation exists before removing it
2 files changed, 5 insertions, 4 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JavaConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JavaConverter.java index 6ba7353ab2..e56e77e046 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JavaConverter.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JavaConverter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -134,7 +134,9 @@ public interface JavaConverter } public void removeConverterAnnotation(JavaResourceAttribute attribute) { - attribute.removeAnnotation(this.getAnnotationName()); + if (attribute.getAnnotation(this.getAnnotationName()) != null) { + attribute.removeAnnotation(this.getAnnotationName()); + } } protected Owner buildOwner() { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOrderable.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOrderable.java index 18d7560a64..ba9d430fdc 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOrderable.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOrderable.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 Oracle. All rights reserved. + * Copyright (c) 2009, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -278,7 +278,6 @@ public class GenericJavaOrderable public void setOrderColumnOrdering(boolean orderColumnOrdering) { if (orderColumnOrdering) { - this.removeOrderByAnnotation(); if (this.getOrderColumnAnnotation() == null) { this.addOrderColumnAnnotation(); } |