1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Warning cleanup.

This commit is contained in:
Sergey Prigogin 2012-02-23 15:05:20 -08:00
parent 934adecf48
commit f6ecdf5318
12 changed files with 118 additions and 217 deletions

View file

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.cdt.codan.core" version="2">
<resource path="src/org/eclipse/cdt/codan/core/model/AbstractProblemLocation.java" type="org.eclipse.cdt.codan.core.model.AbstractProblemLocation">
<filter comment="getFile method should return IResource not IFile according to interface. Don't know how it compiled before like that..." id="338792546">
<message_arguments>
<message_argument value="org.eclipse.cdt.codan.core.model.AbstractProblemLocation"/>
<message_argument value="getFile()"/>
</message_arguments>
</filter>
<filter comment="upgrade file attribute to IResource from IFile - it is backward compatible" id="388161617">
<message_arguments>
<message_argument value="org.eclipse.cdt.codan.core.model.AbstractProblemLocation"/>
<message_argument value="file"/>
</message_arguments>
</filter>
</resource>
</component>

View file

@ -10,7 +10,7 @@ Require-Bundle: org.eclipse.core.runtime,
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.eclipse.cdt.codan.core, Export-Package: org.eclipse.cdt.codan.core,
org.eclipse.cdt.codan.core.externaltool;x-friends:="org.eclipse.cdt.codan.ui,org.eclipse.cdt.codan.core.test", org.eclipse.cdt.codan.core.externaltool,
org.eclipse.cdt.codan.core.model, org.eclipse.cdt.codan.core.model,
org.eclipse.cdt.codan.core.model.cfg;x-friends:="org.eclipse.cdt.codan.core.cxx,org.eclipse.cdt.codan.checkers", org.eclipse.cdt.codan.core.model.cfg;x-friends:="org.eclipse.cdt.codan.core.cxx,org.eclipse.cdt.codan.checkers",
org.eclipse.cdt.codan.core.param, org.eclipse.cdt.codan.core.param,
@ -21,4 +21,8 @@ Export-Package: org.eclipse.cdt.codan.core,
org.eclipse.cdt.codan.ui", org.eclipse.cdt.codan.ui",
org.eclipse.cdt.codan.internal.core.cfg;x-friends:="org.eclipse.cdt.codan.core.cxx", org.eclipse.cdt.codan.internal.core.cfg;x-friends:="org.eclipse.cdt.codan.core.cxx",
org.eclipse.cdt.codan.internal.core.externaltool;x-friends:="org.eclipse.cdt.codan.core.test", org.eclipse.cdt.codan.internal.core.externaltool;x-friends:="org.eclipse.cdt.codan.core.test",
org.eclipse.cdt.codan.internal.core.model;x-friends:="org.eclipse.cdt.codan.core.cxx,org.eclipse.cdt.codan.core.test,org.eclipse.cdt.codan.ui" org.eclipse.cdt.codan.internal.core.model;
x-friends:="org.eclipse.cdt.codan.core.cxx,
org.eclipse.cdt.codan.core.test,
org.eclipse.cdt.codan.ui,
org.eclipse.cdt.codan.ui.cxx"

View file

