mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 16:55:38 +02:00
Cosmetics.
This commit is contained in:
parent
0152c28c22
commit
8ce322ad37
6 changed files with 31 additions and 30 deletions
|
@ -8,7 +8,6 @@
|
|||
* Contributors:
|
||||
* IBM Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.core.parser.util;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
@ -24,7 +23,7 @@ public class HashTable implements Cloneable {
|
|||
return currEntry == -1;
|
||||
}
|
||||
|
||||
final public int size() {
|
||||
public final int size() {
|
||||
return currEntry + 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
|
|||
* For safe usage in index bindings, all fields need to be final or volatile.
|
||||
*/
|
||||
public class AbstractCPPClassSpecializationScope implements ICPPClassSpecializationScope {
|
||||
final private ICPPClassSpecialization specialClass;
|
||||
private final ICPPClassSpecialization specialClass;
|
||||
private volatile ICPPBase[] fBases; // Used by the pdom bindings, needs to be volatile.
|
||||
|
||||
public AbstractCPPClassSpecializationScope(ICPPClassSpecialization specialization) {
|
||||
|
@ -79,7 +79,8 @@ public class AbstractCPPClassSpecializationScope implements ICPPClassSpecializat
|
|||
|
||||
ICPPClassType specialized = specialClass.getSpecializedBinding();
|
||||
IScope classScope = specialized.getCompositeScope();
|
||||
IBinding[] bindings = classScope != null ? classScope.getBindings(new ScopeLookupData(name, resolve, false)) : null;
|
||||
IBinding[] bindings = classScope != null ?
|
||||
classScope.getBindings(new ScopeLookupData(name, resolve, false)) : null;
|
||||
|
||||
if (bindings == null)
|
||||
return null;
|
||||
|
|
|
@ -14,14 +14,6 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.pdom.db;
|
||||
|
||||
import com.ibm.icu.text.MessageFormat;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
@ -32,6 +24,14 @@ import java.nio.channels.ClosedChannelException;
|
|||
import java.nio.channels.FileChannel;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.eclipse.cdt.core.CCorePlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.osgi.util.NLS;
|
||||
|
||||
import com.ibm.icu.text.MessageFormat;
|
||||
|
||||
/**
|
||||
* Database encapsulates access to a flat binary format file with a memory-manager-like API for
|
||||
* obtaining and releasing areas of storage (memory).
|
||||
|
@ -668,7 +668,7 @@ public class Database {
|
|||
public void giveUpExclusiveLock(final boolean flush) throws CoreException {
|
||||
if (fExclusiveLock) {
|
||||
try {
|
||||
ArrayList<Chunk> dirtyChunks= new ArrayList<Chunk>();
|
||||
ArrayList<Chunk> dirtyChunks= new ArrayList<>();
|
||||
synchronized (fCache) {
|
||||
for (int i= 1; i < fChunksUsed; i++) {
|
||||
Chunk chunk= fChunks[i];
|
||||
|
@ -716,7 +716,7 @@ public class Database {
|
|||
}
|
||||
|
||||
// Be careful as other readers may access chunks concurrently.
|
||||
ArrayList<Chunk> dirtyChunks= new ArrayList<Chunk>();
|
||||
ArrayList<Chunk> dirtyChunks= new ArrayList<>();
|
||||
synchronized (fCache) {
|
||||
for (int i= 1; i < fChunksUsed ; i++) {
|
||||
Chunk chunk= fChunks[i];
|
||||
|
|
|
@ -60,6 +60,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
class PDOMCPPClassScope implements ICPPClassScope, IIndexScope {
|
||||
private static final class PopulateMap implements IPDOMVisitor {
|
||||
private final CharArrayMap<List<PDOMBinding>> fResult;
|
||||
|
||||
private PopulateMap(CharArrayMap<List<PDOMBinding>> result) {
|
||||
fResult = result;
|
||||
}
|
||||
|
@ -71,7 +72,7 @@ class PDOMCPPClassScope implements ICPPClassScope, IIndexScope {
|
|||
final char[] nchars = binding.getNameCharArray();
|
||||
List<PDOMBinding> list= fResult.get(nchars);
|
||||
if (list == null) {
|
||||
list= new ArrayList<PDOMBinding>();
|
||||
list= new ArrayList<>();
|
||||
fResult.put(nchars, list);
|
||||
}
|
||||
list.add(binding);
|
||||
|
@ -244,8 +245,8 @@ class PDOMCPPClassScope implements ICPPClassScope, IIndexScope {
|
|||
CharArrayMap<List<PDOMBinding>> map= cached == null ? null : cached.get();
|
||||
|
||||
if (map == null) {
|
||||
// there is no cache, build it:
|
||||
map= new CharArrayMap<List<PDOMBinding>>();
|
||||
// There is no cache, build it:
|
||||
map= new CharArrayMap<>();
|
||||
IPDOMVisitor visitor= new PopulateMap(map);
|
||||
visitor.visit(ct);
|
||||
ct.acceptUncached(visitor);
|
||||
|
@ -271,7 +272,7 @@ class PDOMCPPClassScope implements ICPPClassScope, IIndexScope {
|
|||
acceptViaCache(fBinding, methods, false);
|
||||
return methods.getMethods();
|
||||
} catch (CoreException e) {
|
||||
return new ICPPMethod[0];
|
||||
return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue