diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java index 2fea0104de3..1b453cefcce 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CheckersRegistry.java @@ -37,6 +37,9 @@ import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.Platform; import org.osgi.service.prefs.Preferences; +/** + * Implementation of checker registry interface + */ public class CheckersRegistry implements Iterable, ICheckersRegistry { private static final String NAME_ATTR = "name"; //$NON-NLS-1$ private static final String ID_ATTR = "id"; //$NON-NLS-1$ diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanApplication.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanApplication.java index c31eb9d35a9..9de6a7d2c26 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanApplication.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanApplication.java @@ -16,7 +16,6 @@ import org.eclipse.equinox.app.IApplicationContext; import org.eclipse.osgi.util.NLS; /** - * * Application to support headless build * * @noextend This class is not intended to be extended by clients. diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanBuilder.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanBuilder.java index ff44d900059..7d04ec806d7 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanBuilder.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodanBuilder.java @@ -30,11 +30,17 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; +/** + * Implementation of {@link ICodanBuilder} + */ public class CodanBuilder extends IncrementalProjectBuilder implements ICodanBuilder { + /** + * codan builder id + */ public static final String BUILDER_ID = "org.eclipse.cdt.codan.core.codanBuilder"; //$NON-NLS-1$ - public class CodanDeltaVisitor implements IResourceDeltaVisitor { + private class CodanDeltaVisitor implements IResourceDeltaVisitor { private IProgressMonitor monitor; /** @@ -47,17 +53,17 @@ public class CodanBuilder extends IncrementalProjectBuilder implements public boolean visit(IResourceDelta delta) throws CoreException { IResource resource = delta.getResource(); switch (delta.getKind()) { - case IResourceDelta.ADDED: - // handle added resource - processResource(resource, monitor); - break; - case IResourceDelta.REMOVED: - // handle removed resource - break; - case IResourceDelta.CHANGED: - // handle changed resource - processResource(resource, monitor); - break; + case IResourceDelta.ADDED: + // handle added resource + processResource(resource, monitor); + break; + case IResourceDelta.REMOVED: + // handle removed resource + break; + case IResourceDelta.CHANGED: + // handle changed resource + processResource(resource, monitor); + break; } // return true to continue visiting children. return true; @@ -106,8 +112,8 @@ public class CodanBuilder extends IncrementalProjectBuilder implements } int tick = 1000; // System.err.println("processing " + resource); - monitor.beginTask(Messages.CodanBuilder_Code_Analysis_On + resource, checkers + memsize - * tick); + monitor.beginTask(Messages.CodanBuilder_Code_Analysis_On + resource, + checkers + memsize * tick); try { IProblemReporter problemReporter = CodanRuntime.getInstance() .getProblemReporter(); @@ -172,6 +178,13 @@ public class CodanBuilder extends IncrementalProjectBuilder implements delta.accept(new CodanDeltaVisitor(monitor)); } + /** + * Run all checkers that support "check as you type" mode + * + * @param model - model of given resource such as ast + * @param resource - resource to process + * @param monitor - progress monitor + */ public void runInEditor(Object model, IResource resource, IProgressMonitor monitor) { if (model == null) diff --git a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodeAnlysisNature.java b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodeAnlysisNature.java index 214d760a5a1..83fad6a1e9b 100644 --- a/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodeAnlysisNature.java +++ b/codan/org.eclipse.cdt.codan.core/src/org/eclipse/cdt/codan/internal/core/CodeAnlysisNature.java @@ -16,6 +16,9 @@ import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.resources.IProjectNature; import org.eclipse.core.runtime.CoreException; +/** + * Code Analysis Nature for builder + */ public class CodeAnlysisNature implements IProjectNature { /** * ID of this project nature @@ -23,16 +26,13 @@ public class CodeAnlysisNature implements IProjectNature { public static final String NATURE_ID = "org.eclipse.cdt.codan.core.codanNature"; //$NON-NLS-1$ private IProject project; - /* - * (non-Javadoc) - * - * @see org.eclipse.core.resources.IProjectNature#configure() - */ public void configure() throws CoreException { IProjectDescription desc = project.getDescription(); ICommand[] commands = desc.getBuildSpec(); for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(CodanBuilder.BUILDER_ID)) { return; } + if (commands[i].getBuilderName().equals(CodanBuilder.BUILDER_ID)) { + return; + } } ICommand[] newCommands = new ICommand[commands.length + 1]; System.arraycopy(commands, 0, newCommands, 0, commands.length); @@ -43,11 +43,6 @@ public class CodeAnlysisNature implements IProjectNature { project.setDescription(desc, null); } - /* - * (non-Javadoc) - * - * @see org.eclipse.core.resources.IProjectNature#deconfigure() - */ public void deconfigure() throws CoreException { IProjectDescription description = getProject().getDescription(); ICommand[] commands = description.getBuildSpec(); @@ -55,7 +50,8 @@ public class CodeAnlysisNature implements IProjectNature { if (commands[i].getBuilderName().equals(CodanBuilder.BUILDER_ID)) { ICommand[] newCommands = new ICommand[commands.length - 1]; System.arraycopy(commands, 0, newCommands, 0, i); - System.arraycopy(commands, i + 1, newCommands, i, commands.length - i - 1); + System.arraycopy(commands, i + 1, newCommands, i, + commands.length - i - 1); description.setBuildSpec(newCommands); project.setDescription(description, null); return; @@ -63,22 +59,10 @@ public class CodeAnlysisNature implements IProjectNature { } } - /* - * (non-Javadoc) - * - * @see org.eclipse.core.resources.IProjectNature#getProject() - */ public IProject getProject() { return project; } - /* - * (non-Javadoc) - * - * @see - * org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core - * .resources.IProject) - */ public void setProject(IProject project) { this.project = project; }