A fix is available
APAR status
Closed as program error.
Error description
RAD v7.5.5 and WAS v7.0.0.7 IBM JDK 1.6 SR6 java.util.Scanner nextLine() is incorrect and requires two 'Enter' keypress initially The following code would be expected to initialize the 'lname' variable with what is typed in after the prompt for last name. The behavior is that you have to hit the 'Enter' key twice to get the code to accept the entry of the first name so this throws off the second call to nextLine(). import java.util.Scanner; public class ScannerTest { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println('Hello. Please enter your first name:'); String name = scan.nextLine(); System.out.println('Hello. Please enter your last name:'); String lname = scan.nextLine(); System.out.println('Hello, ' + name + ' ' + lname); } } RESULTS: BAD: //== RAD7.5 Console: ScannerTest.java using //-- RAD7.5.5 built in JRE or WAS 7.0.0.7 JRE: IBM JDK 1.6 SR6 Hello. Please enter your first name: >Firstname > Hello. Please enter your last name: >Lastname >Hello, Firstname //== Note: '>' implies a new line GOOD: //== RAD7.5 Console: ScannerTest.java using //-- WAS 6.1 JRE:IBM JDK 1.5 SR11 Hello. Please enter your first name: >Firstname Hello. Please enter your last name: >Lastname >Hello, Firstname Lastname //=== Workaround: if Java standalone project - compile with Java 1.5 settings and use a WAS 6.1 JRE 1.5 at runtime/build path library
Local fix
Problem summary
**************************************************************** * USERS AFFECTED: * **************************************************************** * PROBLEM DESCRIPTION: * **************************************************************** * RECOMMENDATION: * **************************************************************** Fixed in Java 6 SR8 which is now in the current 7.5.5.2 offering
Problem conclusion
Fixed in Java 6 SR8 which is now in the current 7.5.5.2 offering
Temporary fix
Comments
APAR Information
APAR number
PM09541
Reported component name
RATL APP DEV WI
Reported component ID
5724J1901
Reported release
755
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2010-03-09
Closed date
2010-10-08
Last modified date
2010-10-08
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
RATL APP DEV WI
Fixed component ID
5724J1901
Applicable component levels
R755 PSN
UP
[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.5.5","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]
Document Information
Modified date:
08 October 2010