mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 09:25:31 +02:00
Cleanups.
Remove useless: * casts. * suppress warnings unchecked. * @see comments Change-Id: I4713e9ddf90195cf1e465b3743f5f0bc7e41d338 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
parent
34281a96e0
commit
8a834d5970
10 changed files with 7 additions and 35 deletions
|
@ -83,7 +83,7 @@ public class FunctionReferenceRule extends WordRule {
|
|||
if (c == tagDetector.closedBracket) {
|
||||
if (tagDetector.bracketNesting > 0) {
|
||||
tagDetector.bracketNesting--;
|
||||
return (IToken)fWords.get(endSeq);
|
||||
return fWords.get(endSeq);
|
||||
}
|
||||
return fDefaultToken;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class FunctionReferenceRule extends WordRule {
|
|||
|
||||
String buffer= fBuffer.toString();
|
||||
|
||||
IToken token= (IToken)fWords.get(buffer);
|
||||
IToken token= fWords.get(buffer);
|
||||
|
||||
if (token != null) {
|
||||
if (buffer.equals(startSeq + GNUMakefileConstants.FUNCTION_CALL) || buffer.equals('$' + startSeq + GNUMakefileConstants.FUNCTION_CALL)) {
|
||||
|
|
|
@ -53,7 +53,7 @@ public class CElementHyperlinkDetector extends AbstractHyperlinkDetector {
|
|||
|
||||
@Override
|
||||
public IHyperlink[] detectHyperlinks(final ITextViewer textViewer, final IRegion region, boolean canShowMultipleHyperlinks) {
|
||||
ITextEditor textEditor= (ITextEditor) getAdapter(ITextEditor.class);
|
||||
ITextEditor textEditor= getAdapter(ITextEditor.class);
|
||||
if (region == null || !(textEditor instanceof CEditor))
|
||||
return null;
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ public class CSourceViewer extends ProjectionViewer implements IPropertyChangeLi
|
|||
if (fMacroExplorationPresenter != null) {
|
||||
fMacroExplorationPresenter.install(this);
|
||||
}
|
||||
String[] defaultIndentPrefixes= (String[])fIndentChars.get(IDocument.DEFAULT_CONTENT_TYPE);
|
||||
String[] defaultIndentPrefixes= fIndentChars.get(IDocument.DEFAULT_CONTENT_TYPE);
|
||||
if (defaultIndentPrefixes != null && defaultIndentPrefixes.length > 0) {
|
||||
final int indentWidth= cConfiguration.getIndentWidth(this);
|
||||
final boolean useSpaces= cConfiguration.useSpacesOnly(this);
|
||||
|
@ -409,7 +409,7 @@ public class CSourceViewer extends ProjectionViewer implements IPropertyChangeLi
|
|||
public void prependTextPresentationListener(ITextPresentationListener listener) {
|
||||
Assert.isNotNull(listener);
|
||||
|
||||
@SuppressWarnings("unchecked") // using list from base class
|
||||
// using list from base class
|
||||
List<ITextPresentationListener> textPresentationListeners= fTextPresentationListeners;
|
||||
|
||||
if (textPresentationListeners == null)
|
||||
|
|
|
@ -139,7 +139,7 @@ public class PreprocessorRule extends WordRule {
|
|||
}
|
||||
scanner.unread();
|
||||
}
|
||||
IToken token = (IToken) fWords.get(fBuffer.toString());
|
||||
IToken token = fWords.get(fBuffer.toString());
|
||||
if (token != null)
|
||||
return token;
|
||||
|
||||
|
|
|
@ -100,7 +100,6 @@ public class TemplateVariableProcessor implements IContentAssistProcessor {
|
|||
|
||||
int length= end - offset;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
final Iterator<TemplateVariableResolver> resolvers = fContextType.resolvers();
|
||||
while (resolvers.hasNext()) {
|
||||
TemplateVariableResolver variable= resolvers.next();
|
||||
|
|
|
@ -1049,12 +1049,8 @@ public class CSourceViewerConfiguration extends TextSourceViewerConfiguration {
|
|||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getHyperlinkDetectorTargets(org.eclipse.jface.text.source.ISourceViewer)
|
||||
*/
|
||||
@Override
|
||||
protected Map<String, IAdaptable> getHyperlinkDetectorTargets(ISourceViewer sourceViewer) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, IAdaptable> targets= super.getHyperlinkDetectorTargets(sourceViewer);
|
||||
targets.put("org.eclipse.cdt.ui.cCode", fTextEditor); //$NON-NLS-1$
|
||||
return targets;
|
||||
|
|
|
@ -297,7 +297,6 @@ public class CDebugUIUtils {
|
|||
IAnnotationModel annotationModel = editor.getDocumentProvider().getAnnotationModel(editor.getEditorInput());
|
||||
IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
|
||||
if (annotationModel != null) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Iterator<Annotation> iterator = annotationModel.getAnnotationIterator();
|
||||
while (iterator.hasNext()) {
|
||||
Object object = iterator.next();
|
||||
|
|
|
@ -846,7 +846,6 @@ abstract public class AbstractToggleBreakpointAdapter
|
|||
IAnnotationModel annotationModel = editor.getDocumentProvider().getAnnotationModel(editor.getEditorInput());
|
||||
IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
|
||||
if (annotationModel != null) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Iterator<Annotation> iterator = annotationModel.getAnnotationIterator();
|
||||
while (iterator.hasNext()) {
|
||||
Object object = iterator.next();
|
||||
|
|
|
@ -2829,11 +2829,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
*/
|
||||
protected abstract void closePart();
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.ITextPresentationListener#applyTextPresentation(org.eclipse.jface.text.TextPresentation)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void applyTextPresentation(TextPresentation textPresentation) {
|
||||
IRegion coverage = textPresentation.getExtent();
|
||||
if (coverage == null) {
|
||||
|
|
|
@ -65,33 +65,21 @@ public class DsfStepIntoSelectionHyperlinkDetector extends AbstractHyperlinkDete
|
|||
fSelectionResolver = selectionResolver;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()
|
||||
*/
|
||||
@Override
|
||||
public IRegion getHyperlinkRegion() {
|
||||
return new Region(fSelection.getOffset(), fSelection.getLength());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
|
||||
*/
|
||||
@Override
|
||||
public String getHyperlinkText() {
|
||||
return Messages.DsfUIStepIntoEditorSelection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
|
||||
*/
|
||||
@Override
|
||||
public String getTypeLabel() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
|
||||
*/
|
||||
@Override
|
||||
public void open() {
|
||||
// Resolve the debug context
|
||||
|
@ -111,15 +99,10 @@ public class DsfStepIntoSelectionHyperlinkDetector extends AbstractHyperlinkDete
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.text.hyperlink.IHyperlinkDetector#detectHyperlinks(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion, boolean)
|
||||
*/
|
||||
@Override
|
||||
public IHyperlink[] detectHyperlinks(ITextViewer textViewer, final IRegion region, boolean canShowMultipleHyperlinks) {
|
||||
// Only valid in the context of a selection within the CEditor
|
||||
ITextEditor editor = (ITextEditor) getAdapter(ITextEditor.class);
|
||||
ITextEditor editor = getAdapter(ITextEditor.class);
|
||||
if (editor == null || region == null || !(editor instanceof CEditor))
|
||||
return null;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue