Skip to content

Commit 0690ca0

Browse files
authored
Reformat (no code change) (#200)
Seems some PRs brought in formatting issues. No code change, just reformatted.
1 parent 95d42a9 commit 0690ca0

File tree

7 files changed

+88
-78
lines changed

7 files changed

+88
-78
lines changed

org.eclipse.sisu.inject/src/main/java/org/eclipse/sisu/space/SpaceScanner.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ public void visit( final int version, final int access, final String name, final
189189
}
190190

191191
@Override
192-
public org.objectweb.asm.AnnotationVisitor visitAnnotation( final String desc,
193-
final boolean visible )
192+
public org.objectweb.asm.AnnotationVisitor visitAnnotation( final String desc, final boolean visible )
194193
{
195194
final AnnotationVisitor _av = _cv.visitAnnotation( desc );
196195
return null == _av ? null : new org.objectweb.asm.AnnotationVisitor( Opcodes.ASM9 )

org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/component/configurator/converters/AbstractConfigurationConverter.java

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected Object fromExpression( final PlexusConfiguration configuration, final
6262

6363
protected Object fromExpression( final PlexusConfiguration configuration, final ExpressionEvaluator evaluator,
6464
final Class<?> type, boolean enforceTypeCompatibility )
65-
throws ComponentConfigurationException
65+
throws ComponentConfigurationException
6666

6767
{
6868
String value = configuration.getValue();
@@ -73,32 +73,38 @@ protected Object fromExpression( final PlexusConfiguration configuration, final
7373
{
7474
if ( evaluator instanceof TypeAwareExpressionEvaluator && type != null )
7575
{
76-
result = ((TypeAwareExpressionEvaluator) evaluator).evaluate( value, type );
77-
} else
76+
result = ( (TypeAwareExpressionEvaluator) evaluator ).evaluate( value, type );
77+
}
78+
else
7879
{
7980
result = evaluator.evaluate( value );
8081
}
8182
}
82-
if ( null == result && configuration.getChildCount() == 0 ) {
83+
if ( null == result && configuration.getChildCount() == 0 )
84+
{
8385
value = configuration.getAttribute( "default-value" );
84-
if ( null != value && !value.isEmpty() ) {
85-
if ( evaluator instanceof TypeAwareExpressionEvaluator && type != null ) {
86-
result = ((TypeAwareExpressionEvaluator) evaluator).evaluate( value, type );
87-
} else {
86+
if ( null != value && !value.isEmpty() )
87+
{
88+
if ( evaluator instanceof TypeAwareExpressionEvaluator && type != null )
89+
{
90+
result = ( (TypeAwareExpressionEvaluator) evaluator ).evaluate( value, type );
91+
}
92+
else
93+
{
8894
result = evaluator.evaluate( value );
8995
}
9096
}
9197
}
92-
if ( enforceTypeCompatibility && type != null ) {
98+
if ( enforceTypeCompatibility && type != null )
99+
{
93100
failIfNotTypeCompatible( result, type, configuration );
94101
}
95102
return result;
96103
}
97104
catch ( final ExpressionEvaluationException e )
98105
{
99-
final String reason =
100-
String.format( "Cannot evaluate expression '%s' for configuration entry '%s'",
101-
value, configuration.getName() );
106+
final String reason = String.format( "Cannot evaluate expression '%s' for configuration entry '%s'", value,
107+
configuration.getName() );
102108

103109
throw new ComponentConfigurationException( configuration, reason, e );
104110
}

org.eclipse.sisu.plexus/src/main/java/org/codehaus/plexus/component/configurator/converters/composite/MapConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public Object fromConfiguration( final ConverterLookup lookup, final PlexusConfi
6666
for ( int i = 0, size = configuration.getChildCount(); i < size; i++ )
6767
{
6868
final PlexusConfiguration element = configuration.getChild( i );
69-
map.put( element.getName(), fromExpression( element, evaluator, (Class<?>)elementType ) );
69+
map.put( element.getName(), fromExpression( element, evaluator, (Class<?>) elementType ) );
7070
}
7171
return map;
7272
}

org.eclipse.sisu.plexus/src/test/java/org/codehaus/plexus/component/configurator/converters/composite/MapConverterTest.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,29 @@ public void testConvert()
3939
throws ComponentConfigurationException
4040
{
4141
XmlPlexusConfiguration config = new XmlPlexusConfiguration( "properties" );
42-
config.addChild("key1", "value1" );
42+
config.addChild( "key1", "value1" );
4343
config.addChild( "key2", "value2" );
4444

45-
Object object = new MapConverter().fromConfiguration( null, config, HashMap.class, null, null,
46-
new ExpressionEvaluator()
47-
{
48-
@Override
49-
public Object evaluate( String expression )
50-
throws ExpressionEvaluationException
51-
{
52-
return expression;
53-
}
45+
Object object =
46+
new MapConverter().fromConfiguration( null, config, HashMap.class, null, null, new ExpressionEvaluator()
47+
{
48+
@Override
49+
public Object evaluate( String expression )
50+
throws ExpressionEvaluationException
51+
{
52+
return expression;
53+
}
5454

55-
@Override
56-
public File alignToBaseDirectory( File path )
57-
{
58-
return null;
59-
}
60-
}, null );
55+
@Override
56+
public File alignToBaseDirectory( File path )
57+
{
58+
return null;
59+
}
60+
}, null );
6161
assertTrue( object instanceof HashMap );
6262
HashMap result = (HashMap) object;
6363
assertTrue( result.size() == 2 );
64-
assertEquals( "value1", result.get("key1") );
65-
assertEquals( "value2", result.get("key2") );
64+
assertEquals( "value1", result.get( "key1" ) );
65+
assertEquals( "value2", result.get( "key2" ) );
6666
}
6767
}

org.eclipse.sisu.plexus/src/test/java/org/codehaus/plexus/component/configurator/converters/composite/PropertiesConverterTest.java

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,35 @@ public void testConvert1()
3838
throws ComponentConfigurationException
3939
{
4040
XmlPlexusConfiguration config = new XmlPlexusConfiguration( "properties" );
41-
config.addChild("key1", "value1" );
41+
config.addChild( "key1", "value1" );
4242
config.addChild( "key2", "value2" );
4343

4444
Object object = new PropertiesConverter().fromConfiguration( null, config, Properties.class, null, null,
45-
new ExpressionEvaluator()
46-
{
47-
@Override
48-
public Object evaluate( String expression )
49-
throws ExpressionEvaluationException
50-
{
51-
return expression;
52-
}
45+
new ExpressionEvaluator()
46+
{
47+
@Override
48+
public Object evaluate( String expression )
49+
throws ExpressionEvaluationException
50+
{
51+
return expression;
52+
}
5353

54-
@Override
55-
public File alignToBaseDirectory( File path )
56-
{
57-
return null;
58-
}
59-
}, null );
54+
@Override
55+
public File alignToBaseDirectory( File path )
56+
{
57+
return null;
58+
}
59+
}, null );
6060
assertTrue( object instanceof Properties );
6161
Properties result = (Properties) object;
6262
assertTrue( result.size() == 2 );
63-
assertEquals( "value1", result.getProperty("key1") );
64-
assertEquals( "value2", result.getProperty("key2") );
63+
assertEquals( "value1", result.getProperty( "key1" ) );
64+
assertEquals( "value2", result.getProperty( "key2" ) );
6565
}
6666

6767
@Test
6868
public void testConvert2()
69-
throws ComponentConfigurationException
69+
throws ComponentConfigurationException
7070
{
7171
XmlPlexusConfiguration config = new XmlPlexusConfiguration( "properties" );
7272

@@ -79,28 +79,28 @@ public void testConvert2()
7979
entry2.addChild( "value", "value2" );
8080
config.addChild( entry2 );
8181

82-
System.out.println(config);
82+
System.out.println( config );
8383

8484
Object object = new PropertiesConverter().fromConfiguration( null, config, Properties.class, null, null,
85-
new ExpressionEvaluator()
86-
{
87-
@Override
88-
public Object evaluate( String expression )
89-
throws ExpressionEvaluationException
90-
{
91-
return expression;
92-
}
85+
new ExpressionEvaluator()
86+
{
87+
@Override
88+
public Object evaluate( String expression )
89+
throws ExpressionEvaluationException
90+
{
91+
return expression;
92+
}
9393

94-
@Override
95-
public File alignToBaseDirectory( File path )
96-
{
97-
return null;
98-
}
99-
}, null );
94+
@Override
95+
public File alignToBaseDirectory( File path )
96+
{
97+
return null;
98+
}
99+
}, null );
100100
assertTrue( object instanceof Properties );
101101
Properties result = (Properties) object;
102-
assertEquals(2, result.size() );
103-
assertEquals( "value1", result.getProperty("key1") );
104-
assertEquals( "value2", result.getProperty("key2") );
102+
assertEquals( 2, result.size() );
103+
assertEquals( "value1", result.getProperty( "key1" ) );
104+
assertEquals( "value2", result.getProperty( "key2" ) );
105105
}
106106
}

org.eclipse.sisu.plexus/src/test/java/org/eclipse/sisu/plexus/BasicComponentConfiguratorTest.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,21 +93,22 @@ public void testTypePassedToExpressionEvaluator()
9393
{
9494
@Override
9595
public Object evaluate( String expression, Class<?> type )
96-
throws ExpressionEvaluationException
96+
throws ExpressionEvaluationException
9797
{
9898
assertEquals( CustomType.class, type );
9999
return expression;
100100
}
101101

102102
@Override
103-
public Object evaluate( String expression ) throws ExpressionEvaluationException
103+
public Object evaluate( String expression )
104+
throws ExpressionEvaluationException
104105
{
105106
fail( "Wrong evaluate method being called (without type)" );
106107
return expression; // unreachable
107108
}
108109

109110
@Override
110-
public File alignToBaseDirectory(File path)
111+
public File alignToBaseDirectory( File path )
111112
{
112113
return path;
113114
}
@@ -192,7 +193,7 @@ private void configure( Object component, String... keysAndValues )
192193
}
193194

194195
private void configure( ExpressionEvaluator evaluator, Object component, String... keysAndValues )
195-
throws ComponentConfigurationException
196+
throws ComponentConfigurationException
196197
{
197198
final DefaultPlexusConfiguration config = new DefaultPlexusConfiguration( "testConfig" );
198199
if ( keysAndValues.length % 2 != 0 )
@@ -212,7 +213,8 @@ private void configure( ExpressionEvaluator evaluator, Object component, PlexusC
212213
configure( evaluator, component, config, null );
213214
}
214215

215-
private void configure( ExpressionEvaluator evaluator, Object component, PlexusConfiguration config, ClassRealm loader )
216+
private void configure( ExpressionEvaluator evaluator, Object component, PlexusConfiguration config,
217+
ClassRealm loader )
216218
throws ComponentConfigurationException
217219
{
218220
if ( evaluator == null )

org.eclipse.sisu.plexus/src/test/java/org/eclipse/sisu/plexus/PlexusStrictClasspathScanningTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public void testStrictClasspathScanningWithInvalidClassFileForSisuComponent()
170170
() -> createIsolatedPlexusContainer( configConsumer,
171171
Optional.of( dirClasspath.getURL() ) ) );
172172
assertEquals( "Problem scanning " + dirClasspath.getClassFileUrl( Jsr330Component2.class.getName() ),
173-
e.getCause().getMessage() );
173+
e.getCause().getMessage() );
174174
assertEquals( "Unsupported class file major version 255", e.getCause().getCause().getMessage() );
175175

176176
// test with container realm containing invalid class file
@@ -296,10 +296,13 @@ void invalidateClassFile( String className )
296296
public URL getClassFileUrl( String className )
297297
{
298298
String relativePath = className.replace( '.', File.separatorChar ) + ".class";
299-
try {
299+
try
300+
{
300301
return tempDir.resolve( relativePath ).toUri().toURL();
301-
} catch (MalformedURLException e) {
302-
throw new IllegalArgumentException("Invalid class name: " + className, e);
302+
}
303+
catch ( MalformedURLException e )
304+
{
305+
throw new IllegalArgumentException( "Invalid class name: " + className, e );
303306
}
304307
}
305308

0 commit comments

Comments
 (0)