Bug 1095668 - [abrt] system-switch-java: switch_java_functions.py:138:get_java_identifiers:UnboundLocalError: local variable 'best_identifier_index' referenced before assignment
Summary: [abrt] system-switch-java: switch_java_functions.py:138:get_java_identifiers:...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: system-switch-java
Version: rawhide
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Deepak Bhole
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:11d079306037c24036e2f319bd1...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-08 10:39 UTC by iliketurtlesbro
Modified: 2014-05-09 16:22 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-05-09 16:22:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (1.09 KB, text/plain)
2014-05-08 10:39 UTC, iliketurtlesbro
no flags Details
File: environ (2.05 KB, text/plain)
2014-05-08 10:39 UTC, iliketurtlesbro
no flags Details

Description iliketurtlesbro 2014-05-08 10:39:04 UTC
Description of problem:
ran 'system-switch-java' as root in terminal. 

Version-Release number of selected component:
system-switch-java-1.1.5-10.fc21

Additional info:
reporter:       libreport-2.2.2
cmdline:        python /sbin/system-switch-java
executable:     /sbin/system-switch-java
kernel:         3.15.0-0.rc4.git1.1.fc21.x86_64
runlevel:       N 5
type:           Python
uid:            0

Truncated backtrace:
switch_java_functions.py:138:get_java_identifiers:UnboundLocalError: local variable 'best_identifier_index' referenced before assignment

Traceback (most recent call last):
  File "/sbin/system-switch-java", line 89, in <module>
    main()
  File "/sbin/system-switch-java", line 50, in main
    java_identifiers, best_identifier = get_java_identifiers()
  File "/usr/share/system-switch-java/switch_java_functions.py", line 138, in get_java_identifiers
    best_identifier = identifiers_and_jdks[best_identifier_index][0]
UnboundLocalError: local variable 'best_identifier_index' referenced before assignment

Local variables in innermost frame:
jre_search: None
java: None
identifiers_and_jdks: [('1.8.0-openjdk.x86_64', False)]
i: 1
alternatives: ['/usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java', '/usr/java/latest/bin/java']
jre_expression: <_sre.SRE_Pattern object at 0x12b6dd0>
jdk_expression: <_sre.SRE_Pattern object at 0x12e9930>
best: 1
best_identifier: None
jdks: [False]
best_indentifier_index: -1
alternative: '/usr/java/latest/bin/java'
jdk_search: None
java_identifiers: ['1.8.0-openjdk.x86_64']

Potential duplicate: bug 1069832

Comment 1 iliketurtlesbro 2014-05-08 10:39:07 UTC
Created attachment 893591 [details]
File: backtrace

Comment 2 iliketurtlesbro 2014-05-08 10:39:09 UTC
Created attachment 893592 [details]
File: environ

Comment 3 Omair Majid 2014-05-08 19:54:08 UTC
I agree that system-switch-java should not crash like this. This was fixed upstream recently:
https://fedorahosted.org/system-switch-java/changeset/f9d437fc662ae76e988434b7fa9a50be0a044c16/


On the other hand, /usr/java/latest is an unsupported/proprietary java package. It is not installed following the jpackage or Fedora conventions. As such, system-switch-java will probably fail in other ways when this bug is fixed.

Comment 4 Deepak Bhole 2014-05-09 16:22:20 UTC
Marking CLOSED based on commit Omair referenced in Comment #3.


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