File tree Expand file tree Collapse file tree 6 files changed +20
-22
lines changed
src/main/java/org/codehaus/plexus/components/interactivity
plexus-interactivity-jline
src/main/java/org/codehaus/plexus/components/interactivity/jline Expand file tree Collapse file tree 6 files changed +20
-22
lines changed Original file line number Diff line number Diff line change 2222 <version >5.9.3</version >
2323 <scope >test</scope >
2424 </dependency >
25+ <!--
26+ | @PostConstruct and @PreDestroy help with Plexus->JSR330 migration
27+ -->
2528 <dependency >
26- <groupId >org.codehaus.plexus</groupId >
27- <artifactId >plexus-container-default</artifactId >
29+ <groupId >javax.annotation</groupId >
30+ <artifactId >javax.annotation-api</artifactId >
31+ <version >1.2</version >
2832 </dependency >
2933 </dependencies >
3034</project >
Original file line number Diff line number Diff line change 2424 * SOFTWARE.
2525 */
2626
27- import org .codehaus .plexus .logging .AbstractLogEnabled ;
28-
2927import java .util .List ;
3028import java .util .ArrayList ;
3129import java .io .IOException ;
3735 * @version $Id$
3836 */
3937public abstract class AbstractInputHandler
40- extends AbstractLogEnabled
4138 implements InputHandler
4239{
4340 public List <String > readMultipleLines ()
Original file line number Diff line number Diff line change 2424 * SOFTWARE.
2525 */
2626
27- import org .codehaus .plexus .personality .plexus .lifecycle .phase .Initializable ;
28- import org .codehaus .plexus .personality .plexus .lifecycle .phase .InitializationException ;
29-
27+ import javax .annotation .PostConstruct ;
3028import java .io .BufferedReader ;
3129import java .io .IOException ;
3230import java .io .InputStreamReader ;
3937 */
4038public class DefaultInputHandler
4139 extends AbstractInputHandler
42- implements Initializable
4340{
4441 private BufferedReader consoleReader ;
4542
@@ -55,8 +52,8 @@ public String readPassword()
5552 return consoleReader .readLine ();
5653 }
5754
55+ @ PostConstruct
5856 public void initialize ()
59- throws InitializationException
6057 {
6158 consoleReader = new BufferedReader ( new InputStreamReader ( System .in ) );
6259 }
Original file line number Diff line number Diff line change 2424 * SOFTWARE.
2525 */
2626
27- import org .codehaus .plexus .personality .plexus .lifecycle .phase .Initializable ;
28- import org .codehaus .plexus .personality .plexus .lifecycle .phase .InitializationException ;
29-
27+ import javax .annotation .PostConstruct ;
3028import java .io .IOException ;
3129import java .io .PrintWriter ;
3230
3735 * @version $Id$
3836 */
3937public class DefaultOutputHandler
40- implements Initializable , OutputHandler
38+ implements OutputHandler
4139{
4240 private PrintWriter consoleWriter ;
4341
42+ @ PostConstruct
4443 public void initialize ()
45- throws InitializationException
4644 {
4745 consoleWriter = new PrintWriter ( System .out );
4846 }
Original file line number Diff line number Diff line change 2222 <artifactId >plexus-interactivity-api</artifactId >
2323 <version >${project.version} </version >
2424 </dependency >
25+ <!--
26+ | @PostConstruct and @PreDestroy help with Plexus->JSR330 migration
27+ -->
2528 <dependency >
26- <groupId >org.codehaus.plexus</groupId >
27- <artifactId >plexus-container-default</artifactId >
29+ <groupId >javax.annotation</groupId >
30+ <artifactId >javax.annotation-api</artifactId >
31+ <version >1.2</version >
2832 </dependency >
2933 </dependencies >
3034</project >
Original file line number Diff line number Diff line change 2626
2727import jline .ConsoleReader ;
2828import org .codehaus .plexus .components .interactivity .AbstractInputHandler ;
29- import org .codehaus .plexus .personality .plexus .lifecycle .phase .Initializable ;
30- import org .codehaus .plexus .personality .plexus .lifecycle .phase .InitializationException ;
3129
30+ import javax .annotation .PostConstruct ;
3231import java .io .IOException ;
3332
3433/**
3938 */
4039public class JLineInputHandler
4140 extends AbstractInputHandler
42- implements Initializable
4341{
4442 private ConsoleReader consoleReader ;
4543
@@ -55,16 +53,16 @@ public String readPassword()
5553 return consoleReader .readLine ( new Character ( '*' ) );
5654 }
5755
56+ @ PostConstruct
5857 public void initialize ()
59- throws InitializationException
6058 {
6159 try
6260 {
6361 consoleReader = new ConsoleReader ();
6462 }
6563 catch ( IOException e )
6664 {
67- throw new InitializationException ( "Cannot create console reader: " , e );
65+ throw new IllegalStateException ( "Cannot create console reader: " , e );
6866 }
6967 }
7068}
You can’t perform that action at this time.
0 commit comments