You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@accumulo.apache.org by David Medinets <da...@gmail.com> on 2012/09/11 20:54:13 UTC

SetIterCommand - why set input to new String(input)?

Is there  some value in the line marked by question marks?

  private static String setUpOptions(final ConsoleReader reader, final
String className, final Map<String,String> options) ... {
    ...
          if (input == null) {
            reader.printNewline();
            throw new IOException("Input stream closed");
          } else {
            input = new String(input);  <--- ????
          }
  }

Re: SetIterCommand - why set input to new String(input)?

Posted by Christopher Tubbs <ct...@gmail.com>.
Printing a newline to the console reader is probably so the console
appender for the log4j in the shell doesn't print to the same line as
the prompt.

On Tue, Sep 11, 2012 at 4:37 PM, David Medinets
<da...@gmail.com> wrote:
> One more question. Why print a newline to the reader if the stream is closed?
>
> On Tue, Sep 11, 2012 at 3:27 PM, Billie Rinaldi <bi...@apache.org> wrote:
>> On Tue, Sep 11, 2012 at 11:54 AM, David Medinets
>> <da...@gmail.com>wrote:
>>
>>> Is there  some value in the line marked by question marks?
>>>
>>>   private static String setUpOptions(final ConsoleReader reader, final
>>> String className, final Map<String,String> options) ... {
>>>     ...
>>>           if (input == null) {
>>>             reader.printNewline();
>>>             throw new IOException("Input stream closed");
>>>           } else {
>>>             input = new String(input);  <--- ????
>>>           }
>>>   }
>>>
>>
>> That looks like my fault.  I did it twice in the same method.  Can't
>> imagine why.
>>
>> Billie

Re: SetIterCommand - why set input to new String(input)?

Posted by David Medinets <da...@gmail.com>.
One more question. Why print a newline to the reader if the stream is closed?

On Tue, Sep 11, 2012 at 3:27 PM, Billie Rinaldi <bi...@apache.org> wrote:
> On Tue, Sep 11, 2012 at 11:54 AM, David Medinets
> <da...@gmail.com>wrote:
>
>> Is there  some value in the line marked by question marks?
>>
>>   private static String setUpOptions(final ConsoleReader reader, final
>> String className, final Map<String,String> options) ... {
>>     ...
>>           if (input == null) {
>>             reader.printNewline();
>>             throw new IOException("Input stream closed");
>>           } else {
>>             input = new String(input);  <--- ????
>>           }
>>   }
>>
>
> That looks like my fault.  I did it twice in the same method.  Can't
> imagine why.
>
> Billie

Re: SetIterCommand - why set input to new String(input)?

Posted by Billie Rinaldi <bi...@apache.org>.
On Tue, Sep 11, 2012 at 11:54 AM, David Medinets
<da...@gmail.com>wrote:

> Is there  some value in the line marked by question marks?
>
>   private static String setUpOptions(final ConsoleReader reader, final
> String className, final Map<String,String> options) ... {
>     ...
>           if (input == null) {
>             reader.printNewline();
>             throw new IOException("Input stream closed");
>           } else {
>             input = new String(input);  <--- ????
>           }
>   }
>

That looks like my fault.  I did it twice in the same method.  Can't
imagine why.

Billie