mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 16:55:38 +02:00
Cosmetics.
Change-Id: Ib2caefa5406ea94fe1eec61138193c79fd0f608b
This commit is contained in:
parent
07488984d9
commit
2356094497
3 changed files with 44 additions and 46 deletions
|
@ -44,14 +44,14 @@ import org.eclipse.core.runtime.CoreException;
|
|||
public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding {
|
||||
public static final PDOMBinding[] EMPTY_PDOMBINDING_ARRAY = {};
|
||||
|
||||
private static final int FIRST_DECL_OFFSET = PDOMNamedNode.RECORD_SIZE + 0; // size 4
|
||||
private static final int FIRST_DEF_OFFSET = PDOMNamedNode.RECORD_SIZE + 4; // size 4
|
||||
private static final int FIRST_REF_OFFSET = PDOMNamedNode.RECORD_SIZE + 8; // size 4
|
||||
private static final int LOCAL_TO_FILE = PDOMNamedNode.RECORD_SIZE + 12; // size 4
|
||||
private static final int FIRST_EXTREF_OFFSET = PDOMNamedNode.RECORD_SIZE + 16; // size 4
|
||||
private static final int FIRST_DECL_OFFSET = PDOMNamedNode.RECORD_SIZE; // size 4
|
||||
private static final int FIRST_DEF_OFFSET = FIRST_DECL_OFFSET + Database.PTR_SIZE; // size 4
|
||||
private static final int FIRST_REF_OFFSET = FIRST_DEF_OFFSET + Database.PTR_SIZE; // size 4
|
||||
private static final int LOCAL_TO_FILE = FIRST_REF_OFFSET + Database.PTR_SIZE; // size 4
|
||||
private static final int FIRST_EXTREF_OFFSET = LOCAL_TO_FILE + Database.PTR_SIZE; // size 4
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
protected static final int RECORD_SIZE = PDOMNamedNode.RECORD_SIZE + 20;
|
||||
protected static final int RECORD_SIZE = FIRST_EXTREF_OFFSET + + Database.PTR_SIZE;
|
||||
|
||||
private byte hasDeclaration= -1;
|
||||
|
||||
|
@ -64,10 +64,10 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public Object getAdapter(Class adapter) {
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T getAdapter(Class<T> adapter) {
|
||||
if (adapter.isAssignableFrom(PDOMBinding.class))
|
||||
return this;
|
||||
return (T) this;
|
||||
|
||||
// Any PDOMBinding can have a persistent tag. These tags should be deleted when
|
||||
// the PDOMBinding is deleted. However, PDOMBinding's don't get deleted, so there is no way
|
||||
|
@ -76,7 +76,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
|
|||
// PDOMTagIndex.setTags(getPDOM(), pdomBinding.record, Collections.<ITag>emptyList());
|
||||
// to clear out all tags for the binding.
|
||||
if (adapter.isAssignableFrom(ITagReader.class))
|
||||
return new PDOMTaggable(getPDOM(), getRecord());
|
||||
return (T) new PDOMTaggable(getPDOM(), getRecord());
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
|
|||
*
|
||||
* @param pdom
|
||||
* @param record
|
||||
* @return <code>true</code> if the binding is orphaned.
|
||||
* @return {@code true} if the binding is orphaned.
|
||||
* @throws CoreException
|
||||
*/
|
||||
public static boolean isOrphaned(PDOM pdom, long record) throws CoreException {
|
||||
|
@ -313,7 +313,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
|
|||
* For debug purposes only.
|
||||
* @param linkage
|
||||
* @param value
|
||||
* @return String representation of <code>value</code>.
|
||||
* @return String representation of {@code value}.
|
||||
*/
|
||||
protected static String getConstantNameForValue(PDOMLinkage linkage, int value) {
|
||||
Class<? extends PDOMLinkage> c= linkage.getClass();
|
||||
|
@ -328,9 +328,7 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
|
|||
return field.getName();
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
continue;
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (IllegalAccessException | IllegalArgumentException e) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -402,8 +400,8 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
|
|||
}
|
||||
} while (cmp == 0 && b1 != null && b0 != null);
|
||||
return cmp;
|
||||
} catch (CoreException ce) {
|
||||
CCorePlugin.log(ce);
|
||||
} catch (CoreException e) {
|
||||
CCorePlugin.log(e);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public abstract class PDOMNamedNode extends PDOMNode {
|
|||
* The size in bytes of a PDOMNamedNode record in the database.
|
||||
*/
|
||||
@SuppressWarnings("hiding")
|
||||
protected static final int RECORD_SIZE = PDOMNode.RECORD_SIZE + 4;
|
||||
protected static final int RECORD_SIZE = PDOMNode.RECORD_SIZE + Database.PTR_SIZE;
|
||||
|
||||
private volatile char[] fName;
|
||||
|
||||
|
|
|
@ -27,10 +27,10 @@ import org.eclipse.core.runtime.CoreException;
|
|||
*/
|
||||
public abstract class PDOMNode implements IInternalPDOMNode {
|
||||
private static final int FACTORY_ID = 0;
|
||||
private static final int NODE_TYPE = 2;
|
||||
private static final int PARENT = 4;
|
||||
private static final int NODE_TYPE = FACTORY_ID + 2;
|
||||
private static final int PARENT = NODE_TYPE + 2;
|
||||
|
||||
protected static final int RECORD_SIZE = 8;
|
||||
protected static final int RECORD_SIZE = PARENT + Database.PTR_SIZE;
|
||||
|
||||
private final PDOMLinkage fLinkage;
|
||||
protected final long record;
|
||||
|
|
Loading…
Add table
Reference in a new issue