JBoss Tools SVN: r5394 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-12-19 20:17:13 -0500 (Wed, 19 Dec 2007)
New Revision: 5394
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java
Log:
JBIDE-1425 - I think it's all fixed. =D
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java 2007-12-20 00:20:58 UTC (rev 5393)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/ArchivesModelModuleContributor.java 2007-12-20 01:17:13 UTC (rev 5394)
@@ -80,8 +80,7 @@
if( packs != null && packs.length > 0 ) {
IModule module;
IArchive[] packages = ArchivesModelCore.getProjectPackages(project.getLocation(), new NullProgressMonitor(), true);
- /*boolean requiresSave = */
- ensureArchivesHaveIDs(project, packages);
+ boolean requiresSave = ensureArchivesHaveIDs(project, packages);
ArrayList<IModule> mods = new ArrayList<IModule>();
for( int i = 0; i < packages.length; i++ ) {
module = factory.createModule2(packages[i], project);
@@ -92,6 +91,9 @@
mods.add(module);
}
projectToModules.put(project.getLocation(), mods);
+ if( requiresSave )
+ ArchivesModel.instance().saveModel(project.getLocation(),
+ new NullProgressMonitor());
}
}
@@ -111,15 +113,16 @@
// remove old mods
ArrayList<IModule> mods = projectToModules.get(projectLoc);
IModule mod;
- IArchive arc;
+ PackagedModuleDelegate delegate;
if (mods != null) {
for( Iterator<IModule> i = mods.iterator(); i.hasNext();) {
mod = (IModule)i.next();
- if( moduleDelegates.get(mod) != null ) {
- arc = ((PackagedModuleDelegate)moduleDelegates.get(mod)).getPackage();
- packageToModule.remove(arc);
+ if( modules.contains(mod)) {
+ delegate = ((PackagedModuleDelegate)moduleDelegates.get(mod));
moduleDelegates.remove(mod);
modules.remove(mod);
+ if( delegate != null )
+ packageToModule.remove(delegate.getPackage());
}
}
}
@@ -152,10 +155,6 @@
PackageModuleFactory.getID(archives[i], true));
}
}
- if( requiresSave ) {
- // save
- ArchivesModel.instance().saveModel(project.getLocation(), new NullProgressMonitor());
- }
return requiresSave;
}
}
17 years
JBoss Tools SVN: r5393 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-12-19 19:20:58 -0500 (Wed, 19 Dec 2007)
New Revision: 5393
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java
Log:
Rollback last commit
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java 2007-12-20 00:17:11 UTC (rev 5392)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java 2007-12-20 00:20:58 UTC (rev 5393)
@@ -195,22 +195,9 @@
runRegisterInServerJob(p, new IServer[]{server}, null);
}
- public static void runRegisterInServerJob(final IProject p, final IServer[] servers, final String contextRoot) {
- Job startRegistration = new Job("Starting deployment to server") {
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- RegisterServerJob job = new RegisterServerJob(p, servers, contextRoot);
- job.schedule(100);
- return Status.OK_STATUS;
- }
- };
- startRegistration.setUser(true);
- startRegistration.setRule(p);
- startRegistration.setPriority(Job.DECORATE);
- startRegistration.schedule();
+ public static void runRegisterInServerJob(IProject p, IServer[] servers, String contextRoot) {
+ RegisterServerJob job = new RegisterServerJob(p, servers, contextRoot);
+ job.schedule(100);
}
// registerInJob
17 years
JBoss Tools SVN: r5392 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: core/project/facet and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-12-19 19:17:11 -0500 (Wed, 19 Dec 2007)
New Revision: 5392
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntime.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackage.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPostInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
Log:
Cleanup the code:
1. new Long(value) replaced for Long.valueOf(value)
2. new String() removed
3. new Boolean(true/false) replaced to Boolean.TRUE/FALSE
4. Unused packages were removed from seam.plugins
5. Throwing of NullPointerException replaced to IllegalArgument Exception
6. catch Exception replaced to particular Exception types in several places
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponent.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -14,8 +14,6 @@
import java.util.List;
import java.util.Set;
-import org.jboss.tools.seam.core.event.ISeamValue;
-
/**
* Represents component in seam tools model.
* @author Alexey Kazakov
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -1,8 +1,5 @@
package org.jboss.tools.seam.core;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
import org.eclipse.osgi.util.NLS;
public class SeamCoreMessages {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCorePlugin.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -18,13 +18,8 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.internal.FacetedProject;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
-import org.jboss.tools.seam.internal.core.project.facet.ISeamCoreConstants;
import org.osgi.framework.BundleContext;
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntime.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntime.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntime.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -10,8 +10,6 @@
******************************************************************************/
package org.jboss.tools.seam.core.project.facet;
-import java.io.File;
-
/**
* @author eskimo
*
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackage.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackage.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -11,7 +11,6 @@
package org.jboss.tools.seam.internal.core;
-import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -11,7 +11,6 @@
package org.jboss.tools.seam.internal.core.project.facet;
import java.io.File;
import java.io.FileFilter;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -10,25 +10,15 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core.project.facet;
-import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -11,8 +11,15 @@
package org.jboss.tools.seam.internal.core.project.facet;
-public interface ISeamCoreConstants {
+/**
+ * Old fashion way to define constants
+ * @author eskimo
+ */
+public interface ISeamCoreConstants {
- public static final String SEAM_CORE_FACET_ID = "jst.seam"; //$NON-NLS-1$
+ /**
+ * Seam Facet ID constant
+ */
+ String SEAM_CORE_FACET_ID = "jst.seam"; //$NON-NLS-1$
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -36,106 +36,168 @@
* Package name used session objects: actions, forms, conversations, beans
* web pages backing beans
*/
- public static final String SESION_BEAN_PACKAGE_NAME = "action.package"; //$NON-NLS-1$
+ String SESION_BEAN_PACKAGE_NAME = "action.package"; //$NON-NLS-1$
/**
* Package name for Entity Beans classes
*/
- public static final String ENTITY_BEAN_PACKAGE_NAME = "model.package"; //$NON-NLS-1$
+ String ENTITY_BEAN_PACKAGE_NAME = "model.package"; //$NON-NLS-1$
/**
* Connection profile name
*/
- public static final String SEAM_CONNECTION_PROFILE = "seam.project.connection.profile"; //$NON-NLS-1$
+ String SEAM_CONNECTION_PROFILE = "seam.project.connection.profile"; //$NON-NLS-1$
/**
* Selected deployment type
*/
- public static final String JBOSS_AS_DEPLOY_AS = "seam.project.deployment.type"; //$NON-NLS-1$
+ String JBOSS_AS_DEPLOY_AS = "seam.project.deployment.type"; //$NON-NLS-1$
/**
* Test project name that was created for Seam Web Project
*/
- public static final String SEAM_TEST_PROJECT = "seam.test.project"; //$NON-NLS-1$
+ String SEAM_TEST_PROJECT = "seam.test.project"; //$NON-NLS-1$
/**
* Seam runtime name that should be used to create seam artifacts:
* forms, actions, conversations and entities
*/
- public static final String SEAM_RUNTIME_NAME = "seam.runtime.name"; //$NON-NLS-1$
+ String SEAM_RUNTIME_NAME = "seam.runtime.name"; //$NON-NLS-1$
/**
* Package where tests for seam artifacts should be placed inside the
* test project
*/
- public static final String TEST_CASES_PACKAGE_NAME = "test.package"; //$NON-NLS-1$
+ String TEST_CASES_PACKAGE_NAME = "test.package"; //$NON-NLS-1$
/**
- * Ejb project name created fro Seam Web Project in EAR deployment configuration
+ * Ejb project name created from Seam Web Project in EAR deployment configuration
*/
- public static final String SEAM_EJB_PROJECT = "seam.ejb.project"; //$NON-NLS-1$
+ String SEAM_EJB_PROJECT = "seam.ejb.project"; //$NON-NLS-1$
/**
* Ear project name created for Seam Web Project in EAR deployment configuration
*/
- public static final String SEAM_EAR_PROJECT = "seam.ear.project"; //$NON-NLS-1$
+ String SEAM_EAR_PROJECT = "seam.ear.project"; //$NON-NLS-1$
// Seam Facet Wizard Page parameters constants
- public static final String SEAM_PROJECT_NAME = "project.name"; //$NON-NLS-1$
+ /**
+ * Project name token
+ */
+ String SEAM_PROJECT_NAME = "project.name"; //$NON-NLS-1$
- public static final String SEAM_PROJECT_INSTANCE = "seam.project.instance"; //$NON-NLS-1$
+ /**
+ * Selected Seam Project
+ */
+ String SEAM_PROJECT_INSTANCE = "seam.project.instance"; //$NON-NLS-1$
+
+ /**
+ * Path to JBoss AS server
+ */
+ String JBOSS_AS_HOME = "jboss.home"; //$NON-NLS-1$
- public static final String JBOSS_AS_HOME = "jboss.home"; //$NON-NLS-1$
+ /**
+ * Selected Database type
+ */
+ String DB_TYPE = "database.type"; //$NON-NLS-1$
- public static final String DB_TYPE = "database.type"; //$NON-NLS-1$
+ /**
+ * Selected hibernate dialect
+ */
+ String HIBERNATE_DIALECT = "hibernate.dialect"; //$NON-NLS-1$
- public static final String HIBERNATE_DIALECT = "hibernate.dialect"; //$NON-NLS-1$
+ /**
+ * JDBC driver class name token
+ */
+ String JDBC_DRIVER_CLASS_NAME = "hibernate.connection.driver_class"; //$NON-NLS-1$
- public static final String JDBC_DRIVER_CLASS_NAME = "hibernate.connection.driver_class"; //$NON-NLS-1$
+ /**
+ * JDBC Connection URL token
+ */
+ String JDBC_URL_FOR_DB = "hibernate.connection.url"; //$NON-NLS-1$
- public static final String JDBC_URL_FOR_DB = "hibernate.connection.url"; //$NON-NLS-1$
+ /**
+ * Connection user name token
+ */
+ String DB_USER_NAME = "hibernate.connection.username"; //$NON-NLS-1$
- public static final String DB_USER_NAME = "hibernate.connection.username"; //$NON-NLS-1$
+ /**
+ * Connection user name password
+ */
+ String DB_USER_PASSWORD = "hibernate.connection.password"; //$NON-NLS-1$
- public static final String DB_USER_PASSWORD = "hibernate.connection.password"; //$NON-NLS-1$
+ /**
+ * Schema name
+ */
+ String DB_SCHEMA_NAME = "schema.property"; //$NON-NLS-1$
- public static final String DB_SCHEMA_NAME = "schema.property"; //$NON-NLS-1$
+ /**
+ * Catalog name
+ */
+ String DB_CATALOG_NAME = "catalog.property"; //$NON-NLS-1$
- public static final String DB_CATALOG_NAME = "catalog.property"; //$NON-NLS-1$
+ /**
+ * DB tables already exists in database check box value
+ */
+ String DB_ALREADY_EXISTS = "database.exists"; //$NON-NLS-1$
- public static final String DB_ALREADY_EXISTS = "database.exists"; //$NON-NLS-1$
+ /**
+ * Recreate database tables and data on deploy check box value
+ */
+ String RECREATE_TABLES_AND_DATA_ON_DEPLOY = "database.drop"; //$NON-NLS-1$
- public static final String RECREATE_TABLES_AND_DATA_ON_DEPLOY = "database.drop"; //$NON-NLS-1$
+ /**
+ * TODO
+ */
+ String HIBERNATE_HBM2DDL_AUTO = "hibernate.hbm2ddl.auto"; //$NON-NLS-1$
- public static final String HIBERNATE_HBM2DDL_AUTO = "hibernate.hbm2ddl.auto"; //$NON-NLS-1$
+ /**
+ * Driver file name
+ */
+ String JDBC_DRIVER_JAR_PATH = "driver.file"; //$NON-NLS-1$
- public static final String JDBC_DRIVER_JAR_PATH = "driver.file"; //$NON-NLS-1$
-
// TODO: should be moved to org.jboss.tools.seam.ui.wizard.IParameter
// why is this a property when it is always derivable from sesion_bean_package_name ?
- public static final String SESION_BEAN_PACKAGE_PATH = "action.package.path"; //$NON-NLS-1$
+ String SESION_BEAN_PACKAGE_PATH = "action.package.path"; //$NON-NLS-1$
// TODO: should be moved to org.jboss.tools.seam.ui.wizard.IParameter
// why is this a property when it is always derivable from entity_bean_package_name ?
- public static final String ENTITY_BEAN_PACKAGE_PATH = "model.package.path"; //$NON-NLS-1$
+ String ENTITY_BEAN_PACKAGE_PATH = "model.package.path"; //$NON-NLS-1$
// TODO: should be moved to org.jboss.tools.seam.ui.wizard.IParameter
// why is this a property when it is always derivable from test_package_path ?
- public static final String TEST_CASES_PACKAGE_PATH = "test.package.path"; //$NON-NLS-1$
+ String TEST_CASES_PACKAGE_PATH = "test.package.path"; //$NON-NLS-1$
- public static final String JBOSS_SEAM_HOME = "seam.home.folder"; //$NON-NLS-1$
+ /**
+ * Selected Seam Runtime home folder
+ */
+ String JBOSS_SEAM_HOME = "seam.home.folder"; //$NON-NLS-1$
- public static final String WEB_CONTENTS_FOLDER = "seam.project.web.root.folder"; //$NON-NLS-1$
+ /**
+ * Seam project web contents root folder
+ */
+ String WEB_CONTENTS_FOLDER = "seam.project.web.root.folder"; //$NON-NLS-1$
- public static final String DEPLOY_AS_WAR = "war"; //$NON-NLS-1$
+ /**
+ * WAR deployment constant
+ */
+ String DEPLOY_AS_WAR = "war"; //$NON-NLS-1$
- public static final String DEPLOY_AS_EAR = "ear"; //$NON-NLS-1$
+ /**
+ * EAR deployment constant
+ */
+ String DEPLOY_AS_EAR = "ear"; //$NON-NLS-1$
- public static final String JBOSS_AS_TARGET_SERVER = "seam.project.deployment.target"; //$NON-NLS-1$
+ /**
+ * Selected Server Runtime
+ */
+ String JBOSS_AS_TARGET_SERVER = "seam.project.deployment.target"; //$NON-NLS-1$
- public static final String JBOSS_AS_TARGET_RUNTIME = "seam.project.deployment.runtime"; //$NON-NLS-1$
+ /**
+ * Selected Server
+ */
+ String JBOSS_AS_TARGET_RUNTIME = "seam.project.deployment.runtime"; //$NON-NLS-1$
-
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -18,7 +18,6 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.common.project.facet.core.IDelegate;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.jboss.tools.seam.core.SeamCoreMessages;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPostInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPostInstallDelegate.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPostInstallDelegate.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -11,7 +11,6 @@
package org.jboss.tools.seam.internal.core.project.facet;
import java.io.File;
-
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -28,46 +27,74 @@
import org.jboss.tools.jst.web.server.RegistrationHelper;
/**
+ * <p>Facet Post install delegate that handles:
+ * <ul>
+ * <li>JDBC driver copying to server libraries folder;
+ * <li> registering faceted project on the selected server;
+ * <li>deploying datasource .xml file to the selected server;
+ * </ul>
+ * </p>
* @author eskimo
*
*/
-public class SeamFacetPostInstallDelegate implements
- IDelegate, ISeamFacetDataModelProperties{
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.project.facet.core.IDelegate#execute(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, java.lang.Object, org.eclipse.core.runtime.IProgressMonitor)
+public class SeamFacetPostInstallDelegate implements IDelegate, ISeamFacetDataModelProperties {
+ /**
+ * Description
+ * @param project
+ * target project
+ * @param fv
+ * Facet version information
+ * @param config
+ * configuration parameters
+ * @param monitor
+ * progress monitor
+ * @throws CoreException
+ * never throws
*/
- public void execute(final IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
- final IDataModel model = (IDataModel)config;
+ public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor) throws CoreException {
+ final IDataModel model = (IDataModel) config;
- IServer server = (IServer)model.getProperty(JBOSS_AS_TARGET_SERVER);
- JBossServer jbs = (JBossServer)server.loadAdapter(JBossServer.class, new NullProgressMonitor());
- if( jbs != null ) {
- String[] driverJars = (String[])model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH);
+ IServer server = (IServer) model.getProperty(JBOSS_AS_TARGET_SERVER);
+ JBossServer jbs = (JBossServer) server.loadAdapter(JBossServer.class, new NullProgressMonitor());
+ if (jbs != null) {
+ String[] driverJars = (String[]) model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH);
String configFolder = jbs.getConfigDirectory();
- AntCopyUtils.copyFiles(driverJars, new File(configFolder,"lib"),false);
+ AntCopyUtils.copyFiles(driverJars, new File(configFolder, "lib"), false);
}
if (server != null) {
RegistrationHelper.runRegisterInServerJob(project, server);
IPath filePath = new Path("resources").append(project.getName() + "-ds.xml");
- if(!isWarConfiguration(model)) {
+ if (!isWarConfiguration(model)) {
IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
- IProject earProjectToBeImported = wsRoot.getProject(project.getName()+"-ear");
- new DataSourceXmlDeployer(earProjectToBeImported,server,filePath).schedule();
+ IProject earProjectToBeImported = wsRoot.getProject(project.getName() + "-ear");
+ new DataSourceXmlDeployer(earProjectToBeImported, server, filePath).schedule();
} else {
- new DataSourceXmlDeployer(project,server,filePath).schedule();
+ new DataSourceXmlDeployer(project, server, filePath).schedule();
}
}
}
/**
+ * Never used
+ * @throws CoreException
+ * never throws
+ * @return
+ * always return null
* @see org.eclipse.wst.common.project.facet.core.IActionConfigFactory#create()
*/
- public Object create() throws CoreException {return null; }
-
+ public Object create() throws CoreException {
+ return null;
+ }
+ /**
+ * Define if WAR deployment configuration is used
+ * @param model
+ * configuration parameters
+ * @return
+ * true - is Seam Project uses EAR deployment
+ * false - EAR
+ */
public static boolean isWarConfiguration(IDataModel model) {
return "war".equals(model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS)); //$NON-NLS-1$
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -16,15 +16,12 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.datatools.connectivity.drivers.DriverManager;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IDelegate;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.osgi.service.prefs.BackingStoreException;
public class SeamFacetPreInstallDelegate implements IDelegate {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -16,16 +16,13 @@
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.core.internal.preferences.PreferencesService;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.IScopeContext;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.SeamPreferences;
import org.jboss.tools.seam.core.project.facet.SeamProjectPreferences;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
import org.jboss.tools.seam.core.project.facet.SeamRuntimeListConverter;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core.scanner.java;
-import org.jboss.tools.seam.core.SeamCoreMessages;
/**
* Java annotations processed in building seam model
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -23,8 +23,6 @@
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
import org.eclipse.jdt.internal.compiler.env.EnumConstantSignature;
@@ -33,8 +31,6 @@
import org.eclipse.jdt.internal.compiler.env.IBinaryField;
import org.eclipse.jdt.internal.compiler.env.IBinaryMethod;
import org.eclipse.jdt.internal.compiler.impl.Constant;
-import org.eclipse.jdt.internal.compiler.impl.IntConstant;
-import org.eclipse.jdt.internal.compiler.impl.StringConstant;
import org.jboss.tools.seam.core.BeanType;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IValueInfo;
@@ -48,7 +44,6 @@
import org.jboss.tools.seam.internal.core.SeamJavaComponentDeclaration;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
import org.jboss.tools.seam.internal.core.scanner.Util;
-import org.jboss.tools.seam.internal.core.scanner.java.AnnotatedASTNode;
import org.jboss.tools.seam.internal.core.scanner.java.SeamAnnotations;
import org.jboss.tools.seam.internal.core.scanner.java.ValueInfo;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -111,10 +111,8 @@
((FolderImpl)o.getParent()).updateChildFile(o, f.getLocation().toFile());
if(o.getParent() == null) {
boolean b = isLikelyComponentSource(f);
- System.out.println("--1 " + b);
if(!b) return null;
o = EclipseResourceUtil.getObjectByResource(o.getModel(), f);
- System.out.println("--2 " + o);
if(o == null) return null;
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2007-12-20 00:12:39 UTC (rev 5391)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2007-12-20 00:17:11 UTC (rev 5392)
@@ -12,21 +12,18 @@
import java.util.Set;
-import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.text.BadLocationException;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
/**
* Abstract implementation of ISeamvalidator
@@ -96,10 +93,12 @@
target).getLineOfOffset(offset) + 1);
} catch (BadLocationException e) {
- SeamCorePlugin.getPluginLog().logError(e);
+ SeamCorePlugin.getPluginLog().logError(
+ "Exception occurred during error line number calculation",e);
return;
} catch (CoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
+ SeamCorePlugin.getPluginLog().logError(
+ "Exception occurred during error line number calculation",e);
return;
}
if (!ignore) {
17 years
JBoss Tools SVN: r5391 - trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-12-19 19:12:39 -0500 (Wed, 19 Dec 2007)
New Revision: 5391
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java
Log:
NPE fixed
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java 2007-12-20 00:12:31 UTC (rev 5390)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java 2007-12-20 00:12:39 UTC (rev 5391)
@@ -182,7 +182,7 @@
{
IArchive subPackage = (IArchive) subPackages[i];
if (subPackage.getName().equals(packageNameText.getText())
- && (!archive.equals(this.archive)))
+ && (!subPackage.equals(this.archive)))
{
setErrorMessage(
ArchivesUIMessages.bind(
17 years
JBoss Tools SVN: r5390 - in trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor: print and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-12-19 19:12:31 -0500 (Wed, 19 Dec 2007)
New Revision: 5390
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/dnd/TilesTemplateTransferDropTargetListener.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/print/PagesView.java
Log:
Cleanup the code:
1. new Long(value) replaced for Long.valueOf(value)
2. new String() removed
3. new Boolean(true/false) replaced to Boolean.TRUE/FALSE
4. Unused packages were removed from seam.plugins
5. Throwing of NullPointerException replaced to IllegalArgument Exception
6. catch Exception replaced to particular Exception types in several places
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/dnd/TilesTemplateTransferDropTargetListener.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/dnd/TilesTemplateTransferDropTargetListener.java 2007-12-20 00:12:22 UTC (rev 5389)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/dnd/TilesTemplateTransferDropTargetListener.java 2007-12-20 00:12:31 UTC (rev 5390)
@@ -27,7 +27,7 @@
class TilesTemplateFactory implements CreationFactory {
public Object getNewObject() {
- return new String("definition");
+ return "definition";
}
public Object getObjectType() {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/print/PagesView.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/print/PagesView.java 2007-12-20 00:12:22 UTC (rev 5389)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/print/PagesView.java 2007-12-20 00:12:31 UTC (rev 5390)
@@ -258,7 +258,7 @@
while(tmp>0){
g2.drawLine(tmp - pW+zeroX,zeroY,tmp - pW+zeroX,ymax+zeroY);
tmp = tmp - pW;
- xx.add(new Integer(tmp));
+ xx.add(Integer.valueOf(tmp));
}
List<Rectangle> rec = new ArrayList<Rectangle>();
17 years
JBoss Tools SVN: r5389 - in trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model: engines/impl and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-12-19 19:12:22 -0500 (Wed, 19 Dec 2007)
New Revision: 5389
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XJob.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcessStorage.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemPeer.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccess.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/SwitchPreference.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/extension/ExtensionPointUtil.java
Log:
Cleanup the code:
1. new Long(value) replaced for Long.valueOf(value)
2. new String() removed
3. new Boolean(true/false) replaced to Boolean.TRUE/FALSE
4. Unused packages were removed from seam.plugins
5. Throwing of NullPointerException replaced to IllegalArgument Exception
6. catch Exception replaced to particular Exception types in several places
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XJob.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XJob.java 2007-12-20 00:12:12 UTC (rev 5388)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/XJob.java 2007-12-20 00:12:22 UTC (rev 5389)
@@ -76,7 +76,6 @@
continue;
}
//TODO keep watching
- System.out.println(js[i].getName());
return js[i];
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcessStorage.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcessStorage.java 2007-12-20 00:12:12 UTC (rev 5388)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/engines/impl/XProcessStorage.java 2007-12-20 00:12:22 UTC (rev 5389)
@@ -25,7 +25,7 @@
public void addInstance(String path, XProcess p) {
if(p == null || !p.isRunning()) return;
- getInstances(path).put(new Long(System.currentTimeMillis()), p);
+ getInstances(path).put(Long.valueOf(System.currentTimeMillis()), p);
}
private HashMap<Long,XProcess> getInstances(String path) {
@@ -56,7 +56,7 @@
public void stopInstance(String path, long time) {
HashMap<Long,XProcess> is = getRunningInstances(path);
if(is == null) return;
- Long l = new Long(time);
+ Long l = Long.valueOf(time);
XProcess p = is.get(l);
if(p == null) return;
p.stop();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemPeer.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemPeer.java 2007-12-20 00:12:12 UTC (rev 5388)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/FileSystemPeer.java 2007-12-20 00:12:22 UTC (rev 5389)
@@ -58,7 +58,7 @@
}
private Long toLastModified(File f) {
- return !f.exists() ? new Long(0) : new Long(f.lastModified());
+ return !f.exists() ? Long.valueOf(0) : Long.valueOf(f.lastModified());
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccess.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccess.java 2007-12-20 00:12:12 UTC (rev 5388)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccess.java 2007-12-20 00:12:22 UTC (rev 5389)
@@ -107,7 +107,7 @@
ZipEntry entry = (ZipEntry)en.nextElement();
String name = entry.getName();
if(name != null && !name.endsWith("/") && entry.getSize() > 0) {
- fileEntries.put(name, new Long(entry.getSize()));
+ fileEntries.put(name, Long.valueOf(entry.getSize()));
}
register(name);
} catch (Exception e) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java 2007-12-20 00:12:12 UTC (rev 5388)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/handlers/RemoveModelNatureHandler.java 2007-12-20 00:12:22 UTC (rev 5389)
@@ -64,7 +64,7 @@
pd.setProperty(ServiceDialog.DIALOG_MESSAGE, message);
String checkBoxMessage = "Remove Dynamic Web Project Capabilities";
pd.setProperty(ServiceDialog.CHECKBOX_MESSAGE, checkBoxMessage);
- pd.put(ServiceDialog.CHECKED, new Boolean(false));
+ pd.put(ServiceDialog.CHECKED, Boolean.FALSE);
if(!dialog.openConfirm(pd)) return;
Boolean b = (Boolean)pd.get(ServiceDialog.CHECKED);
unregisterWTP = b.booleanValue();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/SwitchPreference.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/SwitchPreference.java 2007-12-20 00:12:12 UTC (rev 5388)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/options/SwitchPreference.java 2007-12-20 00:12:22 UTC (rev 5389)
@@ -38,7 +38,7 @@
}
public String getValue() {
- if(switchPreference==null) throw new NullPointerException("switchPreference cannot be null, call setSwitchPreferenceFirst.");
+ if(switchPreference==null) throw new IllegalStateException("switchPreference cannot be null, call setSwitchPreferenceFirst.");
Preference preference = (Preference)preferencesMap.get(switchPreference.getValue());
if(preference==null) throw new IllegalStateException("Preference in't added for switch value '" + switchPreference.getValue() + "'");
return preference.getValue();
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2007-12-20 00:12:12 UTC (rev 5388)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2007-12-20 00:12:22 UTC (rev 5389)
@@ -72,13 +72,8 @@
}
public static String getIconPath(XModelObject o) {
- try {
- String s = o.getMainIconName();
- return o.getModelEntity().getMetaModel().getIconList().getIconPath(s, "default.unknown");
- } catch (Exception ex) {
- ModelPlugin.getPluginLog().logError(ex);
- return null;
- }
+ String s = o.getMainIconName();
+ return o.getModelEntity().getMetaModel().getIconList().getIconPath(s, "default.unknown");
}
public static Image getImage(String path) {
@@ -125,13 +120,8 @@
public static XModelObject getObjectByPath(IProject p, String path) {
if(p == null) return null;
- try {
- IModelNature sp = getModelNature(p);
- return (sp == null) ? null : sp.getModel().getByPath(path);
- } catch (Exception e) {
- ModelPlugin.getPluginLog().logError(e);
- return null;
- }
+ IModelNature sp = getModelNature(p);
+ return (sp == null) ? null : sp.getModel().getByPath(path);
}
public static XModelObject findFileSystem(IResource resource, XModel model) {
@@ -201,7 +191,7 @@
if(p == null || !p.isOpen()) return false;
try {
if(p.hasNature(nature)) return true;
- } catch (Exception e) {
+ } catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
}
return false;
@@ -216,7 +206,7 @@
IModelNature n = (IModelNature)p.getNature(natures[i]);
return n == null || n.getModel() == null ? null : n;
}
- } catch (Exception e) {
+ } catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
}
}
@@ -227,7 +217,7 @@
if(p == null || !p.isOpen()) return null;
try {
if(p.hasNature(id)) return (IModelNature)p.getNature(id);
- } catch (Exception e) {
+ } catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
}
return null;
@@ -247,23 +237,20 @@
if(resource == null || !resource.exists()) return null;
IProject project = resource.getProject();
if(project == null || !project.isOpen()) return null;
- try {
- IModelNature sp = getModelNature(project);
- if(sp != null) {
- XModelObject result = getObjectByResource(resource);
- if(result == null) {
- XModelObject fs = findFileSystem(resource.getProject(), sp.getModel());
- if(fs == null) {
- fs = addFileSystem(resource.getProject(), sp.getModel());
- if(fs != null) result = getObjectByResource(resource);
- }
+
+ IModelNature sp = getModelNature(project);
+ if(sp != null) {
+ XModelObject result = getObjectByResource(resource);
+ if(result == null) {
+ XModelObject fs = findFileSystem(resource.getProject(), sp.getModel());
+ if(fs == null) {
+ fs = addFileSystem(resource.getProject(), sp.getModel());
+ if(fs != null) result = getObjectByResource(resource);
}
- return result;
}
- } catch (Exception e) {
- ModelPlugin.getPluginLog().logError(e);
- return null;
+ return result;
}
+
XModel model = models.get(project);
if(model != null) {
validateJarSystem(model.getByPath("FileSystems"), resource);
@@ -311,7 +298,7 @@
IResource[] cs = null;
try {
cs = project.members();
- } catch (Exception e) {
+ } catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
}
if(cs != null) for (int i = 0; i < cs.length; i++) {
@@ -412,7 +399,7 @@
if(project == null || !project.isOpen()) return null;
if(!project.hasNature(JavaCore.NATURE_ID)) return null;
return JavaCore.create(project);
- } catch (Exception e) {
+ } catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
return null;
}
@@ -425,32 +412,17 @@
IPath p = javaProject.getOutputLocation();
IResource r = project.getWorkspace().getRoot().findMember(p);
return (r == null || r.getLocation() == null) ? null : r.getLocation().toString();
- } catch (Exception e) {
+ } catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
return null;
}
}
-
- public static URLClassLoader getClassLoader(IProject project, ClassLoader parent) throws Exception {
- if(!project.hasNature(JavaCore.NATURE_ID)) return null;
- List paths = getClassPath(project);
- ArrayList<URL> l = new ArrayList<URL>();
- for (int i = 0; i < paths.size(); i++) {
- try {
- l.add(new File(paths.get(i).toString()).toURL());
- } catch (Exception e) {
- //ignore - we do not care about malformed URLs in classpath here.
- }
- }
- URL[] urls = l.toArray(new URL[0]);
- return new URLClassLoader(urls, parent);
- }
-
/**
* Returns list of canonical paths to resources included in class path.
+ * @throws IOException
*/
- public static List<String> getClassPath(IProject project) throws Exception {
+ public static List<String> getClassPath(IProject project) throws CoreException, IOException {
if(!project.hasNature(JavaCore.NATURE_ID)) return null;
ArrayList<String> l = new ArrayList<String>();
IJavaProject javaProject = JavaCore.create(project);
@@ -472,7 +444,7 @@
l.add(new java.io.File(s).getCanonicalPath());
}
}
- } catch (Exception e) {
+ } catch (IOException e) {
//ignore - we do not care about non-existent files here.
}
}
@@ -520,7 +492,7 @@
path = new Path(p.replace('.', '/') + ".java");
}
return javaProject.findElement(path);
- } catch (Exception ex) {
+ } catch (CoreException ex) {
ModelPlugin.getPluginLog().logError(ex);
}
return null;
@@ -530,22 +502,25 @@
if (className == null && className.length() == 0) return null;
IJavaProject javaProject = getJavaProject(project);
if(javaProject == null) return null;
+ IFile f = null;
try {
IType t = javaProject.findType(className);
if(t == null || t.isBinary()) return t;
if(t.getParent() instanceof ICompilationUnit) {
ICompilationUnit u = (ICompilationUnit)t.getParent();
- IFile f = (IFile)u.getCorrespondingResource();
+ f = (IFile)u.getCorrespondingResource();
IMarker[] ms = f.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_ZERO);
for (int i = 0; i < ms.length; i++) {
if(ms[i].getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO) == IMarker.SEVERITY_ERROR) return null;
}
}
return t;
- } catch (Exception t) {
+ } catch (JavaModelException t) {
ModelPlugin.getPluginLog().logError("Error while obtaining type " + className, t);
- return null;
+ } catch (CoreException t) {
+ ModelPlugin.getPluginLog().logError("Error occured while obtaining Java Problem markers for " + f.getLocation() , t);
}
+ return null;
}
/**
@@ -581,7 +556,7 @@
String output = r.getLocation().toString();
String f = output + "/" + className.replace('.', '/') + ".class";
return new java.io.File(f).isFile();
- } catch (Exception t) {
+ } catch (JavaModelException t) {
ModelPlugin.getPluginLog().logError("Error checking class " + className, t);
return false;
}
@@ -628,7 +603,7 @@
}
}
}
- } catch (Exception ex) {
+ } catch (JavaModelException ex) {
ModelPlugin.getPluginLog().logError(ex);
}
return null;
@@ -671,7 +646,7 @@
proj.setDescription(description, null);
}
- public static void openResource(IResource resource) throws Exception {
+ public static void openResource(IResource resource) {
XModelObject o = getObjectByResource(resource);
if(o == null) o = createObjectForResource(resource);
if(o != null) XActionInvoker.invoke("Open", o, null);
@@ -694,7 +669,7 @@
public static URL getInstallURL(Bundle bundle) {
try {
return bundle == null ? null : FileLocator.resolve(bundle.getEntry("/"));
- } catch (Exception e) {
+ } catch (IOException e) {
//ignore and try to execute it in the other way
return bundle.getEntry("/");
}
@@ -719,7 +694,7 @@
IResource[] ms = null;
try {
ms = projects[i].members(true);
- } catch (Exception e) {
+ } catch (CoreException e) {
//ignore - we do not care if project can give its members here.
}
if(ms != null) for (int j = 0; j < ms.length; j++) {
@@ -753,7 +728,7 @@
String relative = location.substring(l.length()).replace('\\', '/');
return (relative.length() == 0) ? (IResource)c : c.getFolder(new Path(relative));
}
- } catch (Exception e) {
+ } catch (CoreException e) {
ModelPlugin.getPluginLog().logError(e);
}
continue;
@@ -795,31 +770,30 @@
ArrayList<IResource> l = new ArrayList<IResource>();
IClasspathEntry[] es = null;
+
try {
es = javaProject.getResolvedClasspath(true);
} catch (JavaModelException e) {
//ignore - if project cannot respond, it may not have resources of interest.
return new IProject[0];
}
+
if(es != null) for (int i = 0; i < es.length; i++) {
- try {
- if(es[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) {
- IPath path = es[i].getPath();
- IProject p = (IProject)project.getWorkspace().getRoot().findMember(path);
- l.add(p);
- } else if(es[i].getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
- IPath path = es[i].getPath();
- IResource r = project.getWorkspace().getRoot().findMember(path);
- if(r != null && (r instanceof IContainer)) {
- l.add(r);
- } else if(r != null && !project.getFullPath().isPrefixOf(r.getFullPath())) {
- l.add(r); //probably it is jar
- }
+ if(es[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) {
+ IPath path = es[i].getPath();
+ IProject p = (IProject)project.getWorkspace().getRoot().findMember(path);
+ l.add(p);
+ } else if(es[i].getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
+ IPath path = es[i].getPath();
+ IResource r = project.getWorkspace().getRoot().findMember(path);
+ if(r != null && (r instanceof IContainer)) {
+ l.add(r);
+ } else if(r != null && !project.getFullPath().isPrefixOf(r.getFullPath())) {
+ l.add(r); //probably it is jar
}
- } catch (Exception e) {
- ModelPlugin.getPluginLog().logError(e);
}
}
+
return l.toArray(new IResource[0]);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/extension/ExtensionPointUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/extension/ExtensionPointUtil.java 2007-12-20 00:12:12 UTC (rev 5388)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/extension/ExtensionPointUtil.java 2007-12-20 00:12:22 UTC (rev 5389)
@@ -22,10 +22,10 @@
public static Object findClassByElementId(IExtensionPoint point, String id) throws Exception {
IConfigurationElement element = getElementById(point, id);
if(element == null)
- throw new NullPointerException("Configuration element with id=" + id + " is not found");
+ throw new IllegalArgumentException("Configuration element with id=" + id + " is not found");
String className = element.getAttribute("class");
if(className == null || className.length() == 0)
- throw new NullPointerException("Configuration element with id=" + id + " does not define 'class' attribute");
+ throw new IllegalArgumentException("Configuration element with id=" + id + " does not define 'class' attribute");
return element.createExecutableExtension("class");
}
17 years
JBoss Tools SVN: r5388 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common: model/ui and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-12-19 19:12:12 -0500 (Wed, 19 Dec 2007)
New Revision: 5388
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/TreeFormPage.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIImages.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/util/StringUtilities.java
Log:
Cleanup the code:
1. new Long(value) replaced for Long.valueOf(value)
2. new String() removed
3. new Boolean(true/false) replaced to Boolean.TRUE/FALSE
4. Unused packages were removed from seam.plugins
5. Throwing of NullPointerException replaced to IllegalArgument Exception
6. catch Exception replaced to particular Exception types in several places
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/TreeFormPage.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/TreeFormPage.java 2007-12-20 00:12:06 UTC (rev 5387)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/TreeFormPage.java 2007-12-20 00:12:12 UTC (rev 5388)
@@ -171,7 +171,8 @@
String actionListName = actionList.getName();
String actionListDisplayName = actionList.getDisplayName();
String actionListPath = actionList.getPath();
- System.out.println(level+"ActionList ["+actionListName+"] ["+actionListDisplayName+"] ["+actionListPath+"]");
+ // TBD switch to trace support
+ // System.out.println(level+"ActionList ["+actionListName+"] ["+actionListDisplayName+"] ["+actionListPath+"]");
XActionItem[] items = actionList.getActionItems();
for (int i=0;i<items.length;++i) {
if (items[i] instanceof XActionList) {
@@ -180,7 +181,8 @@
String actionItemName = items[i].getName();
String actionItemDisplayName = items[i].getDisplayName();
String actionItemPath = items[i].getPath();
- System.out.println(level+" "+"ActionItem ["+actionItemName+"] ["+actionItemDisplayName+"] ["+actionItemPath+"]");
+ // TBD switch to trace support
+ // System.out.println(level+" "+"ActionItem ["+actionItemName+"] ["+actionItemDisplayName+"] ["+actionItemPath+"]");
}
}
}
@@ -194,6 +196,7 @@
XModelObject xmo = getModelObject(event.getSelection());
if(selection == xmo) return;
selection = xmo;
+
if (xmo!=null && xmo.getModelEntity()!=null) printActionList("", xmo.getModelEntity().getActionList());
IForm form = (xmo == null) ? null : getFormFactory(xmo).getForm();
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIImages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIImages.java 2007-12-20 00:12:06 UTC (rev 5387)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIImages.java 2007-12-20 00:12:12 UTC (rev 5388)
@@ -85,7 +85,7 @@
ModelUIPlugin.getPluginLog().logInfo("parent = " + (parent==null?"null":parent.getClass().getName()));
}
- if(registryUrl == null) throw new NullPointerException("Base url for image registry cannot be null.");
+ if(registryUrl == null) throw new IllegalArgumentException("Base url for image registry cannot be null.");
baseUrl = registryUrl;
parentRegistry = parent;
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java 2007-12-20 00:12:06 UTC (rev 5387)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java 2007-12-20 00:12:12 UTC (rev 5388)
@@ -76,7 +76,7 @@
}
public XAttributeSupport(XModelObject xmo) {
- if(xmo==null) throw new NullPointerException("XModelObject cannot be null.");
+ if(xmo==null) throw new IllegalArgumentException("XModelObject cannot be null.");
init(xmo);
}
@@ -85,7 +85,7 @@
}
public XAttributeSupport(XModelObject xmo, XEntityData data, boolean useObject) {
- if(data==null) throw new NullPointerException("XEntityData cannot be null.");
+ if(data==null) throw new IllegalArgumentException("XEntityData cannot be null.");
init(xmo, data, useObject);
}
@@ -375,16 +375,16 @@
}
public void load() {
- if(xmo == null) throw new NullPointerException("" +
+ if(xmo == null) throw new IllegalArgumentException("" +
"Init support with XModelObject before saving");
for (int i = 0; i < editors.size(); i++)
((IModelPropertyEditorAdapter)adapters.get(i)).load();
}
public void save() {
- if(xmo == null) throw new NullPointerException("" +
+ if(xmo == null) throw new IllegalArgumentException("" +
"Init support with XModelObject before saving");
- if(xmo.getModel()==null) throw new NullPointerException("Cannot store deleted or removed XModel object");
+ if(xmo.getModel()==null) throw new IllegalArgumentException("Cannot store deleted or removed XModel object");
xmo.getModel().saveOptions();
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/util/StringUtilities.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/util/StringUtilities.java 2007-12-20 00:12:06 UTC (rev 5387)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/util/StringUtilities.java 2007-12-20 00:12:12 UTC (rev 5388)
@@ -50,7 +50,7 @@
str = tmp;
}
} else {
- str = new String(source);
+ str = source;
}
gc.dispose();
return str;
17 years
JBoss Tools SVN: r5387 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-12-19 19:12:06 -0500 (Wed, 19 Dec 2007)
New Revision: 5387
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java
Log:
Cleanup the code:
1. new Long(value) replaced for Long.valueOf(value)
2. new String() removed
3. new Boolean(true/false) replaced to Boolean.TRUE/FALSE
4. Unused packages were removed from seam.plugins
5. Throwing of NullPointerException replaced to IllegalArgument Exception
6. catch Exception replaced to particular Exception types in several places
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java 2007-12-20 00:12:02 UTC (rev 5386)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataFilterSliderTemplate.java 2007-12-20 00:12:06 UTC (rev 5387)
@@ -339,7 +339,7 @@
* @return number
*/
private int getSize(String size) {
- String num = new String(size);
+ String num = size;
int pos = num.indexOf(PIXEL_PREFIX);
if (pos != -1) {
num = num.substring(0, pos);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java 2007-12-20 00:12:02 UTC (rev 5386)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableScrollerTemplate.java 2007-12-20 00:12:06 UTC (rev 5387)
@@ -274,7 +274,7 @@
if(size==null) {
return 0;
}
- String num = new String(size);
+ String num = size;
int pos = size.indexOf(PIXEL_PREFIX);
if (pos != -1) {
num = size.substring(0, pos);
17 years
JBoss Tools SVN: r5386 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-12-19 19:12:02 -0500 (Wed, 19 Dec 2007)
New Revision: 5386
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java
Log:
Cleanup the code:
1. new Long(value) replaced for Long.valueOf(value)
2. new String() removed
3. new Boolean(true/false) replaced to Boolean.TRUE/FALSE
4. Unused packages were removed from seam.plugins
5. Throwing of NullPointerException replaced to IllegalArgument Exception
6. catch Exception replaced to particular Exception types in several places
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java 2007-12-20 00:11:58 UTC (rev 5385)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java 2007-12-20 00:12:02 UTC (rev 5386)
@@ -143,7 +143,7 @@
*/
private String checkCollection(Object value){
- return value != null && (((Collection)value).size() > 0) ? prepareCollectionToString((Collection)value) : new String(""); //$NON-NLS-1$
+ return value != null && (((Collection)value).size() > 0) ? prepareCollectionToString((Collection)value) : ""; //$NON-NLS-1$
}
/*
@@ -168,7 +168,7 @@
* @return
*/
private String checkSimple(Object value){
- return (value != null) ? value.toString() : new String(""); //$NON-NLS-1$
+ return (value != null) ? value.toString() : ""; //$NON-NLS-1$
}
/**
17 years
JBoss Tools SVN: r5385 - trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-12-19 19:11:58 -0500 (Wed, 19 Dec 2007)
New Revision: 5385
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/VResultTemplate.java
Log:
Cleanup the code:
1. new Long(value) replaced for Long.valueOf(value)
2. new String() removed
3. new Boolean(true/false) replaced to Boolean.TRUE/FALSE
4. Unused packages were removed from seam.plugins
5. Throwing of NullPointerException replaced to IllegalArgument Exception
6. catch Exception replaced to particular Exception types in several places
Modified: trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/VResultTemplate.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/VResultTemplate.java 2007-12-20 00:11:55 UTC (rev 5384)
+++ trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/VResultTemplate.java 2007-12-20 00:11:58 UTC (rev 5385)
@@ -157,7 +157,7 @@
VMessageFormat parent = format.getParent();
if (parent != null) {
Object[] params2 = new Object[] {sourceObject, sourcePosition,
- targetObject, targetPosition, message, type, new Integer(significance)};
+ targetObject, targetPosition, message, type,Integer.valueOf(significance)};
message = parent.format(params2);
}
result.setMessage(message);
17 years