@ -161,7 +161,7 @@ public abstract class AbstractChecker implements IChecker {
* @return instance of IProblemLocation * @return instance of IProblemLocation
*/ */
protected IProblemLocation createProblemLocation(IFile file, int startChar, int endChar) { protected IProblemLocation createProblemLocation(IFile file, int startChar, int endChar) {
return getRuntime().getProblemLocationFactory().createProblemLocation(file, startChar, endChar); return getRuntime().getProblemLocationFactory().createProblemLocation(file, startChar, endChar, -1);
} }
/** /**

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2009, 2010 Alena Laskavaia * Copyright (c) 2009, 2010 Alena Laskavaia
* 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
@ -14,7 +14,7 @@ import org.eclipse.core.resources.IFile;
/** /**
* Factory interface that allows to create problem locations. * Factory interface that allows to create problem locations.
* *
* Clients may implement and extend this interface. * Clients may implement and extend this interface.
* <p> * <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as part * <strong>EXPERIMENTAL</strong>. This class or interface has been added as part
@ -25,7 +25,7 @@ import org.eclipse.core.resources.IFile;
public interface IProblemLocationFactory { public interface IProblemLocationFactory {
/** /**
* Create and return instance of IProblemLocation * Create and return instance of IProblemLocation
* *
* @param file * @param file
* - file where problem is found * - file where problem is found
* @param line * @param line
@ -36,7 +36,7 @@ public interface IProblemLocationFactory {
/** /**
* Create and return instance of IProblemLocation * Create and return instance of IProblemLocation
* *
* @param file * @param file
* - file where problem is found * - file where problem is found
* @param startChar * @param startChar
@ -45,21 +45,23 @@ public interface IProblemLocationFactory {
* - end char of the problem in the file, is zero-relative and * - end char of the problem in the file, is zero-relative and
* exclusive. * exclusive.
* @return instance of IProblemLocation * @return instance of IProblemLocation
*
* @deprecated Use {@link #createProblemLocation(IFile, int, int, int)} instead.
*/ */
@Deprecated
public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar); public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar);
/** /**
* Create and return instance of IProblemLocation * Create and return instance of IProblemLocation
* *
* @param astFile - file where problem is found * @param astFile - file where problem is found
* @param startChar - start char of the problem in the file, is * @param startChar - start char of the problem in the file, is
* zero-relative * zero-relative
* @param endChar - end char of the problem in the file, is zero-relative * @param endChar - end char of the problem in the file, is zero-relative
* and * and exclusive.
* exclusive. *
*
* @param line * @param line
* - start line number (for visualisation purposes) * - start line number (for visualization purposes)
* @return instance of IProblemLocation * @return instance of IProblemLocation
*/ */
public IProblemLocation createProblemLocation(IFile astFile, int startChar, int endChar, int line); public IProblemLocation createProblemLocation(IFile astFile, int startChar, int endChar, int line);

View file

