Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java 8 as mininum #6

Merged
merged 1 commit into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ public abstract class AbstractInputHandler
extends AbstractLogEnabled
implements InputHandler
{
public List readMultipleLines()
public List<String> readMultipleLines()
throws IOException
{
List lines = new ArrayList();
List<String> lines = new ArrayList<>();
String line = readLine();
while ( line != null && line.length() > 0 )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
* SOFTWARE.
*/

import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public String prompt( String message, String defaultReply )
}
}

public String prompt( String message, List possibleValues, String defaultReply )
public String prompt( String message, List<String> possibleValues, String defaultReply )
throws PrompterException
{
String formattedMessage = formatMessage( message, possibleValues, defaultReply );
Expand Down Expand Up @@ -152,7 +152,7 @@ public String prompt( String message, List possibleValues, String defaultReply )
return line;
}

public String prompt( String message, List possibleValues )
public String prompt( String message, List<String> possibleValues )
throws PrompterException
{
return prompt( message, possibleValues, null );
Expand Down Expand Up @@ -180,19 +180,19 @@ public String promptForPassword( String message )
}
}

private String formatMessage( String message, List possibleValues, String defaultReply )
private String formatMessage( String message, List<String> possibleValues, String defaultReply )
{
StringBuffer formatted = new StringBuffer( message.length() * 2 );
StringBuilder formatted = new StringBuilder( message.length() * 2 );

formatted.append( message );

if ( possibleValues != null && !possibleValues.isEmpty() )
{
formatted.append( " (" );

for ( Iterator it = possibleValues.iterator(); it.hasNext(); )
for ( Iterator<String> it = possibleValues.iterator(); it.hasNext(); )
michael-o marked this conversation as resolved.
Show resolved Hide resolved
{
String possibleValue = (String) it.next();
String possibleValue = it.next();

formatted.append( possibleValue );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ String readPassword()
* Ends when an empty line is encountered.
* @return a list of lines read
*/
List readMultipleLines()
List<String> readMultipleLines()
throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ String prompt( String message )
String prompt( String message, String defaultReply )
throws PrompterException;

String prompt( String message, List possibleValues )
String prompt( String message, List<String> possibleValues )
throws PrompterException;

String prompt( String message, List possibleValues, String defaultReply )
String prompt( String message, List<String> possibleValues, String defaultReply )
throws PrompterException;

String promptForPassword( String message )
Expand Down
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>plexus-components</artifactId>
<groupId>org.codehaus.plexus</groupId>
<version>6.5</version>
<version>6.6</version>
</parent>

<artifactId>plexus-interactivity</artifactId>
Expand All @@ -17,7 +17,6 @@
<connection>${scm.url}</connection>
<developerConnection>${scm.url}</developerConnection>
<url>https://github.com/codehaus-plexus/plexus-interactivity</url>
<tag>plexus-interactivity-1.1</tag>
</scm>
<issueManagement>
<system>github</system>
Expand Down