Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsrinivasan2010-04-20 22:41:04 +0000
committerrsrinivasan2010-04-20 22:41:04 +0000
commita0148d606a03ed10a77bc5542b21165d8cb1b00b (patch)
treecac38f5ee3d304f49ebf4344432deca0a1ae1f15
parent64ca833f800b31bf3bf9d7fa2b555060002bfdae (diff)
downloadwebtools.jsf-a0148d606a03ed10a77bc5542b21165d8cb1b00b.tar.gz
webtools.jsf-a0148d606a03ed10a77bc5542b21165d8cb1b00b.tar.xz
webtools.jsf-a0148d606a03ed10a77bc5542b21165d8cb1b00b.zip
Bug 309400 - 3.1.2. Patchv20100420
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/Messages.java24
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/libraryprovider/UserLibraryVersionValidator.java14
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/messages.properties1
3 files changed, 28 insertions, 11 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/Messages.java
index ae3844706..8bceebab8 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/Messages.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/Messages.java
@@ -14,14 +14,38 @@ import org.eclipse.osgi.util.NLS;
*
* @author Debajit Adhikary
*/
+/**
+ * @author dadhikar
+ *
+ */
+/**
+ * @author dadhikar
+ *
+ */
+/**
+ * @author dadhikar
+ *
+ */
public class Messages extends NLS
{
private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.common.facet.messages"; //$NON-NLS-1$
+ /**
+ * see messages.properties
+ */
public static String UserLibraryVersionValidator_cannotReadLibraryVersion;
+ /**
+ * see messages.properties
+ */
+ public static String UserLibraryVersionValidator_possiblyIncompatibleLibrary;
+
+ /**
+ * see messages.properties
+ */
public static String UserLibraryVersionValidator_versionMismatch;
+
static
{
// initialize resource bundle
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/libraryprovider/UserLibraryVersionValidator.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/libraryprovider/UserLibraryVersionValidator.java
index 765d8d496..8747e7ee8 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/libraryprovider/UserLibraryVersionValidator.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/libraryprovider/UserLibraryVersionValidator.java
@@ -28,7 +28,6 @@ import org.eclipse.jst.common.project.facet.core.libprov.user.KeyClassesValidato
import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig;
import org.eclipse.jst.jsf.common.JSFCommonPlugin;
import org.eclipse.jst.jsf.common.facet.Messages;
-import org.eclipse.osgi.util.NLS;
/**
@@ -85,18 +84,11 @@ public abstract class UserLibraryVersionValidator extends KeyClassesValidator
if (libraryVersion == null)
return new Status(IStatus.WARNING, JSFCommonPlugin.PLUGIN_ID, Messages.UserLibraryVersionValidator_cannotReadLibraryVersion);
- if (isLibraryFacetCompatible(facetVersion, libraryVersion))
+ if (libraryVersion.compareToIgnoreCase(facetVersion) >= 0) // JSF 2.0 lib for JSF 1.2 app, JSF 1.2 lib for JSF 1.2 app
return Status.OK_STATUS;
- final String errorMessage = NLS.bind(Messages.UserLibraryVersionValidator_versionMismatch, libraryVersion, facetVersion);
- return new Status(IStatus.ERROR, JSFCommonPlugin.PLUGIN_ID, errorMessage);
- }
-
-
- private boolean isLibraryFacetCompatible (final String facetVersion,
- final String libraryVersion)
- {
- return libraryVersion.startsWith(facetVersion);
+ // e.g. JSF 1.2 library used for a JSF 2.0 app
+ return new Status(IStatus.WARNING, JSFCommonPlugin.PLUGIN_ID, Messages.UserLibraryVersionValidator_possiblyIncompatibleLibrary);
}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/messages.properties
index aace54dbd..7e26b507e 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/messages.properties
+++ b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/facet/messages.properties
@@ -1,2 +1,3 @@
UserLibraryVersionValidator_cannotReadLibraryVersion=Could not read version for selected library. The library may not be correct for this facet version.
+UserLibraryVersionValidator_possiblyIncompatibleLibrary=The library may be incompatible with the selected facet version.
UserLibraryVersionValidator_versionMismatch=Incorrect library version: The selected library version ({0}) does not match the facet version ({1}) \ No newline at end of file

Back to the top