Skip to content

Commit 631f0aa

Browse files
authored
add some generics (#6)
Signed-off-by: Olivier Lamy <olamy@apache.org>
1 parent 836ee67 commit 631f0aa

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

plexus-interactivity-api/src/main/java/org/codehaus/plexus/components/interactivity/AbstractInputHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ public abstract class AbstractInputHandler
4040
extends AbstractLogEnabled
4141
implements InputHandler
4242
{
43-
public List readMultipleLines()
43+
public List<String> readMultipleLines()
4444
throws IOException
4545
{
46-
List lines = new ArrayList();
46+
List<String> lines = new ArrayList<>();
4747
String line = readLine();
4848
while ( line != null && line.length() > 0 )
4949
{

plexus-interactivity-api/src/main/java/org/codehaus/plexus/components/interactivity/DefaultOutputHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
* SOFTWARE.
2525
*/
2626

27-
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable;
2827
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
2928
import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
3029

plexus-interactivity-api/src/main/java/org/codehaus/plexus/components/interactivity/DefaultPrompter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public String prompt( String message, String defaultReply )
100100
}
101101
}
102102

103-
public String prompt( String message, List possibleValues, String defaultReply )
103+
public String prompt( String message, List<String> possibleValues, String defaultReply )
104104
throws PrompterException
105105
{
106106
String formattedMessage = formatMessage( message, possibleValues, defaultReply );
@@ -152,7 +152,7 @@ public String prompt( String message, List possibleValues, String defaultReply )
152152
return line;
153153
}
154154

155-
public String prompt( String message, List possibleValues )
155+
public String prompt( String message, List<String> possibleValues )
156156
throws PrompterException
157157
{
158158
return prompt( message, possibleValues, null );
@@ -180,19 +180,19 @@ public String promptForPassword( String message )
180180
}
181181
}
182182

183-
private String formatMessage( String message, List possibleValues, String defaultReply )
183+
private String formatMessage( String message, List<String> possibleValues, String defaultReply )
184184
{
185-
StringBuffer formatted = new StringBuffer( message.length() * 2 );
185+
StringBuilder formatted = new StringBuilder( message.length() * 2 );
186186

187187
formatted.append( message );
188188

189189
if ( possibleValues != null && !possibleValues.isEmpty() )
190190
{
191191
formatted.append( " (" );
192192

193-
for ( Iterator it = possibleValues.iterator(); it.hasNext(); )
193+
for ( Iterator<String> it = possibleValues.iterator(); it.hasNext(); )
194194
{
195-
String possibleValue = (String) it.next();
195+
String possibleValue = it.next();
196196

197197
formatted.append( possibleValue );
198198

plexus-interactivity-api/src/main/java/org/codehaus/plexus/components/interactivity/InputHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ String readPassword()
6161
* Ends when an empty line is encountered.
6262
* @return a list of lines read
6363
*/
64-
List readMultipleLines()
64+
List<String> readMultipleLines()
6565
throws IOException;
6666
}

plexus-interactivity-api/src/main/java/org/codehaus/plexus/components/interactivity/Prompter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ String prompt( String message )
4242
String prompt( String message, String defaultReply )
4343
throws PrompterException;
4444

45-
String prompt( String message, List possibleValues )
45+
String prompt( String message, List<String> possibleValues )
4646
throws PrompterException;
4747

48-
String prompt( String message, List possibleValues, String defaultReply )
48+
String prompt( String message, List<String> possibleValues, String defaultReply )
4949
throws PrompterException;
5050

5151
String promptForPassword( String message )

pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<artifactId>plexus-components</artifactId>
66
<groupId>org.codehaus.plexus</groupId>
7-
<version>6.5</version>
7+
<version>6.6</version>
88
</parent>
99

1010
<artifactId>plexus-interactivity</artifactId>
@@ -17,7 +17,6 @@
1717
<connection>${scm.url}</connection>
1818
<developerConnection>${scm.url}</developerConnection>
1919
<url>https://github.com/codehaus-plexus/plexus-interactivity</url>
20-
<tag>plexus-interactivity-1.1</tag>
2120
</scm>
2221
<issueManagement>
2322
<system>github</system>

0 commit comments

Comments
 (0)