@ -14,7 +14,7 @@ import org.eclipse.core.resources.IResource;
/** /**
* IProblemReporterPersistent - interface to report problems, which are * IProblemReporterPersistent - interface to report problems, which are
* persistent, ex. markers. Also this object has context of checker and * persistent, e.g. markers. Also this object has context of checker and
* current resource, which allows to manage markers better - i.e. instead of * current resource, which allows to manage markers better - i.e. instead of
* deleting replace them when needed, and queue markers for insertion instead * deleting replace them when needed, and queue markers for insertion instead
* of add right away. * of add right away.
@ -30,9 +30,9 @@ import org.eclipse.core.resources.IResource;
public interface IProblemReporterSessionPersistent extends IProblemReporter { public interface IProblemReporterSessionPersistent extends IProblemReporter {
/** /**
* Deletes all problems associated with session resource and session checker. * Deletes all problems associated with session resource and session checker.
* If "all" is true also delete all problems associated with workspace (and
* session checker).
* *
* @param all If <code>true</code> the method also deletes all problems associated with
* workspace (and session checker).
*/ */
public void deleteProblems(boolean all); public void deleteProblems(boolean all);
@ -51,12 +51,11 @@ public interface IProblemReporterSessionPersistent extends IProblemReporter {
IResource getResource(); IResource getResource();
/** /**
* Create an instance of the object. This is a bit ugly since implemented has * Creates a problem reporter.
* to combine the object itself and factory to this object.
* *
* @param resource * @param resource
* @param checker * @param checker
* @return * @return the created reporter
* @since 2.0 * @since 2.0
*/ */
public IProblemReporterSessionPersistent createReporter(IResource resource, IChecker checker); public IProblemReporterSessionPersistent createReporter(IResource resource, IChecker checker);

View file

@ -10,12 +10,6 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.codan.core.param; package org.eclipse.cdt.codan.core.param;
import java.io.IOException;
import java.io.StreamTokenizer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.cdt.codan.core.Messages; import org.eclipse.cdt.codan.core.Messages;
import org.eclipse.cdt.codan.internal.core.CharOperation; import org.eclipse.cdt.codan.internal.core.CharOperation;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
@ -26,6 +20,12 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
import java.io.IOException;
import java.io.StreamTokenizer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/** /**
* Custom preference for resource scope * Custom preference for resource scope
* *
@ -174,14 +174,14 @@ public class FileScopeProblemPreference extends AbstractProblemPreference {
checkChar(tokenizer, '>'); checkChar(tokenizer, '>');
ArrayList<IPath> list = new ArrayList<IPath>(); ArrayList<IPath> list = new ArrayList<IPath>();
int token; int token;
int index = 0;
try { try {
checkChar(tokenizer, '('); checkChar(tokenizer, '(');
token = tokenizer.nextToken(); token = tokenizer.nextToken();
if (token != ')') if (token != ')') {
tokenizer.pushBack(); tokenizer.pushBack();
else } else {
return Collections.emptyList(); return Collections.emptyList();
}
while (true) { while (true) {
token = tokenizer.nextToken(); token = tokenizer.nextToken();
if (tokenizer.sval == null) if (tokenizer.sval == null)
@ -192,7 +192,6 @@ public class FileScopeProblemPreference extends AbstractProblemPreference {
break; break;
tokenizer.pushBack(); tokenizer.pushBack();
checkChar(tokenizer, ','); checkChar(tokenizer, ',');
index++;
} }
} catch (IOException e) { } catch (IOException e) {
throw new IllegalArgumentException(e); throw new IllegalArgumentException(e);

View file

@ -12,7 +12,7 @@ package org.eclipse.cdt.codan.internal.core;
/** /**
* This class is a collection of helper methods to manipulate char arrays. * This class is a collection of helper methods to manipulate char arrays.
* *
* @since 2.1 * @since 2.1
*/ */
public final class CharOperation { public final class CharOperation {
@ -44,7 +44,7 @@ public final class CharOperation {
* => result = { 'c' } * => result = { 'c' }
* </pre></li> * </pre></li>
* </ol> * </ol>
* *
* @param array * @param array
* the array that is concanated with the suffix character * the array that is concanated with the suffix character
* @param suffix * @param suffix
@ -95,7 +95,7 @@ public final class CharOperation {
* => result = { 'a', 'd' , 'e', 'f', '0', '0', '0', '0' } (new array) * => result = { 'a', 'd' , 'e', 'f', '0', '0', '0', '0' } (new array)
* </pre></li> * </pre></li>
* </ol> * </ol>
* *
* @param target * @param target
* the given target * the given target
* @param index * @param index
@ -106,7 +106,7 @@ public final class CharOperation {
* the given start index * the given start index
* @param end * @param end
* the given end index * the given end index
* *
* @return the new array * @return the new array
* @throws NullPointerException * @throws NullPointerException
* if the target array is null * if the target array is null
@ -156,7 +156,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param first * @param first
* the first array to concatenate * the first array to concatenate
* @param second * @param second
@ -205,7 +205,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param first * @param first
* the first array to concatenate * the first array to concatenate
* @param second * @param second
@ -276,7 +276,7 @@ public final class CharOperation {
* </li> * </li>
* </ol> * </ol>
* </p> * </p>
* *
* @param array * @param array
* the given array * the given array
* @param prefix * @param prefix
@ -329,7 +329,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param first * @param first
* the first array to concatenate * the first array to concatenate
* @param second * @param second
@ -396,14 +396,14 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param first * @param first
* the first array to concatenate * the first array to concatenate
* @param second * @param second
* the second array to concatenate * the second array to concatenate
* @param third * @param third
* the third array to concatenate * the third array to concatenate
* *
* @return the concatenation of the three arrays, or null if the three * @return the concatenation of the three arrays, or null if the three
* arrays are null. * arrays are null.
*/ */
@ -456,7 +456,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param first * @param first
* the first array to concatenate * the first array to concatenate
* @param second * @param second
@ -540,7 +540,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param first * @param first
* the first array to concatenate * the first array to concatenate
* @param sep1 * @param sep1
@ -598,7 +598,7 @@ public final class CharOperation {
* => result = { 'a', 'c' } * => result = { 'a', 'c' }
* </pre></li> * </pre></li>
* </ol> * </ol>
* *
* @param prefix * @param prefix
* the prefix character * the prefix character
* @param array * @param array
@ -647,7 +647,7 @@ public final class CharOperation {
* => result = { 'c' } * => result = { 'c' }
* </pre></li> * </pre></li>
* </ol> * </ol>
* *
* @param name * @param name
* the given name * the given name
* @param array * @param array
@ -714,7 +714,7 @@ public final class CharOperation {
* => result = { 'c' } * => result = { 'c' }
* </pre></li> * </pre></li>
* </ol> * </ol>
* *
* @param array * @param array
* the given array * the given array
* @param name * @param name
@ -772,7 +772,7 @@ public final class CharOperation {
* => result = { } * => result = { }
* </pre></li> * </pre></li>
* </ol> * </ol>
* *
* @param array * @param array
* the given array * the given array
* @param separator * @param separator
@ -812,7 +812,7 @@ public final class CharOperation {
/** /**
* Answers true if the array contains an occurrence of character, false * Answers true if the array contains an occurrence of character, false
* otherwise. * otherwise.
* *
* <br> * <br>
* <br> * <br>
* For example: * For example:
@ -830,7 +830,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param character * @param character
* the character to search * the character to search
* @param array * @param array
@ -853,7 +853,7 @@ public final class CharOperation {
/** /**
* Answers true if the array contains an occurrence of character, false * Answers true if the array contains an occurrence of character, false
* otherwise. * otherwise.
* *
* <br> * <br>
* <br> * <br>
* For example: * For example:
@ -871,7 +871,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param character * @param character
* the character to search * the character to search
* @param array * @param array
@ -890,7 +890,7 @@ public final class CharOperation {
/** /**
* Answers a deep copy of the toCopy array. * Answers a deep copy of the toCopy array.
* *
* @param toCopy * @param toCopy
* the array to copy * the array to copy
* @return a deep copy of the toCopy array. * @return a deep copy of the toCopy array.
@ -929,7 +929,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param array * @param array
* the array to check * the array to check
* @param toBeFound * @param toBeFound
@ -984,7 +984,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param first * @param first
* the first array * the first array
* @param second * @param second
@ -1044,7 +1044,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param first * @param first
* the first array * the first array
* @param second * @param second
@ -1104,7 +1104,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param first * @param first
* the first array * the first array
* @param second * @param second
@ -1164,7 +1164,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param first * @param first
* the first array * the first array
* @param second * @param second
@ -1194,7 +1194,7 @@ public final class CharOperation {
/** /**
* If isCaseSensite is true, the equality is case sensitive, otherwise it is * If isCaseSensite is true, the equality is case sensitive, otherwise it is
* case insensitive. * case insensitive.
* *
* Answers true if the name contains the fragment at the starting index * Answers true if the name contains the fragment at the starting index
* startIndex, otherwise false. * startIndex, otherwise false.
* <br> * <br>
@ -1234,7 +1234,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param fragment * @param fragment
* the fragment to check * the fragment to check
* @param name * @param name
@ -1269,7 +1269,7 @@ public final class CharOperation {
/** /**
* Answers a hashcode for the array * Answers a hashcode for the array
* *
* @param array * @param array
* the array for which a hashcode is required * the array for which a hashcode is required
* @return the hashcode * @return the hashcode
@ -1310,7 +1310,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param c * @param c
* the character to check * the character to check
* @return true if c is a whitespace according to the JLS, otherwise false. * @return true if c is a whitespace according to the JLS, otherwise false.
@ -1350,7 +1350,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param toBeFound * @param toBeFound
* the character to search * the character to search
* @param array * @param array
@ -1399,7 +1399,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param toBeFound * @param toBeFound
* the character to search * the character to search
* @param array * @param array
@ -1443,7 +1443,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param toBeFound * @param toBeFound
* the character to search * the character to search
* @param array * @param array
@ -1493,7 +1493,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param toBeFound * @param toBeFound
* the character to search * the character to search
* @param array * @param array
@ -1549,7 +1549,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param toBeFound * @param toBeFound
* the character to search * the character to search
* @param array * @param array
@ -1583,7 +1583,7 @@ public final class CharOperation {
* <pre> * <pre>
* lastSegment("java.lang.Object".toCharArray(),'.') --> Object * lastSegment("java.lang.Object".toCharArray(),'.') --> Object
* </pre> * </pre>
* *
* @param array * @param array
* the array * the array
* @param separator * @param separator
@ -1603,7 +1603,7 @@ public final class CharOperation {
* Answers true if the pattern matches the given name, false otherwise. This * Answers true if the pattern matches the given name, false otherwise. This
* char[] pattern matching * char[] pattern matching
* accepts wild-cards '*' and '?'. * accepts wild-cards '*' and '?'.
* *
* When not case sensitive, the pattern is assumed to already be lowercased, * When not case sensitive, the pattern is assumed to already be lowercased,
* the * the
* name will be lowercased character per character as comparing. * name will be lowercased character per character as comparing.
@ -1635,7 +1635,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param pattern * @param pattern
* the given pattern * the given pattern
* @param name * @param name
@ -1690,7 +1690,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param pattern * @param pattern
* the given pattern * the given pattern
* @param patternStart * @param patternStart
@ -1783,7 +1783,7 @@ public final class CharOperation {
/** /**
* Answers true if the pattern matches the filepath using the pathSepatator, * Answers true if the pattern matches the filepath using the pathSepatator,
* false otherwise. * false otherwise.
* *
* Path char[] pattern matching, accepting wild-cards '**', '*' and '?' * Path char[] pattern matching, accepting wild-cards '**', '*' and '?'
* (using Ant directory tasks * (using Ant directory tasks
* conventions, also see * conventions, also see
@ -1797,7 +1797,7 @@ public final class CharOperation {
* When not case sensitive, the pattern is assumed to already be lowercased, * When not case sensitive, the pattern is assumed to already be lowercased,
* the * the
* name will be lowercased character per character as comparing. * name will be lowercased character per character as comparing.
* *
* @param pattern * @param pattern
* the given pattern * the given pattern
* @param filepath * @param filepath
@ -1852,7 +1852,7 @@ public final class CharOperation {
if (!CharOperation.match(pattern, pSegmentStart, pSegmentEnd, filepath, fSegmentStart, fSegmentEnd, isCaseSensitive)) { if (!CharOperation.match(pattern, pSegmentStart, pSegmentEnd, filepath, fSegmentStart, fSegmentEnd, isCaseSensitive)) {
return false; return false;
} }
// jump to next segment // jump to next segment
pSegmentEnd = CharOperation.indexOf(pathSeparator, pattern, pSegmentStart = pSegmentEnd + 1); pSegmentEnd = CharOperation.indexOf(pathSeparator, pattern, pSegmentStart = pSegmentEnd + 1);
// skip separator // skip separator
if (pSegmentEnd < 0) if (pSegmentEnd < 0)
@ -1927,7 +1927,7 @@ public final class CharOperation {
fSegmentEnd = fLength; fSegmentEnd = fLength;
continue checkSegment; continue checkSegment;
} }
// jump to next segment // jump to next segment
pSegmentEnd = CharOperation.indexOf(pathSeparator, pattern, pSegmentStart = pSegmentEnd + 1); pSegmentEnd = CharOperation.indexOf(pathSeparator, pattern, pSegmentStart = pSegmentEnd + 1);
// skip separator // skip separator
if (pSegmentEnd < 0) if (pSegmentEnd < 0)
@ -1945,7 +1945,7 @@ public final class CharOperation {
/** /**
* Answers the number of occurrences of the given character in the given * Answers the number of occurrences of the given character in the given
* array, 0 if any. * array, 0 if any.
* *
* <br> * <br>
* <br> * <br>
* For example: * For example:
@ -1963,7 +1963,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param toBeFound * @param toBeFound
* the given character * the given character
* @param array * @param array
@ -1975,17 +1975,17 @@ public final class CharOperation {
*/ */
public static final int occurencesOf(char toBeFound, char[] array) { public static final int occurencesOf(char toBeFound, char[] array) {
int count = 0; int count = 0;
for (char element : array) for (char element : array) {
if (toBeFound == element) if (toBeFound == element)
count++; count++;
}
return count; return count;
} }
/** /**
* Answers the number of occurrences of the given character in the given * Answers the number of occurrences of the given character in the given array starting
* array starting
* at the given index, 0 if any. * at the given index, 0 if any.
* *
* <br> * <br>
* <br> * <br>
* For example: * For example:
@ -2005,17 +2005,13 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param toBeFound * @param toBeFound the given character
* the given character * @param array the given array
* @param array * @param start the start position for the search
* the given array * @return the number of occurrences of the given character in the given array, or 0 if any
* @return the number of occurrences of the given character in the given * @exception NullPointerException if array is null
* array, 0 if any * @exception ArrayIndexOutOfBoundsException if start is lower than 0
* @exception NullPointerException
* if array is null
* @exception ArrayIndexOutOfBoundsException
* if start is lower than 0
*/ */
public static final int occurencesOf(char toBeFound, char[] array, int start) { public static final int occurencesOf(char toBeFound, char[] array, int start) {
int count = 0; int count = 0;
@ -2046,7 +2042,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param prefix * @param prefix
* the given prefix * the given prefix
* @param name * @param name
@ -2091,7 +2087,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param prefix * @param prefix
* the given prefix * the given prefix
* @param name * @param name
@ -2147,7 +2143,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param array * @param array
* the given array * the given array
* @param toBeReplaced * @param toBeReplaced
@ -2191,7 +2187,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param array * @param array
* the given array * the given array
* @param toBeReplaced * @param toBeReplaced
@ -2274,7 +2270,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param divider * @param divider
* the given divider * the given divider
* @param array * @param array
@ -2343,7 +2339,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param divider * @param divider
* the given divider * the given divider
* @param array * @param array
@ -2392,7 +2388,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param divider * @param divider
* the given divider * the given divider
* @param array * @param array
@ -2459,7 +2455,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param array * @param array
* the given array * the given array
* @param start * @param start
@ -2514,7 +2510,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param array * @param array
* the given array * the given array
* @param start * @param start
@ -2561,7 +2557,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param chars * @param chars
* the chars to convert * the chars to convert
* @return the result of a char[] conversion to lowercase * @return the result of a char[] conversion to lowercase
@ -2603,7 +2599,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param chars * @param chars
* the given array * the given array
* @return a new array removing leading and trailing spaces (' ') * @return a new array removing leading and trailing spaces (' ')
@ -2642,7 +2638,7 @@ public final class CharOperation {
* </pre> * </pre>
* </li> * </li>
* </ol> * </ol>
* *
* @param array * @param array
* the given array * the given array
* @return a string which is the concatenation of the given array using the * @return a string which is the concatenation of the given array using the

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2009, 2010 Alena Laskavaia * Copyright (c) 2009, 2010 Alena Laskavaia
* 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,24 +10,21 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.codan.internal.core.cfg; package org.eclipse.cdt.codan.internal.core.cfg;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.codan.core.model.cfg.IBasicBlock; import org.eclipse.cdt.codan.core.model.cfg.IBasicBlock;
import org.eclipse.cdt.codan.core.model.cfg.IBranchNode; import org.eclipse.cdt.codan.core.model.cfg.IBranchNode;
import org.eclipse.cdt.codan.core.model.cfg.IConnectorNode; import org.eclipse.cdt.codan.core.model.cfg.IConnectorNode;
import org.eclipse.cdt.codan.core.model.cfg.IDecisionNode; import org.eclipse.cdt.codan.core.model.cfg.IDecisionNode;
import java.util.ArrayList;
import java.util.List;
/** /**
* @see {@link IDecisionNode} * @see IDecisionNode
*/ */
public class DecisionNode extends AbstractSingleIncomingNode implements IDecisionNode { public class DecisionNode extends AbstractSingleIncomingNode implements IDecisionNode {
private List<IBasicBlock> next = new ArrayList<IBasicBlock>(2); private List<IBasicBlock> next = new ArrayList<IBasicBlock>(2);
private IConnectorNode conn; private IConnectorNode conn;
/**
* @param prev
*/
protected DecisionNode() { protected DecisionNode() {
super(); super();
} }
@ -38,33 +35,16 @@ public class DecisionNode extends AbstractSingleIncomingNode implements IDecisio
next.add(cnode); next.add(cnode);
} }
/*
* (non-Javadoc)
*
* @seeorg.eclipse.cdt.codan.provisional.core.model.cfg.IBasicBlock#
* getOutgoingIterator()
*/
@Override @Override
public IBasicBlock[] getOutgoingNodes() { public IBasicBlock[] getOutgoingNodes() {
return next.toArray(new IBasicBlock[next.size()]); return next.toArray(new IBasicBlock[next.size()]);
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.codan.core.model.cfg.IBasicBlock#getOutgoingSize ()
*/
@Override @Override
public int getOutgoingSize() { public int getOutgoingSize() {
return next.size(); return next.size();
} }
/*
* (non-Javadoc)
*
* @seeorg.eclipse.cdt.codan.provisional.core.model.cfg.IDecisionNode#
* getConnectionNode()
*/
@Override @Override
public IConnectorNode getMergeNode() { public IConnectorNode getMergeNode() {
return conn; return conn;

View file

@ -1,12 +1,12 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2009, 2010 Alena Laskavaia * Copyright (c) 2009, 2010 Alena Laskavaia
* 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
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Alena Laskavaia - initial API and implementation * Alena Laskavaia - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.codan.internal.core.model; package org.eclipse.cdt.codan.internal.core.model;
@ -16,37 +16,19 @@ import org.eclipse.core.resources.IFile;
/** /**
* Factory class that allows to create problem locations * Factory class that allows to create problem locations
*
*/ */
public class ProblemLocationFactory implements IProblemLocationFactory { public class ProblemLocationFactory implements IProblemLocationFactory {
/*
* (non-Javadoc)
*
* @seeorg.eclipse.cdt.codan.core.model.IProblemLocationFactory#
* createProblemLocation(org.eclipse.core.resources.IFile, int)
*/
@Override @Override
public IProblemLocation createProblemLocation(IFile file, int line) { public IProblemLocation createProblemLocation(IFile file, int line) {
return new CodanProblemLocation(file, line); return new CodanProblemLocation(file, line);
} }
/*
* (non-Javadoc)
*
* @seeorg.eclipse.cdt.codan.core.model.IProblemLocationFactory#
* createProblemLocation(org.eclipse.core.resources.IFile, int, int)
*/
@Override @Override
@Deprecated
public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar) { public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar) {
return new CodanProblemLocation(file, startChar, endChar); return new CodanProblemLocation(file, startChar, endChar);
} }
/*
* (non-Javadoc)
*
* @seeorg.eclipse.cdt.codan.core.model.IProblemLocationFactory#
* createProblemLocation(org.eclipse.core.resources.IFile, int, int, int)
*/
@Override @Override
public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar, int line) { public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar, int line) {
return new CodanProblemLocation(file, startChar, endChar, line); return new CodanProblemLocation(file, startChar, endChar, line);

View file

@ -6,13 +6,10 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Alena Laskavaia - initial API and implementation * Alena Laskavaia - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.codan.internal.core.model; package org.eclipse.cdt.codan.internal.core.model;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.cdt.codan.core.model.IProblem; import org.eclipse.cdt.codan.core.model.IProblem;
import org.eclipse.cdt.codan.core.model.IProblemCategory; import org.eclipse.cdt.codan.core.model.IProblemCategory;
import org.eclipse.cdt.codan.core.model.IProblemProfile; import org.eclipse.cdt.codan.core.model.IProblemProfile;
@ -22,9 +19,11 @@ import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.ListenerList; import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.SafeRunner; import org.eclipse.core.runtime.SafeRunner;
import java.util.ArrayList;
import java.util.Collection;
/** /**
* @author Alena * @author Alena
*
*/ */
public class ProblemProfile implements IProblemProfile, Cloneable { public class ProblemProfile implements IProblemProfile, Cloneable {
private CodanProblemCategory rootCategory; private CodanProblemCategory rootCategory;
@ -38,23 +37,11 @@ public class ProblemProfile implements IProblemProfile, Cloneable {
rootCategory.setProfile(this); rootCategory.setProfile(this);
} }
/*
* (non-Javadoc)
*
* @see
* org.eclipse.cdt.codan.core.model.IProblemProfile#getProblem(java.lang
* .String)
*/
@Override @Override
public IProblem findProblem(String id) { public IProblem findProblem(String id) {
return CodanProblemCategory.findProblem(getRoot(), id); return CodanProblemCategory.findProblem(getRoot(), id);
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.codan.core.model.IProblemProfile#getProblems()
*/
@Override @Override
public IProblem[] getProblems() { public IProblem[] getProblems() {
Collection<IProblem> problems = new ArrayList<IProblem>(); Collection<IProblem> problems = new ArrayList<IProblem>();
@ -62,10 +49,6 @@ public class ProblemProfile implements IProblemProfile, Cloneable {
return problems.toArray(new IProblem[problems.size()]); return problems.toArray(new IProblem[problems.size()]);
} }
/**
* @param root
* @param problems
*/
protected void collectProblems(IProblemCategory parent, Collection<IProblem> problems) { protected void collectProblems(IProblemCategory parent, Collection<IProblem> problems) {
Object[] children = parent.getChildren(); Object[] children = parent.getChildren();
for (Object object : children) { for (Object object : children) {
@ -94,11 +77,6 @@ public class ProblemProfile implements IProblemProfile, Cloneable {
return CodanProblemCategory.findCategory(getRoot(), id); return CodanProblemCategory.findCategory(getRoot(), id);
} }
/*
* (non-Javadoc)
*
* @see java.lang.Object#clone()
*/
@Override @Override
public Object clone() { public Object clone() {
try { try {
@ -115,38 +93,21 @@ public class ProblemProfile implements IProblemProfile, Cloneable {
} }
} }
/**
* @param p
* @param cat
*/
public void addCategory(IProblemCategory category, IProblemCategory parent) { public void addCategory(IProblemCategory category, IProblemCategory parent) {
((CodanProblemCategory) parent).addChild(category); ((CodanProblemCategory) parent).addChild(category);
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.codan.core.model.IProblemElement#getProfile()
*/
@Override @Override
public IProblemProfile getProfile() { public IProblemProfile getProfile() {
return this; return this;
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.codan.core.model.IProblemElement#getParentCategory()
*/
@Override @Override
public IProblemCategory getParentCategory() { public IProblemCategory getParentCategory() {
return getRoot(); return getRoot();
} }
private ListenerList preferenceChangeListeners; private ListenerList preferenceChangeListeners;
/**
* @param listener
*/
@Override @Override
public void addProfileChangeListener(IProblemProfileChangeListener listener) { public void addProfileChangeListener(IProblemProfileChangeListener listener) {
if (preferenceChangeListeners == null) if (preferenceChangeListeners == null)
@ -154,9 +115,6 @@ public class ProblemProfile implements IProblemProfile, Cloneable {
preferenceChangeListeners.add(listener); preferenceChangeListeners.add(listener);
} }
/**
* @param listener
*/
@Override @Override
public void removeProfileChangeListener(IProblemProfileChangeListener listener) { public void removeProfileChangeListener(IProblemProfileChangeListener listener) {
if (preferenceChangeListeners == null) if (preferenceChangeListeners == null)
@ -166,14 +124,15 @@ public class ProblemProfile implements IProblemProfile, Cloneable {
preferenceChangeListeners = null; preferenceChangeListeners = null;
} }
/* /**
* Convenience method for notifying preference change listeners. * Convenience method for notifying preference change listeners.
*/ */
protected void fireProfileChangeEvent(String key, Object oldValue, Object newValue) { protected void fireProfileChangeEvent(String key, Object oldValue, Object newValue) {
if (preferenceChangeListeners == null) if (preferenceChangeListeners == null)
return; return;
Object[] listeners = preferenceChangeListeners.getListeners(); Object[] listeners = preferenceChangeListeners.getListeners();
final ProblemProfileChangeEvent event = new ProblemProfileChangeEvent(this, this.resource, key, oldValue, newValue); final ProblemProfileChangeEvent event =
new ProblemProfileChangeEvent(this, this.resource, key, oldValue, newValue);
for (int i = 0; i < listeners.length; i++) { for (int i = 0; i < listeners.length; i++) {
final IProblemProfileChangeListener listener = (IProblemProfileChangeListener) listeners[i]; final IProblemProfileChangeListener listener = (IProblemProfileChangeListener) listeners[i];
ISafeRunnable job = new ISafeRunnable() { ISafeRunnable job = new ISafeRunnable() {
@ -191,11 +150,6 @@ public class ProblemProfile implements IProblemProfile, Cloneable {
} }
} }
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.codan.core.model.IProblemProfile#getResource()
*/
@Override @Override
public Object getResource() { public Object getResource() {
return resource; return resource;

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>org.eclipse.cdt.codan.internal.ui.cxx</name> <name>org.eclipse.cdt.codan.ui.cxx</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>

View file

@ -38,6 +38,8 @@ import org.eclipse.ui.editors.text.TextEditor;
* external tools cannot see unsaved changes. * external tools cannot see unsaved changes.
* *
* @author alruiz@google.com (Alex Ruiz) * @author alruiz@google.com (Alex Ruiz)
*
* @since 3.0
*/ */
public abstract class AbstractCxxExternalToolBasedChecker extends AbstractExternalToolBasedChecker { public abstract class AbstractCxxExternalToolBasedChecker extends AbstractExternalToolBasedChecker {
/** /**