Skip to content

Commit acb4703

Browse files
committed
Reformat code
1 parent df44d88 commit acb4703

File tree

66 files changed

+2646
-4004
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2646
-4004
lines changed

pom.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
12
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23
<modelVersion>4.0.0</modelVersion>
34

@@ -16,8 +17,8 @@
1617
<scm>
1718
<connection>scm:git:https://github.com/codehaus-plexus/plexus-interpolation.git</connection>
1819
<developerConnection>scm:git:https://github.com/codehaus-plexus/plexus-interpolation.git</developerConnection>
19-
<url>http://github.com/codehaus-plexus/plexus-interpolation/tree/${project.scm.tag}/</url>
2020
<tag>master</tag>
21+
<url>http://github.com/codehaus-plexus/plexus-interpolation/tree/${project.scm.tag}/</url>
2122
</scm>
2223

2324
<issueManagement>
@@ -60,15 +61,17 @@
6061
<groupId>org.apache.maven.plugins</groupId>
6162
<artifactId>maven-scm-publish-plugin</artifactId>
6263
<configuration>
63-
<content>${project.reporting.outputDirectory}</content><!-- mono-module doesn't require site:stage -->
64+
<content>${project.reporting.outputDirectory}</content>
65+
<!-- mono-module doesn't require site:stage -->
6466
</configuration>
6567
<executions>
6668
<execution>
6769
<id>scm-publish</id>
68-
<phase>site-deploy</phase><!-- deploy site with maven-scm-publish-plugin -->
70+
<!-- deploy site with maven-scm-publish-plugin -->
6971
<goals>
7072
<goal>publish-scm</goal>
7173
</goals>
74+
<phase>site-deploy</phase>
7275
</execution>
7376
</executions>
7477
</plugin>

src/main/java/org/codehaus/plexus/interpolation/AbstractDelegatingValueSource.java

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,31 @@
1818

1919
import java.util.List;
2020

