Seam SVN: r11989 - branches/community/Seam_2_2/ui/src/main/templates.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-01-25 11:31:18 -0500 (Mon, 25 Jan 2010)
New Revision: 11989
Modified:
branches/community/Seam_2_2/ui/src/main/templates/README
Log:
fixed typos
Modified: branches/community/Seam_2_2/ui/src/main/templates/README
===================================================================
(Binary files differ)
14 years, 10 months
Seam SVN: r11988 - branches/community/Seam_2_2/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium.
by seam-commits@lists.jboss.org
Author: jharting
Date: 2010-01-25 07:23:54 -0500 (Mon, 25 Jan 2010)
New Revision: 11988
Modified:
branches/community/Seam_2_2/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java
Log:
Minor change in dvdstore functional test.
Modified: branches/community/Seam_2_2/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java 2010-01-24 02:06:41 UTC (rev 11987)
+++ branches/community/Seam_2_2/src/test/ftest/examples/dvdstore/src/org/jboss/seam/example/dvd/test/selenium/SeleniumDvdTest.java 2010-01-25 12:23:54 UTC (rev 11988)
@@ -55,7 +55,7 @@
public boolean until() {
return browser.isElementPresent(getProperty("LOGIN_SUBMIT"));
}
- }.wait("Login page not loaded.");
+ }.wait("Login page not loaded.", Long.valueOf(TIMEOUT));
if (isLoggedIn(browser)) {
fail("User already logged in.");
}
14 years, 10 months
Seam SVN: r11987 - in modules/remoting/trunk/src/main: resources/org/jboss/seam/remoting and 1 other directory.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-01-23 21:06:41 -0500 (Sat, 23 Jan 2010)
New Revision: 11987
Modified:
modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/wrapper/BagWrapper.java
modules/remoting/trunk/src/main/resources/org/jboss/seam/remoting/remote.js
Log:
fix variable scope issue
Modified: modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/wrapper/BagWrapper.java
===================================================================
--- modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/wrapper/BagWrapper.java 2010-01-22 21:22:04 UTC (rev 11986)
+++ modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/wrapper/BagWrapper.java 2010-01-24 02:06:41 UTC (rev 11987)
@@ -3,6 +3,8 @@
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Array;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
@@ -16,7 +18,6 @@
import javax.enterprise.inject.spi.BeanManager;
import org.dom4j.Element;
-import org.hibernate.collection.PersistentCollection;
/**
* Wrapper for collections, arrays, etc.
@@ -48,15 +49,28 @@
@SuppressWarnings("unchecked")
public void marshal(OutputStream out) throws IOException
{
- // Fix to prevent uninitialized lazy loading in Hibernate
- if (value instanceof PersistentCollection && !loadLazy)
+ try
{
- if (!((PersistentCollection) value).wasInitialized())
+ Class cls = Class.forName("org.hibernate.collection.PersistentCollection");
+
+ // Fix to prevent uninitialized lazy loading in Hibernate
+ if (cls.isInstance(value) && !loadLazy)
{
- out.write(UNDEFINED_TAG);
- return;
- }
+ try
+ {
+ Method m = cls.getMethod("wasInitialized");
+ if (((Boolean) m.invoke(value)).booleanValue() == false)
+ {
+ out.write(UNDEFINED_TAG);
+ return;
+ }
+ }
+ catch (NoSuchMethodException ex) {}
+ catch (InvocationTargetException ex) {}
+ catch (IllegalAccessException ex) {}
+ }
}
+ catch (ClassNotFoundException ex) {}
out.write(BAG_TAG_OPEN);
Modified: modules/remoting/trunk/src/main/resources/org/jboss/seam/remoting/remote.js
===================================================================
--- modules/remoting/trunk/src/main/resources/org/jboss/seam/remoting/remote.js 2010-01-22 21:22:04 UTC (rev 11986)
+++ modules/remoting/trunk/src/main/resources/org/jboss/seam/remoting/remote.js 2010-01-24 02:06:41 UTC (rev 11987)
@@ -44,6 +44,18 @@
return function() { return this[fieldName]; };
};
+Seam.createBeanFunction = function(methodName, paramCount) {
+ return function() {
+ var p = [];
+ for (var i=0; i<paramCount; i++) {
+ p[i] = arguments[i];
+ }
+ var c = (arguments.length > paramCount) ? arguments[paramCount] : undefined;
+ var eh = (arguments.length > (paramCount + 1)) ? arguments[paramCount + 1] : undefined;
+ return Seam.execute(this, methodName, p, c, eh);
+ }
+}
+
Seam.registerBean = function(name, metadata, methods) {
if (Seam.isBeanRegistered(name)) return;
var t = function() {};
@@ -59,16 +71,7 @@
t.__metadata = m;
} else {
for (var m in methods) {
- var pc = methods[m];
- t.prototype[m] = function() {
- var p = [];
- for (var i=0; i<pc; i++) {
- p[i] = arguments[i];
- }
- var c = (arguments.length > pc) ? arguments[pc] : undefined;
- var eh = (arguments.length > (pc + 1)) ? arguments[pc + 1] : undefined;
- return Seam.execute(this, m, p, c, eh);
- };
+ t.prototype[m] = Seam.createBeanFunction(m, methods[m]);
}
}
Seam.beans[name] = t;
14 years, 10 months
Seam SVN: r11986 - in modules/xml/trunk: src/main/java/org/jboss/seam/xml/bootstrap and 6 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-01-22 16:22:04 -0500 (Fri, 22 Jan 2010)
New Revision: 11986
Added:
modules/xml/trunk/src/main/java/org/jboss/seam/xml/util/XmlConfigurationException.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/util/XmlParseException.java
Modified:
modules/xml/trunk/docs/src/main/en-US/xml-general.xml
modules/xml/trunk/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/core/BeanResult.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/core/XmlResult.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/CollectionFieldSet.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/DirectFieldSetter.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/FieldValueSetter.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/MapFieldSet.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/MethodFieldSetter.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/SimpleFieldValue.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/AbstractXmlItem.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/AnnotationXmlItem.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ArrayXmlItem.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/DependsXmlItem.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/KeyXmlItem.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/MethodXmlItem.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ValueXmlItem.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/parser/ParserMain.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/parser/namespace/NamespaceUtils.java
modules/xml/trunk/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java
Log:
improved handling of parse errors
Modified: modules/xml/trunk/docs/src/main/en-US/xml-general.xml
===================================================================
--- modules/xml/trunk/docs/src/main/en-US/xml-general.xml 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/docs/src/main/en-US/xml-general.xml 2010-01-22 21:22:04 UTC (rev 11986)
@@ -4,7 +4,7 @@
<chapter id="remoting">
<title>Seam XML Configuration</title>
- <para>Seam provides a method for configuring JSR-299 beans using XML. </para>
+ <para>Seam provides a method for configuring JSR-299 beans using XML. By default the XML configuration old defines new beans, it does not </para>
</chapter>
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -16,6 +16,7 @@
import java.util.Map.Entry;
import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.enterprise.inject.spi.Extension;
@@ -31,6 +32,7 @@
import org.jboss.seam.xml.parser.ParserMain;
import org.jboss.seam.xml.parser.SaxNode;
import org.jboss.seam.xml.util.FileDataReader;
+import org.jboss.seam.xml.util.XmlParseException;
import org.jboss.weld.extensions.util.AnnotationInstanceProvider;
public class XmlExtension implements Extension
@@ -42,9 +44,9 @@
List<XmlResult> results = new ArrayList<XmlResult>();
- Set<Class> veto = new HashSet<Class>();
+ Set<Class<?>> veto = new HashSet<Class<?>>();
- Map<Class, AnnotatedType> types = new HashMap<Class, AnnotatedType>();
+ Map<Class<?>, AnnotatedType<?>> types = new HashMap<Class<?>, AnnotatedType<?>>();
int count = 0;
@@ -53,6 +55,8 @@
*/
Map<Integer, List<FieldValueObject>> fieldValues = new HashMap<Integer, List<FieldValueObject>>();
+ List<XmlParseException> parseErrors = new ArrayList<XmlParseException>();
+
/**
* This is the entry point for the extension
*/
@@ -73,7 +77,7 @@
{
ParserMain parser = new ParserMain();
ModelBuilder builder = new ModelBuilder();
- SaxNode parentNode = parser.parse(d.getInputSource(), d.getFileUrl());
+ SaxNode parentNode = parser.parse(d.getInputSource(), d.getFileUrl(), parseErrors);
;
results.add(builder.build(parentNode));
}
@@ -95,7 +99,7 @@
problemString.append("\n");
}
}
- for (BeanResult b : r.getFieldValues().keySet())
+ for (BeanResult<?> b : r.getFieldValues().keySet())
{
int val = count++;
fieldValues.put(val, r.getFieldValues().get(b));
@@ -105,11 +109,11 @@
b.getBuilder().addToClass(a);
}
- for (Class b : r.getQualifiers())
+ for (Class<? extends Annotation> b : r.getQualifiers())
{
event.addQualifier(b);
}
- for (Class b : r.getInterceptorBindings())
+ for (Class<? extends Annotation> b : r.getInterceptorBindings())
{
event.addInterceptorBinding(b);
}
@@ -117,7 +121,7 @@
{
event.addStereotype(b.getKey(), b.getValue());
}
- for (BeanResult bb : r.getBeans())
+ for (BeanResult<?> bb : r.getBeans())
{
boolean install = true;
for (Object className : bb.getDependencies())
@@ -134,7 +138,7 @@
}
if (install)
{
- AnnotatedType tp = bb.getBuilder().create();
+ AnnotatedType<?> tp = bb.getBuilder().create();
event.addAnnotatedType(tp);
types.put(tp.getJavaClass(), tp);
}
@@ -148,7 +152,7 @@
}
}
- public void processAnotated(@Observes ProcessAnnotatedType event)
+ public <T> void processAnotated(@Observes ProcessAnnotatedType<T> event)
{
// veto implementation
if (veto.contains(event.getAnnotatedType().getJavaClass()))
@@ -157,19 +161,27 @@
}
}
- public void processInjectionTarget(@Observes ProcessInjectionTarget event)
+ public <T> void processInjectionTarget(@Observes ProcessInjectionTarget<T> event)
{
- AnnotatedType at = event.getAnnotatedType();
+ AnnotatedType<T> at = event.getAnnotatedType();
XmlId xid = at.getAnnotation(XmlId.class);
if (xid != null)
{
List<FieldValueObject> fvs = fieldValues.get(xid.value());
- event.setInjectionTarget(new InjectionTargetWrapper(event.getInjectionTarget(), fvs));
+ event.setInjectionTarget(new InjectionTargetWrapper<T>(event.getInjectionTarget(), fvs));
}
}
+ public void processAfterBeanDeployment(@Observes AfterBeanDiscovery event)
+ {
+ for (XmlParseException t : parseErrors)
+ {
+ event.addDefinitionError(t);
+ }
+ }
+
public List<Class<? extends XmlDocumentProvider>> getDocumentProviders()
{
List<Class<? extends XmlDocumentProvider>> ret = new ArrayList<Class<? extends XmlDocumentProvider>>();
@@ -207,5 +219,4 @@
}
return ret;
}
-
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/core/BeanResult.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/core/BeanResult.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/core/BeanResult.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -12,17 +12,17 @@
public class BeanResult<X>
{
- NewAnnotatedTypeBuilder builder;
+ NewAnnotatedTypeBuilder<X> builder;
List<String> dependencies = new ArrayList<String>();
- Class type;
+ Class<X> type;
- public BeanResult(Class type)
+ public BeanResult(Class<X> type)
{
this.type = type;
builder = new NewAnnotatedTypeBuilder<X>(type);
}
- public NewAnnotatedTypeBuilder getBuilder()
+ public NewAnnotatedTypeBuilder<X> getBuilder()
{
return builder;
}
@@ -37,7 +37,7 @@
return Collections.unmodifiableList(dependencies);
}
- public Class getType()
+ public Class<X> getType()
{
return type;
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/core/XmlResult.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/core/XmlResult.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/core/XmlResult.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -27,13 +27,13 @@
List<Class<? extends Annotation>> interceptorBindings = new ArrayList<Class<? extends Annotation>>();
- List<Class> veto = new ArrayList<Class>();
+ List<Class<?>> veto = new ArrayList<Class<?>>();
List<String> problems = new ArrayList<String>();
- List<BeanResult> beans = new ArrayList<BeanResult>();
+ List<BeanResult<?>> beans = new ArrayList<BeanResult<?>>();
- Map<BeanResult, List<FieldValueObject>> fieldValues = new HashMap<BeanResult, List<FieldValueObject>>();
+ Map<BeanResult<?>, List<FieldValueObject>> fieldValues = new HashMap<BeanResult<?>, List<FieldValueObject>>();
public Map<Class<? extends Annotation>, Annotation[]> getStereotypes()
{
@@ -50,7 +50,7 @@
return interceptorBindings;
}
- public List<BeanResult> getBeans()
+ public List<BeanResult<?>> getBeans()
{
return beans;
}
@@ -65,17 +65,17 @@
problems.add(p);
}
- public Map<BeanResult, List<FieldValueObject>> getFieldValues()
+ public Map<BeanResult<?>, List<FieldValueObject>> getFieldValues()
{
return fieldValues;
}
- public void addVeto(Class clazz)
+ public void addVeto(Class<?> clazz)
{
veto.add(clazz);
}
- public List<Class> getVeto()
+ public List<Class<?>> getVeto()
{
return veto;
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/CollectionFieldSet.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/CollectionFieldSet.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/CollectionFieldSet.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -32,7 +32,7 @@
{
FieldValueSetter field;
List<CFS> values;
- Class elementType;
+ Class<?> elementType;
Class<? extends Collection> collectionType;
public CollectionFieldSet(FieldValueSetter field, List<XmlItem> items)
@@ -48,7 +48,7 @@
setter = new CFS()
{
- public void add(Collection o) throws IllegalAccessException
+ public void add(Collection<Object> o) throws IllegalAccessException
{
o.add(fv);
}
@@ -68,47 +68,47 @@
if (parameterizedType.getRawType() == Collection.class)
{
- elementType = (Class) parameterizedType.getActualTypeArguments()[0];
+ elementType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
collectionType = LinkedHashSet.class;
}
else if (parameterizedType.getRawType() == List.class)
{
- elementType = (Class) parameterizedType.getActualTypeArguments()[0];
+ elementType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
collectionType = ArrayList.class;
}
else if (parameterizedType.getRawType() == Set.class)
{
- elementType = (Class) parameterizedType.getActualTypeArguments()[0];
+ elementType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
collectionType = LinkedHashSet.class;
}
else if (parameterizedType.getRawType() == SortedSet.class)
{
- elementType = (Class) parameterizedType.getActualTypeArguments()[0];
+ elementType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
collectionType = TreeSet.class;
}
else if (parameterizedType.getRawType() == HashSet.class)
{
- elementType = (Class) parameterizedType.getActualTypeArguments()[0];
+ elementType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
collectionType = HashSet.class;
}
else if (parameterizedType.getRawType() == ArrayList.class)
{
- elementType = (Class) parameterizedType.getActualTypeArguments()[0];
+ elementType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
collectionType = ArrayList.class;
}
else if (parameterizedType.getRawType() == LinkedList.class)
{
- elementType = (Class) parameterizedType.getActualTypeArguments()[0];
+ elementType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
collectionType = LinkedList.class;
}
else if (parameterizedType.getRawType() == LinkedHashSet.class)
{
- elementType = (Class) parameterizedType.getActualTypeArguments()[0];
+ elementType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
collectionType = LinkedHashSet.class;
}
else if (parameterizedType.getRawType() == TreeSet.class)
{
- elementType = (Class) parameterizedType.getActualTypeArguments()[0];
+ elementType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
collectionType = TreeSet.class;
}
else
@@ -128,7 +128,7 @@
{
try
{
- Collection res = collectionType.newInstance();
+ Collection<Object> res = collectionType.newInstance();
field.set(instance, res);
for (int i = 0; i < values.size(); ++i)
{
@@ -143,7 +143,7 @@
interface CFS
{
- void add(Collection o) throws IllegalAccessException;
+ void add(Collection<Object> o) throws IllegalAccessException;
}
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/DirectFieldSetter.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/DirectFieldSetter.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/DirectFieldSetter.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -25,7 +25,7 @@
return field.getGenericType();
}
- public Class getType()
+ public Class<?> getType()
{
return field.getType();
}
@@ -35,7 +35,7 @@
return field.getName();
}
- public Class getDeclaringClass()
+ public Class<?> getDeclaringClass()
{
return field.getDeclaringClass();
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/FieldValueSetter.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/FieldValueSetter.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/FieldValueSetter.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -8,11 +8,11 @@
public void set(Object instance, Object value) throws IllegalAccessException, InvocationTargetException;
- public Class getType();
+ public Class<?> getType();
public Type getGenericType();
- public Class getDeclaringClass();
+ public Class<?> getDeclaringClass();
public String getName();
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/MapFieldSet.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/MapFieldSet.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/MapFieldSet.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -28,8 +28,8 @@
{
FieldValueSetter field;
List<MFS> values;
- Class keyType;
- Class valueType;
+ Class<?> keyType;
+ Class<?> valueType;
Class<? extends Map> collectionType;
public MapFieldSet(FieldValueSetter field, List<EntryXmlItem> items)
@@ -45,6 +45,7 @@
final Object value = XmlObjectConverter.convert(valueType, i.getValue().getInnerText());
setter = new MFS()
{
+ @SuppressWarnings("unchecked")
public void add(Map m) throws IllegalAccessException
{
m.put(key, value);
@@ -65,32 +66,32 @@
if (parameterizedType.getRawType() == Map.class)
{
- keyType = (Class) parameterizedType.getActualTypeArguments()[0];
- valueType = (Class) parameterizedType.getActualTypeArguments()[1];
+ keyType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
+ valueType = (Class<?>) parameterizedType.getActualTypeArguments()[1];
collectionType = LinkedHashMap.class;
}
else if (parameterizedType.getRawType() == LinkedHashMap.class)
{
- keyType = (Class) parameterizedType.getActualTypeArguments()[0];
- valueType = (Class) parameterizedType.getActualTypeArguments()[1];
+ keyType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
+ valueType = (Class<?>) parameterizedType.getActualTypeArguments()[1];
collectionType = LinkedHashMap.class;
}
else if (parameterizedType.getRawType() == HashMap.class)
{
- keyType = (Class) parameterizedType.getActualTypeArguments()[0];
- valueType = (Class) parameterizedType.getActualTypeArguments()[1];
+ keyType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
+ valueType = (Class<?>) parameterizedType.getActualTypeArguments()[1];
collectionType = HashMap.class;
}
else if (parameterizedType.getRawType() == SortedMap.class)
{
- keyType = (Class) parameterizedType.getActualTypeArguments()[0];
- valueType = (Class) parameterizedType.getActualTypeArguments()[1];
+ keyType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
+ valueType = (Class<?>) parameterizedType.getActualTypeArguments()[1];
collectionType = TreeMap.class;
}
else if (parameterizedType.getRawType() == TreeMap.class)
{
- keyType = (Class) parameterizedType.getActualTypeArguments()[0];
- valueType = (Class) parameterizedType.getActualTypeArguments()[1];
+ keyType = (Class<?>) parameterizedType.getActualTypeArguments()[0];
+ valueType = (Class<?>) parameterizedType.getActualTypeArguments()[1];
collectionType = TreeMap.class;
}
else
@@ -125,7 +126,7 @@
interface MFS
{
- void add(Map o) throws IllegalAccessException;
+ void add(Map<?, ?> o) throws IllegalAccessException;
}
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/MethodFieldSetter.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/MethodFieldSetter.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/MethodFieldSetter.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -28,12 +28,12 @@
return method.getName();
}
- public Class getDeclaringClass()
+ public Class<?> getDeclaringClass()
{
return method.getDeclaringClass();
}
- public Class getType()
+ public Class<?> getType()
{
return method.getParameterTypes()[0];
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/SimpleFieldValue.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/SimpleFieldValue.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/fieldset/SimpleFieldValue.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -15,7 +15,7 @@
FS setter;
- public SimpleFieldValue(Class javaObject, final FieldValueSetter f, final String value)
+ public SimpleFieldValue(Class<?> javaObject, final FieldValueSetter f, final String value)
{
this.field = f;
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/AbstractXmlItem.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/AbstractXmlItem.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/AbstractXmlItem.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -18,7 +18,7 @@
{
final XmlItemType type;
final XmlItem parent;
- final Class javaClass;
+ final Class<?> javaClass;
final String innerText;
final Map<String, String> attributes;
@@ -28,7 +28,7 @@
return innerText;
}
- public AbstractXmlItem(XmlItemType type, XmlItem parent, Class javaClass, String innerText, Map<String, String> attributes)
+ public AbstractXmlItem(XmlItemType type, XmlItem parent, Class<?> javaClass, String innerText, Map<String, String> attributes)
{
this.type = type;
this.parent = parent;
@@ -76,7 +76,7 @@
return null;
}
- public Class getJavaClass()
+ public Class<?> getJavaClass()
{
return javaClass;
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/AnnotationXmlItem.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/AnnotationXmlItem.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/AnnotationXmlItem.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -21,7 +21,7 @@
* @param innerText
* @param attributes
*/
- public AnnotationXmlItem(XmlItem parent, Class c, String innerText, Map<String, String> attributes)
+ public AnnotationXmlItem(XmlItem parent, Class<?> c, String innerText, Map<String, String> attributes)
{
super(XmlItemType.ANNOTATION, parent, c, innerText, attributes);
if (innerText != null)
@@ -35,7 +35,7 @@
public Set<XmlItemType> getAllowedItem()
{
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ArrayXmlItem.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ArrayXmlItem.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ArrayXmlItem.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -19,7 +19,7 @@
XmlItem child = null, parent;
- Class javaClass;
+ Class<?> javaClass;
public ArrayXmlItem(XmlItem parent)
{
@@ -43,6 +43,7 @@
child = xmlItem;
}
+ @SuppressWarnings("unchecked")
public Map<String, String> getAttributes()
{
return Collections.EMPTY_MAP;
@@ -94,7 +95,7 @@
{
throw new RuntimeException("<array> element must have a child specifying the array type");
}
- Class l = child.getJavaClass();
+ Class<?> l = child.getJavaClass();
try
{
javaClass = getClass().getClassLoader().loadClass("[L" + l.getName() + ";");
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -22,7 +22,7 @@
* @param innerText
* @param attributes
*/
- public ClassXmlItem(XmlItem parent, Class c)
+ public ClassXmlItem(XmlItem parent, Class<?> c)
{
super(XmlItemType.CLASS, parent, c, null, null);
if (innerText != null)
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/DependsXmlItem.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/DependsXmlItem.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/DependsXmlItem.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -17,7 +17,7 @@
public Set<XmlItemType> getAllowedItem()
{
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/KeyXmlItem.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/KeyXmlItem.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/KeyXmlItem.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -17,6 +17,6 @@
public Set<XmlItemType> getAllowedItem()
{
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/MethodXmlItem.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/MethodXmlItem.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/MethodXmlItem.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -61,16 +61,16 @@
return true;
}
- List<Class> rtList = new ArrayList<Class>();
+ List<Class<?>> rtList = new ArrayList<Class<?>>();
for (XmlItem c : children)
{
if (c.getType() == XmlItemType.CLASS)
{
- Class cl = c.getJavaClass();
+ Class<?> cl = c.getJavaClass();
rtList.add(cl);
}
}
- Class[] alAr = new Class[rtList.size()];
+ Class<?>[] alAr = new Class[rtList.size()];
for (int i = 0; i < rtList.size(); ++i)
{
alAr[i] = rtList.get(i);
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -85,6 +85,7 @@
return ret;
}
+ @SuppressWarnings("unchecked")
private void addNodeToResult(XmlResult ret, XmlItem rb) throws InvalidElementException
{
@@ -93,7 +94,7 @@
ResultType type = getItemType(rb);
if (type == ResultType.BEAN)
{
- BeanResult tp = buildAnnotatedType(rb);
+ BeanResult<?> tp = buildAnnotatedType(rb);
ret.getBeans().add(tp);
List<FieldValueObject> fields = new ArrayList<FieldValueObject>();
for (XmlItem xi : rb.getChildren())
@@ -242,10 +243,11 @@
return ret;
}
- BeanResult buildAnnotatedType(XmlItem rb) throws InvalidElementException
+ @SuppressWarnings("unchecked")
+ <T> BeanResult<T> buildAnnotatedType(XmlItem rb) throws InvalidElementException
{
- BeanResult result = new BeanResult(rb.getJavaClass());
- NewAnnotatedTypeBuilder type = result.getBuilder();
+ BeanResult<T> result = new BeanResult<T>(rb.getJavaClass());
+ NewAnnotatedTypeBuilder<T> type = result.getBuilder();
// list of constructor arguments
List<XmlItem> constList = new ArrayList<XmlItem>();
for (XmlItem item : rb.getChildren())
@@ -314,6 +316,7 @@
return result;
}
+ @SuppressWarnings("unchecked")
void addSteriotypeToResult(XmlResult ret, XmlItem rb) throws InvalidElementException
{
@@ -336,10 +339,11 @@
}
+ @SuppressWarnings("unchecked")
Annotation createAnnotation(XmlItem item) throws InvalidElementException
{
Map<String, Object> typedVars = new HashMap<String, Object>();
- Class anClass = item.getJavaClass();
+ Class<?> anClass = item.getJavaClass();
for (Entry<String, String> e : item.getAttributes().entrySet())
{
String mname = e.getKey();
@@ -352,7 +356,7 @@
{
throw new InvalidElementException("Annotation " + item.getJavaClass().getName() + " does not have a member named " + mname + " ,error in XML");
}
- Class returnType = m.getReturnType();
+ Class<?> returnType = m.getReturnType();
typedVars.put(mname, XmlObjectConverter.convert(returnType, e.getValue()));
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ValueXmlItem.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ValueXmlItem.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/model/ValueXmlItem.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -17,6 +17,6 @@
public Set<XmlItemType> getAllowedItem()
{
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/parser/ParserMain.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/parser/ParserMain.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/parser/ParserMain.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -6,18 +6,21 @@
import java.io.IOException;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
+import org.jboss.seam.xml.util.XmlParseException;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
import org.xml.sax.helpers.XMLReaderFactory;
/**
- * Parser for xml configration
+ * Parser for xml configration, this class should only be used once
*
* @author Stuart Douglas <stuart(a)baileyroberts.com.au>
*
@@ -35,8 +38,11 @@
String document;
- public SaxNode parse(InputSource inputSource, String fileUrl)
+ List<XmlParseException> errors;
+
+ public SaxNode parse(InputSource inputSource, String fileUrl, List<XmlParseException> errors)
{
+ this.errors = errors;
document = fileUrl;
try
{
@@ -108,4 +114,15 @@
this.locator = locator;
}
+ @Override
+ public void error(SAXParseException e) throws SAXException
+ {
+ errors.add(new XmlParseException(e, document, e.getLineNumber()));
+ }
+
+ @Override
+ public void fatalError(SAXParseException e) throws SAXException
+ {
+ errors.add(new XmlParseException(e, document, e.getLineNumber()));
+ }
}
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/parser/namespace/NamespaceUtils.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/parser/namespace/NamespaceUtils.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/parser/namespace/NamespaceUtils.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -15,7 +15,7 @@
{
static XmlItem resolveMethodOrField(String name, XmlItem parent, String innerText) throws InvalidElementException
{
- Class p = parent.getJavaClass();
+ Class<?> p = parent.getJavaClass();
Field f = null;
boolean methodFound = false;
f = getField(p, name);
@@ -45,9 +45,9 @@
/**
* we need access to private fields so we cannot just use getField
*/
- public static Field getField(Class parent, String name)
+ public static Field getField(Class<?> parent, String name)
{
- Class p = parent;
+ Class<?> p = parent;
while (p != Object.class)
{
try
Modified: modules/xml/trunk/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java 2010-01-22 19:28:28 UTC (rev 11985)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -17,7 +17,7 @@
public class PackageNamespaceElementResolver implements NamespaceElementResolver
{
String pack;
- Map<String, Class> cache = new HashMap<String, Class>();
+ Map<String, Class<?>> cache = new HashMap<String, Class<?>>();
Set<String> notFound = new HashSet<String>();
public PackageNamespaceElementResolver(String pack)
@@ -34,7 +34,7 @@
try
{
- Class c;
+ Class<?> c;
if (cache.containsKey(name))
{
c = cache.get(name);
Added: modules/xml/trunk/src/main/java/org/jboss/seam/xml/util/XmlConfigurationException.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/util/XmlConfigurationException.java (rev 0)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/util/XmlConfigurationException.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -0,0 +1,20 @@
+package org.jboss.seam.xml.util;
+
+public class XmlConfigurationException extends Exception
+{
+ int lineno;
+ String document;
+
+ public XmlConfigurationException(String message, String document, int lineno)
+ {
+ super(message);
+ this.document = document;
+ this.lineno = lineno;
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return super.getMessage() + " at " + document + ":" + lineno;
+ }
+}
Added: modules/xml/trunk/src/main/java/org/jboss/seam/xml/util/XmlParseException.java
===================================================================
--- modules/xml/trunk/src/main/java/org/jboss/seam/xml/util/XmlParseException.java (rev 0)
+++ modules/xml/trunk/src/main/java/org/jboss/seam/xml/util/XmlParseException.java 2010-01-22 21:22:04 UTC (rev 11986)
@@ -0,0 +1,21 @@
+package org.jboss.seam.xml.util;
+
+
+public class XmlParseException extends RuntimeException
+{
+ int lineno;
+ String document;
+
+ public XmlParseException(Exception e, String document, int lineno)
+ {
+ super(e);
+ this.lineno = lineno;
+ this.document = document;
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return "Error parsing XML document " + document + ":" + lineno + " " + super.getMessage();
+ }
+}
14 years, 10 months
Seam SVN: r11985 - in branches/enterprise/JBPAPP_5_0/src: test/unit/org/jboss/seam/test/unit and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-01-22 14:28:28 -0500 (Fri, 22 Jan 2010)
New Revision: 11985
Modified:
branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/framework/Query.java
branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/QueryTest.java
Log:
JBPAPP-3461
Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/framework/Query.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/framework/Query.java 2010-01-22 18:51:48 UTC (rev 11984)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/framework/Query.java 2010-01-22 19:28:28 UTC (rev 11985)
@@ -28,7 +28,7 @@
public abstract class Query<T, E>
extends PersistenceController<T> //TODO: extend MutableController!
{
- private static final Pattern SUBJECT_PATTERN = Pattern.compile("^select (\\w+((\\s+|\\.)\\w+)*)\\s+from", Pattern.CASE_INSENSITIVE);
+ private static final Pattern SUBJECT_PATTERN = Pattern.compile("^select\\s+(\\w+(?:\\s*\\.\\s*\\w+)*?)(?:\\s*,\\s*(\\w+(?:\\s*\\.\\s*\\w+)*?))*?\\s+from", Pattern.CASE_INSENSITIVE);
private static final Pattern FROM_PATTERN = Pattern.compile("(^|\\s)(from)\\s", Pattern.CASE_INSENSITIVE);
private static final Pattern WHERE_PATTERN = Pattern.compile("\\s(where)\\s", Pattern.CASE_INSENSITIVE);
private static final Pattern ORDER_PATTERN = Pattern.compile("\\s(order)(\\s)+by\\s", Pattern.CASE_INSENSITIVE);
Modified: branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/QueryTest.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/QueryTest.java 2010-01-22 18:51:48 UTC (rev 11984)
+++ branches/enterprise/JBPAPP_5_0/src/test/unit/org/jboss/seam/test/unit/QueryTest.java 2010-01-22 19:28:28 UTC (rev 11985)
@@ -42,6 +42,10 @@
// TODO this should eventually become count(v.person)
assertEquals(query.getCountEjbql(), "select count(*) from Vehicle v left join v.person");
+ query.setEjbql("select v.person, v.color from Vehicle v");
+ query.parseEjbql();
+ assertEquals(query.getCountEjbql(), "select count(*) from Vehicle v");
+
query = new CompliantUnitQuery();
query.setEjbql("select p from Person p");
query.parseEjbql();
14 years, 10 months
Seam SVN: r11984 - in branches/community/Seam_2_2/src: main/org/jboss/seam/international and 1 other directories.
by seam-commits@lists.jboss.org
Author: youngm
Date: 2010-01-22 13:51:48 -0500 (Fri, 22 Jan 2010)
New Revision: 11984
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java
branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java
branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java
Log:
Some JBSEAM-4525 cleanup
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java 2010-01-22 18:39:43 UTC (rev 11983)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java 2010-01-22 18:51:48 UTC (rev 11984)
@@ -347,13 +347,11 @@
public static FacesMessages instance()
{
Component component = Component.forName(StatusMessages.COMPONENT_NAME);
- if(component != null)
+ if(component != null && !component.getScope().isContextActive())
{
- if ( !component.getScope().isContextActive() )
- {
- throw new IllegalStateException("No active "+component.getScope().name()+" context");
- }
+ throw new IllegalStateException("No active "+component.getScope().name()+" context");
}
+ //Attempting to get the instance anyway for backwards compatibility with some potential hack situations.
return (FacesMessages) Component.getInstance(StatusMessages.COMPONENT_NAME);
}
}
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java 2010-01-22 18:39:43 UTC (rev 11983)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java 2010-01-22 18:51:48 UTC (rev 11984)
@@ -376,6 +376,7 @@
{
return;
}
+ //Attempting to get the instance anyway for backwards compatibility with some potential hack situations.
StatusMessages statusMessages = instance();
if ( statusMessages != null )
{
@@ -395,13 +396,11 @@
public static StatusMessages instance()
{
Component component = Component.forName(StatusMessages.COMPONENT_NAME);
- if(component != null)
+ if(component != null && !component.getScope().isContextActive())
{
- if ( !component.getScope().isContextActive() )
- {
- throw new IllegalStateException("No active "+component.getScope().name()+" context");
- }
+ throw new IllegalStateException("No active "+component.getScope().name()+" context");
}
+ //Attempting to get the instance anyway for backwards compatibility with some potential hack situations.
return (StatusMessages) Component.getInstance(COMPONENT_NAME);
}
Modified: branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java
===================================================================
--- branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java 2010-01-22 18:39:43 UTC (rev 11983)
+++ branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java 2010-01-22 18:51:48 UTC (rev 11984)
@@ -38,13 +38,11 @@
public static WicketStatusMessages instance()
{
Component component = Component.forName(StatusMessages.COMPONENT_NAME);
- if(component != null)
+ if(component != null && !component.getScope().isContextActive())
{
- if ( !component.getScope().isContextActive() )
- {
- throw new IllegalStateException("No active "+component.getScope().name()+" context");
- }
+ throw new IllegalStateException("No active "+component.getScope().name()+" context");
}
+ //Attempting to get the instance anyway for backwards compatibility with some potential hack situations.
return (WicketStatusMessages) Component.getInstance(StatusMessages.COMPONENT_NAME);
}
14 years, 10 months
Seam SVN: r11983 - in branches/community/Seam_2_2/src: main/org/jboss/seam/international and 1 other directories.
by seam-commits@lists.jboss.org
Author: youngm
Date: 2010-01-22 13:39:43 -0500 (Fri, 22 Jan 2010)
New Revision: 11983
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java
branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java
branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java
Log:
JBSEAM-4525
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java 2010-01-22 10:58:27 UTC (rev 11982)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java 2010-01-22 18:39:43 UTC (rev 11983)
@@ -17,7 +17,6 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.international.StatusMessage;
import org.jboss.seam.international.StatusMessages;
import org.jboss.seam.util.Strings;
@@ -347,10 +346,14 @@
public static FacesMessages instance()
{
- if ( !Contexts.isConversationContextActive() )
+ Component component = Component.forName(StatusMessages.COMPONENT_NAME);
+ if(component != null)
{
- throw new IllegalStateException("No active conversation context");
+ if ( !component.getScope().isContextActive() )
+ {
+ throw new IllegalStateException("No active "+component.getScope().name()+" context");
+ }
}
- return (FacesMessages) Component.getInstance(StatusMessages.COMPONENT_NAME, ScopeType.CONVERSATION);
+ return (FacesMessages) Component.getInstance(StatusMessages.COMPONENT_NAME);
}
}
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java 2010-01-22 10:58:27 UTC (rev 11982)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java 2010-01-22 18:39:43 UTC (rev 11983)
@@ -371,14 +371,16 @@
protected static void runTasks()
{
- if ( Contexts.isConversationContextActive() )
+ Component component = Component.forName(StatusMessages.COMPONENT_NAME);
+ if( component != null && !component.getScope().isContextActive() )
{
- StatusMessages statusMessages = instance();
- if (statusMessages != null)
- {
- statusMessages.doRunTasks();
- }
+ return;
}
+ StatusMessages statusMessages = instance();
+ if ( statusMessages != null )
+ {
+ statusMessages.doRunTasks();
+ }
}
protected void doRunTasks()
@@ -392,11 +394,15 @@
public static StatusMessages instance()
{
- if ( !Contexts.isConversationContextActive() )
+ Component component = Component.forName(StatusMessages.COMPONENT_NAME);
+ if(component != null)
{
- throw new IllegalStateException("No active conversation context");
+ if ( !component.getScope().isContextActive() )
+ {
+ throw new IllegalStateException("No active "+component.getScope().name()+" context");
+ }
}
- return (StatusMessages) Component.getInstance(COMPONENT_NAME, ScopeType.CONVERSATION);
+ return (StatusMessages) Component.getInstance(COMPONENT_NAME);
}
}
Modified: branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java
===================================================================
--- branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java 2010-01-22 10:58:27 UTC (rev 11982)
+++ branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java 2010-01-22 18:39:43 UTC (rev 11983)
@@ -10,7 +10,6 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.international.StatusMessage;
import org.jboss.seam.international.StatusMessages;
@@ -38,11 +37,15 @@
public static WicketStatusMessages instance()
{
- if ( !Contexts.isConversationContextActive() )
+ Component component = Component.forName(StatusMessages.COMPONENT_NAME);
+ if(component != null)
{
- throw new IllegalStateException("No active conversation context");
+ if ( !component.getScope().isContextActive() )
+ {
+ throw new IllegalStateException("No active "+component.getScope().name()+" context");
+ }
}
- return (WicketStatusMessages) Component.getInstance(StatusMessages.COMPONENT_NAME, ScopeType.CONVERSATION);
+ return (WicketStatusMessages) Component.getInstance(StatusMessages.COMPONENT_NAME);
}
}
14 years, 10 months
Seam SVN: r11982 - modules/remoting/trunk/src/main/java/org/jboss/seam/remoting.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-01-22 05:58:27 -0500 (Fri, 22 Jan 2010)
New Revision: 11982
Modified:
modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/Remoting.java
Log:
implement getServletConfig()
Modified: modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/Remoting.java
===================================================================
--- modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/Remoting.java 2010-01-22 10:49:52 UTC (rev 11981)
+++ modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/Remoting.java 2010-01-22 10:58:27 UTC (rev 11982)
@@ -233,7 +233,7 @@
public ServletConfig getServletConfig()
{
- return null;
+ return servletConfig;
}
public String getServletInfo()
14 years, 10 months
Seam SVN: r11981 - in modules/remoting/trunk/src/main/java/org/jboss/seam/remoting: wrapper and 1 other directory.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-01-22 05:49:52 -0500 (Fri, 22 Jan 2010)
New Revision: 11981
Modified:
modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/MetadataCache.java
modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/Remoting.java
modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/wrapper/BooleanWrapper.java
Log:
make a little more configurable
Modified: modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/MetadataCache.java
===================================================================
--- modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/MetadataCache.java 2010-01-21 21:18:34 UTC (rev 11980)
+++ modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/MetadataCache.java 2010-01-22 10:49:52 UTC (rev 11981)
@@ -1,6 +1,5 @@
package org.jboss.seam.remoting;
-import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
@@ -20,7 +19,6 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.inject.Inject;
-import javax.servlet.http.HttpServletResponse;
import org.jboss.seam.remoting.BeanMetadata.BeanType;
import org.jboss.seam.remoting.annotations.WebRemote;
Modified: modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/Remoting.java
===================================================================
--- modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/Remoting.java 2010-01-21 21:18:34 UTC (rev 11980)
+++ modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/Remoting.java 2010-01-22 10:49:52 UTC (rev 11981)
@@ -245,6 +245,21 @@
{
this.servletConfig = config;
}
+
+ protected ExecutionHandler getExecutionHandler()
+ {
+ return executionHandlerInstance.get();
+ }
+
+ protected InterfaceGenerator getInterfaceHandler()
+ {
+ return interfaceHandlerInstance.get();
+ }
+
+ protected ModelHandler getModelHandler()
+ {
+ return modelHandlerInstance.get();
+ }
public void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
@@ -260,15 +275,15 @@
if (REQUEST_PATH_EXECUTE.equals(pathInfo))
{
- executionHandlerInstance.get().handle(request, response);
+ getExecutionHandler().handle(request, response);
}
else if (REQUEST_PATH_INTERFACE.equals(pathInfo))
{
- interfaceHandlerInstance.get().handle(request, response);
+ getInterfaceHandler().handle(request, response);
}
else if (REQUEST_PATH_MODEL.equals(pathInfo))
{
- modelHandlerInstance.get().handle(request, response);
+ getModelHandler().handle(request, response);
}
else
{
Modified: modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/wrapper/BooleanWrapper.java
===================================================================
--- modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/wrapper/BooleanWrapper.java 2010-01-21 21:18:34 UTC (rev 11980)
+++ modules/remoting/trunk/src/main/java/org/jboss/seam/remoting/wrapper/BooleanWrapper.java 2010-01-22 10:49:52 UTC (rev 11981)
@@ -41,7 +41,7 @@
return value;
}
- public ConversionScore conversionScore(Class cls)
+ public ConversionScore conversionScore(Class<?> cls)
{
if (cls.equals(Boolean.class) || cls.equals(Boolean.TYPE))
return ConversionScore.exact;
14 years, 10 months
Seam SVN: r11980 - branches/community/Seam_2_2/src/test/unit/org/jboss/seam/test/unit.
by seam-commits@lists.jboss.org
Author: smendenh(a)redhat.com
Date: 2010-01-21 16:18:34 -0500 (Thu, 21 Jan 2010)
New Revision: 11980
Modified:
branches/community/Seam_2_2/src/test/unit/org/jboss/seam/test/unit/QueryTest.java
Log:
Resolved https://jira.jboss.org/jira/browse/JBSEAM-4087 per SUBJECT_PATTERN provided in JIRA, passes all tests in QueryTest
Modified: branches/community/Seam_2_2/src/test/unit/org/jboss/seam/test/unit/QueryTest.java
===================================================================
--- branches/community/Seam_2_2/src/test/unit/org/jboss/seam/test/unit/QueryTest.java 2010-01-21 21:17:58 UTC (rev 11979)
+++ branches/community/Seam_2_2/src/test/unit/org/jboss/seam/test/unit/QueryTest.java 2010-01-21 21:18:34 UTC (rev 11980)
@@ -41,7 +41,11 @@
query.parseEjbql();
// TODO this should eventually become count(v.person)
assertEquals(query.getCountEjbql(), "select count(*) from Vehicle v left join v.person");
-
+
+ query.setEjbql("select v.person, v.color from Vehicle v");
+ query.parseEjbql();
+ assertEquals(query.getCountEjbql(), "select count(*) from Vehicle v");
+
query = new CompliantUnitQuery();
query.setEjbql("select p from Person p");
query.parseEjbql();
14 years, 10 months