Ignore:
Timestamp:
03/06/14 10:30:03 (10 years ago)
Author:
pharms
Message:
  • corrected a bug in creating hashcodes for GUI elements (they changed after storing a GUI model to a file and then reloading it)
Location:
trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLDocumentSpec.java

    r1276 r1436  
    7777     */ 
    7878    public HTMLDocumentSpec(HTMLServerSpec server, String path, String query, String title) { 
    79         super("document"); 
     79        super("document", (server != null ? server.hashCode() : 0) + 
     80              (path != null ? path.hashCode() : 0) + (query != null ? query.hashCode() : 0) + 
     81              (title != null ? title.hashCode() : 0)); 
    8082         
    8183        if (server == null) { 
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLGUIElementSpec.java

    r1276 r1436  
    4040     */ 
    4141    private String type; 
     42 
     43    /** 
     44     * <p> 
     45     * the hashCode of this GUI element specification 
     46     * </p> 
     47     */ 
     48    private int hashCode; 
    4249     
    4350    /** 
     
    5057     * @throws IllegalArgumentException if the provided type is null 
    5158     */ 
    52     public HTMLGUIElementSpec(String type) { 
     59    public HTMLGUIElementSpec(String type, int hashCode) { 
    5360        if (type == null) { 
    5461            throw new IllegalArgumentException("type must not be null"); 
     
    5663 
    5764        this.type = type; 
     65        this.hashCode = hashCode; 
    5866    } 
    5967 
     
    8795    } 
    8896 
     97    /* (non-Javadoc) 
     98     * @see java.lang.Object#hashCode() 
     99     */ 
     100    @Override 
     101    public int hashCode() { 
     102        return hashCode; 
     103    } 
     104 
    89105} 
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLPageElementSpec.java

    r1276 r1436  
    8383     */ 
    8484    public HTMLPageElementSpec(HTMLDocumentSpec page, String tagName, String htmlId, int index) { 
    85         super(tagName); 
     85        super(tagName, (page != null ? page.hashCode() : 0) + 
     86              (tagName != null ? tagName.hashCode() : 0) +  
     87              (htmlId != null ? htmlId.hashCode() : 0) + (index >= 0 ? index : 0)); 
    8688         
    8789        if (page == null) { 
  • trunk/autoquest-plugin-html/src/main/java/de/ugoe/cs/autoquest/plugin/html/guimodel/HTMLServerSpec.java

    r1276 r1436  
    5959     */ 
    6060    public HTMLServerSpec(String host, int port) { 
    61         super("server"); 
     61        super("server", (host != null ? host.hashCode() : 0) + port); 
    6262         
    6363        if (host == null) { 
Note: See TracChangeset for help on using the changeset viewer.