Bug 907897 - pretty.print(null) fails
Summary: pretty.print(null) fails
Keywords:
Status: VERIFIED
Alias: None
Product: RHQ Project
Classification: Other
Component: CLI
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: RHQ 4.14
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1324828
TreeView+ depends on / blocked
 
Reported: 2013-02-05 13:47 UTC by Filip Brychta
Modified: 2022-03-31 04:28 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1324828 (view as bug list)
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1277440 0 unspecified VERIFIED pretty.print is printing object type instead of content 2022-03-31 04:28:44 UTC

Internal Links: 1277440

Description Filip Brychta 2013-02-05 13:47:19 UTC
Description of problem:
This is very annoying in non-interactive mode (script is terminated). Null is a valid value returned by some methods, so pretty.print should print it without terminating the script.

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

How reproducible:
always

Steps to Reproduce:
1. ./rhq-cli.sh -s $yourRHQserverIP -p rhqadmin -u rhqadmin
2. pretty.print(null)

  
Actual results:
org.mozilla.javascript.EvaluatorException: The choice of Java method org.rhq.bindings.output.TabularWriter.print matching JavaScript argument types (null) is ambiguous; candidate methods are: 
    void print(java.lang.Object)
    void print(java.util.Map)
    void print(java.util.Collection)
    void print(org.rhq.core.domain.configuration.Configuration)
    void print(java.lang.Object[])
    void print(java.lang.String[][]) (<Unknown source>#1) in <Unknown source> at line number 1
pretty.print(null); 

Expected results:
null

Comment 1 John Sanda 2015-11-18 19:17:00 UTC
I saw that commit 8b540d7848a was pushed to fix this, but it resulted in a minor regression caught by some Jenkins test failures. I fixed the test failures with commit e1fa9edbe0.

Comment 2 Filip Brychta 2016-06-20 11:27:50 UTC
This is again broken, probably after https://github.com/rhq-project/rhq/commit/1074fac1280e34758fbfda8b1aaaebbdd184313b


Note You need to log in before you can comment on or make changes to this bug.