mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-03 14:25:37 +02:00
Cosmetics.
This commit is contained in:
parent
9bc12f31aa
commit
bdfe95527e
2 changed files with 16 additions and 15 deletions
|
@ -15,6 +15,10 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.core.dom.IPDOMVisitor;
|
import org.eclipse.cdt.core.dom.IPDOMVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
|
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
|
||||||
|
@ -41,10 +45,6 @@ import org.eclipse.cdt.internal.core.pdom.dom.PDOMName;
|
||||||
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
|
@ -66,7 +66,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
|
||||||
setKind(classType);
|
setKind(classType);
|
||||||
setAnonymous(classType);
|
setAnonymous(classType);
|
||||||
setFinal(classType);
|
setFinal(classType);
|
||||||
// linked list is initialized by storage being zero'd by malloc
|
// Linked list is initialized by storage being zero'd by malloc
|
||||||
}
|
}
|
||||||
|
|
||||||
public PDOMCPPClassType(PDOMLinkage linkage, long bindingRecord) {
|
public PDOMCPPClassType(PDOMLinkage linkage, long bindingRecord) {
|
||||||
|
@ -308,7 +308,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
|
||||||
return bases;
|
return bases;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List<PDOMCPPBase> list = new ArrayList<PDOMCPPBase>();
|
List<PDOMCPPBase> list = new ArrayList<>();
|
||||||
for (PDOMCPPBase base = getFirstBase(); base != null; base = base.getNextBase()) {
|
for (PDOMCPPBase base = getFirstBase(); base != null; base = base.getNextBase()) {
|
||||||
list.add(base);
|
list.add(base);
|
||||||
}
|
}
|
||||||
|
@ -318,7 +318,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
|
||||||
return bases;
|
return bases;
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
return new ICPPBase[0];
|
return ICPPBase.EMPTY_BASE_ARRAY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,7 +373,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
|
||||||
@Override
|
@Override
|
||||||
public IBinding[] getFriends() {
|
public IBinding[] getFriends() {
|
||||||
try {
|
try {
|
||||||
final List<IBinding> list = new ArrayList<IBinding>();
|
final List<IBinding> list = new ArrayList<>();
|
||||||
for (PDOMCPPFriend friend = getFirstFriend();
|
for (PDOMCPPFriend friend = getFirstFriend();
|
||||||
friend != null; friend = friend.getNextFriend()) {
|
friend != null; friend = friend.getNextFriend()) {
|
||||||
list.add(0, friend.getFriendSpecifier());
|
list.add(0, friend.getFriendSpecifier());
|
||||||
|
@ -381,7 +381,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
|
||||||
return list.toArray(new IBinding[list.size()]);
|
return list.toArray(new IBinding[list.size()]);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
return new IBinding[0];
|
return IBinding.EMPTY_BINDING_ARRAY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,8 @@ class PDOMCPPNamespace extends PDOMCPPBinding
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated @Override
|
@Deprecated
|
||||||
|
@Override
|
||||||
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
|
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
|
||||||
return getBindings(new ScopeLookupData(name, resolve, prefixLookup));
|
return getBindings(new ScopeLookupData(name, resolve, prefixLookup));
|
||||||
}
|
}
|
||||||
|
@ -243,7 +244,7 @@ class PDOMCPPNamespace extends PDOMCPPBinding
|
||||||
@Override
|
@Override
|
||||||
public IBinding[] getMemberBindings() {
|
public IBinding[] getMemberBindings() {
|
||||||
IBinding[] result = null;
|
IBinding[] result = null;
|
||||||
final List<PDOMNode> preresult = new ArrayList<PDOMNode>();
|
final List<PDOMNode> preresult = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
getIndex().accept(new IBTreeVisitor() {
|
getIndex().accept(new IBTreeVisitor() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -257,8 +258,8 @@ class PDOMCPPNamespace extends PDOMCPPBinding
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
result = preresult.toArray(new IBinding[preresult.size()]);
|
result = preresult.toArray(new IBinding[preresult.size()]);
|
||||||
} catch (CoreException ce) {
|
} catch (CoreException e) {
|
||||||
CCorePlugin.log(ce);
|
CCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -288,7 +289,7 @@ class PDOMCPPNamespace extends PDOMCPPBinding
|
||||||
List<PDOMCPPNamespace> nslist = collectInlineNamespaces(getDB(), getLinkage(),
|
List<PDOMCPPNamespace> nslist = collectInlineNamespaces(getDB(), getLinkage(),
|
||||||
record + FIRST_NAMESPACE_CHILD_OFFSET);
|
record + FIRST_NAMESPACE_CHILD_OFFSET);
|
||||||
if (nslist == null) {
|
if (nslist == null) {
|
||||||
fInlineNamespaces= new PDOMCPPNamespace[0];
|
fInlineNamespaces= ICPPNamespaceScope.EMPTY_NAMESPACE_SCOPE_ARRAY;
|
||||||
} else {
|
} else {
|
||||||
fInlineNamespaces= nslist.toArray(new PDOMCPPNamespace[nslist.size()]);
|
fInlineNamespaces= nslist.toArray(new PDOMCPPNamespace[nslist.size()]);
|
||||||
}
|
}
|
||||||
|
@ -305,7 +306,7 @@ class PDOMCPPNamespace extends PDOMCPPBinding
|
||||||
PDOMCPPNamespace ns= new PDOMCPPNamespace(linkage, rec);
|
PDOMCPPNamespace ns= new PDOMCPPNamespace(linkage, rec);
|
||||||
if (ns.isInline()) {
|
if (ns.isInline()) {
|
||||||
if (nslist == null) {
|
if (nslist == null) {
|
||||||
nslist= new ArrayList<PDOMCPPNamespace>();
|
nslist= new ArrayList<>();
|
||||||
}
|
}
|
||||||
nslist.add(ns);
|
nslist.add(ns);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue