mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
cleanup: JavaDoc/compiler warnings
This commit is contained in:
parent
75267de2dc
commit
a2fd559aec
1 changed files with 92 additions and 88 deletions
|
@ -16,7 +16,6 @@ import java.util.ArrayList;
|
|||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||
|
@ -42,6 +41,7 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
|
|||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.viewers.StructuredViewer;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.jface.viewers.ViewerFilter;
|
||||
|
@ -63,6 +63,8 @@ import org.eclipse.swt.widgets.ScrollBar;
|
|||
|
||||
|
||||
/**
|
||||
* Tool Settings Tab in project properties Build Settings
|
||||
*
|
||||
* @noextend This class is not intended to be subclassed by clients.
|
||||
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||
*/
|
||||
|
@ -214,10 +216,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
|
||||
// Create a new settings page if necessary
|
||||
List<AbstractToolSettingUI> pages = getPagesForConfig();
|
||||
ListIterator<AbstractToolSettingUI> iter = pages.listIterator();
|
||||
|
||||
while (iter.hasNext()) {
|
||||
AbstractToolSettingUI page = iter.next();
|
||||
for (AbstractToolSettingUI page : pages) {
|
||||
if (page.isFor(optionHolder, category)) {
|
||||
currentSettingsPage = page;
|
||||
break;
|
||||
|
@ -245,9 +244,9 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
// Make all the other pages invisible
|
||||
Control[] children = settingsPageContainer.getChildren();
|
||||
Control currentControl = currentSettingsPage.getControl();
|
||||
for (int i = 0; i < children.length; i++) {
|
||||
if (children[i] != currentControl)
|
||||
children[i].setVisible(false);
|
||||
for (Control element : children) {
|
||||
if (element != currentControl)
|
||||
element.setVisible(false);
|
||||
}
|
||||
|
||||
if (displayFixedTip==true) {
|
||||
|
@ -288,9 +287,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
|
||||
// Create a new page if we need one
|
||||
List<AbstractToolSettingUI> pages = getPagesForConfig();
|
||||
ListIterator<AbstractToolSettingUI> iter = pages.listIterator();
|
||||
while (iter.hasNext()) {
|
||||
AbstractToolSettingUI page = iter.next();
|
||||
for (AbstractToolSettingUI page : pages) {
|
||||
if (page.isFor(tool, null)) {
|
||||
currentSettingsPage = page;
|
||||
break;
|
||||
|
@ -308,9 +305,9 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
// Make all the other pages invisible
|
||||
Control[] children = settingsPageContainer.getChildren();
|
||||
Control currentControl = currentSettingsPage.getControl();
|
||||
for (int i = 0; i < children.length; i++) {
|
||||
if (children[i] != currentControl)
|
||||
children[i].setVisible(false);
|
||||
for (Control element : children) {
|
||||
if (element != currentControl)
|
||||
element.setVisible(false);
|
||||
}
|
||||
|
||||
if (displayFixedTip==true) {
|
||||
|
@ -448,8 +445,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
}
|
||||
|
||||
private ToolListElement exactMatchSelectionElement(ToolListElement currentElement, ToolListElement[] elements) {
|
||||
for (int i=0; i<elements.length; i++) {
|
||||
ToolListElement e = elements[i];
|
||||
for (ToolListElement e : elements) {
|
||||
if (e == currentElement) {
|
||||
return currentElement;
|
||||
}
|
||||
|
@ -460,8 +456,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
}
|
||||
|
||||
private ToolListElement equivalentMatchSelectionElement(ToolListElement currentElement, ToolListElement[] elements) {
|
||||
for (int i=0; i<elements.length; i++) {
|
||||
ToolListElement e = elements[i];
|
||||
for (ToolListElement e : elements) {
|
||||
if (e.isEquivalentTo(currentElement)) {
|
||||
return e;
|
||||
}
|
||||
|
@ -542,6 +537,9 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
}
|
||||
|
||||
/**
|
||||
* @param filter - a viewer filter
|
||||
* @see StructuredViewer#addFilter(ViewerFilter)
|
||||
*
|
||||
* @since 5.1
|
||||
*/
|
||||
protected void addFilter(ViewerFilter filter) {
|
||||
|
@ -549,9 +547,14 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
}
|
||||
|
||||
/**
|
||||
* Copy the value of an option to another option for a given resource.
|
||||
* @param op1 - option to copy the value from
|
||||
* @param op2 - option to copy the value to
|
||||
* @param dst - the holder/parent of the option
|
||||
* @param res - the resource configuration the option belongs to
|
||||
*
|
||||
* @since 5.1
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected void setOption(IOption op1, IOption op2, IHoldsOptions dst, IResourceInfo res){
|
||||
try {
|
||||
switch (op1.getValueType()) {
|
||||
|
@ -583,6 +586,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
case IOption.UNDEF_LIBRARY_PATHS:
|
||||
case IOption.UNDEF_LIBRARY_FILES:
|
||||
case IOption.UNDEF_MACRO_FILES:
|
||||
@SuppressWarnings("unchecked")
|
||||
String[] data = ((List<String>)op1.getValue()).toArray(new String[0]);
|
||||
ManagedBuildManager.setOption(res, dst, op2, data);
|
||||
break;
|
||||
|
@ -597,8 +601,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
protected boolean containsDefaults(){
|
||||
IConfiguration parentCfg = fInfo.getParent().getParent();
|
||||
ITool tools[] = fInfo.getParent().getTools();
|
||||
for(int i = 0; i < tools.length; i++){
|
||||
ITool tool = tools[i];
|
||||
for (ITool tool : tools) {
|
||||
if(!tool.getCustomBuildStep()){
|
||||
ITool cfgTool = parentCfg.getToolChain().getTool(tool.getSuperClass().getId());
|
||||
// Check for a non-default command or command-line-pattern
|
||||
|
@ -608,8 +611,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
}
|
||||
// Check for a non-default option
|
||||
IOption options[] = tool.getOptions();
|
||||
for( int j = 0; j < options.length; j++){
|
||||
IOption option = options[j];
|
||||
for (IOption option : options) {
|
||||
if(option.getParent() == tool){
|
||||
IOption ext = option;
|
||||
do{
|
||||
|
@ -660,14 +662,16 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
|
||||
/**
|
||||
* Sets the "dirty" state
|
||||
* @param b - the new dirty state, {@code true} or {@code false}
|
||||
*/
|
||||
public void setDirty(boolean b) {
|
||||
List<AbstractToolSettingUI> pages = getPagesForConfig();
|
||||
if (pages == null) return;
|
||||
ListIterator<AbstractToolSettingUI> iter = pages.listIterator();
|
||||
while (iter.hasNext()) {
|
||||
AbstractToolSettingUI page = iter.next();
|
||||
if (page == null) continue;
|
||||
if (pages == null)
|
||||
return;
|
||||
|
||||
for (AbstractToolSettingUI page : pages) {
|
||||
if (page == null)
|
||||
continue;
|
||||
page.setDirty(b);
|
||||
}
|
||||
}
|
||||
|
@ -683,9 +687,8 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
// Nothing to do
|
||||
return false;
|
||||
}
|
||||
ListIterator<AbstractToolSettingUI> iter = pages.listIterator();
|
||||
while (iter.hasNext()) {
|
||||
AbstractToolSettingUI page = iter.next();
|
||||
|
||||
for (AbstractToolSettingUI page : pages) {
|
||||
if (page == null) continue;
|
||||
if (page.isDirty()) return true;
|
||||
}
|
||||
|
@ -743,7 +746,8 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
|||
* in a chain (?) they are matched one-for one in the order in which they are found in
|
||||
* each chain.
|
||||
*
|
||||
* @param t1, t2 two groups of tools. Neither may be <code>null</code>
|
||||
* @param t1 - first group of tools. May not be <code>null</code>
|
||||
* @param t2 - second group of tools. May not be <code>null</code>
|
||||
* @return the one-for-one correspondence of tools, in order of <tt>t2</tt>
|
||||
*/
|
||||
private Map<ITool, ITool> getToolCorrespondence(ITool[] t1, ITool[] t2) {
|
||||
|
|
Loading…
Add table
Reference in a new issue