remove unnecessaary initializers from constructors

This commit is contained in:
zzz
2010-05-16 18:08:24 +00:00
parent d770d3c6da
commit 3bc2e469cc
44 changed files with 10 additions and 141 deletions

View File

@ -24,7 +24,6 @@ public class DataMessage extends I2NPMessageImpl {
public DataMessage(I2PAppContext context) {
super(context);
_data = null;
}
public byte[] getData() {

View File

@ -34,9 +34,7 @@ public class DatabaseSearchReplyMessage extends I2NPMessageImpl {
// do this in netdb if we need it
//_context.statManager().createRateStat("netDb.searchReplyMessageSend", "How many search reply messages we send", "NetworkDatabase", new long[] { 60*1000, 5*60*1000, 10*60*1000, 60*60*1000 });
//_context.statManager().createRateStat("netDb.searchReplyMessageReceive", "How many search reply messages we receive", "NetworkDatabase", new long[] { 60*1000, 5*60*1000, 10*60*1000, 60*60*1000 });
setSearchKey(null);
_peerHashes = new ArrayList(3);
setFromHash(null);
}
/**

View File

@ -43,12 +43,6 @@ public class DatabaseStoreMessage extends I2NPMessageImpl {
public DatabaseStoreMessage(I2PAppContext context) {
super(context);
setValueType(-1);
setKey(null);
setLeaseSet(null);
setRouterInfo(null);
setReplyToken(0);
setReplyTunnel(null);
setReplyGateway(null);
}
/**

View File

@ -51,14 +51,7 @@ public class DeliveryInstructions extends DataStructureImpl {
private final static long FLAG_DELAY = 16;
public DeliveryInstructions() {
setEncrypted(false);
setEncryptionKey(null);
setDeliveryMode(-1);
setDestination(null);
setRouter(null);
setTunnelId(null);
setDelayRequested(false);
setDelaySeconds(0);
}
public boolean getEncrypted() { return _encrypted; }

View File

@ -40,11 +40,7 @@ public class GarlicClove extends DataStructureImpl {
_context = context;
_log = context.logManager().getLog(GarlicClove.class);
_handler = new I2NPMessageHandler(context);
setInstructions(null);
setData(null);
setCloveId(-1);
setExpiration(null);
setCertificate(null);
}
public DeliveryInstructions getInstructions() { return _instructions; }

View File

@ -26,7 +26,6 @@ public class GarlicMessage extends I2NPMessageImpl {
public GarlicMessage(I2PAppContext context) {
super(context);
setData(null);
}
public byte[] getData() {

View File

@ -33,7 +33,6 @@ public class I2NPMessageHandler {
public I2NPMessageHandler(I2PAppContext context) {
_context = context;
_log = context.logManager().getLog(I2NPMessageHandler.class);
_messageBuffer = null;
_lastSize = -1;
}

View File

@ -54,8 +54,6 @@ public abstract class I2NPMessageImpl extends DataStructureImpl implements I2NPM
_log = context.logManager().getLog(I2NPMessageImpl.class);
_expiration = _context.clock().now() + DEFAULT_EXPIRATION_MS;
_uniqueId = _context.random().nextLong(MAX_ID_VALUE);
_written = false;
_read = false;
//_context.statManager().createRateStat("i2np.writeTime", "How long it takes to write an I2NP message", "I2NP", new long[] { 10*60*1000, 60*60*1000 });
//_context.statManager().createRateStat("i2np.readTime", "How long it takes to read an I2NP message", "I2NP", new long[] { 10*60*1000, 60*60*1000 });
}

View File

@ -24,8 +24,6 @@ public abstract class JobImpl implements Job {
_context = context;
_timing = new JobTiming(context);
_id = ++_idSrc;
_addedBy = null;
_madeReadyOn = 0;
}
public long getJobId() { return _id; }

View File

@ -15,11 +15,8 @@ class JobStats {
public JobStats(String name) {
_job = name;
_numRuns = 0;
_totalTime = 0;
_maxTime = -1;
_minTime = -1;
_totalPendingTime = 0;
_maxPendingTime = -1;
_minPendingTime = -1;
}

View File

@ -23,8 +23,6 @@ public class JobTiming implements Clock.ClockUpdateListener {
public JobTiming(RouterContext context) {
_context = context;
_start = context.clock().now();
_actualStart = 0;
_actualEnd = 0;
//context.clock().addUpdateListener(this);
}

View File

@ -66,18 +66,8 @@ public class OutNetMessage {
public OutNetMessage(RouterContext context) {
_context = context;
_log = context.logManager().getLog(OutNetMessage.class);
setTarget(null);
_message = null;
_messageSize = 0;
setPriority(-1);
setExpiration(-1);
setOnSendJob(null);
setOnFailedSendJob(null);
setOnReplyJob(null);
setOnFailedReplyJob(null);
setReplySelector(null);
_failedTransports = null;
_sendBegin = 0;
//_createdBy = new Exception("Created by");
_created = context.clock().now();
timestamp("Created");

View File

@ -60,12 +60,7 @@ public class TunnelPoolSettings {
_duration = DEFAULT_DURATION;
_length = DEFAULT_LENGTH;
_lengthVariance = DEFAULT_LENGTH_VARIANCE;
_lengthOverride = 0;
_allowZeroHop = DEFAULT_ALLOW_ZERO_HOP;
_isInbound = false;
_isExploratory = false;
_destination = null;
_destinationNickname = null;
_IPRestriction = DEFAULT_IP_RESTRICTION;
_unknownOptions = new Properties();
_randomKey = generateRandomKey();