Author: dgeraskov
Date: 2009-06-23 05:01:15 -0400 (Tue, 23 Jun 2009)
New Revision: 16129
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/FileFilter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/RelationalConfigurationEditPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/ConfigurationEditPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/GraphNodeEditPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/TableEditPart.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMappingsTab.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java
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/NewHibernateMappingFileWizard.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationEntitiesNode.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4357
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/JavaPage.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -77,7 +77,7 @@
if(model.getMaxResults()!=null) {
criteria.setMaxResults( model.getMaxResults().intValue() );
}
- } else if (o instanceof List) {
+ } else if (o instanceof List<?>) {
list = (List<Object>) o;
if(model.getMaxResults()!=null) {
list = list.subList( 0, Math.min( list.size(),
model.getMaxResults().intValue() ) );
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/execution/DefaultExecutionContext.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -33,7 +33,7 @@
final private URLClassLoader configurationClassLoader;
private volatile int installs;
- private Map previousLoaders = new WeakHashMap();
+ private Map<Thread, ClassLoader> previousLoaders = new WeakHashMap<Thread,
ClassLoader>();
final String key;
@@ -76,7 +76,7 @@
installs--; // TODO: make more safe (synchronized) bookkeeping of the classloader
installation.
if(installs==0) {
- ClassLoader cl = (ClassLoader) previousLoaders.get(Thread.currentThread() );
+ ClassLoader cl = previousLoaders.get(Thread.currentThread() );
if(configurationClassLoader!=null &&
Thread.currentThread().getContextClassLoader() != configurationClassLoader) {
String out = NLS.bind(ConsoleMessages.DefaultExecutionContext_existing_classloader,
Thread.currentThread().getContextClassLoader(), configurationClassLoader);
throw new IllegalStateException(out);
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationEntitiesNode.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationEntitiesNode.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationEntitiesNode.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -31,10 +31,10 @@
*/
public class ConfigurationEntitiesNode extends BaseNode {
- public ConfigurationEntitiesNode(String name, NodeFactory factory, List classes) {
+ public ConfigurationEntitiesNode(String name, NodeFactory factory, List<String>
classes) {
super(factory,null);
for (int i = 0; i < classes.size(); i++) {
- children.add(factory.createClassNode(this,(String)classes.get(i) ) );
+ children.add(factory.createClassNode(this,classes.get(i) ) );
}
iconName = ImageConstants.TYPES;
this.name = name;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/eclipse/logging/PluginLogManager.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -246,7 +246,7 @@
* Returns all the loggers in this manager.
* @return Enumeration logger enumeration
*/
- public Enumeration getCurrentLoggers() {
+ public Enumeration<?> getCurrentLoggers() {
return this.hierarchy.getCurrentLoggers();
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/EclipseLaunchConsoleConfigurationPreferences.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -6,7 +6,6 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import java.util.Properties;
@@ -114,17 +113,16 @@
return getAttribute( IConsoleConfigurationLaunchConstants.ENTITY_RESOLVER, null );
}
+ @SuppressWarnings("unchecked")
public File[] getMappingFiles() {
try {
- List mappings = launchConfiguration.getAttribute(
IConsoleConfigurationLaunchConstants.FILE_MAPPINGS, Collections.EMPTY_LIST );
+ List<String> mappings = launchConfiguration.getAttribute(
IConsoleConfigurationLaunchConstants.FILE_MAPPINGS, Collections.EMPTY_LIST );
File[] result = new File[mappings.size()];
int i = 0;
- Iterator iter = mappings.iterator();
- while ( iter.hasNext() ) {
- String element = (String) iter.next();
+ for (String element : mappings) {
result[i++] = strToFile( element );
}
- return result;
+ return result;
}
catch (CoreException e) {
throw new HibernateConsoleRuntimeException(e);
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/FileFilter.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/FileFilter.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/FileFilter.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -44,7 +44,7 @@
private final String[] fileExtensions;
- private List excludedFiles;
+ private List<IResource> excludedFiles;
private boolean recursive ;
private final boolean allowDirectories;
@@ -55,7 +55,7 @@
* @param recusive Folders are only shown if, searched recursively, contain
* a matching file
*/
- public FileFilter(String[] fileExtensions, IFile[] excludedFiles, boolean recusive) {
+ public FileFilter(String[] fileExtensions, IResource[] excludedFiles, boolean recusive)
{
this.fileExtensions = fileExtensions;
if (excludedFiles != null) {
this.excludedFiles= Arrays.asList(excludedFiles);
@@ -66,10 +66,10 @@
allowDirectories = false;
}
- public FileFilter(String[] fileExtensions, List excludedFiles, boolean recusive, boolean
allowDirectories) {
+ public FileFilter(String[] fileExtensions, List<IResource> usedFiles, boolean
recusive, boolean allowDirectories) {
this.fileExtensions = fileExtensions;
- this.excludedFiles= excludedFiles;
+ this.excludedFiles= usedFiles;
recursive = recusive;
this.allowDirectories = allowDirectories;
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -44,11 +44,9 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.ViewPart;
import org.hibernate.SessionFactory;
-import org.hibernate.classic.Session;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
-import org.hibernate.eclipse.console.QueryEditor;
import org.hibernate.eclipse.console.utils.QLFormatHelper;
import org.hibernate.eclipse.hqleditor.HQLEditor;
import org.hibernate.eclipse.hqleditor.HQLEditorDocumentSetupParticipant;
@@ -178,7 +176,7 @@
QueryTranslator translator = translators[i];
if(translator.isManipulationStatement()) {
str.append(HibernateConsoleMessages.DynamicSQLPreviewView_manipulation_of + i +
":"); //$NON-NLS-1$
- Iterator iterator = translator.getQuerySpaces().iterator();
+ Iterator<?> iterator = translator.getQuerySpaces().iterator();
while ( iterator.hasNext() ) {
Object qspace = iterator.next();
str.append(qspace);
@@ -195,7 +193,7 @@
}
}
str.append("\n-----------------\n"); //$NON-NLS-1$
- Iterator sqls = translator.collectSqlStrings().iterator();
+ Iterator<?> sqls = translator.collectSqlStrings().iterator();
while ( sqls.hasNext() ) {
String sql = (String) sqls.next();
str.append(QLFormatHelper.formatForScreen(sql));
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/QueryPageViewer.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -120,7 +120,7 @@
if(qp.getExceptions().isEmpty() ) {
return ensureNotNull(objects);
} else {
- Throwable[] throwables = (Throwable[])qp.getExceptions().toArray(new Throwable[0]);
+ Throwable[] throwables = qp.getExceptions().toArray(new Throwable[0]);
HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.QueryPageViewer_exception_while_executing_hql_query,
throwables);
return throwables; // TODO: provide actual error page
}
@@ -261,7 +261,7 @@
private int addColumnsToTable(final Table table) {
table.setHeaderVisible(true);
table.setLinesVisible(true);
- List columns = this.queryPage.getPathNames();
+ List<String> columns = this.queryPage.getPathNames();
int columnCount = columns.size();
for (int i = 0; i < columnCount; i++) {
TableColumn column = new TableColumn(table, SWT.NONE);
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ReloadConfigurationAction.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -23,7 +23,7 @@
}
protected void doRun() {
- for (Iterator i = getSelectedNonResources().iterator(); i.hasNext();) {
+ for (Iterator<?> i = getSelectedNonResources().iterator(); i.hasNext();) {
try {
Object node = i.next();
if (node instanceof ConsoleConfiguration) {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/SchemaExportAction.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -58,12 +58,13 @@
}
public void doRun() {
- for (Iterator i = getSelectedNonResources().iterator(); i.hasNext();) {
+ for (Iterator<?> i = getSelectedNonResources().iterator(); i.hasNext();) {
try {
Object node = i.next();
if ( node instanceof ConsoleConfiguration ) {
final ConsoleConfiguration config = (ConsoleConfiguration) node;
config.execute( new Command() {
+ @SuppressWarnings("unchecked")
public Object execute() {
String out =
NLS.bind(HibernateConsoleMessages.SchemaExportAction_sure_run_schemaexport,
config.getName());
if ( config.getConfiguration() != null
@@ -74,11 +75,10 @@
.getConfiguration() );
export.create( false, true );
if ( !export.getExceptions().isEmpty() ) {
- Iterator iterator = export.getExceptions()
- .iterator();
+ Iterator<Throwable> iterator = export.getExceptions().iterator();
int cnt = 1;
while ( iterator.hasNext() ) {
- Throwable element = (Throwable) iterator.next();
+ Throwable element = iterator.next();
String outStr =
NLS.bind(HibernateConsoleMessages.SchemaExportAction_errornum_while_performing_schemaexport,
cnt++);
HibernateConsolePlugin.getDefault().logErrorMessage(outStr, element );
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterView.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -135,7 +135,7 @@
if ( !selection.isEmpty() ) {
StructuredSelection ss = (StructuredSelection) selection;
- Iterator iterator = ss.iterator();
+ Iterator<?> iterator = ss.iterator();
while ( iterator.hasNext() ) {
Object sel = iterator.next();
ITableFilter filter = null;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/UpDownListComposite.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -292,9 +292,7 @@
protected void handleRemove() {
IStructuredSelection selection = (IStructuredSelection) tableView.getSelection();
if (selection != null) {
- int numSelected= selection.size();
-
- Iterator iterator= selection.iterator();
+ Iterator<?> iterator= selection.iterator();
while (iterator.hasNext() ) {
Object item= iterator.next();
tableView.remove(item);
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/RelationalConfigurationEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/RelationalConfigurationEditPart.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/RelationalConfigurationEditPart.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -23,18 +23,16 @@
import java.util.List;
-import org.eclipse.gef.EditPart;
import org.hibernate.eclipse.graph.model.ConfigurationViewAdapter;
import org.hibernate.eclipse.graph.parts.ConfigurationEditPart;
-public class RelationalConfigurationEditPart extends ConfigurationEditPart
- implements EditPart {
+public class RelationalConfigurationEditPart extends ConfigurationEditPart {
public RelationalConfigurationEditPart(ConfigurationViewAdapter configuration) {
super( configuration );
}
- protected List getModelChildren() {
+ protected List<?> getModelChildren() {
if ( getConfigurationViewAdapter() == null )
return super.getModelChildren();
return getConfigurationViewAdapter().getSelectedTables();
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/ConfigurationEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/ConfigurationEditPart.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/ConfigurationEditPart.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -59,7 +59,7 @@
setModel( configuration );
}
- protected List getModelChildren() {
+ protected List<?> getModelChildren() {
if ( getConfigurationViewAdapter() == null )
return super.getModelChildren();
return getConfigurationViewAdapter().getPersistentClasses();
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/GraphNodeEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/GraphNodeEditPart.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/GraphNodeEditPart.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -34,6 +34,7 @@
import org.eclipse.gef.NodeEditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.hibernate.eclipse.graph.model.AssociationViewAdapter;
import org.hibernate.eclipse.graph.model.GraphNode;
public abstract class GraphNodeEditPart extends AbstractGraphicalEditPart implements
Observer, NodeEditPart {
@@ -51,7 +52,7 @@
}
}
- protected List getModelSourceConnections() {
+ protected List<AssociationViewAdapter> getModelSourceConnections() {
return getGraphNode().getSourceAssociations();
}
@@ -59,7 +60,7 @@
return (GraphNode)getModel();
}
- protected List getModelTargetConnections() {
+ protected List<AssociationViewAdapter> getModelTargetConnections() {
return getGraphNode().getTargetAssociations();
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/TableEditPart.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/TableEditPart.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/graph/parts/TableEditPart.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -26,6 +26,7 @@
import org.eclipse.draw2d.IFigure;
import org.hibernate.eclipse.graph.figures.EditableLabel;
import org.hibernate.eclipse.graph.figures.TableFigure;
+import org.hibernate.eclipse.graph.model.ColumnViewAdapter;
import org.hibernate.eclipse.graph.model.TableViewAdapter;
public class TableEditPart extends GraphNodeEditPart {
@@ -53,7 +54,7 @@
return figure.getColumnsFigure();
}
- protected List getModelChildren() {
+ protected List<ColumnViewAdapter> getModelChildren() {
TableViewAdapter tableViewAdapter = getTableViewAdapter();
return tableViewAdapter.getColumns();
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationLaunchDelegate.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -336,13 +336,13 @@
@SuppressWarnings("unchecked")
private ReverseEngineeringStrategy loadreverseEngineeringStrategy(final String
className, ReverseEngineeringStrategy delegate) {
try {
- Class clazz = ReflectHelper.classForName(className);
+ Class<ReverseEngineeringStrategy> clazz =
ReflectHelper.classForName(className);
Constructor<ReverseEngineeringStrategy> constructor = clazz.getConstructor(new
Class[] { ReverseEngineeringStrategy.class });
return constructor.newInstance(new Object[] { delegate });
}
catch (NoSuchMethodException e) {
try {
- Class clazz = ReflectHelper.classForName(className);
+ Class<?> clazz = ReflectHelper.classForName(className);
ReverseEngineeringStrategy rev = (ReverseEngineeringStrategy) clazz.newInstance();
return rev;
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMappingsTab.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMappingsTab.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMappingsTab.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -77,14 +77,15 @@
return str;
}
+ @SuppressWarnings("unchecked")
public void initializeFrom(ILaunchConfiguration configuration) {
try {
mappingFilesViewer.clear();
- List mappings = configuration.getAttribute(
IConsoleConfigurationLaunchConstants.FILE_MAPPINGS, Collections.EMPTY_LIST );
+ List<String> mappings = configuration.getAttribute(
IConsoleConfigurationLaunchConstants.FILE_MAPPINGS, Collections.EMPTY_LIST );
IPath[] mapA = new IPath[mappings.size()];
int i=0;
- for (Iterator iter = mappings.iterator(); iter.hasNext();) {
- String file = (String) iter.next();
+ for (Iterator<String> iter = mappings.iterator(); iter.hasNext();) {
+ String file = iter.next();
mapA[i++] = Path.fromPortableString( file );
}
mappingFilesViewer.add(mapA, false);
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/HibernateRefactoringUtil.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -79,6 +79,7 @@
return isAttributesAffected(config, oldPath) || isClassPathAffected(config, oldPath);
}
+ @SuppressWarnings("unchecked")
private static boolean isAttributesAffected(ILaunchConfiguration config, IPath oldPath)
throws CoreException{
String attrib = null;
for (int i = 0; i < pathKeys.length; i++) {
@@ -146,6 +147,7 @@
return path.isPrefixOf(new Path(attrib));
}
+ @SuppressWarnings("unchecked")
public static ILaunchConfiguration updateLaunchConfig(ILaunchConfiguration config, IPath
oldPath, IPath newPath) throws CoreException{
final ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
updateAttributes(oldPath, newPath, wc);
@@ -153,7 +155,7 @@
//classpath
try {
IRuntimeClasspathEntry[] entries =
JavaRuntime.computeUnresolvedRuntimeClasspath(config);
- List oldMementos =
config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH,
Collections.EMPTY_LIST);
+ List<String> oldMementos =
config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH,
Collections.EMPTY_LIST);
List<String> newMementos = new ArrayList<String>();
boolean isChanged = updateClasspathEntries(entries, oldMementos, newMementos, oldPath,
newPath);
if (isChanged) wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH,
newMementos);
@@ -281,6 +283,7 @@
}
}
+ @SuppressWarnings("unchecked")
private static void updateAttributes(IPath oldPath, IPath newPath,
final ILaunchConfigurationWorkingCopy wc) throws CoreException {
String attrib = null;
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -331,7 +331,7 @@
}
}
}
- ITypeBinding tb = node.resolveBinding();
+ node.resolveBinding();
return true;
}
@@ -340,8 +340,8 @@
if (node.getBody() == null) {
return res;
}
- List bodyStatemants = node.getBody().statements();
- Iterator it = bodyStatemants.iterator();
+ List<?> bodyStatemants = node.getBody().statements();
+ Iterator<?> it = bodyStatemants.iterator();
for ( ; it.hasNext(); ) {
Object obj = it.next();
if (obj instanceof ReturnStatement) {
@@ -409,9 +409,9 @@
public boolean visit(FieldDeclaration node) {
Type type = node.getType();
List<String> list = new ArrayList<String>();
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames = node.fragments().iterator();
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
String name = var.getName().getIdentifier();
list.add(name);
}
@@ -444,9 +444,9 @@
PrimitiveType pt = (PrimitiveType)type;
if (!pt.getPrimitiveTypeCode().equals(PrimitiveType.BOOLEAN)) {
// this is candidate for primary id
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
if ("version".equalsIgnoreCase(name)) { //$NON-NLS-1$
FieldGetterType versionFieldGetter =
updateFieldGetter(entityInfo.getVersionFieldGetter(), fieldFlag);
@@ -472,9 +472,9 @@
HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException:
", e); //$NON-NLS-1$
}
entityInfo.addDependency(entityFullyQualifiedName);
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
entityInfo.addReference(name, entityFullyQualifiedName, RefType.MANY2ONE);
}
}
@@ -483,9 +483,9 @@
if (tbParent != null) {
if ("java.lang.Number".equals(tbParent.getBinaryName())) { //$NON-NLS-1$
// this is candidate for primary id
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
if ("version".equalsIgnoreCase(name)) { //$NON-NLS-1$
FieldGetterType versionFieldGetter =
updateFieldGetter(entityInfo.getVersionFieldGetter(), fieldFlag);
@@ -498,9 +498,9 @@
}
else if ("java.util.Date".equals(tbParent.getBinaryName())) {
//$NON-NLS-1$
// this is candidate for version
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
if ("version".equalsIgnoreCase(name)) { //$NON-NLS-1$
FieldGetterType versionFieldGetter =
updateFieldGetter(entityInfo.getVersionFieldGetter(), fieldFlag);
@@ -510,9 +510,9 @@
}
}
if ("java.lang.String".equals(tb.getBinaryName())) { //$NON-NLS-1$
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
entityInfo.updateAnnotationColumn(name, null, false);
entityInfo.addPrimaryIdCandidate(name);
}
@@ -538,9 +538,9 @@
HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException:
", e); //$NON-NLS-1$
}
entityInfo.addDependency(entityFullyQualifiedName);
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
entityInfo.addReference(name, entityFullyQualifiedName, RefType.ONE2MANY);
}
}
@@ -570,9 +570,9 @@
}
}*/
if (fullyQualifiedNameTypeName.length() > 0) {
- Iterator typeArgsIt = pt.typeArguments().iterator();
+ Iterator<Type> typeArgsIt = pt.typeArguments().iterator();
while (typeArgsIt.hasNext()) {
- typeP = (Type)typeArgsIt.next();
+ typeP = typeArgsIt.next();
tb = typeP.resolveBinding();
String entityFullyQualifiedName = ""; //$NON-NLS-1$
if (tb.getJavaElement() instanceof SourceType) {
@@ -583,9 +583,9 @@
HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException:
", e); //$NON-NLS-1$
}
entityInfo.addDependency(entityFullyQualifiedName);
- Iterator itVarNames = list.iterator();
+ Iterator<String> itVarNames = list.iterator();
while (itVarNames.hasNext()) {
- String name = (String)itVarNames.next();
+ String name = itVarNames.next();
entityInfo.addReference(name, entityFullyQualifiedName, RefType.ONE2MANY);
}
}
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/common/EntityInfo.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -479,7 +479,7 @@
}
if (node != null) {
Map<String, Expression> rciValues = rci.getValues();
- Iterator it = node.values().iterator();
+ Iterator<?> it = node.values().iterator();
while (it.hasNext()) {
Object obj = it.next();
if (obj instanceof MemberValuePair) {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -129,7 +129,7 @@
ListRewrite lrw = rewriter.getListRewrite(node, CompilationUnit.IMPORTS_PROPERTY);
// insert import declaration in the proper place
// prefer alphabetic order and package separation
- Iterator it = lrw.getRewrittenList().iterator();
+ Iterator<?> it = lrw.getRewrittenList().iterator();
ASTNode insertBeforeNode = null;
for ( ; it.hasNext(); ) {
Object obj = it.next();
@@ -152,6 +152,7 @@
return true;
}
+ @SuppressWarnings("unchecked")
public boolean visit(TypeDeclaration node) {
if (entityInfo.isAddMappedSuperclassFlag()) {
MarkerAnnotation matd = rewriter.getAST().newMarkerAnnotation();
@@ -195,9 +196,9 @@
SimpleName sn = rewriter.getAST().newSimpleName(entityInfo.getName());
md.setName(sn);
ListRewrite lrw = rewriter.getListRewrite(node,
TypeDeclaration.BODY_DECLARATIONS_PROPERTY);
- List list = lrw.getOriginalList();
+ List<?> list = lrw.getOriginalList();
MethodDeclaration insertBeforeNode = null;
- Iterator it = list.iterator();
+ Iterator<?> it = list.iterator();
while (it.hasNext()) {
Object obj = it.next();
if (obj instanceof MethodDeclaration) {
@@ -296,6 +297,7 @@
return true;
}
+ @SuppressWarnings("unchecked")
public boolean visit(FieldDeclaration node) {
if (annotationStyle != AnnotStyle.FIELDS) {
return true;
@@ -307,10 +309,10 @@
if (type.isSimpleType() || type.isPrimitiveType()) {
if (entityInfo.isAddGeneratedValueFlag()) {
String primaryIdName = entityInfo.getPrimaryIdName();
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames =
node.fragments().iterator();
boolean addGeneratedValueMarker = false;
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
String name = var.getName().getIdentifier();
if (primaryIdName.equals(name)) {
addGeneratedValueMarker = true;
@@ -326,10 +328,10 @@
}
if (entityInfo.isAddPrimaryIdFlag()) {
String primaryIdName = entityInfo.getPrimaryIdName();
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames =
node.fragments().iterator();
boolean addIdMarker = false;
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
String name = var.getName().getIdentifier();
if (primaryIdName.equals(name)) {
addIdMarker = true;
@@ -344,10 +346,10 @@
}
}
if (enableOptLock && entityInfo.isAddVersionFlag() &&
!entityInfo.hasVersionAnnotation()) {
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames =
node.fragments().iterator();
boolean addVersionMarker = false;
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
String name = var.getName().getIdentifier();
if ("version".equals(name)) { //$NON-NLS-1$
addVersionMarker = true;
@@ -367,9 +369,9 @@
String typeName = simpleType.getName().getFullyQualifiedName();
if ("java.lang.String".equals(typeName) ||
"String".equals(typeName)) { //$NON-NLS-1$ //$NON-NLS-2$
String fieldId = null;
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames =
node.fragments().iterator();
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
fieldId = var.getName().getIdentifier();
if (fieldId != null) {
break;
@@ -392,13 +394,13 @@
}
}
if (type.isSimpleType() || type.isParameterizedType() || type.isArrayType()) {
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames = node.fragments().iterator();
String fieldId = ""; //$NON-NLS-1$
RefType refType = RefType.UNDEF;
boolean annotated = false;
String fullyQualifiedName2 = ""; //$NON-NLS-1$
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
String name = var.getName().getIdentifier();
fieldId = name;
refType = entityInfo.getFieldIdRelValue(fieldId);
@@ -439,6 +441,7 @@
return true;
}
+ @SuppressWarnings("unchecked")
public boolean visit(MethodDeclaration node) {
if (annotationStyle != AnnotStyle.GETTERS) {
return true;
@@ -609,6 +612,7 @@
return true;
}
+ @SuppressWarnings("unchecked")
public boolean addComplexNormalAnnotation(BodyDeclaration node, String name,
RefEntityInfo rei) {
if (name == null || name.length() == 0) {
return false;
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 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/ConfigurationActor.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -270,6 +270,7 @@
return true;
}
+ @SuppressWarnings("unchecked")
public boolean visit(FieldDeclaration node) {
Type type = node.getType();
if (type == null) {
@@ -277,9 +278,9 @@
}
String primaryIdName = entityInfo.getPrimaryIdName();
- Iterator itVarNames = node.fragments().iterator();
+ Iterator<VariableDeclarationFragment> itVarNames = node.fragments().iterator();
while (itVarNames.hasNext()) {
- VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ VariableDeclarationFragment var = itVarNames.next();
Property prop = createProperty(var);
if (prop == null) {
continue;
@@ -399,7 +400,6 @@
array.setElement(oValue);
}
- if (array == null) return true;
SimpleValue key = new SimpleValue();
if (StringHelper.isNotEmpty(entityInfo.getPrimaryIdName())) {
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-06-23
07:51:27 UTC (rev 16128)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-06-23
09:01:15 UTC (rev 16129)
@@ -231,7 +231,7 @@
throws InvocationTargetException,
InterruptedException {
monitor.beginTask(HibernateConsoleMessages.NewHibernateMappingFileWizard_finding_dependent_cu,
selection.size() + 1);
- Iterator it = selection.iterator();
+ Iterator<?> it = selection.iterator();
int done = 1;
while (it.hasNext()) {
Object obj = it.next();