Bug 871407

Summary: NPE on auto completion for javascript object
Product: [Other] RHQ Project Reporter: Libor Zoubek <lzoubek>
Component: CLIAssignee: Jirka Kremser <jkremser>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.5CC: hrupp, jkremser, theute
Target Milestone: ---   
Target Release: RHQ 4.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-31 06:14:07 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Libor Zoubek 2012-10-30 07:55:56 EDT
Description of problem: I get NPE on code-completion 


Version-Release number of selected component (if applicable):
4.6.0-SNAPSHOT
Build Number: aba99ed

How reproducible:always


Steps to Reproduce:
start CLI and type the following:

var x = {y:"y"}
x..<TAB>

and you get

java.lang.NullPointerException
	at org.rhq.scripting.javascript.JavascriptCompletor.contextComplete(JavascriptCompletor.java:185)
	at org.rhq.scripting.javascript.JavascriptCompletor.complete(JavascriptCompletor.java:131)
	at org.rhq.enterprise.client.utility.CodeCompletionCompletorWrapper.complete(CodeCompletionCompletorWrapper.java:34)
	at jline.MultiCompletor.complete(MultiCompletor.java:53)
	at jline.ConsoleReader.complete(ConsoleReader.java:832)
	at jline.ConsoleReader.readLine(ConsoleReader.java:518)
	at jline.ConsoleReader.readLine(ConsoleReader.java:448)
	at org.rhq.enterprise.client.ClientMain.getUserInput(ClientMain.java:278)
	at org.rhq.enterprise.client.ClientMain$1.run(ClientMain.java:319)
	at java.lang.Thread.run(Unknown Sourc
Comment 1 Jirka Kremser 2012-10-31 09:25:30 EDT
http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=140259030

fixed in master
time:    Wed Oct 31 14:21:17 2012 +0100
commit:  1402590305df51642f83c7efe63340c62b354d83
author:  Jirka Kremser - jkremser@redhat.com
message: [BZ 871407 - NPE on auto completion for javascript object] the contextComplete() method now returns -1 instead of throwing NPE
Comment 2 Libor Zoubek 2013-04-02 05:25:22 EDT
verifed on Version: 4.7.0-SNAPSHOT Build Number: bd0c492
Comment 3 Heiko W. Rupp 2013-08-31 06:14:07 EDT
Bulk close of old bugs in VERIFIED state.