summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2013-04-04 11:17:07 -0700
committerShawn Pearce <spearce@spearce.org>2013-04-04 11:18:41 -0700
commitd45277a6912e436590cec7373f982d7673306a42 (patch)
tree28d278b90d286882f3ced6f94066e4e063139b69 /org.eclipse.jgit
parent1d362e35bc5b13632b6a8e72fc02894604b5534c (diff)
downloadjgit-d45277a6912e436590cec7373f982d7673306a42.tar.gz
jgit-d45277a6912e436590cec7373f982d7673306a42.zip
Declare critical exposed methods of ObjectToPack final
There is no reasonable way for a subclass to correctly override and implement these methods. They depend on internal state that cannot otherwise be managed. Most of these methods are also in critical paths of PackWriter. Declare them final so subclasses do not try to replace them, and so the JIT knows the smaller ones can be safely inlined. Change-Id: I9026938e5833ac0b94246d21c69a143a9224626c
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java
index c7766b2c26..57346ab51a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/ObjectToPack.java
@@ -124,7 +124,7 @@ public class ObjectToPack extends PackedObjectInfo {
* representation; null otherwise - if going to be packed as a
* whole object.
*/
- public ObjectId getDeltaBaseId() {
+ public final ObjectId getDeltaBaseId() {
return deltaBase;
}
@@ -134,7 +134,7 @@ public class ObjectToPack extends PackedObjectInfo {
* pack; null otherwise - if going to be packed as a whole
* object or delta base is specified only as id.
*/
- public ObjectToPack getDeltaBase() {
+ public final ObjectToPack getDeltaBase() {
if (deltaBase instanceof ObjectToPack)
return (ObjectToPack) deltaBase;
return null;
@@ -179,7 +179,7 @@ public class ObjectToPack extends PackedObjectInfo {
* @return true if object is going to be written as delta; false
* otherwise.
*/
- public boolean isDeltaRepresentation() {
+ public final boolean isDeltaRepresentation() {
return deltaBase != null;
}
@@ -189,12 +189,12 @@ public class ObjectToPack extends PackedObjectInfo {
*
* @return true if object is already written; false otherwise.
*/
- public boolean isWritten() {
+ public final boolean isWritten() {
return getOffset() != 0;
}
/** @return the type of this object. */
- public int getType() {
+ public final int getType() {
return (flags >> TYPE_SHIFT) & 0x7;
}
@@ -218,7 +218,7 @@ public class ObjectToPack extends PackedObjectInfo {
* @return true if an existing representation was selected to be reused
* as-is into the pack stream.
*/
- public boolean isReuseAsIs() {
+ public final boolean isReuseAsIs() {
return (flags & REUSE_AS_IS) != 0;
}
@@ -266,7 +266,7 @@ public class ObjectToPack extends PackedObjectInfo {
}
/** @return the extended flags on this object, in the range [0x0, 0xf]. */
- protected int getExtendedFlags() {
+ protected final int getExtendedFlags() {
return (flags >>> EXT_SHIFT) & EXT_MASK;
}
@@ -280,7 +280,7 @@ public class ObjectToPack extends PackedObjectInfo {
* the flag mask to test, must be between 0x0 and 0xf.
* @return true if any of the bits matching the mask are non-zero.
*/
- protected boolean isExtendedFlag(int flag) {
+ protected final boolean isExtendedFlag(int flag) {
return (flags & (flag << EXT_SHIFT)) != 0;
}
@@ -293,7 +293,7 @@ public class ObjectToPack extends PackedObjectInfo {
* @param flag
* the bits to set, must be between 0x0 and 0xf.
*/
- protected void setExtendedFlag(int flag) {
+ protected final void setExtendedFlag(int flag) {
flags |= (flag & EXT_MASK) << EXT_SHIFT;
}
@@ -306,7 +306,7 @@ public class ObjectToPack extends PackedObjectInfo {
* @param flag
* the bits to clear, must be between 0x0 and 0xf.
*/
- protected void clearExtendedFlag(int flag) {
+ protected final void clearExtendedFlag(int flag) {
flags &= ~((flag & EXT_MASK) << EXT_SHIFT);
}
@@ -320,7 +320,7 @@ public class ObjectToPack extends PackedObjectInfo {
* additional flag bits to store in the flags field. Due to space
* constraints only values [0x0, 0xf] are permitted.
*/
- protected void setExtendedFlags(int extFlags) {
+ protected final void setExtendedFlags(int extFlags) {
flags = ((extFlags & EXT_MASK) << EXT_SHIFT) | (flags & NON_EXT_MASK);
}