21-
public abstract class AbstractDelegatingValueSource
22-
implements ValueSource
23-
{
24-
21+
public abstract class AbstractDelegatingValueSource implements ValueSource {
22+
2523
private final ValueSource delegate;
2624

27-
protected AbstractDelegatingValueSource( ValueSource delegate )
28-
{
29-
if ( delegate == null )
30-
{
31-
throw new NullPointerException( "Delegate ValueSource cannot be null." );
25+
protected AbstractDelegatingValueSource(ValueSource delegate) {
26+
if (delegate == null) {
27+
throw new NullPointerException("Delegate ValueSource cannot be null.");
3228
}
33-
29+
3430
this.delegate = delegate;
3531
}
36-
37-
protected ValueSource getDelegate()
38-
{
32+
33+
protected ValueSource getDelegate() {
3934
return delegate;
4035
}
4136

42-
public Object getValue( String expression )
43-
{
44-
return getDelegate().getValue( expression );
37+
public Object getValue(String expression) {
38+
return getDelegate().getValue(expression);
4539
}
46-
47-
public void clearFeedback()
48-
{
40+
41+
public void clearFeedback() {
4942
delegate.clearFeedback();
5043
}
5144

52-
public List getFeedback()
53-
{
45+
public List getFeedback() {
5446
return delegate.getFeedback();
5547
}
56-
5748
}

src/main/java/org/codehaus/plexus/interpolation/AbstractFunctionValueSourceWrapper.java

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
* value of the second expression, which is resolved from the wrapped value
2929
* source.</p>
3030
*/
31-
public abstract class AbstractFunctionValueSourceWrapper
32-
implements ValueSource
33-
{
31+
public abstract class AbstractFunctionValueSourceWrapper implements ValueSource {
3432

3533
private final ValueSource valueSource;
3634

@@ -40,8 +38,7 @@ public abstract class AbstractFunctionValueSourceWrapper
4038
*
4139
* @param valueSource The value source to wrap
4240
*/
43-
protected AbstractFunctionValueSourceWrapper( ValueSource valueSource )
44-
{
41+
protected AbstractFunctionValueSourceWrapper(ValueSource valueSource) {
4542
this.valueSource = valueSource;
4643
}
4744

@@ -56,26 +53,23 @@ protected AbstractFunctionValueSourceWrapper( ValueSource valueSource )
5653
* for the current expression.</li>
5754
* </ol>
5855
*/
59-
public Object getValue( String expression )
60-
{
61-
Object value = valueSource.getValue( expression );
56+
public Object getValue(String expression) {
57+
Object value = valueSource.getValue(expression);
6258

6359
String expr = expression;
6460

65-
if ( valueSource instanceof QueryEnabledValueSource )
66-
{
61+
if (valueSource instanceof QueryEnabledValueSource) {
6762
expr = ((QueryEnabledValueSource) valueSource).getLastExpression();
6863
}
6964

70-
return executeFunction( expr, value );
65+
return executeFunction(expr, value);
7166
}
7267

7368
/**
7469
* Retrieve the embedded value source.
7570
* @return {@link ValueSource}
7671
*/
77-
protected ValueSource getValueSource()
78-
{
72+
protected ValueSource getValueSource() {
7973
return valueSource;
8074
}
8175

@@ -87,6 +81,5 @@ protected ValueSource getValueSource()
8781
* @param value The value for the current expression, resolved by the embedded {@link ValueSource}
8882
* @return The result of modifying the current expression's value using the function named by the last expression.
8983
*/
90-
protected abstract Object executeFunction( String expression, Object value );
91-
84+
protected abstract Object executeFunction(String expression, Object value);
9285
}

src/main/java/org/codehaus/plexus/interpolation/AbstractValueSource.java

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,34 @@
1919
import java.util.ArrayList;
2020
import java.util.List;
2121

22-
public abstract class AbstractValueSource
23-
implements ValueSource
24-
{
25-
22+
public abstract class AbstractValueSource implements ValueSource {
23+
2624
private final List feedback;
27-
28-
protected AbstractValueSource( boolean usesFeedback )
29-
{
30-
if ( usesFeedback )
31-
{
25+
26+
protected AbstractValueSource(boolean usesFeedback) {
27+
if (usesFeedback) {
3228
feedback = new ArrayList();
33-
}
34-
else
35-
{
29+
} else {
3630
feedback = null;
3731
}
3832
}
3933

40-
public void clearFeedback()
41-
{
42-
if ( feedback != null )
43-
{
34+
public void clearFeedback() {
35+
if (feedback != null) {
4436
feedback.clear();
4537
}
4638
}
4739

48-
public List getFeedback()
49-
{
40+
public List getFeedback() {
5041
return feedback;
5142
}
5243

53-
protected void addFeedback( String message )
54-
{
55-
feedback.add( message );
44+
protected void addFeedback(String message) {
45+
feedback.add(message);
5646
}
57-
58-
protected void addFeedback( String message, Throwable cause )
59-
{
60-
feedback.add( message );
61-
feedback.add( cause );
47+
48+
protected void addFeedback(String message, Throwable cause) {
49+
feedback.add(message);
50+
feedback.add(cause);
6251
}
6352
}

src/main/java/org/codehaus/plexus/interpolation/BasicInterpolator.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
*
2121
* TODO: Really really needs a way to communicate errors.
2222
*/
23-
public interface BasicInterpolator
24-
{
23+
public interface BasicInterpolator {
2524
/**
2625
* See {@link org.codehaus.plexus.interpolation.Interpolator#interpolate(String, String, org.codehaus.plexus.interpolation.RecursionInterceptor)}.
2726
* <p>
@@ -34,8 +33,7 @@ public interface BasicInterpolator
3433
* @return the interpolated string.
3534
* @throws InterpolationException in case of an error.
3635
*/
37-
String interpolate( String input )
38-
throws InterpolationException;
36+
String interpolate(String input) throws InterpolationException;
3937

4038
/**
4139
* See {@link org.codehaus.plexus.interpolation.Interpolator#interpolate(String, String, org.codehaus.plexus.interpolation.RecursionInterceptor)}.
@@ -52,6 +50,5 @@ String interpolate( String input )
5250
* @return the interpolated string.
5351
* @throws InterpolationException in case of an error.
5452
*/
55-
String interpolate( String input, RecursionInterceptor recursionInterceptor )
56-
throws InterpolationException;
53+
String interpolate(String input, RecursionInterceptor recursionInterceptor) throws InterpolationException;
5754
}

src/main/java/org/codehaus/plexus/interpolation/EnvarBasedValueSource.java

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,18 @@
1616
* limitations under the License.
1717
*/
1818

19-
import org.codehaus.plexus.interpolation.os.OperatingSystemUtils;
20-
2119
import java.io.IOException;
2220
import java.util.Properties;
2321

22+
import org.codehaus.plexus.interpolation.os.OperatingSystemUtils;
23+
2424
/**
2525
* {@link ValueSource} which resolves expressions against the environment variables
2626
* available from the underlying operating system (and possibly, the shell environment
2727
* that created the present Java process). If the expression starts with 'env.',
2828
* this prefix is trimmed before resolving the rest as an environment variable name.
2929
*/
30-
public class EnvarBasedValueSource
31-
extends AbstractValueSource
32-
{
30+
public class EnvarBasedValueSource extends AbstractValueSource {
3331

3432
private static Properties envarsCaseSensitive;
3533
private static Properties envarsCaseInsensitive;
@@ -43,9 +41,8 @@ public class EnvarBasedValueSource
4341
*
4442
* @throws IOException in case of an error.
4543
*/
46-
public EnvarBasedValueSource() throws IOException
47-
{
48-
this( true );
44+
public EnvarBasedValueSource() throws IOException {
45+
this(true);
4946
}
5047

5148
/**
@@ -55,29 +52,21 @@ public EnvarBasedValueSource() throws IOException
5552
* case-sensitive manner for lookups
5653
* @throws IOException in case of an error.
5754
*/
58-
public EnvarBasedValueSource( boolean caseSensitive ) throws IOException
59-
{
60-
super( false );
55+
public EnvarBasedValueSource(boolean caseSensitive) throws IOException {
56+
super(false);
6157
this.caseSensitive = caseSensitive;
62-
this.envars = getEnvars( caseSensitive );
58+
this.envars = getEnvars(caseSensitive);
6359
}
6460

65-
private static synchronized Properties getEnvars( boolean caseSensitive )
66-
throws IOException
67-
{
68-
if ( caseSensitive )
69-
{
70-
if ( envarsCaseSensitive == null )
71-
{
72-
envarsCaseSensitive = OperatingSystemUtils.getSystemEnvVars( caseSensitive );
61+
private static synchronized Properties getEnvars(boolean caseSensitive) throws IOException {
62+
if (caseSensitive) {
63+
if (envarsCaseSensitive == null) {
64+
envarsCaseSensitive = OperatingSystemUtils.getSystemEnvVars(caseSensitive);
7365
}
7466
return envarsCaseSensitive;
75-
}
76-
else
77-
{
78-
if ( envarsCaseInsensitive == null )
79-
{
80-
envarsCaseInsensitive = OperatingSystemUtils.getSystemEnvVars( caseSensitive );
67+
} else {
68+
if (envarsCaseInsensitive == null) {
69+
envarsCaseInsensitive = OperatingSystemUtils.getSystemEnvVars(caseSensitive);
8170
}
8271
return envarsCaseInsensitive;
8372
}
@@ -92,30 +81,25 @@ private static synchronized Properties getEnvars( boolean caseSensitive )
9281
* @param expression envar expression, like 'HOME' or 'env.HOME'
9382
* @return the environment variable value for the given expression
9483
*/
95-
public Object getValue( String expression )
96-
{
84+
public Object getValue(String expression) {
9785
String expr = expression;
9886

99-
if ( expr.startsWith( "env." ) )
100-
{
101-
expr = expr.substring( "env.".length() );
87+
if (expr.startsWith("env.")) {
88+
expr = expr.substring("env.".length());
10289
}
10390

104-
if ( !caseSensitive )
105-
{
91+
if (!caseSensitive) {
10692
expr = expr.toUpperCase();
10793
}
10894

109-
return envars.getProperty( expr );
95+
return envars.getProperty(expr);
11096
}
111-
97+
11298
/**
11399
* reset static variables acting as a cache for testing purposes only
114100
*/
115-
static void resetStatics()
116-
{
101+
static void resetStatics() {
117102
envarsCaseSensitive = null;
118103
envarsCaseInsensitive = null;
119104
}
120-
121105
}

src/main/java/org/codehaus/plexus/interpolation/FeedbackEnabledValueSource.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* limitations under the License.
1717
*/
1818

19-
2019
/**
2120
* Represents a {@link ValueSource} which provides information back to the caller
2221
* about what may have gone wrong while resolving the value for an expression.
@@ -25,7 +24,4 @@
2524
*
2625
* @deprecated Rolled into {@link ValueSource} now.
2726
*/
28-
public interface FeedbackEnabledValueSource
29-
extends ValueSource
30-
{
31-
}
27+
public interface FeedbackEnabledValueSource extends ValueSource {}

0 commit comments

Comments
 (0)