This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 171862 - A statement is repeated when using Scanner-- Note: May not be related to Scanner.
Summary: A statement is repeated when using Scanner-- Note: May not be related to Scan...
Status: RESOLVED DUPLICATE of bug 167279
Alias: None
Product: platform
Classification: Unclassified
Component: Output Window (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: t_h
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-10 02:38 UTC by tbab
Modified: 2009-09-17 15:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tbab 2009-09-10 02:38:09 UTC
When executing the following code, this is the output ONLY in the NetBeans IDE:

import java.util.Scanner;

class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        System.out.print("Blahdy blah: " + "blah.");
        sc.next();
    }
}

Output:
Blahdy blah: blah.Blahdy blah: blah.

The statement before the call to Scanner#next() is repeated.
This only happens when running the code in the NetBeans IDE. Furthermore, the statement is only repeated when it 
includes that colon. Take it out, and you will notice that it is not repeated.
Comment 1 Peter Pis 2009-09-10 08:23:34 UTC
Sorry, I couldn't reproduce. There's only appropriate output. 

Product Version: NetBeans IDE Dev (Build 200909071948)
Java: 1.5.0_20; Java HotSpot(TM) Client VM 1.5.0_20-141
System: Mac OS X version 10.5.8 running on i386; MacRoman; en_US (nb)

Could you please provide further details? NB build, jdk, operating system. 
Comment 2 tbab 2009-09-10 16:00:41 UTC
I am using NB 6.7.1
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
Windows XP Professional v2002 SP3
Comment 3 tbab 2009-09-11 01:24:36 UTC
Posted a video of this happening on YouTube:
http://www.youtube.com/watch?v=iUHXOm1SHPQ
Comment 4 tbab 2009-09-11 02:33:57 UTC
I found that this can also be replicated with just this code:

class Main {
    public static void main(String[] args) {
        // Apparently anything after the colon that is not a
        // space or blank character will cause this statement to repeat.
        System.out.print("Blahdy blah: a");
    }
}

This does not happen when using the println method.
Comment 5 Peter Pis 2009-09-14 10:02:03 UTC
Reproduced.

Product Version: NetBeans IDE 6.7.1 (Build 200907230233)
Java: 1.5.0_20; Java HotSpot(TM) Client VM 1.5.0_20-141
System: Mac OS X version 10.5.8 running on i386; MacRoman; en_US (nb)

Reassigning.
Comment 6 Tomas Zezula 2009-09-14 10:30:14 UTC
Seems as a bug in the output window or java Ant loger
Comment 7 Tomas Zezula 2009-09-14 10:44:53 UTC

*** This issue has been marked as a duplicate of 168274 ***
Comment 8 Tomas Zezula 2009-09-14 12:37:22 UTC
Sorry wrong tab (issue), reopening.
Comment 9 Tomas Zezula 2009-09-14 14:38:31 UTC
Works for me in 6.8 (current) builds.
Reassigning to the output win.
Comment 10 t_h 2009-09-17 15:05:50 UTC

*** This issue has been marked as a duplicate of 167279 ***