Skip to content

Commit

Permalink
#166: workaround for compiler difference in oracle compiler vs. eclip…
Browse files Browse the repository at this point in the history
…se compiler

#163: make build work
  • Loading branch information
hohwille committed Feb 7, 2016
1 parent 067c928 commit 0a446b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
* such as {@link net.sf.mmm.util.bean.api.BeanAccess#createProperty(String, Class)} according types have to be
* registered via an implementation of this interface.
*
* @param <V> the generic type of the {@link WritableProperty#getValue() property value}.
* @param <PROPERTY> the generic type of the {@link WritableProperty property}.
* @param <V> the generic type of the {@link ReadableProperty#getValue() property value}.
* @param <PROPERTY> the generic type of the {@link #getImplementationClass() property implementation}.
*
* @see PropertyFactoryManager
*
* @author hohwille
* @since 8.0.0
*/
@ComponentSpecification(plugin = true)
public interface PropertyFactory<V, PROPERTY extends WritableProperty<V>> {
public interface PropertyFactory<V, PROPERTY extends ReadableProperty<V>> {

/**
* @return the {@link Class} of the {@link WritableProperty#getValue() property value}. May be <code>null</code> for
* @return the {@link Class} of the {@link ReadableProperty#getValue() property value}. May be <code>null</code> for
* {@link net.sf.mmm.util.property.api.GenericProperty}.
*/
Class<? extends V> getValueClass();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ public interface PropertyFactoryManager {
* @param polymorphic - see {@link #getFactoryForValueType(Class, boolean)}.
* @return the according {@link PropertyFactory} or {@code null} if no such factory is registered.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
default <V, PROPERTY extends ReadableProperty<V>> PropertyFactory<V, ? extends PROPERTY> getFactory(
Class<PROPERTY> propertyType, Class<V> valueType, boolean polymorphic) {

PropertyFactory<V, ? extends PROPERTY> factory = getFactoryForPropertyType(propertyType);
PropertyFactory/* <V, ? extends PROPERTY> */ factory = getFactoryForPropertyType(propertyType);
if (valueType != null) {
if ((factory == null) || (factory.getValueClass() == null)) {
PropertyFactory<V, ? extends ReadableProperty<V>> valueFactory = getFactoryForValueType(valueType,
polymorphic);
if (valueFactory != null) {
if ((propertyType == null) || (propertyType.isAssignableFrom(valueFactory.getImplementationClass()))) {
factory = (PropertyFactory<V, ? extends PROPERTY>) valueFactory;
factory = valueFactory;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ protected void doInitialized() {
return (PropertyFactory) factory;
}

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public <V, PROPERTY extends ReadableProperty<V>> PROPERTY create(Class<PROPERTY> propertyType,
GenericType<V> valueType, boolean polymorphic, String name, Bean bean,
Expand All @@ -189,8 +190,8 @@ public <V, PROPERTY extends ReadableProperty<V>> PROPERTY create(Class<PROPERTY>
if (valueType != null) {
valueClass = valueType.getRetrievalClass();
}
PropertyFactory<V, ? extends PROPERTY> factory = getRequiredFactory(propertyType, valueClass, polymorphic);
return factory.create(name, valueType, bean, validator);
PropertyFactory factory = getRequiredFactory(propertyType, valueClass, polymorphic);
return (PROPERTY) factory.create(name, valueType, bean, validator);
}

}

0 comments on commit 0a446b6

Please sign in to comment.