JBoss Tools SVN: r36315 - workspace/snjeza/swt.win64.patch.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-11-11 20:06:27 -0500 (Fri, 11 Nov 2011)
New Revision: 36315
Added:
workspace/snjeza/swt.win64.patch/SWT333360Patch.zip
workspace/snjeza/swt.win64.patch/org.eclipse.swt.win32.win32.x86_64_compiled_Win7_64_JDK6u25.zip
workspace/snjeza/swt.win64.patch/org.eclipse.swt.win32.win32.x86_64_tweaked.zip
Log:
files from Snjeza: SWT333360Patch.zip (unchanged); org.eclipse.swt.win32.win32.x86_64_tweaked.zip (modified); org.eclipse.swt.win32.win32.x86_64_compiled_Win7_64_JDK6u25.zip (generated on Win7_64 w/ JDK6u25
Added: workspace/snjeza/swt.win64.patch/SWT333360Patch.zip
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/swt.win64.patch/SWT333360Patch.zip
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/snjeza/swt.win64.patch/org.eclipse.swt.win32.win32.x86_64_compiled_Win7_64_JDK6u25.zip
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/swt.win64.patch/org.eclipse.swt.win32.win32.x86_64_compiled_Win7_64_JDK6u25.zip
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/snjeza/swt.win64.patch/org.eclipse.swt.win32.win32.x86_64_tweaked.zip
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/swt.win64.patch/org.eclipse.swt.win32.win32.x86_64_tweaked.zip
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
14 years, 5 months
JBoss Tools SVN: r36314 - workspace/snjeza.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-11-11 19:58:17 -0500 (Fri, 11 Nov 2011)
New Revision: 36314
Added:
workspace/snjeza/swt.win64.patch/
Log:
create folder for fixing JBDS-1648
14 years, 5 months
JBoss Tools SVN: r36313 - trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-11 19:46:30 -0500 (Fri, 11 Nov 2011)
New Revision: 36313
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-10137 Close input and output stream in all places where it used
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java 2011-11-12 00:45:29 UTC (rev 36312)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/util/FileUtil.java 2011-11-12 00:46:30 UTC (rev 36313)
@@ -13,7 +13,6 @@
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
@@ -23,7 +22,6 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
-import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
@@ -184,9 +182,14 @@
if(l < 0) break;
sb.append(new String(b, 0, l));
}
- is.close();
} catch (IOException e) {
CommonPlugin.getPluginLog().logError(e);
+ } finally {
+ try {
+ is.close();
+ } catch (IOException e) {
+ // Ignore
+ }
}
return sb.toString();
}
@@ -222,10 +225,16 @@
if(l < 0) break;
sb.append(new String(b, 0, l, charset));
}
- is.close();
} catch (IOException e) {
CommonPlugin.getPluginLog().logError(e);
+ } finally {
+ try {
+ is.close();
+ } catch (IOException e) {
+ // Ignore
+ }
}
+
return sb.toString();
}
14 years, 5 months
JBoss Tools SVN: r36312 - in trunk/jsf/plugins/org.jboss.tools.jsf: src/org/jboss/tools/jsf/jsf2/model and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-11 19:45:29 -0500 (Fri, 11 Nov 2011)
New Revision: 36312
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/JSF2ComponentModelManager.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/JSF2Util.java
Log:
https://issues.jboss.org/browse/JBIDE-10137 Close input and output stream in all places where it used
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2011-11-12 00:17:34 UTC (rev 36311)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2011-11-12 00:45:29 UTC (rev 36312)
@@ -545,207 +545,8 @@
<adapter type="org.eclipse.core.resources.IProject"/>
</factory>
</extension>
- <!--extension
- id="jsf2"
- name="%JSF2_ComponentsValidator.name"
- point="org.eclipse.wst.validation.validatorV2">
- <validator
- build="true"
- class="org.jboss.tools.jsf.web.validation.jsf2.JSF2ComponentsValidator"
- manual="true"
- markerId="org.jboss.tools.jsf.jsf2problemmarker"
- sourceid="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML"
- version="4">
- <include>
- <rules>
- <contentType
- id="org.eclipse.wst.html.core.htmlsource">
- </contentType>
- <contentType
- id="org.eclipse.jst.jsp.core.jspfragmentsource">
- </contentType>
- <contentType
- id="org.eclipse.jst.jsp.core.tagsource">
- </contentType>
- <fileext
- caseSensitive="false"
- ext="xhtml">
- </fileext>
- <fileext
- caseSensitive="false"
- ext="jsp">
- </fileext>
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- </contentType>
- <contentType
- id="org.jboss.tools.jst.jsp.jspincludesource">
- </contentType>
- </rules>
- </include>
- </validator>
- </extension>
- <extension
- point="org.eclipse.ui.ide.markerResolution">
- <markerResolutionGenerator
- class="org.jboss.tools.jsf.web.validation.jsf2.action.JSF2ComponentResolutionGenerator"
- markerType="org.jboss.tools.jsf.jsf2problemmarker">
- </markerResolutionGenerator>
- </extension>
-
- <extension
- id="jsf2problemmarker"
- name="%JSF2ProblemName"
- point="org.eclipse.core.resources.markers">
- <super
- type="org.eclipse.core.resources.problemmarker">
- </super>
- <persistent
- value="true">
- </persistent>
- <attribute
- name="problemType">
- </attribute>
- <attribute
- name="baseElement">
- </attribute>
- <super
- type="org.eclipse.core.resources.textmarker">
- </super>
- </extension -->
-
- <!--extension
- point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- class="org.jboss.tools.jsf.web.validation.jsf2.JSF2SourceValidator"
- id="org.jboss.tools.jsf.jsf2sourcevalidator"
- scope="total">
- <contentTypeIdentifier
- id="jsf.facelet">
- <partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier
- id="org.eclipse.wst.html.core.htmlsource">
- <partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier
- id="org.jboss.tools.jst.jsp.jspincludesource">
- <partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP"/>
- </contentTypeIdentifier>
- </validator>
- </extension-->
-<!--
- <extension
- point="org.eclipse.ui.ide.markerResolution">
- <markerResolutionGenerator
- class="org.jboss.tools.jsf.web.validation.i18n.I18nMarkerResolutionGenerator"
- markerType="org.jboss.tools.jsf.i18nproblemmarker">
- </markerResolutionGenerator>
- </extension>
-
- <extension
- id="i18nproblemmarker"
- name="%i18nProblemName"
- point="org.eclipse.core.resources.markers">
- <super
- type="org.eclipse.core.resources.problemmarker">
- </super>
- <persistent
- value="true">
- </persistent>
- <attribute
- name="problemType">
- </attribute>
- <attribute
- name="baseElement">
- </attribute>
- <super
- type="org.eclipse.core.resources.textmarker">
- </super>
- </extension>
-
<extension
- point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- class="org.jboss.tools.jsf.web.validation.i18n.I18nValidator"
- id="org.jboss.tools.jsf.externalize.source.validator"
- scope="total">
- <contentTypeIdentifier
- id="jsf.facelet">
- <partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier
- id="org.eclipse.wst.html.core.htmlsource">
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT"/>
- </contentTypeIdentifier>
- <contentTypeIdentifier
- id="org.jboss.tools.jst.jsp.jspincludesource">
- <partitionType
- id="org.eclipse.wst.html.HTML_DEFAULT"/>
- </contentTypeIdentifier>
- </validator>
- </extension>
-
- <extension
- id="i18n"
- name="%I18nValidator.name"
- point="org.eclipse.wst.validation.validatorV2">
- <validator
- build="true"
- class="org.jboss.tools.jsf.web.validation.i18n.I18nValidator"
- manual="true"
- markerId="org.jboss.tools.jsf.i18nproblemmarker"
- sourceid="org.eclipse.wst.xml.ui.internal.validation.DelegatingSourceValidatorForXML"
- version="4">
- <include>
- <rules>
- <contentType
- id="org.eclipse.wst.html.core.htmlsource">
- </contentType>
- <contentType
- id="org.eclipse.jst.jsp.core.jspfragmentsource">
- </contentType>
- <contentType
- id="org.eclipse.jst.jsp.core.tagsource">
- </contentType>
- <fileext
- caseSensitive="false"
- ext="xhtml">
- </fileext>
- <fileext
- caseSensitive="false"
- ext="jsp">
- </fileext>
- <contentType
- id="org.eclipse.jst.jsp.core.jspsource">
- </contentType>
- <contentType
- id="org.jboss.tools.jst.jsp.jspincludesource">
- </contentType>
- </rules>
- </include>
- </validator>
- </extension>
--->
- <!--extension
- point="org.eclipse.wst.sse.ui.quickFixProcessor">
- <quickFixProcessor
- class="org.jboss.tools.jsf.web.validation.jsf2.action.JSF2QuickFixProcessor"
- problemType="org.jboss.tools.jsf.jsf2problemmarker">
- </quickFixProcessor>
- </extension-->
- <extension
point="org.eclipse.ui.editors.annotationTypes">
<type
markerSeverity="1"
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/JSF2ComponentModelManager.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/JSF2ComponentModelManager.java 2011-11-12 00:17:34 UTC (rev 36311)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/model/JSF2ComponentModelManager.java 2011-11-12 00:45:29 UTC (rev 36312)
@@ -313,7 +313,7 @@
public static IDOMDocument getReadableDOMDocument(JarEntryFile file) {
IDOMDocument document = null;
IStructuredModel model = null;
- InputStream inputStream;
+ InputStream inputStream = null;
try {
inputStream = file.getContents();
if (inputStream != null) {
@@ -333,6 +333,13 @@
} catch (CoreException e) {
JSFModelPlugin.getPluginLog().logError(e);
} finally {
+ if(inputStream!=null) {
+ try {
+ inputStream.close();
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
model = null;
}
return document;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/JSF2Util.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/JSF2Util.java 2011-11-12 00:17:34 UTC (rev 36311)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/JSF2Util.java 2011-11-12 00:45:29 UTC (rev 36312)
@@ -151,5 +151,4 @@
}
return false;
}
-
-}
+}
\ No newline at end of file
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java 2011-11-12 00:17:34 UTC (rev 36311)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java 2011-11-12 00:45:29 UTC (rev 36312)
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 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.tools.jsf.web.validation.jsf2;
-
-import java.io.InputStream;
-import java.util.Scanner;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
-import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport;
-import org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;
-import org.jboss.tools.jsf.JSFModelPlugin;
-import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
-import org.jboss.tools.jsf.web.validation.jsf2.components.JSF2AttrTempComponent;
-import org.jboss.tools.jsf.web.validation.jsf2.components.JSF2CompositeTempComponent;
-import org.jboss.tools.jsf.web.validation.jsf2.components.JSF2URITempComponent;
-import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
-import org.jboss.tools.jst.web.kb.IKbProject;
-import org.jboss.tools.jst.web.kb.KbProjectFactory;
-
-/**
- * Validates full file, when we click validate in Context menu
- *
- * @author yzhishko
- * @author mareshkau
- *
- */
-
-@SuppressWarnings("restriction")
-public class JSF2ComponentsValidator extends Validator {
-
- private IKbProject kbProject;
- private IFile file;
-
- @Override
- public ValidationResult validate(IResource resource, int kind,
- ValidationState state, IProgressMonitor monitor) {
- ValidationResult result = new ValidationResult();
- if (resource instanceof IFile) {
- IFile file = (IFile) resource;
- if (!isValidate(file)) {
- return result;
- }
- this.file = file;
- return super.validate(resource, kind, state, monitor);
- }
- return result;
- }
-
- @Override
- public ValidationReport validate(String uri, InputStream inputstream,
- NestedValidatorContext context, ValidationResult result) {
- JSF2XMLValidator validator = JSF2XMLValidator.getInstance();
- return validator.validate(file, uri);
- }
-
- protected boolean isValidate(IFile file) {
- if (!file.isAccessible() || !file.isSynchronized(IResource.DEPTH_ZERO) || file.getProject() == null
- || !file.getProject().isAccessible()) {
- return false;
- }
- IProject project = file.getProject();
- kbProject = KbProjectFactory.getKbProject(project, false);
- if (kbProject == null) {
- return false;
- }
- boolean isValidate = false;
- try {
- InputStream is = file.getContents();
- Scanner scanner = new Scanner(is);
- while (scanner.hasNextLine()) {
- if (scanner.nextLine()
- .indexOf(JSF2ResourceUtil.JSF2_URI_PREFIX) != -1) {
- isValidate = true;
- scanner.close();
- break;
- }
- }
- } catch (CoreException e) {
- JSFModelPlugin.getPluginLog().logError(e);
- return isValidate;
- }
- return isValidate;
- }
-
- @Override
- protected void addInfoToMessage(ValidationMessage validationMessage,
- IMessage message) {
- Object[] args = validationMessage.getMessageArguments();
- if (args == null) {
- return;
- }
- if (args[0] instanceof JSF2CompositeTempComponent) {
- JSF2CompositeTempComponent component = (JSF2CompositeTempComponent) args[0];
- message.setAttribute(JSF2ValidatorConstants.JSF2_TYPE_KEY,
- component.getType());
- message.setAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY,
- component.getComponentResourceLocation());
- message.setAttribute(JSF2ResourceUtil.JSF2_COMPONENT_NAME, component.getElement().getLocalName());
- String[] attrNames = component.getAttrNames();
- if (attrNames != null) {
- for (int i = 0; i < attrNames.length; i++) {
- message.setAttribute(
- JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY
- + String.valueOf(i), attrNames[i]);
- }
- }
- return;
- }
- if (args[0] instanceof JSF2AttrTempComponent) {
- JSF2AttrTempComponent component = (JSF2AttrTempComponent) args[0];
- message.setAttribute(JSF2ValidatorConstants.JSF2_TYPE_KEY,
- component.getType());
- message.setAttribute(JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY,
- component.getName());
- message.setAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY,
- component.getComponentResourceLocation());
- message.setAttribute(JSF2ResourceUtil.JSF2_COMPONENT_NAME, component.getElementName());
- return;
- }
- if (args[0] instanceof JSF2URITempComponent) {
- JSF2URITempComponent component = (JSF2URITempComponent) args[0];
- message.setAttribute(JSF2ValidatorConstants.JSF2_TYPE_KEY,
- JSF2ValidatorConstants.JSF2_URI_TYPE);
- message.setAttribute(JSF2ValidatorConstants.JSF2_URI_NAME_KEY,
- component.getURI());
- message.setAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY,
- component.getResourcesFolder());
- }
- }
-
-}
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java 2011-11-12 00:17:34 UTC (rev 36311)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java 2011-11-12 00:45:29 UTC (rev 36312)
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 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.tools.jsf.web.validation.jsf2;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.jboss.tools.jsf.JSFModelPlugin;
-import org.jboss.tools.jsf.jsf2.model.JSF2ComponentModelManager;
-import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
-import org.jboss.tools.jsf.web.validation.IJSFValidationComponent;
-import org.jboss.tools.jsf.web.validation.LocalizedMessage;
-
-/**
- * Validates when we change smth in file
- *
- * @author yzhishko
- * @author mareshkau
- *
- */
-
-@SuppressWarnings("restriction")
-public class JSF2SourceValidator implements IValidator, ISourceValidator {
-
- private IDOMDocument document;
- private IFile validateFile;
-
- public void cleanup(IReporter reporter) {
- }
-
- public void validate(IValidationContext helper, IReporter reporter)
- throws ValidationException {
- if (document != null) {
- IResource resource = JSF2ResourceUtil.getValidatingResource(helper);
- if (resource instanceof IFile) {
- validateFile = (IFile) resource;
- reportProblems(reporter,
- JSF2XMLValidator.getValidationComponents(document,
- (IFile) resource),resource);
- }
- }
- }
-
- public void connect(IDocument document) {
- this.document = JSF2ComponentModelManager
- .getReadableDOMDocument(document);
- }
-
- public void disconnect(IDocument document) {
- document = null;
- validateFile = null;
- }
-
- public void validate(IRegion dirtyRegion, IValidationContext helper,
- IReporter reporter) {
- }
-
- private void reportProblems(IReporter reporter,
- IJSFValidationComponent[] validationComponents,IResource resource) {
- try {
- resource.deleteMarkers(JSF2XMLValidator.JSF2_PROBLEM_ID, false, IResource.DEPTH_INFINITE);
- for (int i = 0; i < validationComponents.length; i++) {
- Message locMessage = LocalizedMessage.createJSF2LocalizedMessage(validationComponents[i], validateFile);
- reporter.addMessage(this, locMessage);
- IMarker marker = resource.createMarker(JSF2XMLValidator.JSF2_PROBLEM_ID);
- marker.setAttributes(locMessage.getAttributes());
- }
- } catch (CoreException e) {
- JSFModelPlugin.getPluginLog().logError(e);
- }
-
- }
-}
\ No newline at end of file
14 years, 5 months
JBoss Tools SVN: r36311 - in trunk/cdi/tests/org.jboss.tools.cdi.core.test: src/org/jboss/tools/cdi/core/test/tck/validation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-11 19:17:34 -0500 (Fri, 11 Nov 2011)
New Revision: 36311
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml.with.alternative
trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10166 CDI Validator validates resources from output folder
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml 2011-11-11 23:55:16 UTC (rev 36310)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml 2011-11-12 00:17:34 UTC (rev 36311)
@@ -3,5 +3,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
<alternatives>
<class>org.jboss.jsr299.tck.tests.jbt.validation.beansxml.incremental.Test1</class>
+ <class>cdi.test.alternative.Unxisting</class>
</alternatives>
</beans>
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml.with.alternative
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml.with.alternative 2011-11-11 23:55:16 UTC (rev 36310)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/JavaSource/META-INF/beans.xml.with.alternative 2011-11-12 00:17:34 UTC (rev 36311)
@@ -3,5 +3,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
<alternatives>
<class>org.jboss.jsr299.tck.tests.jbt.validation.beansxml.incremental.Test1</class>
+ <class>cdi.test.alternative.Unxisting</class>
</alternatives>
</beans>
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java 2011-11-11 23:55:16 UTC (rev 36310)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/src/org/jboss/tools/cdi/core/test/tck/validation/BeansXmlValidationTest.java 2011-11-12 00:17:34 UTC (rev 36311)
@@ -27,6 +27,13 @@
static int FORD_INTERCEPTOR_1_LINE = CAT_INTERCEPTOR_LINE + 3; // <class>org.jboss.jsr299.tck.tests.interceptors.definition.broken.sameClassListedTwiceInBeansXml.FordInterceptor</class>
static int FORD_INTERCEPTOR_2_LINE = FORD_INTERCEPTOR_1_LINE + 1; //
+ public void testBeansXMLInBin() throws Exception {
+ IFile file = tckProject.getFile("JavaSource/META-INF/beans.xml");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, false, 6);
+ file = tckProject.getFile("WebContent/WEB-INF/classes/META-INF/beans.xml");
+ AbstractResourceMarkerTest.assertMarkerIsNotCreated(file, CDIValidationMessages.UNKNOWN_ALTERNATIVE_BEAN_CLASS_NAME, 6);
+ }
+
/**
* 5.1.1. Declaring selected alternatives for a bean archive
* - Each child <class> element must specify the name of an alternative bean class. If there is no class with the specified
14 years, 5 months
JBoss Tools SVN: r36310 - trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-11 18:55:16 -0500 (Fri, 11 Nov 2011)
New Revision: 36310
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java
Log:
Removed System.out.print
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java 2011-11-11 23:45:06 UTC (rev 36309)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.solder.core/src/org/jboss/tools/cdi/seam/solder/core/CDISeamSolderDefaultBeanExtension.java 2011-11-11 23:55:16 UTC (rev 36310)
@@ -193,7 +193,7 @@
for (IBean link: linked) {
if(link.getSourcePath() != null) {
validator.getValidationContext().addLinkedCoreResource(CDICoreValidator.SHORT_ID, key, link.getSourcePath(), true);
- System.out.println(key + ":" + link.getSourcePath());
+// System.out.println(key + ":" + link.getSourcePath());
}
}
}
14 years, 5 months
JBoss Tools SVN: r36309 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-11-11 18:45:06 -0500 (Fri, 11 Nov 2011)
New Revision: 36309
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
https://issues.jboss.org/browse/JBIDE-10166 CDI Validator validates resources from output folder
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-11-11 22:16:01 UTC (rev 36308)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-11-11 23:45:06 UTC (rev 36309)
@@ -116,6 +116,7 @@
IValidatingProjectTree projectTree;
IValidatingProjectSet projectSet;
Set<IFolder> sourceFolders;
+ List<IFile> allBeansXmls;
private BeansXmlValidationDelegate beansXmlValidator = new BeansXmlValidationDelegate(this);
private AnnotationValidationDelegate annotationValidator = new AnnotationValidationDelegate(this);
@@ -265,6 +266,7 @@
projectTree = validationHelper.getValidationContextManager().getValidatingProjectTree(this);
projectSet = projectTree.getBrunches().get(rootProject);
rootCdiProject = null;
+ allBeansXmls = null;
CDICoreNature nature = CDICorePlugin.getCDI(projectSet.getRootProject(), true);
if(nature!=null) {
rootCdiProject = nature.getDelegate();
@@ -495,8 +497,10 @@
CDIValidationContext context = getCDIContext(file);
ICDIProject cdiProject = context.getCdiProject();
if("beans.xml".equalsIgnoreCase(file.getName()) && CDIPreferences.shouldValidateBeansXml(file.getProject())) {
- // TODO should we check the path of the beans.xml? Or it's better to check the every beans.xml even if it is not in META-INF or WEB-INF.
- beansXmlValidator.validateBeansXml(context, file);
+ List<IFile> allBaensXmls = getAllBeansXmls();
+ if(allBaensXmls.contains(file)) { // See https://issues.jboss.org/browse/JBIDE-10166
+ beansXmlValidator.validateBeansXml(context, file);
+ }
} else {
Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
for (IBean bean : beans) {
@@ -539,27 +543,29 @@
* @return
*/
private List<IFile> getAllBeansXmls() {
- List<IFile> beansXmls = new ArrayList<IFile>();
- // From source folders
- Set<IFolder> sourceFolders = getSourceFoldersForProjectsSet();
- for (IFolder source : sourceFolders) {
- IResource beansXml = source.findMember(new Path("/META-INF/beans.xml")); //$NON-NLS-1$
- if(beansXml!=null && beansXml instanceof IFile) {
- beansXmls.add((IFile)beansXml);
+ if(allBeansXmls==null) {
+ allBeansXmls = new ArrayList<IFile>();
+ // From source folders
+ Set<IFolder> sourceFolders = getSourceFoldersForProjectsSet();
+ for (IFolder source : sourceFolders) {
+ IResource beansXml = source.findMember(new Path("/META-INF/beans.xml")); //$NON-NLS-1$
+ if(beansXml!=null && beansXml instanceof IFile) {
+ allBeansXmls.add((IFile)beansXml);
+ }
}
- }
- Set<IProject> allProjects = projectSet.getAllProjects();
- for (IProject project : allProjects) {
- // From WEB-INF folder
- IVirtualComponent com = ComponentCore.createComponent(project);
- if(com!=null) {
- IVirtualFile beansXml = com.getRootFolder().getFile(new Path("/WEB-INF/beans.xml")); //$NON-NLS-1$
- if(beansXml!=null && beansXml.getUnderlyingFile().isAccessible()) {
- beansXmls.add(beansXml.getUnderlyingFile());
+ Set<IProject> allProjects = projectSet.getAllProjects();
+ for (IProject project : allProjects) {
+ // From WEB-INF folder
+ IVirtualComponent com = ComponentCore.createComponent(project);
+ if(com!=null) {
+ IVirtualFile beansXml = com.getRootFolder().getFile(new Path("/WEB-INF/beans.xml")); //$NON-NLS-1$
+ if(beansXml!=null && beansXml.getUnderlyingFile().isAccessible()) {
+ allBeansXmls.add(beansXml.getUnderlyingFile());
+ }
}
}
}
- return beansXmls;
+ return allBeansXmls;
}
/**
14 years, 5 months
JBoss Tools SVN: r36308 - in trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el: internal/core/parser and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-11-11 17:16:01 -0500 (Fri, 11 Nov 2011)
New Revision: 36308
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java
Log:
JBIDE-10159
https://issues.jboss.org/browse/JBIDE-10159
Content assist outside expression in Java sources provided. White spaces after the last dot are included into expression to provide ca for members rather than beans in that region.
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2011-11-11 22:11:35 UTC (rev 36307)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2011-11-11 22:16:01 UTC (rev 36308)
@@ -56,7 +56,9 @@
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberPresentation;
import org.jboss.tools.common.el.core.resolver.Var;
+import org.jboss.tools.common.el.internal.core.model.ELPropertyInvocationImpl;
import org.jboss.tools.common.el.internal.core.parser.token.JavaNameTokenDescription;
+import org.jboss.tools.common.el.internal.core.parser.token.WhiteSpaceTokenDescription;
import org.jboss.tools.common.text.TextProposal;
public abstract class AbstractELCompletionEngine<V extends IVariable> implements ELResolver, ELCompletionEngine {
@@ -95,6 +97,25 @@
return getProposals(context, el, offset);
}
}
+ List<ELInstance> is = ref.getELModel().getInstances();
+ for (ELInstance i: is) {
+ ELExpression exp = i.getExpression();
+ if(exp == null || exp.getFirstToken() == null) {
+ continue;
+ }
+ LexicalToken b = exp.getFirstToken();
+ while(b.getPreviousToken() != null && b.getPreviousToken().getType() == WhiteSpaceTokenDescription.WHITESPACE) {
+ b = b.getPreviousToken();
+ }
+ LexicalToken e = exp.getLastToken();
+ if(e == null) e = b;
+ while(e.getNextToken() != null && e.getNextToken().getType() == WhiteSpaceTokenDescription.WHITESPACE) {
+ e = e.getNextToken();
+ }
+ if(exp != null && ref.getStartPosition() + b.getStart() <= offset && ref.getStartPosition() + e.getStart() + e.getLength() >= offset) {
+ return getProposals(context, "#{", offset);
+ }
+ }
}
return Collections.emptyList();
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java 2011-11-11 22:11:35 UTC (rev 36307)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/ELParserImpl.java 2011-11-11 22:16:01 UTC (rev 36308)
@@ -295,6 +295,10 @@
ELPropertyInvocationImpl incompleteProperty = new ELPropertyInvocationImpl();
incompleteProperty.setSeparator(dot);
incompleteProperty.setLastToken(dot);
+ LexicalToken n = dot.getNextToken();
+ if(n != null && n.getType() == WhiteSpaceTokenDescription.WHITESPACE) {
+ incompleteProperty.setLastToken(n);
+ }
incompleteProperty.setLeft(result);
incompleteProperty.setLeftIsFake(isLeftFake);
result = incompleteProperty;
14 years, 5 months
JBoss Tools SVN: r36307 - trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2Beans/src/test/beans.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-11-11 17:11:35 -0500 (Fri, 11 Nov 2011)
New Revision: 36307
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2Beans/src/test/beans/Bean1.java
Log:
JBIDE-10159
https://issues.jboss.org/browse/JBIDE-10159
Test added for content assist outside expression.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2Beans/src/test/beans/Bean1.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2Beans/src/test/beans/Bean1.java 2011-11-11 22:11:17 UTC (rev 36306)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSF2Beans/src/test/beans/Bean1.java 2011-11-11 22:11:35 UTC (rev 36307)
@@ -8,4 +8,8 @@
return "#{}";
}
+ String s1 = "#{ mybean1}";
+ String s2 = "#{ mybean1. }";
+ String s3 = "#{ mybean1 }";
+
}
14 years, 5 months
JBoss Tools SVN: r36306 - trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-11-11 17:11:17 -0500 (Fri, 11 Nov 2011)
New Revision: 36306
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForJSF2BeansInJavaTest.java
Log:
JBIDE-10159
https://issues.jboss.org/browse/JBIDE-10159
Test added for content assist outside expression.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForJSF2BeansInJavaTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForJSF2BeansInJavaTest.java 2011-11-11 19:06:20 UTC (rev 36305)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForJSF2BeansInJavaTest.java 2011-11-11 22:11:17 UTC (rev 36306)
@@ -42,4 +42,27 @@
checkProposals(PAGE_NAME, "#{}", 2, proposals, false);
}
+
+ /**
+ * JBIDE-10159
+ */
+ public void testCAoutsideExpression(){
+ String[] proposals = {
+ "mybean1 : Bean1", "bean4 : Bean4", "bean5 : Bean5"
+ };
+
+ checkProposals(PAGE_NAME, "#{ mybean1}", 2, proposals, false);
+ checkProposals(PAGE_NAME, "#{ mybean1 }", 12, proposals, false);
+ }
+
+ /**
+ * JBIDE-10159
+ */
+ public void testCAMemberafterWhitespace(){
+ String[] proposals = {
+ "name : String - Bean1"
+ };
+
+ checkProposals(PAGE_NAME, "#{ mybean1. }", 13, proposals, true);
+ }
}
\ No newline at end of file
14 years, 5 months