JBoss Tools SVN: r39039 - in trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi: configurators and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-23 04:10:48 -0500 (Thu, 23 Feb 2012)
New Revision: 39039
Removed:
trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/Messages.java
trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/messages.properties
Modified:
trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/configurators/CDIProjectConfigurator.java
Log:
JBIDE-11005 : remove confusing logging
Deleted: trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/Messages.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/Messages.java 2012-02-23 09:10:02 UTC (rev 39038)
+++ trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/Messages.java 2012-02-23 09:10:48 UTC (rev 39039)
@@ -1,30 +0,0 @@
-/*************************************************************************************
- * Copyright (c) 2008-2011 Red Hat, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * JBoss by Red Hat - Initial implementation.
- ************************************************************************************/
-package org.jboss.tools.maven.cdi;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- *
- * @author snjeza
- *
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.maven.cdi.messages"; //$NON-NLS-1$
- public static String CDIProjectConfigurator_The_project_does_not_contain_required_facets;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/configurators/CDIProjectConfigurator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/configurators/CDIProjectConfigurator.java 2012-02-23 09:10:02 UTC (rev 39038)
+++ trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/configurators/CDIProjectConfigurator.java 2012-02-23 09:10:48 UTC (rev 39039)
@@ -24,7 +24,6 @@
import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.componentcore.ModuleCoreNature;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
@@ -34,7 +33,6 @@
import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.CDIUtil;
import org.jboss.tools.maven.cdi.MavenCDIActivator;
-import org.jboss.tools.maven.cdi.Messages;
import org.jboss.tools.maven.core.IJBossMavenConstants;
import org.jboss.tools.maven.core.internal.project.facet.MavenFacetInstallDataModelProvider;
import org.jboss.tools.maven.ui.Activator;
@@ -139,15 +137,8 @@
if ((currentWebVersion != null && currentWebVersion.compareTo(dynamicWebVersion)> -1)
|| (currentEjbVersion != null && currentEjbVersion.compareTo(ejbVersion)> -1)) {
installCDIFacet(fproj, cdiVersion, monitor);
- } else {
- String name = "";
- if (fproj.getProject() != null) {
- name = fproj.getProject().getName();
- }
- MavenCDIActivator.log(NLS.bind(Messages.CDIProjectConfigurator_The_project_does_not_contain_required_facets, name));
}
installM2Facet(fproj, monitor);
-
}
Deleted: trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/messages.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/messages.properties 2012-02-23 09:10:02 UTC (rev 39038)
+++ trunk/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/messages.properties 2012-02-23 09:10:48 UTC (rev 39039)
@@ -1 +0,0 @@
-CDIProjectConfigurator_The_project_does_not_contain_required_facets=The {0} project does not contain the Dynamic Web Module facet or the EJB Module facet.
12 years, 4 months
JBoss Tools SVN: r39038 - in branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi: configurators and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-02-23 04:10:02 -0500 (Thu, 23 Feb 2012)
New Revision: 39038
Removed:
branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/Messages.java
branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/messages.properties
Modified:
branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/configurators/CDIProjectConfigurator.java
Log:
JBIDE-11005 : remove confusing logging
Deleted: branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/Messages.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/Messages.java 2012-02-23 08:56:40 UTC (rev 39037)
+++ branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/Messages.java 2012-02-23 09:10:02 UTC (rev 39038)
@@ -1,30 +0,0 @@
-/*************************************************************************************
- * Copyright (c) 2008-2011 Red Hat, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * JBoss by Red Hat - Initial implementation.
- ************************************************************************************/
-package org.jboss.tools.maven.cdi;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- *
- * @author snjeza
- *
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.maven.cdi.messages"; //$NON-NLS-1$
- public static String CDIProjectConfigurator_The_project_does_not_contain_required_facets;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Modified: branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/configurators/CDIProjectConfigurator.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/configurators/CDIProjectConfigurator.java 2012-02-23 08:56:40 UTC (rev 39037)
+++ branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/configurators/CDIProjectConfigurator.java 2012-02-23 09:10:02 UTC (rev 39038)
@@ -24,7 +24,6 @@
import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
import org.eclipse.m2e.core.project.configurator.AbstractProjectConfigurator;
import org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.componentcore.ModuleCoreNature;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
@@ -34,7 +33,6 @@
import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.CDIUtil;
import org.jboss.tools.maven.cdi.MavenCDIActivator;
-import org.jboss.tools.maven.cdi.Messages;
import org.jboss.tools.maven.core.IJBossMavenConstants;
import org.jboss.tools.maven.core.internal.project.facet.MavenFacetInstallDataModelProvider;
import org.jboss.tools.maven.ui.Activator;
@@ -139,15 +137,8 @@
if ((currentWebVersion != null && currentWebVersion.compareTo(dynamicWebVersion)> -1)
|| (currentEjbVersion != null && currentEjbVersion.compareTo(ejbVersion)> -1)) {
installCDIFacet(fproj, cdiVersion, monitor);
- } else {
- String name = "";
- if (fproj.getProject() != null) {
- name = fproj.getProject().getName();
- }
- MavenCDIActivator.log(NLS.bind(Messages.CDIProjectConfigurator_The_project_does_not_contain_required_facets, name));
}
installM2Facet(fproj, monitor);
-
}
Deleted: branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/messages.properties
===================================================================
--- branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/messages.properties 2012-02-23 08:56:40 UTC (rev 39037)
+++ branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.cdi/src/org/jboss/tools/maven/cdi/messages.properties 2012-02-23 09:10:02 UTC (rev 39038)
@@ -1 +0,0 @@
-CDIProjectConfigurator_The_project_does_not_contain_required_facets=The {0} project does not contain the Dynamic Web Module facet or the EJB Module facet.
12 years, 4 months
JBoss Tools SVN: r39037 - branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-02-23 03:56:40 -0500 (Thu, 23 Feb 2012)
New Revision: 39037
Modified:
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftPasswordStorageKey.java
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java
Log:
Fixed - JBIDE-10993 - Error when connecting into the OpenShift Express Console for the first time
https://issues.jboss.org/browse/JBIDE-10993
Modified: branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftPasswordStorageKey.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftPasswordStorageKey.java 2012-02-23 08:47:53 UTC (rev 39036)
+++ branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/OpenShiftPasswordStorageKey.java 2012-02-23 08:56:40 UTC (rev 39037)
@@ -29,8 +29,8 @@
private String userName;
public OpenShiftPasswordStorageKey(String platform, String userName) {
- this.userName = platform;
- this.platform = userName;
+ this.platform = platform;
+ this.userName = userName;
}
@Override
@@ -47,8 +47,8 @@
if (!key.getClass().isAssignableFrom(OpenShiftPasswordStorageKey.class)) {
return false;
}
- OpenShiftPasswordStorageKey deltaCloudKey = (OpenShiftPasswordStorageKey) key;
- return userName.equals(deltaCloudKey.userName)
- && platform.equals(deltaCloudKey.platform);
+ OpenShiftPasswordStorageKey openshiftKey = (OpenShiftPasswordStorageKey) key;
+ return (userName != null && openshiftKey.userName != null && userName.equals(openshiftKey.userName))
+ && (platform != null && openshiftKey.platform != null && platform.equals(openshiftKey.platform));
}
}
Modified: branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java 2012-02-23 08:47:53 UTC (rev 39036)
+++ branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/utils/SecurePasswordStore.java 2012-02-23 08:56:40 UTC (rev 39037)
@@ -48,11 +48,13 @@
}
}
- public void setPassword(String password) throws SecurePasswordStoreException {
+ public void setPassword(String password)
+ throws SecurePasswordStoreException {
update(storageKey, password);
}
- public void update(IStorageKey key, String password) throws SecurePasswordStoreException {
+ public void update(IStorageKey key, String password)
+ throws SecurePasswordStoreException {
if (!storageKey.equals(key) || isPasswordChanged(password)) {
storeInPreferences(this.password = password, this.storageKey = key);
}
@@ -62,7 +64,8 @@
if (this.password == null && password == null) {
return false;
} else {
- return (this.password == null && password != null) || (this.password != null && password == null)
+ return (this.password == null && password != null)
+ || (this.password != null && password == null)
|| !password.equals(this.password);
}
}
@@ -71,15 +74,18 @@
try {
ISecurePreferences node = getNode(storageKey);
if (node == null) {
- throw new SecurePasswordStoreException("Could not remove password");
+ throw new SecurePasswordStoreException(
+ "Could not remove password");
}
node.clear();
} catch (Exception e) {
- throw new SecurePasswordStoreException("Could not remove password", e);
+ throw new SecurePasswordStoreException("Could not remove password",
+ e);
}
}
- private String getFromPreferences(IStorageKey key) throws StorageException, UnsupportedEncodingException {
+ private String getFromPreferences(IStorageKey key) throws StorageException,
+ UnsupportedEncodingException {
ISecurePreferences node = getNode(key);
String password = node.get("password", null); //$NON-NLS-1$
if (password == null) {
@@ -88,16 +94,22 @@
return new String(EncodingUtils.decodeBase64(password));
}
- private void storeInPreferences(String password, IStorageKey key) throws SecurePasswordStoreException {
- try {
- ISecurePreferences node = getNode(key);
- node.put("password", EncodingUtils.encodeBase64(password.getBytes()), true /* encrypt */); //$NON-NLS-1$
- } catch (Exception e) {
- throw new SecurePasswordStoreException("Could not store password", e);
+ private void storeInPreferences(String password, IStorageKey key)
+ throws SecurePasswordStoreException {
+ if (password != null) {
+ try {
+ ISecurePreferences node = getNode(key);
+ node.put(
+ "password", EncodingUtils.encodeBase64(password.getBytes()), true /* encrypt */); //$NON-NLS-1$
+ } catch (Exception e) {
+ throw new SecurePasswordStoreException(
+ "Could not store password", e);
+ }
}
}
- private ISecurePreferences getNode(IStorageKey key) throws UnsupportedEncodingException {
+ private ISecurePreferences getNode(IStorageKey key)
+ throws UnsupportedEncodingException {
if (key == null) {
return null;
}
12 years, 4 months
JBoss Tools SVN: r39036 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-02-23 03:47:53 -0500 (Thu, 23 Feb 2012)
New Revision: 39036
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
Log:
Removing unwanted catch(Throwable) clause
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-02-23 08:26:39 UTC (rev 39035)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPageModel.java 2012-02-23 08:47:53 UTC (rev 39036)
@@ -225,8 +225,6 @@
} catch (Exception e) {
status = OpenShiftUIActivator.createErrorStatus(NLS.bind(
"Could not check user credentials: {0}.", e.getMessage()));
- } catch(Throwable e) {
- Logger.error("Failed to validate credentials", e);
}
return status;
}
12 years, 4 months
JBoss Tools SVN: r39035 - in trunk/as/plugins: org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-23 03:26:39 -0500 (Thu, 23 Feb 2012)
New Revision: 39035
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB3ClasspathContainer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/CustomRuntimeClasspathModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/src/org/jboss/ide/eclipse/as/classpath/ui/containers/custom/CustomClasspathPreferencePage.java
Log:
JBIDE-11032 - to trunk handling exceptions
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB3ClasspathContainer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB3ClasspathContainer.java 2012-02-23 08:25:05 UTC (rev 39034)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/ejb3/EJB3ClasspathContainer.java 2012-02-23 08:26:39 UTC (rev 39035)
@@ -14,6 +14,8 @@
import java.io.FileNotFoundException;
import java.util.ArrayList;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
@@ -55,36 +57,38 @@
public EJB3ClasspathContainer(IPath path, IJavaProject project) {
this.path = path;
this.javaProject = project;
-
- try {
- String configName = path.segment(1);
- IServer servers[] = ServerCore.getServers();
-
- if (configName == null) {
- // old classpath container, try finding the persisten property
- configName = project.getProject().getPersistentProperty(JBOSS_EJB3_CONFIGURATION);
- if (configName != null) {
- // go ahead and remove the persistent property
- project.getProject().setPersistentProperty(JBOSS_EJB3_CONFIGURATION, null);
- }
- }
-
- for (int i = 0; i < servers.length; i++) {
- if (servers[i].getName().equals(configName)) {
- jbossServer = (JBossServer) servers[i].loadAdapter(JBossServer.class, new NullProgressMonitor());
- try {
- homePath = jbossServer.getServer().getRuntime().getLocation();
- configPath = new Path(jbossServer.getConfigDirectory());
- } catch( Exception e ) {
- IStatus status = new Status(IStatus.ERROR, ClasspathCorePlugin.PLUGIN_ID,Messages.EJB3ClasspathContainer_could_not_determine_home, e);
- ClasspathCorePlugin.getDefault().getLog().log(status);
- }
- break;
- }
- }
- } catch (CoreException e) {
+ String configName = path.segment(1);
+ IServer servers[] = ServerCore.getServers();
+ IProject p = project.getProject();
+ if( p.exists() && p.isOpen() /* && Deprecated : p.isLocal(IResource.DEPTH_INFINITE)*/) {
+ try {
+ if (configName == null) {
+ // old classpath container, try finding the persisten property
+ configName = project.getProject().getPersistentProperty(JBOSS_EJB3_CONFIGURATION);
+ if (configName != null) {
+ // go ahead and remove the persistent property
+ project.getProject().setPersistentProperty(JBOSS_EJB3_CONFIGURATION, null);
+ }
+ }
+ } catch( CoreException ce ) {
+ // This should never occur. If it does, it regards legacy situations.
+ // The project is opened and accessible. There are no reasons for this
+ // to ever occur.
+ }
+ }
+ for (int i = 0; i < servers.length; i++) {
+ if (servers[i].getName().equals(configName)) {
+ jbossServer = (JBossServer) servers[i].loadAdapter(JBossServer.class, new NullProgressMonitor());
+ try {
+ homePath = jbossServer.getServer().getRuntime().getLocation();
+ configPath = new Path(jbossServer.getConfigDirectory());
+ } catch( Exception e ) {
+ IStatus status = new Status(IStatus.ERROR, ClasspathCorePlugin.PLUGIN_ID,Messages.EJB3ClasspathContainer_could_not_determine_home, e);
+ ClasspathCorePlugin.getDefault().getLog().log(status);
+ }
+ break;
+ }
}
-
}
public String getDescription() {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/CustomRuntimeClasspathModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/CustomRuntimeClasspathModel.java 2012-02-23 08:25:05 UTC (rev 39034)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/CustomRuntimeClasspathModel.java 2012-02-23 08:26:39 UTC (rev 39035)
@@ -225,11 +225,19 @@
}
return null;
}
+
+ /**
+ * Return a list of filesets, or null if none are found
+ * @param file
+ * @param server
+ * @return
+ */
public static Fileset[] loadFilesets(File file, IServer server) {
- if( file != null && file.exists()) {
- try {
+ try {
+ if( file != null && file.exists())
return FilesetUtil.loadFilesets(new FileInputStream(file), server);
- } catch( FileNotFoundException fnfe) {}
+ } catch( FileNotFoundException fnfe) {
+ return null;
}
return null;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/src/org/jboss/ide/eclipse/as/classpath/ui/containers/custom/CustomClasspathPreferencePage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/src/org/jboss/ide/eclipse/as/classpath/ui/containers/custom/CustomClasspathPreferencePage.java 2012-02-23 08:25:05 UTC (rev 39034)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.ui/src/org/jboss/ide/eclipse/as/classpath/ui/containers/custom/CustomClasspathPreferencePage.java 2012-02-23 08:26:39 UTC (rev 39035)
@@ -54,6 +54,7 @@
import org.jboss.ide.eclipse.as.classpath.core.RuntimeKey;
import org.jboss.ide.eclipse.as.classpath.core.runtime.CustomRuntimeClasspathModel;
import org.jboss.ide.eclipse.as.classpath.core.runtime.CustomRuntimeClasspathModel.IDefaultPathProvider;
+import org.jboss.ide.eclipse.as.classpath.ui.ClasspathUIPlugin;
import org.jboss.ide.eclipse.as.classpath.ui.Messages;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.preferences.ServerTypePreferencePage;
@@ -95,6 +96,8 @@
try {
prefs.flush();
} catch(BackingStoreException e) {
+ // IGNORE this since it is only a setting to remember what was the last selected
+ // runtime. This is extremely not necessary to log or inform the user about.
}
MessageDialog dialog= new MessageDialog(getShell(),
@@ -115,7 +118,7 @@
// A full build is not enough
jp.setRawClasspath(jp.getRawClasspath(), new NullProgressMonitor());
} catch( JavaModelException jme ) {
- // TODO
+ return jme.getStatus();
}
CoreUtility.getBuildJob(jp.getProject()).schedule();
}
@@ -146,6 +149,8 @@
IProject[] allProjs = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for( int i = 0; i < allProjs.length; i++ ) {
try {
+ if( !allProjs[i].exists() || !allProjs[i].isOpen())
+ continue;
if(FacetedProjectFramework.isFacetedProject(allProjs[i])) {
IFacetedProject fp = ProjectFacetsManager.create(allProjs[i]);
org.eclipse.wst.common.project.facet.core.runtime.IRuntime primary = fp.getPrimaryRuntime();
@@ -156,7 +161,10 @@
}
}
} catch(CoreException ce) {
- // Exception thrown if project does not exist or is closed, can ignore safely
+ // Exception thrown if project does not exist or is closed,
+ // can ignore safely because we checked that, and also,
+ // if this project is erroring, we do not want to error every time
+ // this is checked. Simply recognize this project is not suitable
}
}
return matching.toArray(new IProject[matching.size()]);
12 years, 4 months
JBoss Tools SVN: r39034 - in trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core: src/org/jboss/tools/ws/jaxrs/core/internal/utils and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: xcoulon
Date: 2012-02-23 03:25:05 -0500 (Thu, 23 Feb 2012)
New Revision: 39034
Modified:
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/.options
trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/Logger.java
Log:
Fixed - JBIDE-11006 - JAXRS builder now installed is logged
https://issues.jboss.org/browse/JBIDE-11006
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/.options
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/.options 2012-02-23 08:10:33 UTC (rev 39033)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/.options 2012-02-23 08:25:05 UTC (rev 39034)
@@ -1,3 +1,4 @@
# This file enables runtime tracing
+org.jboss.tools.ws.jaxrs.core/info=true
org.jboss.tools.ws.jaxrs.core/debug=true
org.jboss.tools.ws.jaxrs.core/trace=false
\ No newline at end of file
Modified: trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/Logger.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/Logger.java 2012-02-23 08:10:33 UTC (rev 39033)
+++ trunk/ws/plugins/org.jboss.tools.ws.jaxrs.core/src/org/jboss/tools/ws/jaxrs/core/internal/utils/Logger.java 2012-02-23 08:25:05 UTC (rev 39034)
@@ -35,6 +35,9 @@
*/
public final class Logger {
+ /** The 'info' level name, matching the .options file. */
+ private static final String INFO = JBossJaxrsCorePlugin.PLUGIN_ID + "/info";
+
/** The 'debug' level name, matching the .options file. */
private static final String DEBUG = JBossJaxrsCorePlugin.PLUGIN_ID + "/debug";
@@ -63,9 +66,9 @@
* the throwable cause
*/
public static void error(final String message, final Throwable t) {
- if(JBossJaxrsCorePlugin.getDefault() != null) {
- JBossJaxrsCorePlugin.getDefault().getLog()
- .log(new Status(Status.ERROR, JBossJaxrsCorePlugin.PLUGIN_ID, message, t));
+ if (JBossJaxrsCorePlugin.getDefault() != null) {
+ JBossJaxrsCorePlugin.getDefault().getLog()
+ .log(new Status(Status.ERROR, JBossJaxrsCorePlugin.PLUGIN_ID, message, t));
} else {
// at least write in the .log file
t.printStackTrace();
@@ -108,20 +111,22 @@
}
/**
- * Logs a message with an 'info' severity.
+ * Logs a message with an 'info' severity, if the 'INFO' tracing option is enabled, to avoid unwanted extra
+ * messages in the error log.
*
* @param message
* the message to log
*/
public static void info(String message) {
- JBossJaxrsCorePlugin.getDefault().getLog()
- .log(new Status(Status.INFO, JBossJaxrsCorePlugin.PLUGIN_ID, message));
+ if (isOptionEnabled(INFO)) {
+ JBossJaxrsCorePlugin.getDefault().getLog()
+ .log(new Status(Status.INFO, JBossJaxrsCorePlugin.PLUGIN_ID, message));
+ }
}
/**
- * Outputs a debug message in the trace file (not the error view of the
- * runtime workbench). Traces must be activated for this plugin in order to
- * see the output messages.
+ * Outputs a debug message in the trace file (not the error view of the runtime workbench). Traces must be activated
+ * for this plugin in order to see the output messages.
*
* @param message
* the message to trace.
@@ -132,9 +137,8 @@
}
/**
- * Outputs a 'debug' level message in the .log file (not the error view of
- * the runtime workbench). Traces must be activated for this plugin in order
- * to see the output messages.
+ * Outputs a 'debug' level message in the .log file (not the error view of the runtime workbench). Traces must be
+ * activated for this plugin in order to see the output messages.
*
* @param message
* the message to trace.
@@ -144,9 +148,8 @@
}
/**
- * Outputs a 'trace' level message in the .log file (not the error view of
- * the runtime workbench). Traces must be activated for this plugin in order
- * to see the output messages.
+ * Outputs a 'trace' level message in the .log file (not the error view of the runtime workbench). Traces must be
+ * activated for this plugin in order to see the output messages.
*
* @param message
* the message to trace.
@@ -157,10 +160,8 @@
private static void log(final String level, final String message, final Object... items) {
try {
- String debugOption = Platform.getDebugOption(level);
- String valuedMessage = message;
- if (JBossJaxrsCorePlugin.getDefault() != null && JBossJaxrsCorePlugin.getDefault().isDebugging()
- && "true".equalsIgnoreCase(debugOption)) {
+ if (isOptionEnabled(level)) {
+ String valuedMessage = message;
if (items != null) {
for (Object item : items) {
valuedMessage = valuedMessage.replaceFirst("\\{\\}", (item != null ? item.toString()
@@ -177,4 +178,10 @@
}
}
}
+
+ private static boolean isOptionEnabled(String level) {
+ final String debugOption = Platform.getDebugOption(level);
+ return JBossJaxrsCorePlugin.getDefault() != null && JBossJaxrsCorePlugin.getDefault().isDebugging()
+ && "true".equalsIgnoreCase(debugOption);
+ }
}
12 years, 4 months
JBoss Tools SVN: r39033 - in trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools: filesets/vcf and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-23 03:10:33 -0500 (Thu, 23 Feb 2012)
New Revision: 39033
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/NewServerFilesetHandler.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetComponentResolver.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetVCLabelProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/WorkspaceFilesetVirtualComponent.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModelModuleContributor.java
Log:
JBIDE-11010 - error handling
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/NewServerFilesetHandler.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/NewServerFilesetHandler.java 2012-02-23 07:53:30 UTC (rev 39032)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/NewServerFilesetHandler.java 2012-02-23 08:10:33 UTC (rev 39033)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.archives.webtools.filesets;
import java.io.IOException;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetComponentResolver.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetComponentResolver.java 2012-02-23 07:53:30 UTC (rev 39032)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetComponentResolver.java 2012-02-23 08:10:33 UTC (rev 39033)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.archives.webtools.filesets.vcf;
import java.io.UnsupportedEncodingException;
@@ -46,7 +56,6 @@
path = includes = excludes = null;
try {
for( int i = 0; i < split.length; i++ ) {
- boolean hasEquals = split[i].contains("="); //$NON-NLS-1$
String pre = split[i].substring(0, split[i].indexOf("=")); //$NON-NLS-1$
String post = split[i].substring(split[i].indexOf("=") + 1); //$NON-NLS-1$
post = URLDecoder.decode(post, "UTF-8"); //$NON-NLS-1$
@@ -57,15 +66,18 @@
else if( "excludes".equals(pre)) //$NON-NLS-1$
excludes = post;
}
- } catch( UnsupportedEncodingException uee) {}
- WorkspaceFilesetVirtualComponent comp = new WorkspaceFilesetVirtualComponent(p, context, path);
- comp.setIncludes(includes);
- comp.setExcludes(excludes);
- IVirtualReference ref = ComponentCore.createReference(context, comp);
- ref.setArchiveName(referencedComponent.getArchiveName());
- ref.setRuntimePath(referencedComponent.getRuntimePath());
- ref.setDependencyType(referencedComponent.getDependencyType().getValue());
- return ref;
+ WorkspaceFilesetVirtualComponent comp = new WorkspaceFilesetVirtualComponent(p, context, path);
+ comp.setIncludes(includes);
+ comp.setExcludes(excludes);
+ IVirtualReference ref = ComponentCore.createReference(context, comp);
+ ref.setArchiveName(referencedComponent.getArchiveName());
+ ref.setRuntimePath(referencedComponent.getRuntimePath());
+ ref.setDependencyType(referencedComponent.getDependencyType().getValue());
+ return ref;
+ } catch( UnsupportedEncodingException uee) {
+ // Impossible, since I've hard-coded UTF-8 here.
+ return null;
+ }
}
public ReferencedComponent resolve(IVirtualReference reference) {
@@ -86,10 +98,10 @@
rc.setHandle(URI.createURI(fsvc.getId() + url));
rc.setDependencyType(DependencyType.CONSUMES_LITERAL);
return rc;
-
- } catch( UnsupportedEncodingException uee) {}
- int x = 5;
- return null;
+ } catch( UnsupportedEncodingException uee) {
+ // This should never happen, since I am hard-coding in UTF-8.
+ return null;
+ }
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetVCLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetVCLabelProvider.java 2012-02-23 07:53:30 UTC (rev 39032)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/FilesetVCLabelProvider.java 2012-02-23 08:10:33 UTC (rev 39033)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.archives.webtools.filesets.vcf;
import org.eclipse.swt.graphics.Image;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/WorkspaceFilesetVirtualComponent.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/WorkspaceFilesetVirtualComponent.java 2012-02-23 07:53:30 UTC (rev 39032)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/vcf/WorkspaceFilesetVirtualComponent.java 2012-02-23 08:10:33 UTC (rev 39033)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.archives.webtools.filesets.vcf;
import org.eclipse.core.resources.IContainer;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModelModuleContributor.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModelModuleContributor.java 2012-02-23 07:53:30 UTC (rev 39032)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/ArchivesModelModuleContributor.java 2012-02-23 08:10:33 UTC (rev 39033)
@@ -94,6 +94,9 @@
ArchivesModel.instance().getRoot(project.getLocation()).save(
new NullProgressMonitor());
} catch( ArchivesModelException ame ) {
+ // I have no idea how often this will happen, and I am not willing
+ // to currently log an error which may be very common and is curentl
+ // ignored since it will not affect users in this specific case.
}
}
}
12 years, 4 months
JBoss Tools SVN: r39032 - trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-23 02:53:30 -0500 (Thu, 23 Feb 2012)
New Revision: 39032
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/Fileset.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetContentProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/NewServerFilesetHandler.java
Log:
JBIDE-11010 - error handling
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/Fileset.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/Fileset.java 2012-02-23 07:51:17 UTC (rev 39031)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/Fileset.java 2012-02-23 07:53:30 UTC (rev 39032)
@@ -16,11 +16,14 @@
import org.eclipse.core.internal.variables.StringVariableManager;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.archives.core.asf.DirectoryScanner;
import org.jboss.ide.eclipse.archives.core.model.DirectoryScannerFactory;
+import org.jboss.ide.eclipse.archives.webtools.IntegrationPlugin;
public class Fileset implements Cloneable {
@@ -33,14 +36,12 @@
public Fileset() {
}
public Fileset(String string) {
- try {
- name = folder = includesPattern =excludesPattern = ""; //$NON-NLS-1$
- String[] parts = string.split(SEP);
- name = parts[0];
- folder = parts[1];
- includesPattern = parts[2];
- excludesPattern = parts[3];
- } catch( ArrayIndexOutOfBoundsException aioobe) {}
+ name = folder = includesPattern =excludesPattern = ""; //$NON-NLS-1$
+ String[] parts = string.split(SEP);
+ name = parts.length <= 0 ? null : parts[0];
+ folder = parts.length <= 1 ? null : parts[1];
+ includesPattern = parts.length <= 2 ? null : parts[2];
+ excludesPattern = parts.length <= 3 ? null : parts[3];
}
public Fileset(String name, String folder, String inc, String exc) {
@@ -72,6 +73,10 @@
}
public static String getFolder(String folder, IRuntime runtime) {
+ return getFolder(folder, runtime, true);
+ }
+ public static String getFolder(String folder, IRuntime runtime, boolean ignoreError) {
+
String tmp = folder == null ? "" : folder; //$NON-NLS-1$
if( runtime != null ) {
tmp = tmp.replace(JBOSS_CONFIG_DIR_ARG, getConfigDirSubstitute(runtime));
@@ -81,7 +86,12 @@
StringSubstitutionEngine engine = new StringSubstitutionEngine();
tmp = engine.performStringSubstitution(tmp, true,
true, StringVariableManager.getDefault());
- } catch( CoreException ce ) {}
+ } catch( CoreException ce ) {
+ if( !ignoreError ) {
+ IntegrationPlugin.getDefault().getLog().log(
+ new Status(IStatus.WARNING, IntegrationPlugin.PLUGIN_ID, ce.getMessage(), ce));
+ }
+ }
IPath p = new Path(tmp);
if( !p.isAbsolute() && runtime != null ) {
@@ -158,10 +168,10 @@
}
public Object clone() {
- try {
- return super.clone();
- } catch( Exception e ) {}
- return null;
+ Fileset fs = new Fileset(name, folder, includesPattern, excludesPattern);
+ fs.setServer(server);
+ fs.setRuntime(runtime);
+ return fs;
}
public boolean equals(Object other) {
@@ -181,8 +191,18 @@
String excludes = getExcludesPattern();
return findPaths(dir, includes, excludes);
}
+
+ /**
+ * This method intentionally will not log any exceptions. It will only
+ * return an empty array if the scanner is incapable of scanning
+ * with the given parameters.
+ *
+ * @param dir
+ * @param includes
+ * @param excludes
+ * @return
+ */
public static IPath[] findPaths(String dir, String includes, String excludes) {
- IPath[] paths = new IPath[0];
try {
if (dir != null && new File(dir).exists()) {
DirectoryScanner scanner = DirectoryScannerFactory
@@ -190,15 +210,17 @@
null, false, 1, true);
if (scanner != null) {
String[] files = scanner.getIncludedFiles();
- paths = new IPath[files.length];
+ IPath[] paths = new IPath[files.length];
for (int i = 0; i < files.length; i++) {
paths[i] = new Path(files[i]);
}
+ return paths;
}
}
} catch (IllegalStateException ise) {
+ return new IPath[0];
}
- return paths;
+ return new IPath[0];
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetContentProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetContentProvider.java 2012-02-23 07:51:17 UTC (rev 39031)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetContentProvider.java 2012-02-23 07:53:30 UTC (rev 39032)
@@ -13,7 +13,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
-import java.util.List;
import org.apache.tools.ant.BuildException;
import org.eclipse.core.runtime.IPath;
@@ -21,7 +20,6 @@
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
public class FilesetContentProvider implements ITreeContentProvider {
private static final String FILESET_KEY = "org.jboss.ide.eclipse.as.ui.views.server.providers.FilesetViewProvider.PropertyKey"; //$NON-NLS-1$
@@ -84,19 +82,18 @@
private void addPath(ArrayList<PathWrapper> children,
HashMap<String, FolderWrapper> folders, IPath path, IPath folder) {
- try {
- FolderWrapper fw = null;
- if (!folders.containsKey(path.segment(0))) {
- fw = new FolderWrapper(path.removeLastSegments(path
- .segmentCount() - 1), folder);
- folders.put(path.segment(0), fw);
+ FolderWrapper fw = null;
+ if (path.segmentCount() > 0) {
+ String seg1 = path.segment(0);
+ if( !folders.containsKey(seg1)) {
+ fw = new FolderWrapper(path.removeLastSegments(
+ path.segmentCount() - 1), folder);
+ folders.put(seg1, fw);
children.add(fw);
} else {
- fw = folders.get(path.segment(0));
+ fw = folders.get(seg1);
}
fw.addChild(path.removeFirstSegments(1));
- } catch (Exception e) {
- e.printStackTrace();
}
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetUtil.java 2012-02-23 07:51:17 UTC (rev 39031)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/FilesetUtil.java 2012-02-23 07:53:30 UTC (rev 39032)
@@ -18,7 +18,10 @@
import java.io.InputStream;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.archives.webtools.IntegrationPlugin;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.tools.jmx.core.IMemento;
import org.jboss.tools.jmx.core.util.XMLMemento;
@@ -38,12 +41,13 @@
* @return
*/
public static Fileset[] loadFilesets(File file, IServer server) {
- if( file != null && file.exists()) {
- try {
- return loadFilesets(new FileInputStream(file), server);
- } catch( FileNotFoundException fnfe) {}
+ if( file == null || !file.exists())
+ return new Fileset[0];
+ try {
+ return loadFilesets(new FileInputStream(file), server);
+ } catch( FileNotFoundException fnfe) {
+ return new Fileset[0];
}
- return new Fileset[]{};
}
/**
@@ -101,7 +105,9 @@
try {
memento.save(new FileOutputStream(file));
} catch( IOException ioe) {
- // TODO LOG
+ IntegrationPlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, IntegrationPlugin.PLUGIN_ID, ioe.getMessage(), ioe)
+ );
}
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/NewServerFilesetHandler.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/NewServerFilesetHandler.java 2012-02-23 07:51:17 UTC (rev 39031)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/NewServerFilesetHandler.java 2012-02-23 07:53:30 UTC (rev 39032)
@@ -8,13 +8,13 @@
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerType;
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.archives.webtools.IntegrationPlugin;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
public class NewServerFilesetHandler extends UnitedServerListener {
@@ -28,20 +28,23 @@
protected NewServerFilesetHandler() {
IServerType[] types = ServerCore.getServerTypes();
for( int i = 0; i < types.length; i++ ) {
- try {
- IPath fileToWrite = FilesetUtil.DEFAULT_FS_ROOT.append(types[i].getId());
- if( !fileToWrite.toFile().exists()) {
- IPath p = new Path("filesetdata").append(types[i].getId()); //$NON-NLS-1$
- URL url = FileLocator.find(IntegrationPlugin.getDefault().getBundle(), p, null);
- if( url != null ) {
+ IPath fileToWrite = FilesetUtil.DEFAULT_FS_ROOT.append(types[i].getId());
+ if( !fileToWrite.toFile().exists()) {
+ IPath p = new Path("filesetdata").append(types[i].getId()); //$NON-NLS-1$
+ URL url = FileLocator.find(IntegrationPlugin.getDefault().getBundle(), p, null);
+ if( url != null ) {
+ try {
InputStream fis = url.openStream();
Fileset[] sets = FilesetUtil.loadFilesets(fis, null);
if( sets != null && sets.length != 0 ) {
FilesetUtil.saveFilesets(fileToWrite.toFile(), sets);
}
+ } catch(IOException ioe) {
+ IntegrationPlugin.getDefault().getLog().log(
+ new Status(IStatus.ERROR, IntegrationPlugin.PLUGIN_ID, ioe.getMessage(), ioe));
}
}
- } catch(IOException ioe) {}
+ }
}
}
12 years, 4 months
JBoss Tools SVN: r39031 - trunk/central/plugins/org.jboss.tools.central.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2012-02-23 02:51:17 -0500 (Thu, 23 Feb 2012)
New Revision: 39031
Modified:
trunk/central/plugins/org.jboss.tools.central/plugin.xml
Log:
https://issues.jboss.org/browse/JBIDE-10144
Revert previous commit
Modified: trunk/central/plugins/org.jboss.tools.central/plugin.xml
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/plugin.xml 2012-02-23 07:44:28 UTC (rev 39030)
+++ trunk/central/plugins/org.jboss.tools.central/plugin.xml 2012-02-23 07:51:17 UTC (rev 39031)
@@ -262,8 +262,6 @@
<newWizardShortcut id="org.jboss.tools.central.wizards.NewRichfacesProjectWizard"/>
<newWizardShortcut id="org.jboss.tools.central.wizards.NewSpringMvcProjectWizard"/>
<newWizardShortcut id="org.jboss.tools.central.wizards.NewGwtProjectWizard"/>
- <!-- Hibernate Run Code Generation Toolbar -->
- <actionSet id="org.hibernate.eclipse.launch.actionset"/>
</perspectiveExtension>
</extension>
12 years, 4 months
JBoss Tools SVN: r39030 - trunk/ws/tests/org.jboss.tools.ws.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: jjankovi
Date: 2012-02-23 02:44:28 -0500 (Thu, 23 Feb 2012)
New Revision: 39030
Added:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/requirements.properties
Log:
added requirements.properties file for WS bot tests
Added: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/requirements.properties
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/requirements.properties (rev 0)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/requirements.properties 2012-02-23 07:44:28 UTC (rev 39030)
@@ -0,0 +1,2 @@
+requirements=jbossas-6.0.0.Final
+#best runtime would AS 7 + WS / EAP 5.1 <=
12 years, 4 months