JBoss Tools SVN: r42288 - in trunk: jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2012-06-28 12:02:04 -0400 (Thu, 28 Jun 2012)
New Revision: 42288
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLLinkHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForwardHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPStylesheetRelLinkHyperlinkPartitioner.java
Log:
JBIDE-11140
OpenOn does not work for files referenced with EL variable
Issue is fixed
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLLinkHyperlinkPartitioner.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLLinkHyperlinkPartitioner.java 2012-06-28 15:33:04 UTC (rev 42287)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLLinkHyperlinkPartitioner.java 2012-06-28 16:02:04 UTC (rev 42288)
@@ -28,6 +28,10 @@
* @author Jeremy
*/
public abstract class XMLLinkHyperlinkPartitioner extends AbstractHyperlinkPartitioner implements IHyperlinkPartitionRecognizer {
+ protected static final String EL_DOLLAR_PREFIX = "${"; //$NON-NLS-1$
+ protected static final String EL_SUFFIX = "}"; //$NON-NLS-1$
+ protected static final String EL_SHARP_PREFIX = "#{"; //$NON-NLS-1$
+
/**
* @see com.ibm.sse.editor.hyperlink.AbstractHyperlinkPartitioner#parse(org.eclipse.jface.text.IDocument, com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
*/
@@ -87,6 +91,12 @@
}
if (start + bStart > offset || start + bEnd - 1 < offset) return null;
+ int elStart = sb.indexOf(EL_SHARP_PREFIX) == -1 ? sb.indexOf(EL_DOLLAR_PREFIX) : sb.indexOf(EL_SHARP_PREFIX);
+ if (elStart != -1 && elStart >= bStart && elStart < bEnd) {
+ int elEnd = sb.indexOf(EL_SUFFIX, elStart);
+ bStart = (elEnd == -1 || elEnd > bEnd) ? bEnd : elEnd + 1;
+ }
+
//find start and end of path property
while (bStart >= 0) {
if (!Character.isJavaIdentifierPart(sb.charAt(bStart)) &&
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForwardHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForwardHyperlinkPartitioner.java 2012-06-28 15:33:04 UTC (rev 42287)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPForwardHyperlinkPartitioner.java 2012-06-28 16:02:04 UTC (rev 42288)
@@ -24,6 +24,7 @@
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import org.w3c.dom.Text;
/**
* @author Jeremy
@@ -31,6 +32,10 @@
public class JSPForwardHyperlinkPartitioner extends AbstractHyperlinkPartitioner /*implements IHyperlinkPartitionRecognizer */{
public static final String JSP_FORWARD_PARTITION = "org.jboss.tools.common.text.ext.jsp.JSP_FORWARD"; //$NON-NLS-1$
+ private static final String EL_DOLLAR_PREFIX = "${"; //$NON-NLS-1$
+ private static final String EL_SUFFIX = "}"; //$NON-NLS-1$
+ private static final String EL_SHARP_PREFIX = "#{"; //$NON-NLS-1$
+
/**
* @see com.ibm.sse.editor.hyperlink.AbstractHyperlinkPartitioner#parse(org.eclipse.jface.text.IDocument, com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
*/
@@ -57,8 +62,8 @@
protected String getAxis(IDocument document, int offset) {
return JSPRootHyperlinkPartitioner.computeAxis(document, offset) + "/"; //$NON-NLS-1$
}
-
- public static IHyperlinkRegion getRegion(IDocument document, final int offset) {
+
+ public IHyperlinkRegion getRegion(IDocument document, final int offset) {
StructuredModelWrapper smw = new StructuredModelWrapper();
smw.init(document);
try {
@@ -67,39 +72,71 @@
Node n = Utils.findNodeForOffset(xmlDocument, offset);
- if (n == null || !(n instanceof Attr)) return null;
+ if (n == null || !(n instanceof Attr || n instanceof Text)) return null;
int start = Utils.getValueStart(n);
int end = Utils.getValueEnd(n);
- if (start < 0 || start > offset) return null;
+ String text = document.get(start, end - start);
+ StringBuffer sb = new StringBuffer(text);
- String attrText = document.get(start, end - start);
- StringBuffer sb = new StringBuffer(attrText);
-
- //find start and end of path property
- int bStart = 0;
- int bEnd = attrText.length() - 1;
-
- while (bStart < bEnd &&
- (sb.charAt(bStart) == '\'' || sb.charAt(bStart) == '\"' ||
- Character.isWhitespace(sb.charAt(bStart)))) {
+ int bStart = 0;
+ int bEnd = sb.length();
+
+ // In case of attribute value we need to skip leading and ending quotes && whitespaces
+ while (bStart < bEnd && (sb.charAt(bStart) == '"' || sb.charAt(bStart) == '\'' ||
+ sb.charAt(bStart) == 0x09 || sb.charAt(bStart) == 0x0A ||
+ sb.charAt(bStart) == 0x0D || sb.charAt(bStart) == 0x20)) {
bStart++;
}
- while (bEnd > bStart &&
- (sb.charAt(bEnd) == '\'' || sb.charAt(bEnd) == '\"' ||
- Character.isWhitespace(sb.charAt(bEnd)))) {
+
+ while (bEnd - 1 > bStart && (sb.charAt(bEnd - 1) == '"' || sb.charAt(bEnd - 1) == '\'' ||
+ sb.charAt(bEnd - 1) == 0x09 || sb.charAt(bEnd - 1) == 0x0A ||
+ sb.charAt(bEnd - 1) == 0x0D || sb.charAt(bEnd - 1) == 0x20)) {
bEnd--;
}
- bEnd++;
+ if (start + bStart > offset || start + bEnd - 1 < offset) return null;
+ int elStart = sb.indexOf(EL_SHARP_PREFIX) == -1 ? sb.indexOf(EL_DOLLAR_PREFIX) : sb.indexOf(EL_SHARP_PREFIX);
+ if (elStart != -1 && elStart >= bStart && elStart < bEnd) {
+ int elEnd = sb.indexOf(EL_SUFFIX, elStart);
+ bStart = (elEnd == -1 || elEnd > bEnd) ? bEnd : elEnd + 1;
+ }
+
+ //find start and end of path property
+ while (bStart >= 0) {
+ if (!Character.isJavaIdentifierPart(sb.charAt(bStart)) &&
+ sb.charAt(bStart) != '\\' && sb.charAt(bStart) != '/' &&
+ sb.charAt(bStart) != ':' && sb.charAt(bStart) != '-' &&
+ sb.charAt(bStart) != '.' && sb.charAt(bStart) != '_' &&
+ sb.charAt(bStart) != '%' && sb.charAt(bStart) != '?' &&
+ sb.charAt(bStart) != '&' && sb.charAt(bStart) != '=') {
+ bStart++;
+ break;
+ }
+
+ if (bStart == 0) break;
+ bStart--;
+ }
+ // find end of bean property
+ bEnd = bStart;
+ while (bEnd < sb.length()) {
+ if (!Character.isJavaIdentifierPart(sb.charAt(bEnd)) &&
+ sb.charAt(bEnd) != '\\' && sb.charAt(bEnd) != '/' &&
+ sb.charAt(bEnd) != ':' && sb.charAt(bEnd) != '-' &&
+ sb.charAt(bEnd) != '.' && sb.charAt(bEnd) != '_' &&
+ sb.charAt(bEnd) != '%' && sb.charAt(bEnd) != '?' &&
+ sb.charAt(bEnd) != '&' && sb.charAt(bEnd) != '=') {
+ break;
+ }
+ bEnd++;
+ }
+
int propStart = bStart + start;
int propLength = bEnd - bStart;
+ if (propStart > offset + 1 || propStart + propLength < offset) return null;
- if (propStart > offset || propStart + propLength < offset) return null;
-
- IHyperlinkRegion region = new HyperlinkRegion(propStart, propLength, null, null, null);
- return region;
+ return new HyperlinkRegion(propStart, propLength);
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x); //$NON-NLS-1$
return null;
Modified: trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPStylesheetRelLinkHyperlinkPartitioner.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPStylesheetRelLinkHyperlinkPartitioner.java 2012-06-28 15:33:04 UTC (rev 42287)
+++ trunk/jst/plugins/org.jboss.tools.jst.text.ext/src/org/jboss/tools/jst/text/ext/hyperlink/jsp/JSPStylesheetRelLinkHyperlinkPartitioner.java 2012-06-28 16:02:04 UTC (rev 42288)
@@ -42,6 +42,9 @@
private static final String URL_METHODSTART = "url("; //$NON-NLS-1$
private static final String URL_METHODEND = ")"; //$NON-NLS-1$
private static final String URL_METHODEND_2 = ";"; //$NON-NLS-1$
+ private static final String EL_DOLLAR_PREFIX = "${"; //$NON-NLS-1$
+ private static final String EL_SUFFIX = "}"; //$NON-NLS-1$
+ private static final String EL_SHARP_PREFIX = "#{"; //$NON-NLS-1$
/**
* @see com.ibm.sse.editor.hyperlink.AbstractHyperlinkPartitioner#parse(org.eclipse.jface.text.IDocument, com.ibm.sse.editor.extensions.hyperlink.IHyperlinkRegion)
@@ -151,7 +154,6 @@
protected IRegion getRegion (IDocument document, int offset) {
StructuredModelWrapper smw = new StructuredModelWrapper();
smw.init(document);
- smw.init(document);
try {
Document xmlDocument = smw.getDocument();
if (xmlDocument == null) return null;
@@ -161,30 +163,53 @@
if (n == null || !(n instanceof Text || n instanceof Attr)) return null;
String text = null;
- int bStart = 0;
- int bEnd = 0;
-
+ int start = 0;
+ int end = 0;
if (n instanceof Text) {
- int start = Utils.getValueStart(n);
- int end = Utils.getValueEnd(n);
+ start = Utils.getValueStart(n);
+ end = Utils.getValueEnd(n);
if (start < 0 || start > offset) return null;
text = document.get(start, end - start);
- bStart = offset - start;
- bEnd = offset - start;
+// bStart = offset - start;
+// bEnd = offset - start;
} else if (n instanceof Attr) {
Attr attr = (Attr)n;
if (!HREF_ATTRNAME.equalsIgnoreCase(attr.getName())) return null;
- int start = Utils.getValueStart(n);
- int end = Utils.getValueEnd(n);
+ start = Utils.getValueStart(n);
+ end = Utils.getValueEnd(n);
if(start < 0) return null;
text = document.get(start, end - start);
- bStart = offset - start;
- bEnd = offset - start;
+// bStart = offset - start;
+// bEnd = offset - start;
}
+
StringBuffer sb = new StringBuffer(text);
+ int bStart = 0;
+ int bEnd = sb.length();
+
+ // In case of attribute value we need to skip leading and ending quotes && whitespaces
+ while (bStart < bEnd && (sb.charAt(bStart) == '"' || sb.charAt(bStart) == '\'' ||
+ sb.charAt(bStart) == 0x09 || sb.charAt(bStart) == 0x0A ||
+ sb.charAt(bStart) == 0x0D || sb.charAt(bStart) == 0x20)) {
+ bStart++;
+ }
+
+ while (bEnd - 1 > bStart && (sb.charAt(bEnd - 1) == '"' || sb.charAt(bEnd - 1) == '\'' ||
+ sb.charAt(bEnd - 1) == 0x09 || sb.charAt(bEnd - 1) == 0x0A ||
+ sb.charAt(bEnd - 1) == 0x0D || sb.charAt(bEnd - 1) == 0x20)) {
+ bEnd--;
+ }
+ if (start + bStart > offset || start + bEnd - 1 < offset) return null;
+
+ int elStart = sb.indexOf(EL_SHARP_PREFIX) == -1 ? sb.indexOf(EL_DOLLAR_PREFIX) : sb.indexOf(EL_SHARP_PREFIX);
+ if (elStart != -1 && elStart >= bStart && elStart < bEnd) {
+ int elEnd = sb.indexOf(EL_SUFFIX, elStart);
+ bStart = (elEnd == -1 || elEnd > bEnd) ? bEnd : elEnd + 1;
+ }
+
//find start of bean property
while (bStart >= 0) {
if (!Character.isJavaIdentifierPart(sb.charAt(bStart)) &&
12 years, 8 months
JBoss Tools SVN: r42287 - in trunk/openshift: plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core and 15 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-06-28 11:33:04 -0400 (Thu, 28 Jun 2012)
New Revision: 42287
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/src/org/jboss/tools/openshift/egit/core/
trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/src/org/jboss/tools/openshift/egit/internal/
trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/src/org/jboss/tools/openshift/egit/internal/test/
trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/src/org/jboss/tools/openshift/egit/internal/test/util/
trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/src/org/jboss/tools/openshift/express/
trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/src/org/jboss/tools/openshift/express/internal/
trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/src/org/jboss/tools/openshift/express/internal/ui/
trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/
trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/META-INF/MANIFEST.MF
trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java
trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/META-INF/MANIFEST.MF
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureGitSharedProject.java
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF/MANIFEST.MF
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestRepository.java
Log:
[JBIDE-12240] bumped required egit/jgit version to 2.0. fixed compilation error due to API changes in Juno
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/META-INF/MANIFEST.MF 2012-06-28 15:09:22 UTC (rev 42286)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/META-INF/MANIFEST.MF 2012-06-28 15:33:04 UTC (rev 42287)
@@ -5,8 +5,8 @@
Bundle-Version: 2.3.0.qualifier
Bundle-Activator: org.jboss.tools.openshift.egit.core.internal.EGitCoreActivator
Require-Bundle: org.jboss.ide.eclipse.as.core;bundle-version="2.3.0",
- org.eclipse.jgit;bundle-version="1.2.0",
- org.eclipse.egit;bundle-version="1.2.0",
+ org.eclipse.jgit;bundle-version="2.0.0",
+ org.eclipse.egit;bundle-version="2.0.0",
com.jcraft.jsch;bundle-version="0.1.44",
org.eclipse.egit.core;bundle-version="1.2.0",
org.eclipse.team.core;bundle-version="3.6.0",
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java 2012-06-28 15:09:22 UTC (rev 42286)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java 2012-06-28 15:33:04 UTC (rev 42287)
@@ -47,6 +47,7 @@
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.InitCommand;
import org.eclipse.jgit.api.MergeResult;
+import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.errors.NoWorkTreeException;
import org.eclipse.jgit.errors.NotSupportedException;
@@ -177,6 +178,11 @@
NLS.bind("Could not initialize a git repository at {0}: {1}",
getRepositoryPathFor(project),
e.getMessage()), e));
+ } catch (GitAPIException e) {
+ throw new CoreException(EGitCoreActivator.createErrorStatus(
+ NLS.bind("Could not initialize a git repository at {0}: {1}",
+ getRepositoryPathFor(project),
+ e.getMessage()), e));
}
}
@@ -873,8 +879,9 @@
* @return
* @throws IOException
* @throws NoWorkTreeException
+ * @throws GitAPIException
*/
- public static boolean isDirty(Repository repository) throws NoWorkTreeException, IOException {
+ public static boolean isDirty(Repository repository) throws NoWorkTreeException, IOException, GitAPIException {
boolean hasChanges = false;
org.eclipse.jgit.api.Status repoStatus = new Git(repository).status().call();
hasChanges |= !repoStatus.getAdded().isEmpty();
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/META-INF/MANIFEST.MF 2012-06-28 15:09:22 UTC (rev 42286)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.egit.ui/META-INF/MANIFEST.MF 2012-06-28 15:33:04 UTC (rev 42287)
@@ -5,11 +5,11 @@
Bundle-Version: 2.3.0.qualifier
Bundle-Activator: org.jboss.tools.openshift.egit.ui.EGitUIActivator
Require-Bundle: org.jboss.tools.openshift.egit.core;bundle-version="[2.3.0,3.0.0)",
- org.eclipse.egit.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.egit.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jgit;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.egit.core;bundle-version="2.0.0",
+ org.eclipse.egit.ui;bundle-version="2.0.0",
+ org.eclipse.jgit;bundle-version="2.0.0",
com.jcraft.jsch;bundle-version="[0.1.44,1.0.0)",
- org.eclipse.ui;bundle-version="[3.7.0,4.0.0)",
+ org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.core.runtime,
org.eclipse.core.expressions;bundle-version="[3.4.300,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.7.100,4.0.0)",
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2012-06-28 15:09:22 UTC (rev 42286)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2012-06-28 15:33:04 UTC (rev 42287)
@@ -9,8 +9,8 @@
org.jboss.tools.openshift.egit.core;bundle-version="2.3.0",
org.jboss.tools.openshift.egit.ui;bundle-version="2.3.0",
org.jboss.ide.eclipse.as.ui;bundle-version="[2.3.0,3.0.0)",
- org.eclipse.egit.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.egit.core;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.egit.ui;bundle-version="1.1.0",
+ org.eclipse.egit.core;bundle-version="1.1.0",
org.eclipse.jgit;bundle-version="[1.1.0,2.1.0)",
com.jcraft.jsch;bundle-version="0.1.44",
org.eclipse.jsch.core;bundle-version="[1.1.300,2.0.0)",
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java 2012-06-28 15:09:22 UTC (rev 42286)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/IOpenShiftExpressWizardModel.java 2012-06-28 15:33:04 UTC (rev 42287)
@@ -19,6 +19,8 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jgit.api.errors.GitAPIException;
+import org.eclipse.jgit.errors.NoWorkTreeException;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServerType;
import org.jboss.tools.common.databinding.IObservablePojo;
@@ -124,10 +126,12 @@
* clone to the user project
* @throws CoreException
* The user project could not be shared with the git
+ * @throws GitAPIException
+ * @throws NoWorkTreeException
*/
public void configureGitSharedProject(IProgressMonitor monitor)
throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
- URISyntaxException;
+ URISyntaxException, NoWorkTreeException, GitAPIException;
public File getRepositoryFile();
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-06-28 15:09:22 UTC (rev 42286)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-06-28 15:33:04 UTC (rev 42287)
@@ -18,6 +18,7 @@
import java.util.Set;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -290,6 +291,7 @@
public ImportJob(DelegatingProgressMonitor delegatingMonitor) {
super("Importing project to workspace...");
+ setRule(ResourcesPlugin.getWorkspace().getRoot());
this.delegatingMonitor = delegatingMonitor;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-06-28 15:09:22 UTC (rev 42286)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizardModel.java 2012-06-28 15:33:04 UTC (rev 42287)
@@ -13,6 +13,8 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jgit.api.errors.GitAPIException;
+import org.eclipse.jgit.errors.NoWorkTreeException;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServerType;
import org.eclipse.wst.server.core.ServerCore;
@@ -145,11 +147,13 @@
* clone to the user project
* @throws CoreException
* The user project could not be shared with the git
+ * @throws GitAPIException
+ * @throws NoWorkTreeException
*/
@Override
public void configureGitSharedProject(IProgressMonitor monitor)
throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
- URISyntaxException {
+ URISyntaxException, NoWorkTreeException, GitAPIException {
IProject project = new ConfigureGitSharedProject(
getProjectName()
, getApplication()
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureGitSharedProject.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureGitSharedProject.java 2012-06-28 15:09:22 UTC (rev 42286)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ConfigureGitSharedProject.java 2012-06-28 15:33:04 UTC (rev 42287)
@@ -23,6 +23,8 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jgit.api.errors.GitAPIException;
+import org.eclipse.jgit.errors.NoWorkTreeException;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.transport.RemoteConfig;
import org.eclipse.osgi.util.NLS;
@@ -80,6 +82,8 @@
* clone to the user project
* @throws CoreException
* The user project could not be shared with the git
+ * @throws GitAPIException
+ * @throws NoWorkTreeException
*
* @see #cloneRepository
* @see #copyOpenshiftConfiguration
@@ -89,7 +93,7 @@
@Override
public IProject execute(IProgressMonitor monitor)
throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
- URISyntaxException {
+ URISyntaxException, NoWorkTreeException, GitAPIException {
IProject project = getProject();
Assert.isTrue(EGitUtils.isSharedWithGit(project));
Modified: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF/MANIFEST.MF 2012-06-28 15:09:22 UTC (rev 42286)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/META-INF/MANIFEST.MF 2012-06-28 15:33:04 UTC (rev 42287)
@@ -5,8 +5,8 @@
Bundle-Version: 2.3.0.qualifier
Bundle-Activator: org.jboss.tools.openshift.egit.internal.test.EGitTestActivator
Bundle-Vendor: JBoss by Red Hat
-Require-Bundle: org.eclipse.egit.core;bundle-version="1.0.0",
- org.eclipse.jgit;bundle-version="[1.0.0,2.0.1]",
+Require-Bundle: org.eclipse.egit.core;bundle-version="2.0.0",
+ org.eclipse.jgit;bundle-version="2.0.0",
org.eclipse.core.runtime,
org.eclipse.core.resources;bundle-version="[3.7.100,4.0.0)",
org.eclipse.core.filesystem;bundle-version="1.3.100",
Modified: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java 2012-06-28 15:09:22 UTC (rev 42286)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java 2012-06-28 15:33:04 UTC (rev 42287)
@@ -17,6 +17,8 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.egit.core.Activator;
+import org.eclipse.jgit.api.errors.GitAPIException;
+import org.eclipse.jgit.errors.NoWorkTreeException;
import org.eclipse.jgit.lib.ConfigConstants;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.StoredConfig;
@@ -196,7 +198,7 @@
}
@Test
- public void addedButNotCommittedIsDirty() throws IOException {
+ public void addedButNotCommittedIsDirty() throws IOException, NoWorkTreeException, GitAPIException {
assertFalse(EGitUtils.isDirty(testRepository.getRepository()));
File file = testRepository.createFile("a.txt", "protoculture");
testRepository.add(file);
Modified: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestRepository.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestRepository.java 2012-06-28 15:09:22 UTC (rev 42286)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestRepository.java 2012-06-28 15:33:04 UTC (rev 42287)
@@ -34,12 +34,10 @@
import org.eclipse.egit.core.op.DisconnectProviderOperation;
import org.eclipse.jgit.api.CommitCommand;
import org.eclipse.jgit.api.Git;
-import org.eclipse.jgit.api.errors.ConcurrentRefUpdateException;
+import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.api.errors.NoFilepatternException;
-import org.eclipse.jgit.api.errors.NoHeadException;
-import org.eclipse.jgit.api.errors.NoMessageException;
-import org.eclipse.jgit.api.errors.WrongRepositoryStateException;
+import org.eclipse.jgit.api.errors.UnmergedPathsException;
import org.eclipse.jgit.dircache.DirCache;
import org.eclipse.jgit.dircache.DirCacheEntry;
import org.eclipse.jgit.errors.UnmergedPathException;
@@ -132,15 +130,11 @@
* commit message
* @return commit object
* @throws IOException
- * @throws NoHeadException
- * @throws NoMessageException
- * @throws ConcurrentRefUpdateException
* @throws JGitInternalException
- * @throws WrongRepositoryStateException
+ * @throws GitAPIException
*/
public RevCommit createInitialCommit(String message) throws IOException,
- NoHeadException, NoMessageException, ConcurrentRefUpdateException,
- JGitInternalException, WrongRepositoryStateException {
+ JGitInternalException, GitAPIException {
String repoPath = repository.getWorkTree().getAbsolutePath();
File file = new File(repoPath, "dummy");
if (!file.exists())
@@ -252,17 +246,14 @@
* commit message
* @return commit object
*
- * @throws NoHeadException
- * @throws NoMessageException
* @throws UnmergedPathException
- * @throws ConcurrentRefUpdateException
* @throws JGitInternalException
- * @throws WrongRepositoryStateException
+ * @throws GitAPIException
+ * @throws UnmergedPathsException
*/
- public RevCommit commit(String message) throws NoHeadException,
- NoMessageException, UnmergedPathException,
- ConcurrentRefUpdateException, JGitInternalException,
- WrongRepositoryStateException {
+ public RevCommit commit(String message) throws UnmergedPathException,
+ JGitInternalException,
+ UnmergedPathsException, GitAPIException {
Git git = new Git(repository);
CommitCommand commitCommand = git.commit();
commitCommand.setAuthor("J. Git", "j.git(a)egit.org");
@@ -271,7 +262,7 @@
return commitCommand.call();
}
- public void add(IFile file) throws IOException {
+ public void add(IFile file) throws IOException, GitAPIException {
add(new File(file.getLocation().toOSString()));
}
@@ -280,8 +271,9 @@
*
* @param file
* @throws IOException
+ * @throws GitAPIException
*/
- public void add(File file) throws IOException {
+ public void add(File file) throws IOException, GitAPIException {
String repoPath =
getRepoRelativePath(file.getAbsolutePath());
try {
12 years, 8 months
JBoss Tools SVN: r42286 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-06-28 11:09:22 -0400 (Thu, 28 Jun 2012)
New Revision: 42286
Modified:
trunk/build/target-platform/jbds.target.p2mirror.xml
trunk/build/target-platform/multiple.target.p2mirror.xml
trunk/build/target-platform/unified.target.p2mirror.xml
Log:
add org.eclipse.mylyn.commons.identity to TP
Modified: trunk/build/target-platform/jbds.target.p2mirror.xml
===================================================================
--- trunk/build/target-platform/jbds.target.p2mirror.xml 2012-06-28 15:09:12 UTC (rev 42285)
+++ trunk/build/target-platform/jbds.target.p2mirror.xml 2012-06-28 15:09:22 UTC (rev 42286)
@@ -188,6 +188,7 @@
<iu id="org.eclipse.mylyn.ide_feature.feature.group" version=""/>
<iu id="org.eclipse.mylyn.commons.feature.group" version=""/>
<iu id="org.eclipse.mylyn.commons.compatibility.feature.group" version=""/>
+<iu id="org.eclipse.mylyn.commons.identity.feature.group" version=""/>
<iu id="org.eclipse.mylyn.commons.repositories.feature.group" version=""/>
<iu id="org.eclipse.mylyn.commons.repositories.http.feature.group" version=""/>
<iu id="org.eclipse.mylyn.context_feature.feature.group" version=""/>
Modified: trunk/build/target-platform/multiple.target.p2mirror.xml
===================================================================
--- trunk/build/target-platform/multiple.target.p2mirror.xml 2012-06-28 15:09:12 UTC (rev 42285)
+++ trunk/build/target-platform/multiple.target.p2mirror.xml 2012-06-28 15:09:22 UTC (rev 42286)
@@ -208,6 +208,7 @@
<iu id="org.eclipse.mylyn.ide_feature.feature.group" version=""/>
<iu id="org.eclipse.mylyn.commons.feature.group" version=""/>
<iu id="org.eclipse.mylyn.commons.compatibility.feature.group" version=""/>
+<iu id="org.eclipse.mylyn.commons.identity.feature.group" version=""/>
<iu id="org.eclipse.mylyn.commons.repositories.feature.group" version=""/>
<iu id="org.eclipse.mylyn.commons.repositories.http.feature.group" version=""/>
<iu id="org.eclipse.mylyn.context_feature.feature.group" version=""/>
Modified: trunk/build/target-platform/unified.target.p2mirror.xml
===================================================================
--- trunk/build/target-platform/unified.target.p2mirror.xml 2012-06-28 15:09:12 UTC (rev 42285)
+++ trunk/build/target-platform/unified.target.p2mirror.xml 2012-06-28 15:09:22 UTC (rev 42286)
@@ -208,6 +208,7 @@
<iu id="org.eclipse.mylyn.ide_feature.feature.group" version=""/>
<iu id="org.eclipse.mylyn.commons.feature.group" version=""/>
<iu id="org.eclipse.mylyn.commons.compatibility.feature.group" version=""/>
+<iu id="org.eclipse.mylyn.commons.identity.feature.group" version=""/>
<iu id="org.eclipse.mylyn.commons.repositories.feature.group" version=""/>
<iu id="org.eclipse.mylyn.commons.repositories.http.feature.group" version=""/>
<iu id="org.eclipse.mylyn.context_feature.feature.group" version=""/>
12 years, 8 months
JBoss Tools SVN: r42285 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-06-28 11:09:12 -0400 (Thu, 28 Jun 2012)
New Revision: 42285
Modified:
trunk/build/target-platform/unified.target
Log:
add org.eclipse.mylyn.commons.identity to TP
Modified: trunk/build/target-platform/unified.target
===================================================================
--- trunk/build/target-platform/unified.target 2012-06-28 15:09:05 UTC (rev 42284)
+++ trunk/build/target-platform/unified.target 2012-06-28 15:09:12 UTC (rev 42285)
@@ -216,9 +216,9 @@
<unit id="org.eclipse.mylyn.ide_feature.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.compatibility.feature.group" version="3.8.0.v20120612-0600"/>
- <unit id="org.eclipse.mylyn.commons.identity.feature.group" version="1.0.0.v20120612-0600"/>
- <unit id="org.eclipse.mylyn.commons.repositories.feature.group" version="3.8.0.v20120612-0600"/>
- <unit id="org.eclipse.mylyn.commons.repositories.http.feature.group" version="3.8.0.v20120612-0600"/>
+ <unit id="org.eclipse.mylyn.commons.identity.feature.group" version="1.0.0.v20120612-0600"/>
+ <unit id="org.eclipse.mylyn.commons.repositories.feature.group" version="1.0.0.v20120612-0600"/>
+ <unit id="org.eclipse.mylyn.commons.repositories.http.feature.group" version="1.0.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.context_feature.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.bugzilla_feature.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.discovery.feature.group" version="3.8.0.v20120612-0600"/>
12 years, 8 months
JBoss Tools SVN: r42284 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-06-28 11:09:05 -0400 (Thu, 28 Jun 2012)
New Revision: 42284
Modified:
trunk/build/target-platform/multiple.target
Log:
add org.eclipse.mylyn.commons.identity to TP
Modified: trunk/build/target-platform/multiple.target
===================================================================
--- trunk/build/target-platform/multiple.target 2012-06-28 15:08:57 UTC (rev 42283)
+++ trunk/build/target-platform/multiple.target 2012-06-28 15:09:05 UTC (rev 42284)
@@ -217,8 +217,8 @@
<unit id="org.eclipse.mylyn.commons.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.compatibility.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.identity.feature.group" version="1.0.0.v20120612-0600"/>
- <unit id="org.eclipse.mylyn.commons.repositories.feature.group" version="3.8.0.v20120612-0600"/>
- <unit id="org.eclipse.mylyn.commons.repositories.http.feature.group" version="3.8.0.v20120612-0600"/>
+ <unit id="org.eclipse.mylyn.commons.repositories.feature.group" version="1.0.0.v20120612-0600"/>
+ <unit id="org.eclipse.mylyn.commons.repositories.http.feature.group" version="1.0.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.context_feature.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.bugzilla_feature.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.discovery.feature.group" version="3.8.0.v20120612-0600"/>
12 years, 8 months
JBoss Tools SVN: r42283 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-06-28 11:08:57 -0400 (Thu, 28 Jun 2012)
New Revision: 42283
Modified:
trunk/build/target-platform/jbds.target
Log:
add org.eclipse.mylyn.commons.identity to TP
Modified: trunk/build/target-platform/jbds.target
===================================================================
--- trunk/build/target-platform/jbds.target 2012-06-28 15:08:47 UTC (rev 42282)
+++ trunk/build/target-platform/jbds.target 2012-06-28 15:08:57 UTC (rev 42283)
@@ -195,8 +195,9 @@
<unit id="org.eclipse.mylyn.ide_feature.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.compatibility.feature.group" version="3.8.0.v20120612-0600"/>
- <unit id="org.eclipse.mylyn.commons.repositories.feature.group" version="3.8.0.v20120612-0600"/>
- <unit id="org.eclipse.mylyn.commons.repositories.http.feature.group" version="3.8.0.v20120612-0600"/>
+ <unit id="org.eclipse.mylyn.commons.identity.feature.group" version="1.0.0.v20120612-0600"/>
+ <unit id="org.eclipse.mylyn.commons.repositories.feature.group" version="1.0.0.v20120612-0600"/>
+ <unit id="org.eclipse.mylyn.commons.repositories.http.feature.group" version="1.0.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.context_feature.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.bugzilla_feature.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.discovery.feature.group" version="3.8.0.v20120612-0600"/>
@@ -267,4 +268,4 @@
<unit id="com.google.gwt.eclipse.sdkbundle.e37.feature.feature.group" version="2.4.0.v201202290255-rel-r37"/>
</location>
</locations>
-</target>
\ No newline at end of file
+</target>
12 years, 8 months
JBoss Tools SVN: r42282 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-06-28 11:08:47 -0400 (Thu, 28 Jun 2012)
New Revision: 42282
Modified:
trunk/build/target-platform/unified.target
Log:
add org.eclipse.mylyn.commons.identity to TP
Modified: trunk/build/target-platform/unified.target
===================================================================
--- trunk/build/target-platform/unified.target 2012-06-28 15:08:38 UTC (rev 42281)
+++ trunk/build/target-platform/unified.target 2012-06-28 15:08:47 UTC (rev 42282)
@@ -216,6 +216,7 @@
<unit id="org.eclipse.mylyn.ide_feature.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.compatibility.feature.group" version="3.8.0.v20120612-0600"/>
+ <unit id="org.eclipse.mylyn.commons.identity.feature.group" version="1.0.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.repositories.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.repositories.http.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.context_feature.feature.group" version="3.8.0.v20120612-0600"/>
@@ -307,4 +308,4 @@
<feature id="org.mozilla.xpcom.feature"/>
</includeBundles>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-</target>
\ No newline at end of file
+</target>
12 years, 8 months
JBoss Tools SVN: r42281 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2012-06-28 11:08:38 -0400 (Thu, 28 Jun 2012)
New Revision: 42281
Modified:
trunk/build/target-platform/multiple.target
Log:
add org.eclipse.mylyn.commons.identity to TP
Modified: trunk/build/target-platform/multiple.target
===================================================================
--- trunk/build/target-platform/multiple.target 2012-06-28 14:32:33 UTC (rev 42280)
+++ trunk/build/target-platform/multiple.target 2012-06-28 15:08:38 UTC (rev 42281)
@@ -216,6 +216,7 @@
<unit id="org.eclipse.mylyn.ide_feature.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.compatibility.feature.group" version="3.8.0.v20120612-0600"/>
+ <unit id="org.eclipse.mylyn.commons.identity.feature.group" version="1.0.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.repositories.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.commons.repositories.http.feature.group" version="3.8.0.v20120612-0600"/>
<unit id="org.eclipse.mylyn.context_feature.feature.group" version="3.8.0.v20120612-0600"/>
12 years, 8 months
JBoss Tools SVN: r42278 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-06-28 08:44:08 -0400 (Thu, 28 Jun 2012)
New Revision: 42278
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java
Log:
https://issues.jboss.org/browse/JBIDE-10531 - Getting the bundle value should not succeed if the EL is missing any required token.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java 2012-06-28 12:24:23 UTC (rev 42277)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMap.java 2012-06-28 12:44:08 UTC (rev 42278)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-2012 Exadel, Inc. and 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,
@@ -453,22 +453,29 @@
}
public String getBundleValue(String name) {
-// System.out.println("\n1 BM -> getBundleValue -> " + name);
-// System.out.println("2 BM -> showBundleUsageAsEL = "
-// + showBundleUsageAsEL);
String bundleValue = name;
if (!showBundleUsageAsEL) {
List<ELInstance> is = parseJSFExpression(name);
if (is != null) {
StringBuffer sb = new StringBuffer();
int index = 0;
+ boolean parsingErrors = false;
for (ELInstance i : is) {
+ /*
+ * https://issues.jboss.org/browse/JBIDE-10531
+ * Getting the bundle value should not succeed
+ * if the EL is missing any required token.
+ */
+ if (!i.getErrors().isEmpty()) {
+ parsingErrors = true;
+ break;
+ }
int start = i.getStartPosition();
sb.append(name.substring(index, start));
index = start;
if (i.getExpression() instanceof ELInvocationExpression) {
- ELInvocationExpression expr = (ELInvocationExpression) i
- .getExpression();
+ ELInvocationExpression expr =
+ (ELInvocationExpression) i.getExpression();
String[] values = getCall(expr);
if (values != null) {
String value = getBundleValue(values[0], values[1]);
@@ -476,12 +483,13 @@
sb.append(value);
index = i.getEndPosition();
}
-
}
}
if (index < i.getEndPosition()) {
- // fix has been added by Maksim Areshkau
- // https://jira.jboss.org/jira/browse/JBIDE-6064
+ /*
+ * https://jira.jboss.org/jira/browse/JBIDE-6064
+ * CA out of range error occurs sometimes
+ */
if (name.length() > i.getEndPosition()) {
sb.append(name.substring(index, i.getEndPosition()));
index = i.getEndPosition();
@@ -491,10 +499,11 @@
}
}
}
- bundleValue = sb.append(name.substring(index)).toString();
+ if (!parsingErrors) {
+ bundleValue = sb.append(name.substring(index)).toString();
+ }
}
}
-// System.out.println("3 BM -> getBundleValue -> " + bundleValue);
return bundleValue;
}
12 years, 8 months