Ignore:
Timestamp:
08/31/12 15:16:13 (12 years ago)
Author:
sherbold
Message:
  • changed JFCGUIElementSpec to store the elementHash as String instead of int. The reason for this is a problem that Integer.parseInt() that can occur with handling of negative hexadecimal values (see also Rev. 588)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-plugin-jfc/src/main/java/de/ugoe/cs/quest/plugin/jfc/JFCLogParser.java

    r713 r736  
    340340                    else if ("hash".equals(atts.getValue("name"))) { 
    341341                        currentGuiElementSpec.setElementHash 
    342                             (Integer.parseInt(atts.getValue("value"), 16)); 
     342                            (atts.getValue("value")); 
    343343                    } 
    344344                } 
     
    645645            matcher = Pattern.compile(pattern).matcher(matcher.group(2)); 
    646646             
    647             float elementHash = -1; 
     647            String elementHash = "-1"; 
    648648             
    649649            pattern = "(([\\d]*)|([\\w$]*)|(([\\w$@\\.]*)=([\\w$@\\.]*)))\\z"; 
     
    656656                        // found digit value. Those in combination usually denote the position 
    657657                        // of the GUI element. So calculate an element has out of them 
    658                         elementHash += Integer.parseInt(valueMatcher.group(2)); 
     658                        elementHash += valueMatcher.group(2); 
    659659                    } 
    660660                    else if ((valueMatcher.group(5) != null) && 
     
    667667                         
    668668                        if ("alignmentX".equals(key) || "alignmentY".equals(key)) { 
    669                             elementHash += Float.parseFloat(valueMatcher.group(6)); 
     669                            elementHash += valueMatcher.group(6); 
    670670                        } 
    671671                    } 
     
    673673            } 
    674674 
    675             currentGuiElementSpec.setName("unknown(" + ((int) elementHash) + ")"); 
     675            currentGuiElementSpec.setName("unknown(" + elementHash + ")"); 
    676676            currentGuiElementSpec.setType(type); 
    677677            currentGuiElementSpec.setIndex(-1); 
    678             currentGuiElementSpec.setElementHash((int) elementHash); 
     678            currentGuiElementSpec.setElementHash(elementHash); 
    679679        } 
    680680        catch (Exception e) 
Note: See TracChangeset for help on using the changeset viewer.