🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #555

Re: Wierd system.out.println

#555
From: Paul Murray
Date: Thu, 24 Aug 2000 00:00
60 lines
2678 bytes
Hmm, a method named "processRequest". You aren't fooling with threads, by
any chance?

--
--------------------------------------------------------------
Repent! Quit your job! Slack off!
http://www.users.bigpond.com/pmurray/index-2.html
ICQ: 26066755
"Nicholas Routledge" <n.routledge@bigpond.com> wrote in message
news:s5Oo5.36404$c5.101625@newsfeeds.bigpond.com...
> Hi all,
>
> I'm having this extremely frustrating problem that i can't see to fix.
> I have a method called processRequest and when called, returns a string.
> After processRequest is called, the string that is returned is assigned to
a
> variable called status.
> this is what i have next,
>
> if (status.equals("Confirm")) {
>     ...
>     System.out.println("Confirm (Y/N): ");
>     char c = (char) br.read();
>     ...
> }
>
> else if (status.equals("Alternate")) {
>     ...
>     System.out.println("Confirm (Y/N): ");
>     char c = (char) br.read();
>     ...
> }
> .
> .
>
> Now the problem is, the System.out.println statements in each conditional
> branch are executed TWICE for some reason.  They should only be executed
> once because the statements are not nested inside a loop.  Also, i have no
> recursion anywhere in the program.
>
> For example, if the first branch is taken, it prints out,
> "Confirm (Y/N): "
> "Confirm (Y/N): "
>
> Its extremely wierd but i was wondering whether anyone had any suggestions
> or whether anyone had seen this problem before?
> I can't explain it.
>
> --
> cheers,
> Nick
>
> =================================
> Nicholas Routledge
> ICQ#: 41114416
> Website: http://users.bigpond.com/n.routledge/
> Email: s371556@student.uq.edu.au
> =================================
>
>
Technical Details
Message-ID: <VQ8p5.37174$c5.103733@newsfeeds.bigpond.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <s5Oo5.36404$c5.101625@newsfeeds.bigpond.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10a146,23055c9aac63ea4a
X-Google-Attributes: gid10a146,public
X-Google-Thread: 10d6db,23055c9aac63ea4a
X-Google-Attributes: gid10d6db,public
X-Google-Thread: 113ae9,23055c9aac63ea4a
X-Google-Attributes: gid113ae9,public
From: "Paul Murray" <pmurray@nospam.bigpond.com>
Subject: Re: Wierd system.out.println
Date: 2000/08/24
Message-ID: <VQ8p5.37174$c5.103733@newsfeeds.bigpond.com>
X-Deja-AN: 661937766
References: <s5Oo5.36404$c5.101625@newsfeeds.bigpond.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
X-Trace: newsfeeds.bigpond.com 967121333 139.134.125.18 (Thu, 24 Aug 2000 22:48:53 EST)
Organization: Telstra BigPond Internet Services (http://www.bigpond.com)
X-MSMail-Priority: Normal
NNTP-Posting-Date: Thu, 24 Aug 2000 22:48:53 EST
Newsgroups: aus.computers.java,comp.lang.java.help,comp.lang.java.programmer