mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 09:16:02 +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.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ListIterator;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
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.IStructuredSelection;
|
||||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||||
import org.eclipse.jface.viewers.StructuredSelection;
|
import org.eclipse.jface.viewers.StructuredSelection;
|
||||||
|
import org.eclipse.jface.viewers.StructuredViewer;
|
||||||
import org.eclipse.jface.viewers.TreeViewer;
|
import org.eclipse.jface.viewers.TreeViewer;
|
||||||
import org.eclipse.jface.viewers.Viewer;
|
import org.eclipse.jface.viewers.Viewer;
|
||||||
import org.eclipse.jface.viewers.ViewerFilter;
|
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.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
* @noinstantiate This class is not intended to be instantiated 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
|
// Create a new settings page if necessary
|
||||||
List<AbstractToolSettingUI> pages = getPagesForConfig();
|
List<AbstractToolSettingUI> pages = getPagesForConfig();
|
||||||
ListIterator<AbstractToolSettingUI> iter = pages.listIterator();
|
for (AbstractToolSettingUI page : pages) {
|
||||||
|
|
||||||
while (iter.hasNext()) {
|
|
||||||
AbstractToolSettingUI page = iter.next();
|
|
||||||
if (page.isFor(optionHolder, category)) {
|
if (page.isFor(optionHolder, category)) {
|
||||||
currentSettingsPage = page;
|
currentSettingsPage = page;
|
||||||
break;
|
break;
|
||||||
|
@ -245,9 +244,9 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
// Make all the other pages invisible
|
// Make all the other pages invisible
|
||||||
Control[] children = settingsPageContainer.getChildren();
|
Control[] children = settingsPageContainer.getChildren();
|
||||||
Control currentControl = currentSettingsPage.getControl();
|
Control currentControl = currentSettingsPage.getControl();
|
||||||
for (int i = 0; i < children.length; i++) {
|
for (Control element : children) {
|
||||||
if (children[i] != currentControl)
|
if (element != currentControl)
|
||||||
children[i].setVisible(false);
|
element.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (displayFixedTip==true) {
|
if (displayFixedTip==true) {
|
||||||
|
@ -288,9 +287,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
|
|
||||||
// Create a new page if we need one
|
// Create a new page if we need one
|
||||||
List<AbstractToolSettingUI> pages = getPagesForConfig();
|
List<AbstractToolSettingUI> pages = getPagesForConfig();
|
||||||
ListIterator<AbstractToolSettingUI> iter = pages.listIterator();
|
for (AbstractToolSettingUI page : pages) {
|
||||||
while (iter.hasNext()) {
|
|
||||||
AbstractToolSettingUI page = iter.next();
|
|
||||||
if (page.isFor(tool, null)) {
|
if (page.isFor(tool, null)) {
|
||||||
currentSettingsPage = page;
|
currentSettingsPage = page;
|
||||||
break;
|
break;
|
||||||
|
@ -308,9 +305,9 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
// Make all the other pages invisible
|
// Make all the other pages invisible
|
||||||
Control[] children = settingsPageContainer.getChildren();
|
Control[] children = settingsPageContainer.getChildren();
|
||||||
Control currentControl = currentSettingsPage.getControl();
|
Control currentControl = currentSettingsPage.getControl();
|
||||||
for (int i = 0; i < children.length; i++) {
|
for (Control element : children) {
|
||||||
if (children[i] != currentControl)
|
if (element != currentControl)
|
||||||
children[i].setVisible(false);
|
element.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (displayFixedTip==true) {
|
if (displayFixedTip==true) {
|
||||||
|
@ -448,8 +445,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
}
|
}
|
||||||
|
|
||||||
private ToolListElement exactMatchSelectionElement(ToolListElement currentElement, ToolListElement[] elements) {
|
private ToolListElement exactMatchSelectionElement(ToolListElement currentElement, ToolListElement[] elements) {
|
||||||
for (int i=0; i<elements.length; i++) {
|
for (ToolListElement e : elements) {
|
||||||
ToolListElement e = elements[i];
|
|
||||||
if (e == currentElement) {
|
if (e == currentElement) {
|
||||||
return currentElement;
|
return currentElement;
|
||||||
}
|
}
|
||||||
|
@ -460,8 +456,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
}
|
}
|
||||||
|
|
||||||
private ToolListElement equivalentMatchSelectionElement(ToolListElement currentElement, ToolListElement[] elements) {
|
private ToolListElement equivalentMatchSelectionElement(ToolListElement currentElement, ToolListElement[] elements) {
|
||||||
for (int i=0; i<elements.length; i++) {
|
for (ToolListElement e : elements) {
|
||||||
ToolListElement e = elements[i];
|
|
||||||
if (e.isEquivalentTo(currentElement)) {
|
if (e.isEquivalentTo(currentElement)) {
|
||||||
return e;
|
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
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
protected void addFilter(ViewerFilter filter) {
|
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
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
protected void setOption(IOption op1, IOption op2, IHoldsOptions dst, IResourceInfo res){
|
protected void setOption(IOption op1, IOption op2, IHoldsOptions dst, IResourceInfo res){
|
||||||
try {
|
try {
|
||||||
switch (op1.getValueType()) {
|
switch (op1.getValueType()) {
|
||||||
|
@ -583,6 +586,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
case IOption.UNDEF_LIBRARY_PATHS:
|
case IOption.UNDEF_LIBRARY_PATHS:
|
||||||
case IOption.UNDEF_LIBRARY_FILES:
|
case IOption.UNDEF_LIBRARY_FILES:
|
||||||
case IOption.UNDEF_MACRO_FILES:
|
case IOption.UNDEF_MACRO_FILES:
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
String[] data = ((List<String>)op1.getValue()).toArray(new String[0]);
|
String[] data = ((List<String>)op1.getValue()).toArray(new String[0]);
|
||||||
ManagedBuildManager.setOption(res, dst, op2, data);
|
ManagedBuildManager.setOption(res, dst, op2, data);
|
||||||
break;
|
break;
|
||||||
|
@ -597,8 +601,7 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
protected boolean containsDefaults(){
|
protected boolean containsDefaults(){
|
||||||
IConfiguration parentCfg = fInfo.getParent().getParent();
|
IConfiguration parentCfg = fInfo.getParent().getParent();
|
||||||
ITool tools[] = fInfo.getParent().getTools();
|
ITool tools[] = fInfo.getParent().getTools();
|
||||||
for(int i = 0; i < tools.length; i++){
|
for (ITool tool : tools) {
|
||||||
ITool tool = tools[i];
|
|
||||||
if(!tool.getCustomBuildStep()){
|
if(!tool.getCustomBuildStep()){
|
||||||
ITool cfgTool = parentCfg.getToolChain().getTool(tool.getSuperClass().getId());
|
ITool cfgTool = parentCfg.getToolChain().getTool(tool.getSuperClass().getId());
|
||||||
// Check for a non-default command or command-line-pattern
|
// 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
|
// Check for a non-default option
|
||||||
IOption options[] = tool.getOptions();
|
IOption options[] = tool.getOptions();
|
||||||
for( int j = 0; j < options.length; j++){
|
for (IOption option : options) {
|
||||||
IOption option = options[j];
|
|
||||||
if(option.getParent() == tool){
|
if(option.getParent() == tool){
|
||||||
IOption ext = option;
|
IOption ext = option;
|
||||||
do{
|
do{
|
||||||
|
@ -660,14 +662,16 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the "dirty" state
|
* Sets the "dirty" state
|
||||||
|
* @param b - the new dirty state, {@code true} or {@code false}
|
||||||
*/
|
*/
|
||||||
public void setDirty(boolean b) {
|
public void setDirty(boolean b) {
|
||||||
List<AbstractToolSettingUI> pages = getPagesForConfig();
|
List<AbstractToolSettingUI> pages = getPagesForConfig();
|
||||||
if (pages == null) return;
|
if (pages == null)
|
||||||
ListIterator<AbstractToolSettingUI> iter = pages.listIterator();
|
return;
|
||||||
while (iter.hasNext()) {
|
|
||||||
AbstractToolSettingUI page = iter.next();
|
for (AbstractToolSettingUI page : pages) {
|
||||||
if (page == null) continue;
|
if (page == null)
|
||||||
|
continue;
|
||||||
page.setDirty(b);
|
page.setDirty(b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -683,9 +687,8 @@ public class ToolSettingsTab extends AbstractCBuildPropertyTab implements IPrefe
|
||||||
// Nothing to do
|
// Nothing to do
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
ListIterator<AbstractToolSettingUI> iter = pages.listIterator();
|
|
||||||
while (iter.hasNext()) {
|
for (AbstractToolSettingUI page : pages) {
|
||||||
AbstractToolSettingUI page = iter.next();
|
|
||||||
if (page == null) continue;
|
if (page == null) continue;
|
||||||
if (page.isDirty()) return true;
|
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
|
* in a chain (?) they are matched one-for one in the order in which they are found in
|
||||||
* each chain.
|
* 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>
|
* @return the one-for-one correspondence of tools, in order of <tt>t2</tt>
|
||||||
*/
|
*/
|
||||||
private Map<ITool, ITool> getToolCorrespondence(ITool[] t1, ITool[] t2) {
|
private Map<ITool, ITool> getToolCorrespondence(ITool[] t1, ITool[] t2) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue