From 5001cf3e336c7bac013ebe2a920e1f545b917820 Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Thu, 27 Mar 2008 14:19:53 +0000 Subject: [PATCH] Fixes warnings --- .../internal/core/dom/parser/EmptyCodeReaderCache.java | 5 +++-- .../cdt/internal/core/dom/parser/c/CASTAmbiguity.java | 10 +++++----- .../core/dom/parser/cpp/CPPFunctionSpecialization.java | 2 +- .../core/dom/parser/cpp/CPPSpecialization.java | 2 +- .../changegenerator/ChangeGeneratorWriterVisitor.java | 7 ------- .../cdt/internal/core/parser/EmptyIterator.java | 6 +++--- .../cdt/internal/core/pdom/db/DBProperties.java | 1 + 7 files changed, 14 insertions(+), 19 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/EmptyCodeReaderCache.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/EmptyCodeReaderCache.java index 7a2f583b3dc..7ea9c363ed2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/EmptyCodeReaderCache.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/EmptyCodeReaderCache.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005 IBM Corporation and others. + * Copyright (c) 2005, 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 @@ -12,6 +12,7 @@ package org.eclipse.cdt.internal.core.dom.parser; import java.util.Iterator; +import org.eclipse.cdt.core.model.IWorkingCopy; import org.eclipse.cdt.core.parser.CodeReader; import org.eclipse.cdt.core.parser.ICodeReaderCache; import org.eclipse.cdt.internal.core.parser.InternalParserUtil; @@ -44,7 +45,7 @@ public class EmptyCodeReaderCache implements ICodeReaderCache { * @param workingCopies * @return */ - public CodeReader createReader( String finalPath, Iterator workingCopies ) { + public CodeReader createReader( String finalPath, Iterator workingCopies ) { return InternalParserUtil.createFileReader(finalPath); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTAmbiguity.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTAmbiguity.java index 207475ea92a..e2e2ab3009f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTAmbiguity.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTAmbiguity.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2007 IBM Corporation and others. + * Copyright (c) 2004, 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 @@ -11,8 +11,6 @@ *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser.c; -import java.util.Arrays; - import org.eclipse.cdt.core.dom.ast.ASTVisitor; import org.eclipse.cdt.core.dom.ast.DOMException; import org.eclipse.cdt.core.dom.ast.IASTName; @@ -36,7 +34,8 @@ public abstract class CASTAmbiguity extends CASTNode { shouldVisitNames = true; } - public int visit(IASTName name) { + @Override + public int visit(IASTName name) { if (name != null) { namesPos++; names = (IASTName[]) ArrayUtil.append( IASTName.class, names, name ); @@ -54,7 +53,8 @@ public abstract class CASTAmbiguity extends CASTNode { protected abstract IASTNode [] getNodes(); - public boolean accept(ASTVisitor visitor) { + @Override + public boolean accept(ASTVisitor visitor) { IASTNode [] nodez = getNodes(); int [] issues = new int[ nodez.length ]; for( int i = 0; i < nodez.length; ++i ) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionSpecialization.java index 92b51c5c457..f7b2f05d9e7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionSpecialization.java @@ -243,7 +243,7 @@ public class CPPFunctionSpecialization extends CPPSpecialization implements ICPP } result.append(t != null ? ASTTypeUtil.getParameterTypeString(t) : "()"); //$NON-NLS-1$ if (argumentMap != null) { - result.append(" "); + result.append(" "); //$NON-NLS-1$ result.append(argumentMap.toString()); } return result.toString(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSpecialization.java index d2575445007..07cef550fc9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSpecialization.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPSpecialization.java @@ -130,7 +130,7 @@ public abstract class CPPSpecialization extends PlatformObject public String toString() { StringBuilder result = new StringBuilder(getName()); if (argumentMap != null) { - result.append(" "); + result.append(" "); //$NON-NLS-1$ result.append(argumentMap.toString()); } return result.toString(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGeneratorWriterVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGeneratorWriterVisitor.java index 2dd900aa110..7fbfc286b04 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGeneratorWriterVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGeneratorWriterVisitor.java @@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.core.dom.rewrite.changegenerator; import java.util.List; -import org.eclipse.cdt.core.dom.ast.IASTComment; import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier; import org.eclipse.cdt.core.dom.ast.IASTDeclaration; import org.eclipse.cdt.core.dom.ast.IASTDeclarator; @@ -131,12 +130,6 @@ public class ChangeGeneratorWriterVisitor extends ASTWriterVisitor { return PROCESS_SKIP; } - @Override - public int leave(IASTComment comment) { - super.leave(comment); - return PROCESS_SKIP; - } - @Override public int leave(IASTDeclaration declaration) { super.leave(declaration); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/EmptyIterator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/EmptyIterator.java index 7600a8d2e79..e29f4a042f0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/EmptyIterator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/EmptyIterator.java @@ -14,10 +14,10 @@ import java.util.Iterator; import java.util.NoSuchElementException; -public final class EmptyIterator implements Iterator +public final class EmptyIterator implements Iterator { - public static final EmptyIterator EMPTY_ITERATOR = new EmptyIterator(); + public static final EmptyIterator EMPTY_ITERATOR = new EmptyIterator(); private EmptyIterator() { @@ -34,7 +34,7 @@ public final class EmptyIterator implements Iterator /* (non-Javadoc) * @see java.util.Iterator#next() */ - public final Object next() + public final T next() { throw new NoSuchElementException(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java index 91e636776a9..0c737e890a7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/DBProperties.java @@ -155,6 +155,7 @@ public class DBProperties { private static class DBProperty { static final int KEY = 0; static final int VALUE = 4; + @SuppressWarnings("hiding") static final int RECORD_SIZE = 8; Database db;