summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Butzke2012-11-20 13:01:43 (EST)
committerKaren Butzke2012-11-20 13:01:43 (EST)
commitee521ba10b458ecc858cdcea3af8d1a6b6f6aa6e (patch)
tree58fbc444f1a53843e68ea59d0b3648aa2d0a291f
parent0abe6c6f71214193167779f8351f000bb6c78b01 (diff)
downloadwebtools.dali-ee521ba10b458ecc858cdcea3af8d1a6b6f6aa6e.zip
webtools.dali-ee521ba10b458ecc858cdcea3af8d1a6b6f6aa6e.tar.gz
webtools.dali-ee521ba10b458ecc858cdcea3af8d1a6b6f6aa6e.tar.bz2
Bug 387630 - Convert java plural queries or converters to xml and the plural annotation is left behind
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAnnotatedElement.java2
-rw-r--r--common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapter.java6
2 files changed, 6 insertions, 2 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAnnotatedElement.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAnnotatedElement.java
index 6a05ffe..81a5ca5 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAnnotatedElement.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/resource/java/source/SourceAnnotatedElement.java
@@ -779,7 +779,7 @@ abstract class SourceAnnotatedElement<E extends AnnotatedElement>
@Override
public NestableAnnotation removeNestedAnnotation(int index) {
- if (this.nestedAnnotations.size() == 2) {
+ if (this.nestedAnnotations.size() <= 2) {
this.containerAnnotation = null;
}
return super.removeNestedAnnotation(index);
diff --git a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapter.java b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapter.java
index d027dc9..b0ee534 100644
--- a/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapter.java
+++ b/common/plugins/org.eclipse.jpt.common.core/src/org/eclipse/jpt/common/core/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
+ * Copyright (c) 2006, 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.
@@ -193,6 +193,10 @@ public class CombinationIndexedDeclarationAnnotationAdapter
if (this.nestedElementCanBeConvertedToStandAlone(declaration)) {
this.convertLastElementAnnotationToStandAloneAnnotation(declaration);
}
+ Annotation containerAnnotation = this.getContainerAnnotation(declaration);
+ if (containerAnnotation != null && containerAnnotation.isMarkerAnnotation()) {
+ removeContainerAnnotation(declaration);
+ }
}
public ASTNode getAstNode(ModifiedDeclaration declaration) {