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


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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16400, comment 6

    v1 v2  
    1 > In `PluginInformation`, this code doesn't work I think:
     1In `PluginInformation`, this code doesn't work I think:
    22
    3 Why do you think so?
     3{{{
     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}}}