Author: dgeraskov
Date: 2011-05-05 09:32:04 -0400 (Thu, 05 May 2011)
New Revision: 31101
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
Log:
https://issues.jboss.org/browse/JBIDE-8028
Do not annotate static or final fields
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2011-05-05
13:27:01 UTC (rev 31100)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2011-05-05
13:32:04 UTC (rev 31101)
@@ -16,9 +16,9 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
-import java.util.Map.Entry;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jdt.core.ICompilationUnit;
@@ -31,6 +31,7 @@
import org.eclipse.jdt.core.dom.FieldDeclaration;
import org.eclipse.jdt.core.dom.ITypeBinding;
import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.Modifier;
import org.eclipse.jdt.core.dom.ParameterizedType;
import org.eclipse.jdt.core.dom.PrimitiveType;
import org.eclipse.jdt.core.dom.QualifiedType;
@@ -350,6 +351,11 @@
@SuppressWarnings("unchecked")
public boolean visit(FieldDeclaration node) {
+ //do not map static or final fields
+ if ((node.getModifiers() & (Modifier.FINAL | Modifier.STATIC)) != 0){
+ return false;
+ }
+
Type type = node.getType();
if (type == null) {
return true;