Revert upstream feature which introduced a regression
- Resolves: rhbz#1070915
This commit is contained in:
parent
baa1af086a
commit
ae05a4f50b
@ -0,0 +1,97 @@
|
|||||||
|
From fdbcb51eea40131ed221ecd07e6f33926d14e387 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Mikolaj Izdebski <mizdebsk@redhat.com>
|
||||||
|
Date: Mon, 3 Mar 2014 05:48:15 +0100
|
||||||
|
Subject: [PATCH] Revert "Bug 406688: allow maps of string to complex types in
|
||||||
|
mojo configuration"
|
||||||
|
|
||||||
|
This reverts commit 5b469c87c134ca9e78883981f138a8972ac31bdc.
|
||||||
|
---
|
||||||
|
.../converters/composite/MapConverter.java | 37 +---------------------
|
||||||
|
1 file changed, 1 insertion(+), 36 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/org.eclipse.sisu.plexus/src/org/codehaus/plexus/component/configurator/converters/composite/MapConverter.java b/org.eclipse.sisu.plexus/src/org/codehaus/plexus/component/configurator/converters/composite/MapConverter.java
|
||||||
|
index 277f267..790b6c2 100644
|
||||||
|
--- a/org.eclipse.sisu.plexus/src/org/codehaus/plexus/component/configurator/converters/composite/MapConverter.java
|
||||||
|
+++ b/org.eclipse.sisu.plexus/src/org/codehaus/plexus/component/configurator/converters/composite/MapConverter.java
|
||||||
|
@@ -13,7 +13,6 @@
|
||||||
|
package org.codehaus.plexus.component.configurator.converters.composite;
|
||||||
|
|
||||||
|
import java.lang.reflect.Modifier;
|
||||||
|
-import java.lang.reflect.Type;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
@@ -21,15 +20,12 @@ import java.util.TreeMap;
|
||||||
|
import org.codehaus.plexus.component.configurator.ComponentConfigurationException;
|
||||||
|
import org.codehaus.plexus.component.configurator.ConfigurationListener;
|
||||||
|
import org.codehaus.plexus.component.configurator.converters.AbstractConfigurationConverter;
|
||||||
|
-import org.codehaus.plexus.component.configurator.converters.ConfigurationConverter;
|
||||||
|
-import org.codehaus.plexus.component.configurator.converters.ParameterizedConfigurationConverter;
|
||||||
|
import org.codehaus.plexus.component.configurator.converters.lookup.ConverterLookup;
|
||||||
|
import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator;
|
||||||
|
import org.codehaus.plexus.configuration.PlexusConfiguration;
|
||||||
|
|
||||||
|
public class MapConverter
|
||||||
|
extends AbstractConfigurationConverter
|
||||||
|
- implements ParameterizedConfigurationConverter
|
||||||
|
{
|
||||||
|
public boolean canConvert( final Class<?> type )
|
||||||
|
{
|
||||||
|
@@ -41,15 +37,6 @@ public class MapConverter
|
||||||
|
final ExpressionEvaluator evaluator, final ConfigurationListener listener )
|
||||||
|
throws ComponentConfigurationException
|
||||||
|
{
|
||||||
|
- return fromConfiguration( lookup, configuration, type, null, enclosingType, loader, evaluator, listener );
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- public Object fromConfiguration( final ConverterLookup lookup, final PlexusConfiguration configuration,
|
||||||
|
- final Class<?> type, final Type[] typeArguments, final Class<?> enclosingType,
|
||||||
|
- final ClassLoader loader, final ExpressionEvaluator evaluator,
|
||||||
|
- final ConfigurationListener listener )
|
||||||
|
- throws ComponentConfigurationException
|
||||||
|
- {
|
||||||
|
final Object value = fromExpression( configuration, evaluator, type );
|
||||||
|
if ( null != value )
|
||||||
|
{
|
||||||
|
@@ -58,23 +45,10 @@ public class MapConverter
|
||||||
|
try
|
||||||
|
{
|
||||||
|
final Map<Object, Object> map = instantiateMap( configuration, type, loader );
|
||||||
|
- final Class<?> elementType = findElementType( typeArguments );
|
||||||
|
- if ( Object.class == elementType || String.class == elementType )
|
||||||
|
- {
|
||||||
|
- for ( int i = 0, size = configuration.getChildCount(); i < size; i++ )
|
||||||
|
- {
|
||||||
|
- final PlexusConfiguration element = configuration.getChild( i );
|
||||||
|
- map.put( element.getName(), fromExpression( element, evaluator ) );
|
||||||
|
- }
|
||||||
|
- return map;
|
||||||
|
- }
|
||||||
|
- // handle maps with complex element types...
|
||||||
|
- final ConfigurationConverter converter = lookup.lookupConverterForType( elementType );
|
||||||
|
for ( int i = 0, size = configuration.getChildCount(); i < size; i++ )
|
||||||
|
{
|
||||||
|
final PlexusConfiguration element = configuration.getChild( i );
|
||||||
|
- map.put( element.getName(), converter.fromConfiguration( lookup, element, elementType, enclosingType,
|
||||||
|
- loader, evaluator, listener ) );
|
||||||
|
+ map.put( element.getName(), fromExpression( element, evaluator ) );
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
@@ -103,13 +77,4 @@ public class MapConverter
|
||||||
|
failIfNotTypeCompatible( impl, type, configuration );
|
||||||
|
return (Map<Object, Object>) impl;
|
||||||
|
}
|
||||||
|
-
|
||||||
|
- private static Class<?> findElementType( final Type[] typeArguments )
|
||||||
|
- {
|
||||||
|
- if ( null != typeArguments && typeArguments.length > 1 && typeArguments[1] instanceof Class<?> )
|
||||||
|
- {
|
||||||
|
- return (Class<?>) typeArguments[1];
|
||||||
|
- }
|
||||||
|
- return Object.class;
|
||||||
|
- }
|
||||||
|
}
|
||||||
|
--
|
||||||
|
1.8.4.2
|
||||||
|
|
13
sisu.spec
13
sisu.spec
@ -1,7 +1,7 @@
|
|||||||
Name: sisu
|
Name: sisu
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Version: 0.2.0
|
Version: 0.2.0
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
Summary: Eclipse dependency injection framework
|
Summary: Eclipse dependency injection framework
|
||||||
# bundled asm is under BSD
|
# bundled asm is under BSD
|
||||||
# See also: https://fedorahosted.org/fpc/ticket/346
|
# See also: https://fedorahosted.org/fpc/ticket/346
|
||||||
@ -13,6 +13,9 @@ URL: http://eclipse.org/sisu
|
|||||||
Source0: http://git.eclipse.org/c/%{name}/org.eclipse.%{name}.inject.git/snapshot/releases/%{version}.tar.bz2#/org.eclipse.%{name}.inject-%{version}.tar.bz2
|
Source0: http://git.eclipse.org/c/%{name}/org.eclipse.%{name}.inject.git/snapshot/releases/%{version}.tar.bz2#/org.eclipse.%{name}.inject-%{version}.tar.bz2
|
||||||
Source1: http://git.eclipse.org/c/%{name}/org.eclipse.%{name}.plexus.git/snapshot/releases/%{version}.tar.bz2#/org.eclipse.%{name}.plexus-%{version}.tar.bz2
|
Source1: http://git.eclipse.org/c/%{name}/org.eclipse.%{name}.plexus.git/snapshot/releases/%{version}.tar.bz2#/org.eclipse.%{name}.plexus-%{version}.tar.bz2
|
||||||
|
|
||||||
|
# Revert new feature which introduced a regressionm
|
||||||
|
Patch0: 0001-Revert-Bug-406688-allow-maps-of-string-to-complex-ty.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
BuildRequires: maven-local
|
BuildRequires: maven-local
|
||||||
@ -112,6 +115,10 @@ This package contains %{summary}.
|
|||||||
tar xf %{SOURCE0} && mv releases/* sisu-inject && rmdir releases
|
tar xf %{SOURCE0} && mv releases/* sisu-inject && rmdir releases
|
||||||
tar xf %{SOURCE1} && mv releases/* sisu-plexus && rmdir releases
|
tar xf %{SOURCE1} && mv releases/* sisu-plexus && rmdir releases
|
||||||
|
|
||||||
|
pushd sisu-plexus
|
||||||
|
%patch0 -p1
|
||||||
|
popd
|
||||||
|
|
||||||
%mvn_file ":{*}" @1
|
%mvn_file ":{*}" @1
|
||||||
%mvn_package ":*{inject,plexus}" @1
|
%mvn_package ":*{inject,plexus}" @1
|
||||||
%mvn_package : __noinstall
|
%mvn_package : __noinstall
|
||||||
@ -193,6 +200,10 @@ done
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Mar 3 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:0.2.0-4
|
||||||
|
- Revert upstream feature which introduced a regression
|
||||||
|
- Resolves: rhbz#1070915
|
||||||
|
|
||||||
* Thu Feb 20 2014 Michal Srb <msrb@redhat.com> - 1:0.2.0-3
|
* Thu Feb 20 2014 Michal Srb <msrb@redhat.com> - 1:0.2.0-3
|
||||||
- Remove R on cdi-api
|
- Remove R on cdi-api
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user