APPLICATION
}
public String name() default "";
+ @SuppressWarnings("unchecked") // Can't use Class<?> because API needs to match specification
public Class type() default Object.class;
public AuthenticationType authenticationType() default AuthenticationType.CONTAINER;
public boolean shareable() default true;
public @interface EJB {
String name() default "";
String description() default "";
+ @SuppressWarnings("unchecked") // Can't use Class<?> because API needs to match specification
Class beanInterface() default java.lang.Object.class;
String beanName() default "";
String mappedName() default "";
this.type = descriptor.getPropertyType();
}
- public Class getPropertyType() {
+ @SuppressWarnings("unchecked") // Can't use Class<?> because API needs to match specification
+ public Class getPropertyType() {
return this.type;
}
return props.get(ctx, prop);
}
- private final static Method getMethod(Class type, Method m) {
+ private final static Method getMethod(Class<?> type, Method m) {
if (m == null || Modifier.isPublic(type.getModifiers())) {
return m;
}
this.resolved = false;
}
+ @SuppressWarnings("unchecked") // Can't use Class<?> because API needs to match specification
public Object getContext(Class key) {
if (this.map == null) {
return null;
return this.map.get(key);
}
+ @SuppressWarnings("unchecked") // Can't use Class<?> because API needs to match specification
public void putContext(Class key, Object contextObject) throws NullPointerException {
if (key == null || contextObject == null) {
throw new NullPointerException();
private final boolean readOnly;
- private final static Class<? extends List> UNMODIFIABLE =
+ private final static Class<?> UNMODIFIABLE =
Collections.unmodifiableList(new ArrayList<Object>()).getClass();
public ListELResolver() {
throw new NullPointerException();
}
- if (base instanceof List) {
+ if (base instanceof List<?>) {
context.setPropertyResolved(true);
- List<Object> list = (List<Object>) base;
+ List<?> list = (List<?>) base;
int idx = coerce(property);
if (idx < 0 || idx >= list.size()) {
return null;
throw new NullPointerException();
}
- if (base instanceof List) {
+ if (base instanceof List<?>) {
context.setPropertyResolved(true);
- List<Object> list = (List<Object>) base;
+ List<?> list = (List<?>) base;
int idx = coerce(property);
if (idx < 0 || idx >= list.size()) {
return null;
throw new NullPointerException();
}
- if (base instanceof List) {
+ if (base instanceof List<?>) {
context.setPropertyResolved(true);
+ @SuppressWarnings("unchecked") // Must be OK to cast to Object
List<Object> list = (List<Object>) base;
if (this.readOnly) {
throw new NullPointerException();
}
- if (base instanceof List) {
+ if (base instanceof List<?>) {
context.setPropertyResolved(true);
- List<Object> list = (List<Object>) base;
+ List<?> list = (List<?>) base;
int idx = coerce(property);
if (idx < 0 || idx >= list.size()) {
throw new PropertyNotFoundException(
@Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
- if (base instanceof List) {
- FeatureDescriptor[] descs = new FeatureDescriptor[((List) base).size()];
+ if (base instanceof List<?>) {
+ FeatureDescriptor[] descs = new FeatureDescriptor[((List<?>) base).size()];
for (int i = 0; i < descs.length; i++) {
descs[i] = new FeatureDescriptor();
descs[i].setDisplayName("["+i+"]");
@Override
public Class<?> getCommonPropertyType(ELContext context, Object base) {
- if (base != null && base instanceof List) {
+ if (base instanceof List<?>) { // implies base != null
return Integer.class;
}
return null;
public class MapELResolver extends ELResolver {
- private final static Class UNMODIFIABLE = Collections.unmodifiableMap(
- new HashMap()).getClass();
+ private final static Class<?> UNMODIFIABLE = Collections.unmodifiableMap(
+ new HashMap<Object, Object>()).getClass();
private final boolean readOnly;
throw new NullPointerException();
}
- if (base instanceof Map) {
+ if (base instanceof Map<?,?>) {
context.setPropertyResolved(true);
- return ((Map) base).get(property);
+ return ((Map<?,?>) base).get(property);
}
return null;
throw new NullPointerException();
}
- if (base instanceof Map) {
+ if (base instanceof Map<?,?>) {
context.setPropertyResolved(true);
- Object obj = ((Map) base).get(property);
+ Object obj = ((Map<?,?>) base).get(property);
return (obj != null) ? obj.getClass() : null;
}
throw new NullPointerException();
}
- if (base instanceof Map) {
+ if (base instanceof Map<?, ?>) {
context.setPropertyResolved(true);
if (this.readOnly) {
}
try {
- ((Map) base).put(property, value);
+ @SuppressWarnings("unchecked") // Must be OK
+ Map<Object, Object> map = ((Map<Object, Object>) base);
+ map.put(property, value);
} catch (UnsupportedOperationException e) {
throw new PropertyNotWritableException(e);
}
throw new NullPointerException();
}
- if (base instanceof Map) {
+ if (base instanceof Map<?, ?>) {
context.setPropertyResolved(true);
return this.readOnly || UNMODIFIABLE.equals(base.getClass());
}
@Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
- if (base instanceof Map) {
- Iterator itr = ((Map) base).keySet().iterator();
+ if (base instanceof Map<?, ?>) {
+ Iterator<?> itr = ((Map<?, ?>) base).keySet().iterator();
List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>();
Object key;
FeatureDescriptor desc;
@Override
public Class<?> getCommonPropertyType(ELContext context, Object base) {
- if (base instanceof Map) {
+ if (base instanceof Map<?, ?>) {
return Object.class;
}
return null;
}
@Override
+ @SuppressWarnings("unchecked") // Can't use Iterator<FeatureDescriptor> because API needs to match specification
public Iterator getFeatureDescriptors(ELContext context, Object base) {
if (base instanceof ResourceBundle) {
List<FeatureDescriptor> feats = new ArrayList<FeatureDescriptor>();
- Enumeration e = ((ResourceBundle) base).getKeys();
+ Enumeration<String> e = ((ResourceBundle) base).getKeys();
FeatureDescriptor feat;
String key;
while (e.hasMoreElements()) {
- key = (String) e.nextElement();
+ key = e.nextElement();
feat = new FeatureDescriptor();
feat.setDisplayName(key);
feat.setExpert(false);
public @interface WebServiceRef {
public String name() default "";
+ @SuppressWarnings("unchecked") // Can't use Class<?> because API needs to match specification
public Class type() default java.lang.Object.class;
+ @SuppressWarnings("unchecked") // Can't use Class<?> because API needs to match specification
public Class value() default java.lang.Object.class;
public String wsdlLocation() default "";
public String mappedName() default "";