lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor Rodionov (JIRA)" <j...@apache.org>
Subject [jira] Created: (SOLR-2139) Wrong cast from string to float
Date Fri, 01 Oct 2010 12:25:34 GMT
Wrong cast from string to float
-------------------------------

                 Key: SOLR-2139
                 URL: https://issues.apache.org/jira/browse/SOLR-2139
             Project: Solr
          Issue Type: Bug
          Components: spellchecker
    Affects Versions: 4.0
         Environment: Ubuntu 9.04 
java.runtime.name = Java(TM) SE Runtime Environment
sun.boot.library.path = /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/i386
java.vm.version = 16.3-b01
java.vm.vendor = Sun Microsystems Inc.
java.vendor.url = http://java.sun.com/
path.separator = :
java.vm.name = Java HotSpot(TM) Server VM
file.encoding.pkg = sun.io
user.country = RU
sun.java.launcher = SUN_STANDARD
sun.os.patch.level = unknown
java.vm.specification.name = Java Virtual Machine Specification
user.dir = /media/data/soft/apache-solr/drupal
java.runtime.version = 1.6.0_20-b02
java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
java.endorsed.dirs = /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/endorsed
os.arch = i386
java.io.tmpdir = /tmp
line.separator = 

java.vm.specification.vendor = Sun Microsystems Inc.
os.name = Linux
sun.jnu.encoding = UTF-8
java.library.path = /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/i386/server:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
java.specification.name = Java Platform API Specification
java.class.version = 50.0
jetty.home = /media/data/soft/apache-solr/drupal
sun.management.compiler = HotSpot Tiered Compilers
os.version = 2.6.28-19-generic
user.home = /root
user.timezone = Asia/Omsk
org.mortbay.jetty.Request.maxFormContentSize = 1000000
java.awt.printerjob = sun.print.PSPrinterJob
file.encoding = UTF-8
java.specification.version = 1.6
user.name = root
java.class.path = /media/data/soft/apache-solr/drupal/lib/jetty-6.1.22.jar:/media/data/soft/apache-solr/drupal/lib/jetty-util-6.1.22.jar:/media/data/soft/apache-solr/drupal/lib/servlet-api-2.5-20081211.jar:/media/data/soft/apache-solr/drupal/lib/jsp-2.1/core-3.1.1.jar:/media/data/soft/apache-solr/drupal/lib/jsp-2.1/jsp-2.1-glassfish-9.1.1.B60.25.p2.jar:/media/data/soft/apache-solr/drupal/lib/jsp-2.1/jsp-2.1-jetty-6.1.22.jar:/media/data/soft/apache-solr/drupal/lib/jsp-2.1/jsp-api-2.1-glassfish-9.1.1.B60.25.p2.jar:/usr/share/ant/lib/ant.jar
java.vm.specification.version = 1.0
sun.arch.data.model = 32
java.home = /usr/lib/jvm/java-6-sun-1.6.0.20/jre
java.specification.vendor = Sun Microsystems Inc.
user.language = ru
java.vm.info = mixed mode
java.version = 1.6.0_20
java.ext.dirs = /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/ext:/usr/java/packages/lib/ext
sun.boot.class.path = /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/resources.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/rt.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/jsse.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/jce.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/charsets.jar:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/classes
java.vendor = Sun Microsystems Inc.
file.separator = /
java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
sun.cpu.endian = little
sun.io.unicode.encoding = UnicodeLittle
sun.cpu.isalist = 

            Reporter: Igor Rodionov


Class java.org.apache.solr.spelling.suggest.Suggester str 60
Invalid cast from String to Float.

 threshold = config.get(THRESHOLD_TOKEN_FREQUENCY) == null ? 0.0f

            : (Float) config.get(THRESHOLD_TOKEN_FREQUENCY);

config.get returns String, We want just cast it to Float.

correct code should be like 
 threshold = config.get(THRESHOLD_TOKEN_FREQUENCY) == null ? 0.0f
            : Float.valueOf(config.get(THRESHOLD_TOKEN_FREQUENCY).trim()).floatValue();



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message