Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
slachiewicz committed Dec 13, 2023
1 parent 5827324 commit 5cde88e
Show file tree
Hide file tree
Showing 13 changed files with 150 additions and 258 deletions.
3 changes: 2 additions & 1 deletion plexus-interactivity-api/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>plexus-interactivity</artifactId>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interactivity</artifactId>
<version>1.2-SNAPSHOT</version>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,22 @@
* SOFTWARE.
*/

import java.util.List;
import java.util.ArrayList;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
* Base input handler, implements a default <code>readMultipleLines</code>.
*
* @author Brett Porter
* @version $Id$
*/
public abstract class AbstractInputHandler
implements InputHandler
{
public List<String> readMultipleLines()
throws IOException
{
public abstract class AbstractInputHandler implements InputHandler {
public List<String> readMultipleLines() throws IOException {
List<String> lines = new ArrayList<>();
String line = readLine();
while ( line != null && line.length() > 0 )
{
lines.add( line );
while (line != null && line.length() > 0) {
lines.add(line);
line = readLine();
}
return lines;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

import javax.annotation.PostConstruct;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
Expand All @@ -35,26 +36,19 @@
* @author Brett Porter
* @version $Id$
*/
public class DefaultInputHandler
extends AbstractInputHandler
{
public class DefaultInputHandler extends AbstractInputHandler {
private BufferedReader consoleReader;

public String readLine()
throws IOException
{
public String readLine() throws IOException {
return consoleReader.readLine();
}

public String readPassword()
throws IOException
{
public String readPassword() throws IOException {
return consoleReader.readLine();
}

@PostConstruct
public void initialize()
{
consoleReader = new BufferedReader( new InputStreamReader( System.in ) );
public void initialize() {
consoleReader = new BufferedReader(new InputStreamReader(System.in));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

import javax.annotation.PostConstruct;

import java.io.IOException;
import java.io.PrintWriter;

Expand All @@ -34,27 +35,20 @@
* @author Brett Porter
* @version $Id$
*/
public class DefaultOutputHandler
implements OutputHandler
{
public class DefaultOutputHandler implements OutputHandler {
private PrintWriter consoleWriter;

@PostConstruct
public void initialize()
{
consoleWriter = new PrintWriter( System.out );
public void initialize() {
consoleWriter = new PrintWriter(System.out);
}

public void write( String line )
throws IOException
{
consoleWriter.print( line );
public void write(String line) throws IOException {
consoleWriter.print(line);
consoleWriter.flush();
}

public void writeLine( String line )
throws IOException
{
public void writeLine(String line) throws IOException {
consoleWriter.println();
}
}
Loading

0 comments on commit 5cde88e

Please sign in to comment.