1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 14:55:41 +02:00

Fix warnings

This commit is contained in:
Anton Leherbauer 2008-04-24 08:05:44 +00:00
parent c3725935d9
commit b293aef49f
3 changed files with 31 additions and 30 deletions

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006 Wind River Systems, Inc. and others.
* Copyright (c) 2006, 2008 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -35,7 +35,7 @@ public interface IPositionTrackerManager {
* Returns the position converter suitable for mapping character offsets of the
* given translation unit to the current version of it.
*
* @param file a file for which the position adapter is requested.
* @param tu a translation unit for which the position adapter is requested.
* @param timestamp identifies the version of the file stored on disk.
* @return the requested position converter or <code>null</code>.
*/
@ -56,7 +56,7 @@ public interface IPositionTrackerManager {
* The method can be used for resources by supplying the <b>full path</b>. However,
* it does not work if you supply the location of a resource.
*
* @param externalLocationOrFullPath an external location for which the position adapter is requested.
* @param fullPathOrExternalLocation an external location for which the position adapter is requested.
* @param timestamp identifies the version of the file stored on disk.
* @return the requested position converter or <code>null</code>.
*/

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2007 QNX Software Systems and others.
* Copyright (c) 2000, 2008 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -15,6 +15,7 @@ package org.eclipse.cdt.core;
import java.util.Map;
import org.eclipse.cdt.core.formatter.CodeFormatter;
import org.eclipse.cdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.cdt.internal.formatter.CCodeFormatter;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
@ -38,7 +39,7 @@ public class ToolFactory {
* @see DefaultCodeFormatterConstants
* @see CCorePlugin#getOptions()
*/
public static CodeFormatter createCodeFormatter(Map options){
public static CodeFormatter createCodeFormatter(Map<String, ?> options){
if (options == null)
options = CCorePlugin.getOptions();
String formatterID = (String)options.get(CCorePreferenceConstants.CODE_FORMATTER);
@ -80,7 +81,7 @@ public class ToolFactory {
* @see DefaultCodeFormatterConstants
* @see CCorePlugin#getOptions()
*/
public static CodeFormatter createDefaultCodeFormatter(Map options){
public static CodeFormatter createDefaultCodeFormatter(Map<String, ?> options){
if (options == null)
options = CCorePlugin.getOptions();
return new CCodeFormatter(options);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others.
* Copyright (c) 2006, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -326,13 +326,13 @@ public final class IndentManipulation {
throw new IllegalArgumentException();
}
ArrayList result= new ArrayList();
ArrayList<ReplaceEdit> result= new ArrayList<ReplaceEdit>();
try {
ILineTracker tracker= new DefaultLineTracker();
tracker.set(source);
int nLines= tracker.getNumberOfLines();
if (nLines == 1)
return (ReplaceEdit[])result.toArray(new ReplaceEdit[result.size()]);
return result.toArray(new ReplaceEdit[result.size()]);
for (int i= 1; i < nLines; i++) {
IRegion region= tracker.getLineInformation(i);
int offset= region.getOffset();
@ -348,7 +348,7 @@ public final class IndentManipulation {
} catch (BadLocationException cannotHappen) {
// can not happen
}
return (ReplaceEdit[])result.toArray(new ReplaceEdit[result.size()]);
return result.toArray(new ReplaceEdit[result.size()]);
}
/*
@ -382,14 +382,14 @@ public final class IndentManipulation {
/**
* Returns the tab width as configured in the given map.
* <p>Use {@link org.eclipse.jdt.core.IJavaProject#getOptions(boolean)} to get the most current project options.</p>
* <p>Use {@link org.eclipse.cdt.core.model.ICProject#getOptions(boolean)} to get the most current project options.</p>
*
* @param options the map to get the formatter settings from.
*
* @return the tab width
* @exception IllegalArgumentException if the given <code>options</code> is null
*/
public static int getTabWidth(Map options) {
public static int getTabWidth(Map<String, String> options) {
if (options == null) {
throw new IllegalArgumentException();
}
@ -398,14 +398,14 @@ public final class IndentManipulation {
/**
* Returns the tab width as configured in the given map.
* <p>Use {@link org.eclipse.jdt.core.IJavaProject#getOptions(boolean)} to get the most current project options.</p>
* <p>Use {@link org.eclipse.cdt.core.model.ICProject#getOptions(boolean)} to get the most current project options.</p>
*
* @param options the map to get the formatter settings from
*
* @return the indent width
* @exception IllegalArgumentException if the given <code>options</code> is null
*/
public static int getIndentWidth(Map options) {
public static int getIndentWidth(Map<String, String> options) {
if (options == null) {
throw new IllegalArgumentException();
}
@ -417,9 +417,9 @@ public final class IndentManipulation {
return tabWidth;
}
private static int getIntValue(Map options, String key, int def) {
private static int getIntValue(Map<String, String> options, String key, int def) {
try {
return Integer.parseInt((String) options.get(key));
return Integer.parseInt(options.get(key));
} catch (NumberFormatException e) {
return def;
}