Bug 690606 - get_java_identifiers from switch_java_functions.py crashes when Sun Java RE is installed
Summary: get_java_identifiers from switch_java_functions.py crashes when Sun Java RE i...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: system-switch-java
Version: 14
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Deepak Bhole
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-24 18:50 UTC by Met Merilius
Modified: 2012-08-16 12:59 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-16 12:59:26 UTC
Type: ---


Attachments (Terms of Use)

Description Met Merilius 2011-03-24 18:50:44 UTC
Description of problem:

Sun (Oracle) java RE installs itself to /usr/java/latest/bin/java, and adds this to alternatives file (/var/lib/alternatives/java).
system-switch-java deals incorrectly with this path what results in program crash (list index out of range)

Version-Release number of selected component (if applicable):
system-switch-java-1.1.5-2.fc14.noarch

How reproducible:
always

Steps to Reproduce:
1. Install Sun Java RE from an RPM for Fedora (http://www.java.com/en/download/linux_manual.jsp?locale=en&host=www.java.com), use the RPM provided.
2. execute system-switch-java
3.
  
Actual results:
program crash

Expected results:
Treat Sun Java Re correctly, or at least ignore it and do not crash.

Additional info:
Problem lies in get_java_identifiers() and how it tries to determine a name of java package from path:

alternatives, best = get_alternatives('java')
java_expression = re.compile('/usr/lib/jvm/jre-([^/]*)/bin/java')
    for alternative in alternatives:
        java_search = java_expression.search(alternative)
        if java_search == None:
            # Skip unrecognized java alternative.
            continue
        java = java_search.group(1)
        java_identifiers.append(java)


This leads to keeping best variable pointing to Sun Java, but the regular expression fail and a corresponding entry is not appended java_identifiers.
Length of java_identifiers < best

There is a FIXME statement in the code just below, and waiting to be fixed.

Comment 1 Fedora End Of Life 2012-08-16 12:59:28 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


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