Bug 844495 - Incompability in interpretation of CLI scripts in JON3.1 and master
Summary: Incompability in interpretation of CLI scripts in JON3.1 and master
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: CLI
Version: 4.5
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: ---
: RHQ 4.5.0
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 842567
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-30 22:23 UTC by Lukas Krejci
Modified: 2013-09-01 10:01 UTC (History)
3 users (show)

Fixed In Version:
Clone Of: 842567
Environment:
Last Closed: 2013-09-01 10:01:38 UTC
Embargoed:


Attachments (Terms of Use)

Description Lukas Krejci 2012-07-30 22:23:16 UTC
+++ This bug was initially created as a clone of Bug #842567 +++

Description of problem:
The same CLI script is interpreted differently in JON3.1 and master. Found difference: 
Concatenation in JON3.1 results into string, but in master into object -> problems: 
1 - conString.length() is working for master but not for JON3.1
2 -(conString == objectWithTheSameString) is true in JON3.1 (comparing string with object), but in master is false (comparing two objects) 

Version-Release number of selected component (if applicable):
Version: 4.5.0-SNAPSHOT
Build Number: 0170a5a

How reproducible:
Always

Additional info:
See attached scripts and theirs outputs for JON3.1 and master. In stringTestOutput* you can see that concatenation results into different types in JON3.1 and master. In creatingContentBackedResOutput* you can see that condition was resolved differently for JON3.1 and master. Search for 'Comparing: 'MiscBeans.ear' with 'MiscBeans.ear'' You can see there the problem with length() vs. length as well, search for 'size of childname and packagename:'

--- Additional comment from fbrychta on 2012-07-24 05:07:55 EDT ---

Created attachment 599961 [details]
creatingContentBackedRes.js

--- Additional comment from fbrychta on 2012-07-24 05:08:25 EDT ---

Created attachment 599963 [details]
stringTest.js

--- Additional comment from fbrychta on 2012-07-24 05:09:16 EDT ---

Created attachment 599964 [details]
output of creatingContentBackedRes.js for JON3.1

--- Additional comment from fbrychta on 2012-07-24 05:09:48 EDT ---

Created attachment 599965 [details]
output of creatingContentBackedRes.js for RHQ4.5

--- Additional comment from fbrychta on 2012-07-24 05:10:55 EDT ---

Created attachment 599967 [details]
output of stringTest.js for JON3.1

--- Additional comment from fbrychta on 2012-07-24 05:11:40 EDT ---

Created attachment 599968 [details]
output of stringTest.js for RHQ4.5

--- Additional comment from lkrejci on 2012-07-30 12:55:57 EDT ---

After playing with this I see the following problem:

var a = "str"
var b = "str"

var test1 = a + b

var test2 = "strstr"

var test3 = new java.lang.String("strstr")

test1 == test2 //= true
test1 == test3 //= false, should be true
test2 == test3 //= true

The strange thing is that the above seems to work in the "raw" Rhino shell, which suggests that the bug must lie somewhere in the script engine or the RHQ's wrapper.

Comment 1 Lukas Krejci 2012-07-30 22:27:20 UTC
master http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=commitdiff;h=f4484a83507fa1f45ea18e5862dceb376efeda1c
Author: Lukas Krejci <lkrejci>
Date:   Tue Jul 31 00:24:17 2012 +0200

    [BZ 844495] - Fixing the inconsistency in the string handling introduced by
    Rhino 1.7R4. The new version of Rhino introduced some performance
    optimizations in the script concatenation which confused the script engine,
    which is based on the previous versions of Rhino.

Comment 2 Heiko W. Rupp 2013-09-01 10:01:38 UTC
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.


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