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-RequiredExecutionEnvironment: JavaSE-1.6
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.cfg;x-friends:="org.eclipse.cdt.codan.core.cxx,org.eclipse.cdt.codan.checkers",
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.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.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
*/
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
* are made available under the terms of the Eclipse Public License v1.0
* 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.
*
*
* Clients may implement and extend this interface.
* <p>
* <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 {
/**
* Create and return instance of IProblemLocation
*
*
* @param file
* - file where problem is found
* @param line
@ -36,7 +36,7 @@ public interface IProblemLocationFactory {
/**
* Create and return instance of IProblemLocation
*
*
* @param file
* - file where problem is found
* @param startChar
@ -45,21 +45,23 @@ public interface IProblemLocationFactory {
* - end char of the problem in the file, is zero-relative and
* exclusive.
* @return instance of IProblemLocation
*
* @deprecated Use {@link #createProblemLocation(IFile, int, int, int)} instead.
*/
@Deprecated
public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar);
/**
* Create and return instance of IProblemLocation
*
*
* @param astFile - file where problem is found
* @param startChar - start char of the problem in the file, is
* zero-relative
* @param endChar - end char of the problem in the file, is zero-relative
* and
* exclusive.
*
* and exclusive.
*
* @param line
* - start line number (for visualisation purposes)
* - start line number (for visualization purposes)
* @return instance of IProblemLocation
*/
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
* 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
* deleting replace them when needed, and queue markers for insertion instead
* of add right away.
@ -30,9 +30,9 @@ import org.eclipse.core.resources.IResource;
public interface IProblemReporterSessionPersistent extends IProblemReporter {
/**
* 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);
@ -51,12 +51,11 @@ public interface IProblemReporterSessionPersistent extends IProblemReporter {
IResource getResource();
/**
* Create an instance of the object. This is a bit ugly since implemented has
* to combine the object itself and factory to this object.
* Creates a problem reporter.
*
* @param resource
* @param checker
* @return
* @return the created reporter
* @since 2.0
*/
public IProblemReporterSessionPersistent createReporter(IResource resource, IChecker checker);

View file

@ -10,12 +10,6 @@
*******************************************************************************/
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.internal.core.CharOperation;
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.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
*
@ -174,14 +174,14 @@ public class FileScopeProblemPreference extends AbstractProblemPreference {
checkChar(tokenizer, '>');
ArrayList<IPath> list = new ArrayList<IPath>();
int token;
int index = 0;
try {
checkChar(tokenizer, '(');
token = tokenizer.nextToken();
if (token != ')')
if (token != ')') {
tokenizer.pushBack();
else
} else {
return Collections.emptyList();
}
while (true) {
token = tokenizer.nextToken();
if (tokenizer.sval == null)
@ -192,7 +192,6 @@ public class FileScopeProblemPreference extends AbstractProblemPreference {
break;
tokenizer.pushBack();
checkChar(tokenizer, ',');
index++;
}
} catch (IOException 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.
*
*
* @since 2.1
*/
public final class CharOperation {
@ -44,7 +44,7 @@ public final class CharOperation {
* => result = { 'c' }
* </pre></li>
* </ol>
*
*
* @param array
* the array that is concanated with the suffix character
* @param suffix
@ -95,7 +95,7 @@ public final class CharOperation {
* => result = { 'a', 'd' , 'e', 'f', '0', '0', '0', '0' } (new array)
* </pre></li>
* </ol>
*
*
* @param target
* the given target
* @param index
@ -106,7 +106,7 @@ public final class CharOperation {
* the given start index
* @param end
* the given end index
*
*
* @return the new array
* @throws NullPointerException
* if the target array is null
@ -156,7 +156,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param first
* the first array to concatenate
* @param second
@ -205,7 +205,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param first
* the first array to concatenate
* @param second
@ -276,7 +276,7 @@ public final class CharOperation {
* </li>
* </ol>
* </p>
*
*
* @param array
* the given array
* @param prefix
@ -329,7 +329,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param first
* the first array to concatenate
* @param second
@ -396,14 +396,14 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param first
* the first array to concatenate
* @param second
* the second array to concatenate
* @param third
* the third array to concatenate
*
*
* @return the concatenation of the three arrays, or null if the three
* arrays are null.
*/
@ -456,7 +456,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param first
* the first array to concatenate
* @param second
@ -540,7 +540,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param first
* the first array to concatenate
* @param sep1
@ -598,7 +598,7 @@ public final class CharOperation {
* => result = { 'a', 'c' }
* </pre></li>
* </ol>
*
*
* @param prefix
* the prefix character
* @param array
@ -647,7 +647,7 @@ public final class CharOperation {
* => result = { 'c' }
* </pre></li>
* </ol>
*
*
* @param name
* the given name
* @param array
@ -714,7 +714,7 @@ public final class CharOperation {
* => result = { 'c' }
* </pre></li>
* </ol>
*
*
* @param array
* the given array
* @param name
@ -772,7 +772,7 @@ public final class CharOperation {
* => result = { }
* </pre></li>
* </ol>
*
*
* @param array
* the given array
* @param separator
@ -812,7 +812,7 @@ public final class CharOperation {
/**
* Answers true if the array contains an occurrence of character, false
* otherwise.
*
*
* <br>
* <br>
* For example:
@ -830,7 +830,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param character
* the character to search
* @param array
@ -853,7 +853,7 @@ public final class CharOperation {
/**
* Answers true if the array contains an occurrence of character, false
* otherwise.
*
*
* <br>
* <br>
* For example:
@ -871,7 +871,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param character
* the character to search
* @param array
@ -890,7 +890,7 @@ public final class CharOperation {
/**
* Answers a deep copy of the toCopy array.
*
*
* @param toCopy
* the array to copy
* @return a deep copy of the toCopy array.
@ -929,7 +929,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param array
* the array to check
* @param toBeFound
@ -984,7 +984,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param first
* the first array
* @param second
@ -1044,7 +1044,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param first
* the first array
* @param second
@ -1104,7 +1104,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param first
* the first array
* @param second
@ -1164,7 +1164,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param first
* the first array
* @param second
@ -1194,7 +1194,7 @@ public final class CharOperation {
/**
* If isCaseSensite is true, the equality is case sensitive, otherwise it is
* case insensitive.
*
*
* Answers true if the name contains the fragment at the starting index
* startIndex, otherwise false.
* <br>
@ -1234,7 +1234,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param fragment
* the fragment to check
* @param name
@ -1269,7 +1269,7 @@ public final class CharOperation {
/**
* Answers a hashcode for the array
*
*
* @param array
* the array for which a hashcode is required
* @return the hashcode
@ -1310,7 +1310,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param c
* the character to check
* @return true if c is a whitespace according to the JLS, otherwise false.
@ -1350,7 +1350,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param toBeFound
* the character to search
* @param array
@ -1399,7 +1399,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param toBeFound
* the character to search
* @param array
@ -1443,7 +1443,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param toBeFound
* the character to search
* @param array
@ -1493,7 +1493,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param toBeFound
* the character to search
* @param array
@ -1549,7 +1549,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param toBeFound
* the character to search
* @param array
@ -1583,7 +1583,7 @@ public final class CharOperation {
* <pre>
* lastSegment("java.lang.Object".toCharArray(),'.') --> Object
* </pre>
*
*
* @param array
* the array
* @param separator
@ -1603,7 +1603,7 @@ public final class CharOperation {
* Answers true if the pattern matches the given name, false otherwise. This
* char[] pattern matching
* accepts wild-cards '*' and '?'.
*
*
* When not case sensitive, the pattern is assumed to already be lowercased,
* the
* name will be lowercased character per character as comparing.
@ -1635,7 +1635,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param pattern
* the given pattern
* @param name
@ -1690,7 +1690,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param pattern
* the given pattern
* @param patternStart
@ -1783,7 +1783,7 @@ public final class CharOperation {
/**
* Answers true if the pattern matches the filepath using the pathSepatator,
* false otherwise.
*
*
* Path char[] pattern matching, accepting wild-cards '**', '*' and '?'
* (using Ant directory tasks
* conventions, also see
@ -1797,7 +1797,7 @@ public final class CharOperation {
* When not case sensitive, the pattern is assumed to already be lowercased,
* the
* name will be lowercased character per character as comparing.
*
*
* @param pattern
* the given pattern
* @param filepath
@ -1852,7 +1852,7 @@ public final class CharOperation {
if (!CharOperation.match(pattern, pSegmentStart, pSegmentEnd, filepath, fSegmentStart, fSegmentEnd, isCaseSensitive)) {
return false;
}
// jump to next segment
// jump to next segment
pSegmentEnd = CharOperation.indexOf(pathSeparator, pattern, pSegmentStart = pSegmentEnd + 1);
// skip separator
if (pSegmentEnd < 0)
@ -1927,7 +1927,7 @@ public final class CharOperation {
fSegmentEnd = fLength;
continue checkSegment;
}
// jump to next segment
// jump to next segment
pSegmentEnd = CharOperation.indexOf(pathSeparator, pattern, pSegmentStart = pSegmentEnd + 1);
// skip separator
if (pSegmentEnd < 0)
@ -1945,7 +1945,7 @@ public final class CharOperation {
/**
* Answers the number of occurrences of the given character in the given
* array, 0 if any.
*
*
* <br>
* <br>
* For example:
@ -1963,7 +1963,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param toBeFound
* the given character
* @param array
@ -1975,17 +1975,17 @@ public final class CharOperation {
*/
public static final int occurencesOf(char toBeFound, char[] array) {
int count = 0;
for (char element : array)
for (char element : array) {
if (toBeFound == element)
count++;
}
return count;
}
/**
* Answers the number of occurrences of the given character in the given
* array starting
* Answers the number of occurrences of the given character in the given array starting
* at the given index, 0 if any.
*
*
* <br>
* <br>
* For example:
@ -2005,17 +2005,13 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
* @param toBeFound
* the given character
* @param array
* the given array
* @return the number of occurrences of the given character in the given
* array, 0 if any
* @exception NullPointerException
* if array is null
* @exception ArrayIndexOutOfBoundsException
* if start is lower than 0
*
* @param toBeFound the given character
* @param array the given array
* @param start the start position for the search
* @return the number of occurrences of the given character in the given array, or 0 if any
* @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) {
int count = 0;
@ -2046,7 +2042,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param prefix
* the given prefix
* @param name
@ -2091,7 +2087,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param prefix
* the given prefix
* @param name
@ -2147,7 +2143,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param array
* the given array
* @param toBeReplaced
@ -2191,7 +2187,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param array
* the given array
* @param toBeReplaced
@ -2274,7 +2270,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param divider
* the given divider
* @param array
@ -2343,7 +2339,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param divider
* the given divider
* @param array
@ -2392,7 +2388,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param divider
* the given divider
* @param array
@ -2459,7 +2455,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param array
* the given array
* @param start
@ -2514,7 +2510,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param array
* the given array
* @param start
@ -2561,7 +2557,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param chars
* the chars to convert
* @return the result of a char[] conversion to lowercase
@ -2603,7 +2599,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param chars
* the given array
* @return a new array removing leading and trailing spaces (' ')
@ -2642,7 +2638,7 @@ public final class CharOperation {
* </pre>
* </li>
* </ol>
*
*
* @param array
* the given array
* @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
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -10,24 +10,21 @@
*******************************************************************************/
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.IBranchNode;
import org.eclipse.cdt.codan.core.model.cfg.IConnectorNode;
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 {
private List<IBasicBlock> next = new ArrayList<IBasicBlock>(2);
private IConnectorNode conn;
/**
* @param prev
*/
protected DecisionNode() {
super();
}
@ -38,33 +35,16 @@ public class DecisionNode extends AbstractSingleIncomingNode implements IDecisio
next.add(cnode);
}
/*
* (non-Javadoc)
*
* @seeorg.eclipse.cdt.codan.provisional.core.model.cfg.IBasicBlock#
* getOutgoingIterator()
*/
@Override
public IBasicBlock[] getOutgoingNodes() {
return next.toArray(new IBasicBlock[next.size()]);
}
/*
* (non-Javadoc)
*
* @see org.eclipse.cdt.codan.core.model.cfg.IBasicBlock#getOutgoingSize ()
*/
@Override
public int getOutgoingSize() {
return next.size();
}
/*
* (non-Javadoc)
*
* @seeorg.eclipse.cdt.codan.provisional.core.model.cfg.IDecisionNode#
* getConnectionNode()
*/
@Override
public IConnectorNode getMergeNode() {
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
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Alena Laskavaia - initial API and implementation
* Alena Laskavaia - initial API and implementation
*******************************************************************************/
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
*
*/
public class ProblemLocationFactory implements IProblemLocationFactory {
/*
* (non-Javadoc)
*
* @seeorg.eclipse.cdt.codan.core.model.IProblemLocationFactory#
* createProblemLocation(org.eclipse.core.resources.IFile, int)
*/
@Override
public IProblemLocation createProblemLocation(IFile file, int line) {
return new CodanProblemLocation(file, line);
}
/*
* (non-Javadoc)
*
* @seeorg.eclipse.cdt.codan.core.model.IProblemLocationFactory#
* createProblemLocation(org.eclipse.core.resources.IFile, int, int)
*/
@Override
@Deprecated
public IProblemLocation createProblemLocation(IFile file, int startChar, int 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
public IProblemLocation createProblemLocation(IFile file, int startChar, int endChar, int line) {
return new CodanProblemLocation(file, startChar, endChar, line);

View file

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

View file

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

View file

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