mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fixed warning.
This commit is contained in:
parent
2384cbd3f2
commit
5ddcabbe62
2 changed files with 12 additions and 15 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2001, 2006 IBM Corporation and others.
|
* Copyright (c) 2001, 2008 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -10,11 +10,10 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.parser;
|
package org.eclipse.cdt.internal.core.parser;
|
||||||
|
|
||||||
|
|
||||||
public class ParserException extends Exception {
|
public class ParserException extends Exception {
|
||||||
|
private static final long serialVersionUID = -1589821762220079641L;
|
||||||
|
|
||||||
public ParserException( String msg )
|
public ParserException(String msg) {
|
||||||
{
|
super(msg);
|
||||||
super( msg );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2006 IBM Corporation and others.
|
* Copyright (c) 2004, 2008 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,24 +8,22 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Rational Software - Initial API and implementation
|
* IBM Rational Software - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.parser;
|
package org.eclipse.cdt.internal.core.parser;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.MissingResourceException;
|
import java.util.MissingResourceException;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
*
|
|
||||||
* To change the template for this generated type comment go to
|
|
||||||
* Window - Preferences - Java - Code Generation - Code and Comments
|
|
||||||
*/
|
*/
|
||||||
public class ParserMessages {
|
public class ParserMessages {
|
||||||
private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.parser.ParserMessages";//$NON-NLS-1$
|
private static final String BUNDLE_NAME = ParserMessages.class.getName();
|
||||||
private static ResourceBundle resourceBundle;
|
private static ResourceBundle resourceBundle;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
resourceBundle = ResourceBundle.getBundle( BUNDLE_NAME );
|
resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
|
||||||
} catch (MissingResourceException x) {
|
} catch (MissingResourceException x) {
|
||||||
resourceBundle = null;
|
resourceBundle = null;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +33,7 @@ public class ParserMessages {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getString(String key) {
|
public static String getString(String key) {
|
||||||
if( resourceBundle == null )
|
if (resourceBundle == null)
|
||||||
return '#' + key +'#';
|
return '#' + key +'#';
|
||||||
try {
|
try {
|
||||||
return resourceBundle.getString(key);
|
return resourceBundle.getString(key);
|
||||||
|
@ -50,7 +48,7 @@ public class ParserMessages {
|
||||||
* @param key the string used to get the bundle value, must not be null
|
* @param key the string used to get the bundle value, must not be null
|
||||||
*/
|
*/
|
||||||
public static String getFormattedString(String key, Object[] args) {
|
public static String getFormattedString(String key, Object[] args) {
|
||||||
String format = getString( key );
|
String format = getString(key);
|
||||||
return MessageFormat.format(format, args);
|
return MessageFormat.format(format, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +58,7 @@ public class ParserMessages {
|
||||||
* @param key the string used to get the bundle value, must not be null
|
* @param key the string used to get the bundle value, must not be null
|
||||||
*/
|
*/
|
||||||
public static String getFormattedString(String key, Object arg) {
|
public static String getFormattedString(String key, Object arg) {
|
||||||
String format = getString( key );
|
String format = getString(key);
|
||||||
|
|
||||||
if (arg == null)
|
if (arg == null)
|
||||||
arg = ""; //$NON-NLS-1$
|
arg = ""; //$NON-NLS-1$
|
||||||
|
|
Loading…
Add table
Reference in a new issue