Changes between Initial Version and Version 1 of Ticket #16400, comment 6


Ignore:
Timestamp:
2018-06-18T14:19:24+02:00 (7 years ago)
Author:
stoecker

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16400, comment 6

    initial v1  
    1 In `PluginInformation`, this code doesn't work I think:
    2 {{{
    3 #!java
    4         if (oldcheck && mainversion > Version.getInstance().getVersion()) {
    5             int myv = Version.getInstance().getVersion();
    6             for (Map.Entry<Object, Object> entry : attr.entrySet()) {
    7                 try {
    8                     String key = ((Attributes.Name) entry.getKey()).toString();
    9                     if (key.endsWith("_Plugin-Url")) {
    10                         int mv = Integer.parseInt(key.substring(0, key.length()-11));
    11                         if (mv <= myv && (mv > mainversion || mainversion > myv)) {
    12                             String v = (String) entry.getValue();
    13                             int i = v.indexOf(';');
    14                             if (i > 0) {
    15                                 downloadlink = v.substring(i+1);
    16                                 mainversion = mv;
    17                                 version = v.substring(0, i);
    18                                 oldmode = true;
    19                             }
    20                         }
    21                     }
    22                 } catch (NumberFormatException e) {
    23                     Logging.error(e);
    24                 }
    25             }
    26         }
    27 }}}
     1> In `PluginInformation`, this code doesn't work I think:
     2
     3Why do you think so?