1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Fixes warnings.

This commit is contained in:
Markus Schorn 2009-03-26 15:51:12 +00:00
parent 00d1f34feb
commit 7c51979037
13 changed files with 43 additions and 67 deletions

View file

@ -15,7 +15,6 @@
package org.eclipse.cdt.core;
import java.io.IOException;
import com.ibm.icu.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@ -82,6 +81,8 @@ import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.jobs.Job;
import org.osgi.framework.BundleContext;
import com.ibm.icu.text.MessageFormat;
/**
* CCorePlugin is the life-cycle owner of the core plug-in, and starting point for access to many core APIs.
*
@ -234,6 +235,7 @@ public class CCorePlugin extends Plugin {
return MessageFormat.format(getResourceString(key), new Object[] { arg });
}
@SuppressWarnings("cast") // java.text.MessageFormat would require the cast
public static String getFormattedString(String key, String[] args) {
return MessageFormat.format(getResourceString(key), (Object[])args);
}

View file

@ -109,11 +109,6 @@ public class TypeSelectionDialog extends TwoPaneElementSelector {
fNameMatcher = fSegmentMatchers[fSegmentMatchers.length-1];
}
public void setVisibleTypes(Collection<Integer> visibleTypes) {
fVisibleTypes.clear();
fVisibleTypes.addAll(visibleTypes);
}
public Collection<Integer> getVisibleTypes() {
return fVisibleTypes;
}

View file

@ -445,8 +445,8 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
}
private static class BracketLevel {
int fOffset;
int fLength;
// int fOffset;
// int fLength;
LinkedModeUI fUI;
Position fFirstPosition;
Position fSecondPosition;
@ -525,14 +525,14 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
}
}
/**
* Returns the position category.
*
* @return the position category
*/
public String getCategory() {
return fCategory;
}
// /**
// * Returns the position category.
// *
// * @return the position category
// */
// public String getCategory() {
// return fCategory;
// }
}
private class BracketInserter implements VerifyKeyListener, ILinkedModeListener {
@ -673,8 +673,8 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
model.addGroup(group);
model.forceInstall();
level.fOffset = offset;
level.fLength = 2;
// level.fOffset = offset;
// level.fLength = 2;
// set up position tracking for our magic peers
if (fBracketLevelStack.size() == 1) {

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2008 IBM Corporation and others.
* Copyright (c) 2007, 2009 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
@ -269,12 +269,10 @@ public class ProjectLanguageMappingWidget extends LanguageMappingWidget {
private static class LanguageTableData {
ICConfigurationDescription configuration;
String contentTypeId;
String languageId;
LanguageTableData(ICConfigurationDescription configuration, String contentTypeId, String languageId) {
this.configuration = configuration;
this.contentTypeId = contentTypeId;
this.languageId = languageId;
}
}
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2002, 2007 QNX Software Systems and others.
* Copyright (c) 2002, 2009 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
@ -135,11 +135,7 @@ public class CEditorHoverConfigurationBlock implements IPreferenceConfigurationB
public void dispose() {
}
public boolean isDeleted(Object element) {
return false;
}
public Object[] getElements(Object element) {
return (Object[])element;
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* Copyright (c) 2000, 2009 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
@ -112,10 +112,10 @@ public class LineWrappingTabPage extends FormatterTabPage {
}
}
public void add(Category category) {
category.index= fIndex++;
fCategoriesList.add(category);
}
// public void add(Category category) {
// category.index= fIndex++;
// fCategoriesList.add(category);
// }
public void selectionChanged(SelectionChangedEvent event) {
if (event != null)

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
* Copyright (c) 2007, 2009 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
@ -215,10 +215,6 @@ public class CMacroExpansionInput {
return null;
}
IASTNode getEnclosingNode() {
return fEnclosingNode;
}
MacroExpansionExplorer getMacroExpansionExplorer() {
return fExplorer;
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* Copyright (c) 2000, 2009 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
@ -90,7 +90,7 @@ import org.eclipse.cdt.ui.PreferenceConstants;
import org.eclipse.cdt.ui.text.ICPartitions;
import org.eclipse.cdt.ui.text.folding.ICFoldingStructureProvider;
import org.eclipse.cdt.internal.core.dom.parser.c.CVisitor;
import org.eclipse.cdt.internal.core.dom.parser.ASTQueries;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.cdt.internal.core.model.ASTCache;
@ -237,7 +237,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
if (declaration instanceof IASTFunctionDefinition) {
final IASTFunctionDeclarator declarator = ((IASTFunctionDefinition)declaration).getDeclarator();
if (declarator != null) {
fFunction= new String(CVisitor.findInnermostDeclarator(declarator).getName().toCharArray());
fFunction= new String(ASTQueries.findInnermostDeclarator(declarator).getName().toCharArray());
fLevel= 0;
}
}
@ -526,17 +526,17 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
return fCategory;
}
public void setCategory(int category) {
fCategory = category;
}
public boolean isComment() {
return fCategory == COMMENT;
}
public void setIsComment(boolean isComment) {
fCategory= isComment ? COMMENT : 0;
}
// public void setCategory(int category) {
// fCategory = category;
// }
//
// public boolean isComment() {
// return fCategory == COMMENT;
// }
//
// public void setIsComment(boolean isComment) {
// fCategory= isComment ? COMMENT : 0;
// }
/*
* @see java.lang.Object#toString()
*/

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2001, 2008 IBM Corporation and others.
* Copyright (c) 2001, 2009 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
@ -852,11 +852,7 @@ public class ListDialogField<T> extends DialogField {
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// will never happen
}
public boolean isDeleted(Object element) {
return false;
}
public void dispose() {
}

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2007 QNX Software Systems and others.
* Copyright (c) 2004, 2009 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
@ -853,10 +853,6 @@ public class TreeListDialogField<T> extends DialogField {
// will never happen
}
public boolean isDeleted(Object element) {
return false;
}
public void dispose() {
}

View file

@ -273,6 +273,7 @@ public class CUIPlugin extends AbstractUIPlugin {
return MessageFormat.format(getResourceString(key), new Object[] {arg});
}
@SuppressWarnings("cast") // java.text.MessageFormat would require the cast
public static String getFormattedString(String key, String[] args) {
return MessageFormat.format(getResourceString(key), (Object[]) args);
}

View file

@ -122,10 +122,6 @@ public class IndexerBlock extends AbstractCOptionPage {
return fElement.getAttribute(ATTRIB_NAME);
}
public String getIndexerID(){
return fElement.getAttribute(ATTRIB_INDEXERID);
}
public String getLocalId() {
return fElement.getAttribute(ATTRIB_ID);
}