Mercurial > hg > graal-compiler
annotate graal/com.oracle.jvmci.options/src/com/oracle/jvmci/options/OptionUtils.java @ 21554:b1530a6cce8c
renamed com.oracle.graal.[debug|options|hotspotvmconfig]* modules to com.oracle.jvmci.[debug|options|hotspotvmconfig]* modules (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 26 May 2015 23:21:15 +0200 |
parents | graal/com.oracle.graal.options/src/com/oracle/graal/options/OptionUtils.java@8ad82587f08d |
children | 47bebae7454f |
rev | line source |
---|---|
18684
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
1 /* |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
4 * |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
8 * |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
14 * |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
18 * |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
21 * questions. |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
22 */ |
21554
b1530a6cce8c
renamed com.oracle.graal.[debug|options|hotspotvmconfig]* modules to com.oracle.jvmci.[debug|options|hotspotvmconfig]* modules (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
20822
diff
changeset
|
23 package com.oracle.jvmci.options; |
18684
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
24 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
25 import java.util.*; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
26 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
27 public class OptionUtils { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
28 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
29 public interface OptionConsumer { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
30 void set(OptionDescriptor desc, Object value); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
31 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
32 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
33 /** |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
34 * Parses a given option value specification. |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
35 * |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
36 * @param option the specification of an option and its value |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
37 * @param setter the object to notify of the parsed option and value. If null, the |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
38 * {@link OptionValue#setValue(Object)} method of the specified option is called |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
39 * instead. |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
40 */ |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
41 public static boolean parseOption(SortedMap<String, OptionDescriptor> options, String option, String prefix, OptionConsumer setter) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
42 if (option.length() == 0) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
43 return false; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
44 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
45 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
46 Object value = null; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
47 String optionName = null; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
48 String valueString = null; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
49 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
50 if (option.equals("+PrintFlags")) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
51 printFlags(options, prefix); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
52 return true; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
53 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
54 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
55 char first = option.charAt(0); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
56 if (first == '+' || first == '-') { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
57 optionName = option.substring(1); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
58 value = (first == '+'); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
59 } else { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
60 int index = option.indexOf('='); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
61 if (index == -1) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
62 optionName = option; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
63 valueString = null; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
64 } else { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
65 optionName = option.substring(0, index); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
66 valueString = option.substring(index + 1); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
67 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
68 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
69 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
70 OptionDescriptor desc = options.get(optionName); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
71 if (desc == null) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
72 printNoMatchMessage(options, optionName, prefix); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
73 return false; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
74 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
75 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
76 Class<?> optionType = desc.getType(); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
77 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
78 if (value == null) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
79 if (optionType == Boolean.TYPE || optionType == Boolean.class) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
80 System.err.println("Value for boolean option '" + optionName + "' must use '" + prefix + "+" + optionName + "' or '" + prefix + "-" + optionName + "' format"); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
81 return false; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
82 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
83 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
84 if (valueString == null) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
85 System.err.println("Value for option '" + optionName + "' must use '" + prefix + optionName + "=<value>' format"); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
86 return false; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
87 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
88 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
89 if (optionType == Float.class) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
90 value = Float.parseFloat(valueString); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
91 } else if (optionType == Double.class) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
92 value = Double.parseDouble(valueString); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
93 } else if (optionType == Integer.class) { |
20822
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
94 value = Integer.valueOf((int) parseLong(valueString)); |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
95 } else if (optionType == Long.class) { |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
96 value = Long.valueOf(parseLong(valueString)); |
18684
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
97 } else if (optionType == String.class) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
98 value = valueString; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
99 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
100 } else { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
101 if (optionType != Boolean.class) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
102 System.err.println("Value for option '" + optionName + "' must use '" + prefix + optionName + "=<value>' format"); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
103 return false; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
104 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
105 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
106 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
107 if (value != null) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
108 if (setter != null) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
109 setter.set(desc, value); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
110 } else { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
111 OptionValue<?> optionValue = desc.getOptionValue(); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
112 optionValue.setValue(value); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
113 // System.err.println("Set option " + desc.getName() + " to " + value); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
114 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
115 } else { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
116 System.err.println("Wrong value \"" + valueString + "\" for option " + optionName); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
117 return false; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
118 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
119 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
120 return true; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
121 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
122 |
20822
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
123 private static long parseLong(String v) { |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
124 String valueString = v.toLowerCase(); |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
125 long scale = 1; |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
126 if (valueString.endsWith("k")) { |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
127 scale = 1024L; |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
128 } else if (valueString.endsWith("m")) { |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
129 scale = 1024L * 1024L; |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
130 } else if (valueString.endsWith("g")) { |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
131 scale = 1024L * 1024L * 1024L; |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
132 } else if (valueString.endsWith("t")) { |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
133 scale = 1024L * 1024L * 1024L * 1024L; |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
134 } |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
135 |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
136 if (scale != 1) { |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
137 /* Remove trailing scale character. */ |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
138 valueString = valueString.substring(0, valueString.length() - 1); |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
139 } |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
140 |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
141 return Long.parseLong(valueString) * scale; |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
142 } |
8ad82587f08d
Allow scaling factors in integer options; add support for Long values in addition to Integer values
Christian Wimmer <christian.wimmer@oracle.com>
parents:
18684
diff
changeset
|
143 |
18684
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
144 public static void printNoMatchMessage(SortedMap<String, OptionDescriptor> options, String optionName, String prefix) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
145 OptionDescriptor desc = options.get(optionName); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
146 if (desc != null) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
147 if (desc.getType() == Boolean.class) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
148 System.err.println("Boolean option " + optionName + " must be prefixed with '+' or '-'"); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
149 } else { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
150 System.err.println(desc.getType().getSimpleName() + " option " + optionName + " must not be prefixed with '+' or '-'"); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
151 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
152 } else { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
153 System.err.println("Could not find option " + optionName + " (use " + prefix + "+PrintFlags to see options)"); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
154 List<OptionDescriptor> matches = fuzzyMatch(options, optionName); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
155 if (!matches.isEmpty()) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
156 System.err.println("Did you mean one of the following?"); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
157 for (OptionDescriptor match : matches) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
158 boolean isBoolean = match.getType() == Boolean.class; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
159 System.err.println(String.format(" %s%s%s", isBoolean ? "(+/-)" : "", match.getName(), isBoolean ? "" : "=<value>")); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
160 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
161 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
162 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
163 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
164 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
165 /** |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
166 * Wraps some given text to one or more lines of a given maximum width. |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
167 * |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
168 * @param text text to wrap |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
169 * @param width maximum width of an output line, exception for words in {@code text} longer than |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
170 * this value |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
171 * @return {@code text} broken into lines |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
172 */ |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
173 private static List<String> wrap(String text, int width) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
174 List<String> lines = Collections.singletonList(text); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
175 if (text.length() > width) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
176 String[] chunks = text.split("\\s+"); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
177 lines = new ArrayList<>(); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
178 StringBuilder line = new StringBuilder(); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
179 for (String chunk : chunks) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
180 if (line.length() + chunk.length() > width) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
181 lines.add(line.toString()); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
182 line.setLength(0); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
183 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
184 if (line.length() != 0) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
185 line.append(' '); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
186 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
187 String[] embeddedLines = chunk.split("%n", -2); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
188 if (embeddedLines.length == 1) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
189 line.append(chunk); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
190 } else { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
191 for (int i = 0; i < embeddedLines.length; i++) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
192 line.append(embeddedLines[i]); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
193 if (i < embeddedLines.length - 1) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
194 lines.add(line.toString()); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
195 line.setLength(0); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
196 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
197 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
198 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
199 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
200 if (line.length() != 0) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
201 lines.add(line.toString()); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
202 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
203 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
204 return lines; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
205 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
206 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
207 public static void printFlags(SortedMap<String, OptionDescriptor> options, String prefix) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
208 System.out.println("[List of " + prefix + " options]"); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
209 SortedMap<String, OptionDescriptor> sortedOptions = options; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
210 for (Map.Entry<String, OptionDescriptor> e : sortedOptions.entrySet()) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
211 e.getKey(); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
212 OptionDescriptor desc = e.getValue(); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
213 Object value = desc.getOptionValue().getValue(); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
214 List<String> helpLines = wrap(desc.getHelp(), 70); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
215 System.out.println(String.format("%9s %-40s = %-14s %s", desc.getType().getSimpleName(), e.getKey(), value, helpLines.get(0))); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
216 for (int i = 1; i < helpLines.size(); i++) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
217 System.out.println(String.format("%67s %s", " ", helpLines.get(i))); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
218 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
219 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
220 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
221 System.exit(0); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
222 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
223 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
224 /** |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
225 * Compute string similarity based on Dice's coefficient. |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
226 * |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
227 * Ported from str_similar() in globals.cpp. |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
228 */ |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
229 static float stringSimiliarity(String str1, String str2) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
230 int hit = 0; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
231 for (int i = 0; i < str1.length() - 1; ++i) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
232 for (int j = 0; j < str2.length() - 1; ++j) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
233 if ((str1.charAt(i) == str2.charAt(j)) && (str1.charAt(i + 1) == str2.charAt(j + 1))) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
234 ++hit; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
235 break; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
236 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
237 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
238 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
239 return 2.0f * hit / (str1.length() + str2.length()); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
240 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
241 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
242 private static final float FUZZY_MATCH_THRESHOLD = 0.7F; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
243 |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
244 /** |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
245 * Returns the set of options that fuzzy match a given option name. |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
246 */ |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
247 private static List<OptionDescriptor> fuzzyMatch(SortedMap<String, OptionDescriptor> options, String optionName) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
248 List<OptionDescriptor> matches = new ArrayList<>(); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
249 for (Map.Entry<String, OptionDescriptor> e : options.entrySet()) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
250 float score = stringSimiliarity(e.getKey(), optionName); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
251 if (score >= FUZZY_MATCH_THRESHOLD) { |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
252 matches.add(e.getValue()); |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
253 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
254 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
255 return matches; |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
256 } |
137773e5250c
Factor out VM-independent parts of option parsing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
257 } |