This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 145006
Collapse All | Expand All

(-)a/core.startup/src/org/netbeans/core/startup/Bundle.properties (-1 / +1 lines)
Lines 104-110 Link Here
104
ERR_UINotFound=UI class not found, using default UI...
104
ERR_UINotFound=UI class not found, using default UI...
105
ERR_FontSizeExpected=Font size expected, using default font size...
105
ERR_FontSizeExpected=Font size expected, using default font size...
106
ERR_BadFontSize=Bad format of the font size, using default font size...
106
ERR_BadFontSize=Bad format of the font size, using default font size...
107
ERR_BrandingNeedsArgument=Option --branding requires one argument
107
ERR_OptionNeedsArgument=Option {0} requires one argument
108
108
109
109
110
# TopManager properties
110
# TopManager properties
(-)a/core.startup/src/org/netbeans/core/startup/CLIOptions.java (-17 / +22 lines)
Lines 169-196 Link Here
169
                }
169
                }
170
            } else if (isOption (args[i], "locale")) { // NOI18N
170
            } else if (isOption (args[i], "locale")) { // NOI18N
171
                args[i] = null;
171
                args[i] = null;
172
                String localeParam = args[++i];
172
                try {
173
                String language;
173
                    String localeParam = args[++i];
174
                String country = ""; // NOI18N
174
                    String language;
175
                String variant = ""; // NOI18N
175
                    String country = ""; // NOI18N
176
                int index1 = localeParam.indexOf(":"); // NOI18N
176
                    String variant = ""; // NOI18N
177
                if (index1 == -1)
177
                    int index1 = localeParam.indexOf(":"); // NOI18N
178
                    language = localeParam;
178
                    if (index1 == -1)
179
                else {
179
                        language = localeParam;
180
                    language = localeParam.substring(0, index1);
180
                    else {
181
                    int index2 = localeParam.indexOf(":", index1+1); // NOI18N
181
                        language = localeParam.substring(0, index1);
182
                    if (index2 != -1) {
182
                        int index2 = localeParam.indexOf(":", index1+1); // NOI18N
183
                        country = localeParam.substring(index1+1, index2);
183
                        if (index2 != -1) {
184
                        variant = localeParam.substring(index2+1);
184
                            country = localeParam.substring(index1+1, index2);
185
                            variant = localeParam.substring(index2+1);
186
                        }
187
                        else
188
                            country = localeParam.substring(index1+1);
185
                    }
189
                    }
186
                    else
190
                    Locale.setDefault(new Locale(language, country, variant));
187
                        country = localeParam.substring(index1+1);
191
                } catch(ArrayIndexOutOfBoundsException e) {
192
                    System.err.println(NbBundle.getMessage(CLIOptions.class, "ERR_OptionNeedsArgument", "--locale"));//NOI18N
193
                    return 2;
188
                }
194
                }
189
                Locale.setDefault(new Locale(language, country, variant));
190
            } else if (isOption (args[i], "branding")) { // NOI18N
195
            } else if (isOption (args[i], "branding")) { // NOI18N
191
                args[i] = null;
196
                args[i] = null;
192
                if (++i == args.length) {
197
                if (++i == args.length) {
193
                    System.err.println(getString("ERR_BrandingNeedsArgument"));
198
                    System.err.println(NbBundle.getMessage(CLIOptions.class, "ERR_OptionNeedsArgument", "--branding"));//NOI18N
194
                    return 2;
199
                    return 2;
195
                }
200
                }
196
                String branding = args[i];
201
                String branding = args[i];

Return to bug 145006