DMT.java

Index Score
freenet.io.comm
Freenet

View: Reasons, Metrics, Source Code

These are the metrics that contribute to the Enerjy Score for this file, ranked by impact. So the metrics listed at the top influence the score to a greater extent that the metrics listed at the bottom.

MetricDescription
PARAMSNumber of formal parameter declarations
LOGICAL_LINESNumber of statements
JAVA0116JAVA0116 Missing javadoc: field 'field'
INTERFACE_COMPLEXITYInterface complexity
PROGRAM_LENGTHHalstead program length
OPERATORSNumber of operators
OPERANDSNumber of operands
ELOCEffective lines of code
UNIQUE_OPERANDSNumber of unique operands
JAVA0117JAVA0117 Missing javadoc: method 'method'
SIZESize of the file in bytes
LOCLines of code
PROGRAM_VOCABHalstead program vocabulary
FUNCTIONSNumber of function declarations
BLOCKSNumber of blocks
LINESNumber of lines in the source file
RETURNSNumber of return points from functions
JAVA0068JAVA0068 Modifiers not declared in recommended order
JAVA0064JAVA0064 N variations of identifier name (maximum: M)
LINE_COMMENTNumber of line comments
WHITESPACENumber of whitespace lines
JAVA0144JAVA0144 Line exceeds maximum M characters
CYCLOMATICCyclomatic complexity
DECL_COMMENTSComments in declarations
JAVA0145JAVA0145 Tab character used in source file
JAVA0138JAVA0138 N parameters defined for method (maximum: M)
PROGRAM_VOLUMEHalstead program volume
JAVA0136JAVA0136 N methods defined in class (maximum: M)
JAVA0035JAVA0035 Missing braces in for statement
JAVA0126JAVA0126 Method declares unchecked exception in throws
JAVA0110JAVA0110 Incorrect javadoc: no @return tag
COMPARISONSNumber of comparison operators
LOOPSNumber of loops
JAVA0108JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
DOC_COMMENTNumber of javadoc comment lines
/* * Dijjer - A Peer to Peer HTTP Cache * Copyright (C) 2004,2005 Change.Tv, Inc * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package freenet.io.comm; import java.util.LinkedList; import freenet.crypt.DSAPublicKey; import freenet.keys.Key; import freenet.keys.NodeCHK; import freenet.keys.NodeSSK; import freenet.support.BitArray; import freenet.support.Buffer; import freenet.support.Fields; import freenet.support.ShortBuffer; /** * @author ian * * To change the template for this generated type comment go to * Window - Preferences - Java - Code Generation - Code and Comments */ public class DMT { public static final String UID = "uid"; public static final String SEND_TIME = "sendTime"; public static final String EXTERNAL_ADDRESS = "externalAddress"; public static final String BUILD = "build"; public static final String FIRST_GOOD_BUILD = "firstGoodBuild"; public static final String JOINER = "joiner"; public static final String REASON = "reason"; public static final String DESCRIPTION = "description"; public static final String TTL = "ttl"; public static final String PEERS = "peers"; public static final String URL = "url"; public static final String FORWARDERS = "forwarders"; public static final String FILE_LENGTH = "fileLength"; public static final String LAST_MODIFIED = "lastModified"; public static final String CHUNK_NO = "chunkNo"; public static final String DATA_SOURCE = "dataSource"; public static final String CACHED = "cached"; public static final String PACKET_NO = "packetNo"; public static final String DATA = "data"; public static final String IS_HASH = "isHash"; public static final String HASH = "hash"; public static final String SENT = "sent"; public static final String MISSING = "missing"; public static final String KEY = "key"; public static final String CHK_HEADER = "chkHeader"; public static final String FREENET_URI = "freenetURI"; public static final String FREENET_ROUTING_KEY = "freenetRoutingKey"; public static final String TEST_CHK_HEADERS = "testCHKHeaders"; public static final String HTL = "hopsToLive"; public static final String SUCCESS = "success"; public static final String FNP_SOURCE_PEERNODE = "sourcePeerNode"; public static final String PING_SEQNO = "pingSequenceNumber"; public static final String LOCATION = "location"; public static final String NEAREST_LOCATION = "nearestLocation"; public static final String BEST_LOCATION = "bestLocation"; public static final String TARGET_LOCATION = "targetLocation"; public static final String TYPE = "type"; public static final String PAYLOAD = "payload"; public static final String COUNTER = "counter"; public static final String UNIQUE_COUNTER = "uniqueCounter"; public static final String LINEAR_COUNTER = "linearCounter"; public static final String RETURN_LOCATION = "returnLocation"; public static final String BLOCK_HEADERS = "blockHeaders"; public static final String DATA_INSERT_REJECTED_REASON = "dataInsertRejectedReason"; public static final String STREAM_SEQNO = "streamSequenceNumber"; public static final String IS_LOCAL = "isLocal"; public static final String ANY_TIMED_OUT = "anyTimedOut"; public static final String PUBKEY_HASH = "pubkeyHash"; public static final String NEED_PUB_KEY = "needPubKey"; public static final String PUBKEY_AS_BYTES = "pubkeyAsBytes"; public static final String SOURCE_NODENAME = "sourceNodename"; public static final String TARGET_NODENAME = "targetNodename"; public static final String NODE_TO_NODE_MESSAGE_TYPE = "nodeToNodeMessageType"; public static final String NODE_TO_NODE_MESSAGE_TEXT = "nodeToNodeMessageText"; public static final String NODE_TO_NODE_MESSAGE_DATA = "nodeToNodeMessageData"; public static final String NODE_UIDS = "nodeUIDs"; public static final String MY_UID = "myUID"; public static final String PEER_LOCATIONS = "peerLocations"; public static final String PEER_UIDS = "peerUIDs"; public static final String BEST_LOCATIONS_NOT_VISITED = "bestLocationsNotVisited"; public static final String MAIN_JAR_KEY = "mainJarKey"; public static final String EXTRA_JAR_KEY = "extraJarKey"; public static final String REVOCATION_KEY = "revocationKey"; public static final String HAVE_REVOCATION_KEY = "haveRevocationKey"; public static final String MAIN_JAR_VERSION = "mainJarVersion"; public static final String EXTRA_JAR_VERSION = "extJarVersion"; public static final String REVOCATION_KEY_TIME_LAST_TRIED = "revocationKeyTimeLastTried"; public static final String REVOCATION_KEY_DNF_COUNT = "revocationKeyDNFCount"; public static final String REVOCATION_KEY_FILE_LENGTH = "revocationKeyFileLength"; public static final String MAIN_JAR_FILE_LENGTH = "mainJarFileLength"; public static final String EXTRA_JAR_FILE_LENGTH = "extraJarFileLength"; public static final String PING_TIME = "pingTime"; public static final String BWLIMIT_DELAY_TIME = "bwlimitDelayTime"; public static final String TIME = "time"; public static final String FORK_COUNT = "forkCount"; public static final String TIME_LEFT = "timeLeft"; public static final String PREV_UID = "prevUID"; public static final String OPENNET_NODEREF = "opennetNoderef"; public static final String REMOVE = "remove"; public static final String PURGE = "purge"; public static final String TRANSFER_UID = "transferUID"; public static final String NODEREF_LENGTH = "noderefLength"; public static final String PADDED_LENGTH = "paddedLength"; public static final String TIME_DELTAS = "timeDeltas"; public static final String HASHES = "hashes"; public static final String REJECT_CODE = "rejectCode"; public static final String ROUTING_ENABLED = "routingEnabled"; public static final String OFFER_AUTHENTICATOR = "offerAuthenticator"; public static final String DAWN_HTL = "dawnHtl"; public static final String SECRET = "secret"; public static final String NODE_IDENTITY = "nodeIdentity"; public static final String UPTIME_PERCENT_48H = "uptimePercent48H"; /** Very urgent */ public static final short PRIORITY_NOW=-2; /** Short timeout, or urgent for other reasons - Accepted, RejectedLoop etc. */ public static final short PRIORITY_HIGH=-1; // /** Unspecified e.g. test-only messages. */ public static final short PRIORITY_UNSPECIFIED=0; /** Long timeout (e.g. DataFound), or moderately urgent. */ public static final short PRIORITY_LOW=1; // long timeout, or moderately urgent /** * Bulk data transfer, bottom of the heap, high level limiting must ensure there is time to send it by * not accepting an infeasible number of requests; starvation will cause bwlimitDelayTime to go high and * requests to be rejected. That's the ultimate limiter if even output bandwidth liability fails. */ public static final short PRIORITY_BULK_DATA=2; // Assimilation // New data transmission messages public static final MessageType packetTransmit = new MessageType("packetTransmit", PRIORITY_BULK_DATA) {{ addField(UID, Long.class); addField(PACKET_NO, Integer.class); addField(SENT, BitArray.class); addField(DATA, Buffer.class); }}; public static final Message createPacketTransmit(long uid, int packetNo, BitArray sent, Buffer data) { Message msg = new Message(packetTransmit); msg.set(UID, uid); msg.set(PACKET_NO, packetNo); msg.set(SENT, sent); msg.set(DATA, data); return msg; } public static int packetTransmitSize(int size, int _packets) { return size + 8 /* uid */ + 4 /* packet# */ + BitArray.serializedLength(_packets) + 4 /* Message header */; } public static int bulkPacketTransmitSize(int size) { return size + 8 /* uid */ + 4 /* packet# */ + 4 /* Message header */; } //This is of priority BULK_DATA to cut down on suprious resend requests, it will be queued after the packets it represents public static final MessageType allSent = new MessageType("allSent", PRIORITY_BULK_DATA) {{ addField(UID, Long.class); }}; public static final Message createAllSent(long uid) { Message msg = new Message(allSent); msg.set(UID, uid); return msg; } public static final MessageType missingPacketNotification = new MessageType("missingPacketNotification", PRIORITY_LOW) {{ addField(UID, Long.class); addLinkedListField(MISSING, Integer.class); }}; public static final Message createMissingPacketNotification(long uid, LinkedList missing) { Message msg = new Message(missingPacketNotification); msg.set(UID, uid); msg.set(MISSING, missing); return msg; } public static final MessageType allReceived = new MessageType("allReceived", PRIORITY_LOW) {{ addField(UID, Long.class); }}; public static final Message createAllReceived(long uid) { Message msg = new Message(allReceived); msg.set(UID, uid); return msg; } public static final MessageType sendAborted = new MessageType("sendAborted", PRIORITY_LOW) {{ addField(UID, Long.class); addField(DESCRIPTION, String.class); addField(REASON, Integer.class); }}; public static final Message createSendAborted(long uid, int reason, String description) { Message msg = new Message(sendAborted); msg.set(UID, uid); msg.set(REASON, reason); msg.set(DESCRIPTION, description); return msg; } public static final MessageType FNPBulkPacketSend = new MessageType("FNPBulkPacketSend", PRIORITY_BULK_DATA) {{ addField(UID, Long.class); addField(PACKET_NO, Integer.class); addField(DATA, ShortBuffer.class); }}; public static final Message createFNPBulkPacketSend(long uid, int packetNo, ShortBuffer data) { Message msg = new Message(FNPBulkPacketSend); msg.set(UID, uid); msg.set(PACKET_NO, packetNo); msg.set(DATA, data); return msg; } public static final Message createFNPBulkPacketSend(long uid, int packetNo, byte[] data) { return createFNPBulkPacketSend(uid, packetNo, new ShortBuffer(data)); } public static final MessageType FNPBulkSendAborted = new MessageType("FNPBulkSendAborted", PRIORITY_LOW) {{ addField(UID, Long.class); }}; public static final Message createFNPBulkSendAborted(long uid) { Message msg = new Message(FNPBulkSendAborted); msg.set(UID, uid); return msg; } public static final MessageType FNPBulkReceiveAborted = new MessageType("FNPBulkReceiveAborted", PRIORITY_LOW) {{ addField(UID, Long.class); }}; public static final Message createFNPBulkReceiveAborted(long uid) { Message msg = new Message(FNPBulkReceiveAborted); msg.set(UID, uid); return msg; } public static final MessageType FNPBulkReceivedAll = new MessageType("FNPBulkReceivedAll", PRIORITY_LOW) {{ addField(UID, Long.class); }}; public static final Message createFNPBulkReceivedAll(long uid) { Message msg = new Message(FNPBulkReceivedAll); msg.set(UID, uid); return msg; } public static final MessageType testTransferSend = new MessageType("testTransferSend", PRIORITY_UNSPECIFIED) {{ addField(UID, Long.class); }}; public static final Message createTestTransferSend(long uid) { Message msg = new Message(testTransferSend); msg.set(UID, uid); return msg; } public static final MessageType testTransferSendAck = new MessageType("testTransferSendAck", PRIORITY_UNSPECIFIED) {{ addField(UID, Long.class); }}; public static final Message createTestTransferSendAck(long uid) { Message msg = new Message(testTransferSendAck); msg.set(UID, uid); return msg; } public static final MessageType testSendCHK = new MessageType("testSendCHK", PRIORITY_UNSPECIFIED) {{ addField(UID, Long.class); addField(FREENET_URI, String.class); addField(CHK_HEADER, Buffer.class); }}; public static final Message createTestSendCHK(long uid, String uri, Buffer header) { Message msg = new Message(testSendCHK); msg.set(UID, uid); msg.set(FREENET_URI, uri); msg.set(CHK_HEADER, header); return msg; } public static final MessageType testRequest = new MessageType("testRequest", PRIORITY_UNSPECIFIED) {{ addField(UID, Long.class); addField(FREENET_ROUTING_KEY, Key.class); addField(HTL, Integer.class); }}; public static final Message createTestRequest(Key Key, long id, int htl) { Message msg = new Message(testRequest); msg.set(UID, id); msg.set(FREENET_ROUTING_KEY, Key); msg.set(HTL, htl); return msg; } public static final MessageType testDataNotFound = new MessageType("testDataNotFound", PRIORITY_UNSPECIFIED) {{ addField(UID, Long.class); }}; public static final Message createTestDataNotFound(long uid) { Message msg = new Message(testDataNotFound); msg.set(UID, uid); return msg; } public static final MessageType testDataReply = new MessageType("testDataReply", PRIORITY_UNSPECIFIED) {{ addField(UID, Long.class); addField(TEST_CHK_HEADERS, Buffer.class); }}; public static final Message createTestDataReply(long uid, byte[] headers) { Message msg = new Message(testDataReply); msg.set(UID, uid); msg.set(TEST_CHK_HEADERS, new Buffer(headers)); return msg; } public static final MessageType testSendCHKAck = new MessageType("testSendCHKAck", PRIORITY_UNSPECIFIED) {{ addField(UID, Long.class); addField(FREENET_URI, String.class); }}; public static final Message createTestSendCHKAck(long uid, String key) { Message msg = new Message(testSendCHKAck); msg.set(UID, uid); msg.set(FREENET_URI, key); return msg; } public static final MessageType testDataReplyAck = new MessageType("testDataReplyAck", PRIORITY_UNSPECIFIED) {{ addField(UID, Long.class); }}; public static final Message createTestDataReplyAck(long id) { Message msg = new Message(testDataReplyAck); msg.set(UID, id); return msg; } public static final MessageType testDataNotFoundAck = new MessageType("testDataNotFoundAck", PRIORITY_UNSPECIFIED) {{ addField(UID, Long.class); }}; public static final Message createTestDataNotFoundAck(long id) { Message msg = new Message(testDataNotFoundAck); msg.set(UID, id); return msg; } // Internal only messages public static final MessageType testReceiveCompleted = new MessageType("testReceiveCompleted", PRIORITY_UNSPECIFIED, true) {{ addField(UID, Long.class); addField(SUCCESS, Boolean.class); addField(REASON, String.class); }}; public static final Message createTestReceiveCompleted(long id, boolean success, String reason) { Message msg = new Message(testReceiveCompleted); msg.set(UID, id); msg.set(SUCCESS, success); msg.set(REASON, reason); return msg; } public static final MessageType testSendCompleted = new MessageType("testSendCompleted", PRIORITY_UNSPECIFIED, true) {{ addField(UID, Long.class); addField(SUCCESS, Boolean.class); addField(REASON, String.class); }}; public static final Message createTestSendCompleted(long id, boolean success, String reason) { Message msg = new Message(testSendCompleted); msg.set(UID, id); msg.set(SUCCESS, success); msg.set(REASON, reason); return msg; } // Node-To-Node Message (generic) public static final MessageType nodeToNodeMessage = new MessageType("nodeToNodeMessage", PRIORITY_LOW, false) {{ addField(NODE_TO_NODE_MESSAGE_TYPE, Integer.class); addField(NODE_TO_NODE_MESSAGE_DATA, ShortBuffer.class); }}; public static final Message createNodeToNodeMessage(int type, byte[] data) { Message msg = new Message(nodeToNodeMessage); msg.set(NODE_TO_NODE_MESSAGE_TYPE, type); msg.set(NODE_TO_NODE_MESSAGE_DATA, new ShortBuffer(data)); return msg; } // FNP messages public static final MessageType FNPCHKDataRequest = new MessageType("FNPCHKDataRequest", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(HTL, Short.class); addField(NEAREST_LOCATION, Double.class); addField(FREENET_ROUTING_KEY, NodeCHK.class); }}; public static final Message createFNPCHKDataRequest(long id, short htl, NodeCHK key) { Message msg = new Message(FNPCHKDataRequest); msg.set(UID, id); msg.set(HTL, htl); msg.set(FREENET_ROUTING_KEY, key); msg.set(NEAREST_LOCATION, 0.0); return msg; } public static final MessageType FNPSSKDataRequest = new MessageType("FNPSSKDataRequest", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(HTL, Short.class); addField(NEAREST_LOCATION, Double.class); addField(FREENET_ROUTING_KEY, NodeSSK.class); addField(NEED_PUB_KEY, Boolean.class); }}; public static final Message createFNPSSKDataRequest(long id, short htl, NodeSSK key, boolean needPubKey) { Message msg = new Message(FNPSSKDataRequest); msg.set(UID, id); msg.set(HTL, htl); msg.set(FREENET_ROUTING_KEY, key); msg.set(NEAREST_LOCATION, 0.0); msg.set(NEED_PUB_KEY, needPubKey); return msg; } // Hit our tail, try a different node. public static final MessageType FNPRejectedLoop = new MessageType("FNPRejectLoop", PRIORITY_HIGH) {{ addField(UID, Long.class); }}; public static final Message createFNPRejectedLoop(long id) { Message msg = new Message(FNPRejectedLoop); msg.set(UID, id); return msg; } // Too many requests for present capacity. Fail, propagate back // to source, and reduce send rate. public static final MessageType FNPRejectedOverload = new MessageType("FNPRejectOverload", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(IS_LOCAL, Boolean.class); }}; public static final Message createFNPRejectedOverload(long id, boolean isLocal) { Message msg = new Message(FNPRejectedOverload); msg.set(UID, id); msg.set(IS_LOCAL, isLocal); return msg; } public static final MessageType FNPAccepted = new MessageType("FNPAccepted", PRIORITY_HIGH) {{ addField(UID, Long.class); }}; public static final Message createFNPAccepted(long id) { Message msg = new Message(FNPAccepted); msg.set(UID, id); return msg; } public static final MessageType FNPDataNotFound = new MessageType("FNPDataNotFound", PRIORITY_LOW) {{ addField(UID, Long.class); }}; public static final Message createFNPDataNotFound(long id) { Message msg = new Message(FNPDataNotFound); msg.set(UID, id); return msg; } public static final MessageType FNPRecentlyFailed = new MessageType("FNPRecentlyFailed", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(TIME_LEFT, Integer.class); }}; public static final Message createFNPRecentlyFailed(long id, int timeLeft) { Message msg = new Message(FNPRecentlyFailed); msg.set(UID, id); msg.set(TIME_LEFT, timeLeft); return msg; } public static final MessageType FNPCHKDataFound = new MessageType("FNPCHKDataFound", PRIORITY_LOW) {{ addField(UID, Long.class); addField(BLOCK_HEADERS, ShortBuffer.class); }}; public static final Message createFNPCHKDataFound(long id, byte[] buf) { Message msg = new Message(FNPCHKDataFound); msg.set(UID, id); msg.set(BLOCK_HEADERS, new ShortBuffer(buf)); return msg; } public static final MessageType FNPRouteNotFound = new MessageType("FNPRouteNotFound", PRIORITY_LOW) {{ addField(UID, Long.class); addField(HTL, Short.class); }}; public static final Message createFNPRouteNotFound(long id, short htl) { Message msg = new Message(FNPRouteNotFound); msg.set(UID, id); msg.set(HTL, htl); return msg; } public static final MessageType FNPInsertRequest = new MessageType("FNPInsertRequest", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(HTL, Short.class); addField(NEAREST_LOCATION, Double.class); addField(FREENET_ROUTING_KEY, Key.class); }}; public static final Message createFNPInsertRequest(long id, short htl, Key key) { Message msg = new Message(FNPInsertRequest); msg.set(UID, id); msg.set(HTL, htl); msg.set(FREENET_ROUTING_KEY, key); msg.set(NEAREST_LOCATION, 0.0); return msg; } public static final MessageType FNPInsertReply = new MessageType("FNPInsertReply", PRIORITY_LOW) {{ addField(UID, Long.class); }}; public static final Message createFNPInsertReply(long id) { Message msg = new Message(FNPInsertReply); msg.set(UID, id); return msg; } public static final MessageType FNPDataInsert = new MessageType("FNPDataInsert", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(BLOCK_HEADERS, ShortBuffer.class); }}; public static final Message createFNPDataInsert(long uid, byte[] headers) { Message msg = new Message(FNPDataInsert); msg.set(UID, uid); msg.set(BLOCK_HEADERS, new ShortBuffer(headers)); return msg; } public static final MessageType FNPInsertTransfersCompleted = new MessageType("FNPInsertTransfersCompleted", PRIORITY_LOW) {{ addField(UID, Long.class); addField(ANY_TIMED_OUT, Boolean.class); }}; public static final Message createFNPInsertTransfersCompleted(long uid, boolean anyTimedOut) { Message msg = new Message(FNPInsertTransfersCompleted); msg.set(UID, uid); msg.set(ANY_TIMED_OUT, anyTimedOut); return msg; } public static final MessageType FNPRejectedTimeout = new MessageType("FNPTooSlow", PRIORITY_LOW) {{ addField(UID, Long.class); }}; public static final Message createFNPRejectedTimeout(long uid) { Message msg = new Message(FNPRejectedTimeout); msg.set(UID, uid); return msg; } public static final MessageType FNPDataInsertRejected = new MessageType("FNPDataInsertRejected", PRIORITY_LOW) {{ addField(UID, Long.class); addField(DATA_INSERT_REJECTED_REASON, Short.class); }}; public static final Message createFNPDataInsertRejected(long uid, short reason) { Message msg = new Message(FNPDataInsertRejected); msg.set(UID, uid); msg.set(DATA_INSERT_REJECTED_REASON, reason); return msg; } public static final short DATA_INSERT_REJECTED_VERIFY_FAILED = 1; public static final short DATA_INSERT_REJECTED_RECEIVE_FAILED = 2; public static final short DATA_INSERT_REJECTED_SSK_ERROR = 3; public static final String getDataInsertRejectedReason(short reason) { if(reason == DATA_INSERT_REJECTED_VERIFY_FAILED) return "Verify failed"; else if(reason == DATA_INSERT_REJECTED_RECEIVE_FAILED) return "Receive failed"; else if(reason == DATA_INSERT_REJECTED_SSK_ERROR) return "SSK error"; return "Unknown reason code: "+reason; } public static final MessageType FNPSSKInsertRequest = new MessageType("FNPSSKInsertRequest", PRIORITY_BULK_DATA) {{ addField(UID, Long.class); addField(HTL, Short.class); addField(FREENET_ROUTING_KEY, NodeSSK.class); addField(NEAREST_LOCATION, Double.class); addField(BLOCK_HEADERS, ShortBuffer.class); addField(PUBKEY_HASH, ShortBuffer.class); addField(DATA, ShortBuffer.class); }}; public static Message createFNPSSKInsertRequest(long uid, short htl, NodeSSK myKey, byte[] headers, byte[] data, byte[] pubKeyHash) { Message msg = new Message(FNPSSKInsertRequest); msg.set(UID, uid); msg.set(HTL, htl); msg.set(FREENET_ROUTING_KEY, myKey); msg.set(NEAREST_LOCATION, 0.0); msg.set(BLOCK_HEADERS, new ShortBuffer(headers)); msg.set(PUBKEY_HASH, new ShortBuffer(pubKeyHash)); msg.set(DATA, new ShortBuffer(data)); return msg; } public static final MessageType FNPSSKInsertRequestNew = new MessageType("FNPSSKInsertRequestNew", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(HTL, Short.class); addField(FREENET_ROUTING_KEY, NodeSSK.class); }}; public static Message createFNPSSKInsertRequestNew(long uid, short htl, NodeSSK myKey) { Message msg = new Message(FNPSSKInsertRequestNew); msg.set(UID, uid); msg.set(HTL, htl); msg.set(FREENET_ROUTING_KEY, myKey); return msg; } public static final MessageType FNPSSKInsertRequestHeaders = new MessageType("FNPSSKInsertRequestHeaders", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(BLOCK_HEADERS, ShortBuffer.class); }}; public static final Message createFNPSSKInsertRequestHeaders(long uid, byte[] headers) { Message msg = new Message(FNPSSKInsertRequestHeaders); msg.set(UID, uid); msg.set(BLOCK_HEADERS, new ShortBuffer(headers)); return msg; } public static final MessageType FNPSSKInsertRequestData = new MessageType("FNPSSKInsertRequestData", PRIORITY_BULK_DATA) {{ addField(UID, Long.class); addField(DATA, ShortBuffer.class); }}; public static final Message createFNPSSKInsertRequestData(long uid, byte[] data) { Message msg = new Message(FNPSSKInsertRequestData); msg.set(UID, uid); msg.set(DATA, new ShortBuffer(data)); return msg; } public static final MessageType FNPSSKDataFound = new MessageType("FNPSSKDataFound", PRIORITY_LOW) {{ addField(UID, Long.class); addField(BLOCK_HEADERS, ShortBuffer.class); addField(DATA, ShortBuffer.class); }}; public static Message createFNPSSKDataFound(long uid, byte[] headers, byte[] data) { Message msg = new Message(FNPSSKDataFound); msg.set(UID, uid); msg.set(BLOCK_HEADERS, new ShortBuffer(headers)); msg.set(DATA, new ShortBuffer(data)); return msg; } public static final MessageType FNPSSKDataFoundHeaders = new MessageType("FNPSSKDataFoundHeaders", PRIORITY_LOW) {{ addField(UID, Long.class); addField(BLOCK_HEADERS, ShortBuffer.class); }}; public static Message createFNPSSKDataFoundHeaders(long uid, byte[] headers) { Message msg = new Message(FNPSSKDataFoundHeaders); msg.set(UID, uid); msg.set(BLOCK_HEADERS, new ShortBuffer(headers)); return msg; } public static final MessageType FNPSSKDataFoundData = new MessageType("FNPSSKDataFoundData", PRIORITY_BULK_DATA) {{ addField(UID, Long.class); addField(DATA, ShortBuffer.class); }}; public static Message createFNPSSKDataFoundData(long uid, byte[] data) { Message msg = new Message(FNPSSKDataFoundData); msg.set(UID, uid); msg.set(DATA, new ShortBuffer(data)); return msg; } public final static MessageType FNPSSKAccepted = new MessageType("FNPSSKAccepted", PRIORITY_HIGH) { { addField(UID, Long.class); addField(NEED_PUB_KEY, Boolean.class); }}; public static final Message createFNPSSKAccepted(long uid, boolean needPubKey) { Message msg = new Message(FNPSSKAccepted); msg.set(UID, uid); msg.set(NEED_PUB_KEY, needPubKey); return msg; } public final static MessageType FNPSSKPubKey = new MessageType("FNPSSKPubKey", PRIORITY_BULK_DATA) { { addField(UID, Long.class); addField(PUBKEY_AS_BYTES, ShortBuffer.class); }}; public static Message createFNPSSKPubKey(long uid, DSAPublicKey pubkey) { Message msg = new Message(FNPSSKPubKey); msg.set(UID, uid); msg.set(PUBKEY_AS_BYTES, new ShortBuffer(pubkey.asPaddedBytes())); return msg; } public final static MessageType FNPSSKPubKeyAccepted = new MessageType("FNPSSKPubKeyAccepted", PRIORITY_HIGH) { { addField(UID, Long.class); }}; public static Message createFNPSSKPubKeyAccepted(long uid) { Message msg = new Message(FNPSSKPubKeyAccepted); msg.set(UID, uid); return msg; } // Opennet completions (not sent to darknet nodes) /** Sent when a request to an opennet node is completed, but the data source does not want to * path fold. Sent even on pure darknet. A better name might be FNPRequestCompletedAck. */ public final static MessageType FNPOpennetCompletedAck = new MessageType("FNPOpennetCompletedAck", PRIORITY_LOW) { { addField(UID, Long.class); }}; public static Message createFNPOpennetCompletedAck(long uid) { Message msg = new Message(FNPOpennetCompletedAck); msg.set(UID, uid); return msg; } /** Sent when a request completes and the data source wants to path fold. Starts a bulk data * transfer including the (padded) noderef. */ public final static MessageType FNPOpennetConnectDestinationNew = new MessageType("FNPConnectDestinationNew", PRIORITY_UNSPECIFIED) { { addField(UID, Long.class); // UID of original message chain addField(TRANSFER_UID, Long.class); // UID of data transfer addField(NODEREF_LENGTH, Integer.class); // Size of noderef addField(PADDED_LENGTH, Integer.class); // Size of actual transfer i.e. padded length }}; public static Message createFNPOpennetConnectDestinationNew(long uid, long transferUID, int noderefLength, int paddedLength) { Message msg = new Message(FNPOpennetConnectDestinationNew); msg.set(UID, uid); msg.set(TRANSFER_UID, transferUID); msg.set(NODEREF_LENGTH, noderefLength); msg.set(PADDED_LENGTH, paddedLength); return msg; } /** Path folding response. Sent when the requestor wants to path fold and has received a noderef * from the data source. Starts a bulk data transfer including the (padded) noderef. */ public final static MessageType FNPOpennetConnectReplyNew = new MessageType("FNPConnectReplyNew", PRIORITY_UNSPECIFIED) { { addField(UID, Long.class); // UID of original message chain addField(TRANSFER_UID, Long.class); // UID of data transfer addField(NODEREF_LENGTH, Integer.class); // Size of noderef addField(PADDED_LENGTH, Integer.class); // Size of actual transfer i.e. padded length }}; public static Message createFNPOpennetConnectReplyNew(long uid, long transferUID, int noderefLength, int paddedLength) { Message msg = new Message(FNPOpennetConnectReplyNew); msg.set(UID, uid); msg.set(TRANSFER_UID, transferUID); msg.set(NODEREF_LENGTH, noderefLength); msg.set(PADDED_LENGTH, paddedLength); return msg; } // Opennet announcement /** * Announcement request. Noderef is attached, will be transferred before anything else is done. */ public final static MessageType FNPOpennetAnnounceRequest = new MessageType("FNPOpennetAnnounceRequest", PRIORITY_HIGH) { { addField(UID, Long.class); addField(TRANSFER_UID, Long.class); addField(NODEREF_LENGTH, Integer.class); addField(PADDED_LENGTH, Integer.class); addField(HTL, Short.class); addField(NEAREST_LOCATION, Double.class); addField(TARGET_LOCATION, Double.class); }}; public static Message createFNPOpennetAnnounceRequest(long uid, long transferUID, int noderefLength, int paddedLength, double target, short htl) { Message msg = new Message(FNPOpennetAnnounceRequest); msg.set(UID, uid); msg.set(TRANSFER_UID, transferUID); msg.set(NODEREF_LENGTH, noderefLength); msg.set(PADDED_LENGTH, paddedLength); msg.set(HTL, htl); msg.set(NEAREST_LOCATION, 0.0); msg.set(TARGET_LOCATION, target); return msg; } /** * Announcement reply. Noderef is attached, will be transferred, both nodes add the other. A single * request will result in many reply's. When the announcement is done, we return a DataNotFound; if * we run into a dead-end, we return a RejectedLoop; if we can't accept it, RejectedOverload. */ public final static MessageType FNPOpennetAnnounceReply = new MessageType("FNPOpennetAnnounceReply", PRIORITY_LOW) { { addField(UID, Long.class); addField(TRANSFER_UID, Long.class); addField(NODEREF_LENGTH, Integer.class); addField(PADDED_LENGTH, Integer.class); }}; public static Message createFNPOpennetAnnounceReply(long uid, long transferUID, int noderefLength, int paddedLength) { Message msg = new Message(FNPOpennetAnnounceReply); msg.set(UID, uid); msg.set(TRANSFER_UID, transferUID); msg.set(NODEREF_LENGTH, noderefLength); msg.set(PADDED_LENGTH, paddedLength); return msg; } public final static MessageType FNPOpennetAnnounceCompleted = new MessageType("FNPOpennetAnnounceCompleted", PRIORITY_LOW) { { addField(UID, Long.class); }}; public static Message createFNPOpennetAnnounceCompleted(long uid) { Message msg = new Message(FNPOpennetAnnounceCompleted); msg.set(UID, uid); return msg; } public final static MessageType FNPOpennetDisabled = new MessageType("FNPOpennetDisabled", PRIORITY_HIGH) { { addField(UID, Long.class); }}; public static Message createFNPOpennetDisabled(long uid) { Message msg = new Message(FNPOpennetDisabled); msg.set(UID, uid); return msg; } public final static MessageType FNPOpennetNoderefRejected = new MessageType("FNPOpennetNoderefRejected", PRIORITY_HIGH) { { addField(UID, Long.class); addField(REJECT_CODE, Integer.class); }}; public static Message createFNPOpennetNoderefRejected(long uid, int rejectCode) { Message msg = new Message(FNPOpennetNoderefRejected); msg.set(UID, uid); msg.set(REJECT_CODE, rejectCode); return msg; } public static String getOpennetRejectedCode(int x) { switch(x) { case NODEREF_REJECTED_TOO_BIG: return "Too big"; case NODEREF_REJECTED_REAL_BIGGER_THAN_PADDED: return "Real length bigger than padded length"; case NODEREF_REJECTED_TRANSFER_FAILED: return "Transfer failed"; case NODEREF_REJECTED_INVALID: return "Invalid noderef"; default: return "Unknown rejection code "+x; } } public static final int NODEREF_REJECTED_TOO_BIG = 1; public static final int NODEREF_REJECTED_REAL_BIGGER_THAN_PADDED = 2; public static final int NODEREF_REJECTED_TRANSFER_FAILED = 3; public static final int NODEREF_REJECTED_INVALID = 4; // FIXME get rid??? public final static MessageType FNPOpennetAnnounceNodeNotWanted = new MessageType( "FNPOpennetAnnounceNodeNotWanted", PRIORITY_LOW) { { addField(UID, Long.class); }}; public static Message createFNPOpennetAnnounceNodeNotWanted(long uid) { Message msg = new Message(FNPOpennetAnnounceNodeNotWanted); msg.set(UID, uid); return msg; } // Key offers (ULPRs) public final static MessageType FNPOfferKey = new MessageType("FNPOfferKey", PRIORITY_LOW) { { addField(KEY, Key.class); addField(OFFER_AUTHENTICATOR, ShortBuffer.class); }}; public static Message createFNPOfferKey(Key key, byte[] authenticator) { Message msg = new Message(FNPOfferKey); msg.set(KEY, key); msg.set(OFFER_AUTHENTICATOR, new ShortBuffer(authenticator)); return msg; } // Short timeout so PRIORITY_HIGH public final static MessageType FNPGetOfferedKey = new MessageType("FNPGetOfferedKey", PRIORITY_HIGH) { { addField(KEY, Key.class); addField(OFFER_AUTHENTICATOR, ShortBuffer.class); addField(NEED_PUB_KEY, Boolean.class); addField(UID, Long.class); }}; public static Message createFNPGetOfferedKey(Key key, byte[] authenticator, boolean needPubkey, long uid) { Message msg = new Message(FNPGetOfferedKey); msg.set(KEY, key); msg.set(OFFER_AUTHENTICATOR, new ShortBuffer(authenticator)); msg.set(NEED_PUB_KEY, needPubkey); msg.set(UID, uid); return msg; } // Permanently rejected. RejectedOverload means temporarily rejected. public final static MessageType FNPGetOfferedKeyInvalid = new MessageType("FNPGetOfferedKeyInvalid", PRIORITY_HIGH) { { // short timeout addField(UID, Long.class); addField(REASON, Short.class); }}; public static Message createFNPGetOfferedKeyInvalid(long uid, short reason) { Message msg = new Message(FNPGetOfferedKeyInvalid); msg.set(UID, uid); msg.set(REASON, reason); return msg; } public final static short GET_OFFERED_KEY_REJECTED_BAD_AUTHENTICATOR = 1; public final static short GET_OFFERED_KEY_REJECTED_NO_KEY = 2; public static final MessageType FNPPing = new MessageType("FNPPing", PRIORITY_HIGH) {{ addField(PING_SEQNO, Integer.class); }}; public static final Message createFNPPing(int seqNo) { Message msg = new Message(FNPPing); msg.set(PING_SEQNO, seqNo); return msg; } public static final MessageType FNPPong = new MessageType("FNPPong", PRIORITY_HIGH) {{ addField(PING_SEQNO, Integer.class); }}; public static final Message createFNPPong(int seqNo) { Message msg = new Message(FNPPong); msg.set(PING_SEQNO, seqNo); return msg; } public static final MessageType FNPRHProbeReply = new MessageType("FNPRHProbeReply", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(NEAREST_LOCATION, Double.class); addField(BEST_LOCATION, Double.class); addField(COUNTER, Short.class); addField(UNIQUE_COUNTER, Short.class); addField(LINEAR_COUNTER, Short.class); }}; public static final Message createFNPRHProbeReply(long uid, double nearest, double best, short counter, short uniqueCounter, short linearCounter) { Message msg = new Message(FNPRHProbeReply); msg.set(UID, uid); msg.set(NEAREST_LOCATION, nearest); msg.set(BEST_LOCATION, best); msg.set(COUNTER, counter); msg.set(UNIQUE_COUNTER, uniqueCounter); msg.set(LINEAR_COUNTER, linearCounter); return msg; } public static final MessageType FNPRHProbeRequest = new MessageType("FNPRHProbeRequest", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(TARGET_LOCATION, Double.class); addField(NEAREST_LOCATION, Double.class); addField(BEST_LOCATION, Double.class); addField(HTL, Short.class); }}; public static final Message createFNPRHProbeRequest(long uid, double target, double nearest, double best, short htl) { Message msg = new Message(FNPRHProbeRequest); msg.set(UID, uid); msg.set(TARGET_LOCATION, target); msg.set(NEAREST_LOCATION, nearest); msg.set(BEST_LOCATION, best); msg.set(HTL, htl); return msg; } public static final MessageType FNPRHReturnSubMessage = new MessageType("FNPRHReturnSubMessage", PRIORITY_HIGH) {{ addField(NEAREST_LOCATION, Double.class); addField(BEST_LOCATION, Double.class); addField(COUNTER, Short.class); addField(UNIQUE_COUNTER, Short.class); addField(LINEAR_COUNTER, Short.class); addField(REASON, String.class); }}; public static final Message createFNPRHReturnSubMessage(double nearest, double best, short counter, short uniqueCounter, short linearCounter, String reason) { Message msg = new Message(FNPRHReturnSubMessage); msg.set(NEAREST_LOCATION, nearest); msg.set(BEST_LOCATION, best); msg.set(COUNTER, counter); msg.set(UNIQUE_COUNTER, uniqueCounter); msg.set(LINEAR_COUNTER, linearCounter); msg.set(REASON, reason); return msg; } public static final MessageType FNPRHProbeTrace = new MessageType("FNPRHProbeTrace", PRIORITY_LOW) {{ addField(UID, Long.class); addField(NEAREST_LOCATION, Double.class); addField(BEST_LOCATION, Double.class); addField(HTL, Short.class); addField(COUNTER, Short.class); addField(UNIQUE_COUNTER, Short.class); addField(LOCATION, Double.class); addField(MY_UID, Long.class); addField(PEER_LOCATIONS, ShortBuffer.class); addField(PEER_UIDS, ShortBuffer.class); addField(FORK_COUNT, Short.class); addField(LINEAR_COUNTER, Short.class); addField(REASON, String.class); addField(PREV_UID, Long.class); }}; public static Message createFNPRHProbeTrace(long uid, double nearest, double best, short htl, short counter, short uniqueCounter, double myLoc, long swapIdentifier, double[] peerLocs, long[] peerUIDs, short forkCount, short linearCounter, String reason, long prevUID) { return createFNPRHProbeTrace(uid, nearest, best, htl, counter, uniqueCounter, myLoc, swapIdentifier, new ShortBuffer(Fields.doublesToBytes(peerLocs)), new ShortBuffer(Fields.longsToBytes(peerUIDs)), forkCount, linearCounter, reason, prevUID); } public static Message createFNPRHProbeTrace(long uid, double nearest, double best, short htl, short counter, short uniqueCounter, double myLoc, long swapIdentifier, ShortBuffer peerLocs, ShortBuffer peerUIDs, short forkCount, short linearCounter, String reason, long prevUID) { Message msg = new Message(FNPRHProbeTrace); msg.set(UID, uid); msg.set(NEAREST_LOCATION, nearest); msg.set(BEST_LOCATION, best); msg.set(HTL, htl); msg.set(COUNTER, counter); msg.set(UNIQUE_COUNTER, uniqueCounter); msg.set(LOCATION, myLoc); msg.set(MY_UID, swapIdentifier); msg.set(PEER_LOCATIONS, peerLocs); msg.set(PEER_UIDS, peerUIDs); msg.set(FORK_COUNT, forkCount); msg.set(LINEAR_COUNTER, linearCounter); msg.set(REASON, reason); msg.set(PREV_UID, prevUID); return msg; } public static final MessageType FNPProbeRequest = new MessageType("FNPProbeRequest", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(TARGET_LOCATION, Double.class); addField(NEAREST_LOCATION, Double.class); addField(BEST_LOCATION, Double.class); addField(HTL, Short.class); addField(COUNTER, Short.class); addField(LINEAR_COUNTER, Short.class); }}; public static final MessageType FNPProbeTrace = new MessageType("FNPProbeTrace", PRIORITY_LOW) {{ addField(UID, Long.class); addField(TARGET_LOCATION, Double.class); addField(NEAREST_LOCATION, Double.class); addField(BEST_LOCATION, Double.class); addField(HTL, Short.class); addField(COUNTER, Short.class); addField(LOCATION, Double.class); addField(MY_UID, Long.class); addField(PEER_LOCATIONS, ShortBuffer.class); addField(PEER_UIDS, ShortBuffer.class); addField(FORK_COUNT, Short.class); addField(LINEAR_COUNTER, Short.class); addField(REASON, String.class); addField(PREV_UID, Long.class); }}; public static final MessageType FNPProbeReply = new MessageType("FNPProbeReply", PRIORITY_LOW) {{ addField(UID, Long.class); addField(TARGET_LOCATION, Double.class); addField(NEAREST_LOCATION, Double.class); addField(BEST_LOCATION, Double.class); addField(COUNTER, Short.class); addField(LINEAR_COUNTER, Short.class); }}; public static final MessageType FNPProbeRejected = new MessageType("FNPProbeRejected", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(TARGET_LOCATION, Double.class); addField(NEAREST_LOCATION, Double.class); addField(BEST_LOCATION, Double.class); addField(HTL, Short.class); addField(COUNTER, Short.class); addField(REASON, Short.class); addField(LINEAR_COUNTER, Short.class); }}; static public final short PROBE_REJECTED_LOOP = 1; static public final short PROBE_REJECTED_RNF = 2; static public final short PROBE_REJECTED_OVERLOAD = 3; public static final MessageType FNPSwapRequest = new MessageType("FNPSwapRequest", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(HASH, ShortBuffer.class); addField(HTL, Integer.class); }}; public static final Message createFNPSwapRequest(long uid, byte[] buf, int htl) { Message msg = new Message(FNPSwapRequest); msg.set(UID, uid); msg.set(HASH, new ShortBuffer(buf)); msg.set(HTL, htl); return msg; } public static final MessageType FNPSwapRejected = new MessageType("FNPSwapRejected", PRIORITY_HIGH) {{ addField(UID, Long.class); }}; public static final Message createFNPSwapRejected(long uid) { Message msg = new Message(FNPSwapRejected); msg.set(UID, uid); return msg; } public static final MessageType FNPSwapReply = new MessageType("FNPSwapReply", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(HASH, ShortBuffer.class); }}; public static final Message createFNPSwapReply(long uid, byte[] buf) { Message msg = new Message(FNPSwapReply); msg.set(UID, uid); msg.set(HASH, new ShortBuffer(buf)); return msg; } public static final MessageType FNPSwapCommit = new MessageType("FNPSwapCommit", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(DATA, ShortBuffer.class); }}; public static final Message createFNPSwapCommit(long uid, byte[] buf) { Message msg = new Message(FNPSwapCommit); msg.set(UID, uid); msg.set(DATA, new ShortBuffer(buf)); return msg; } public static final MessageType FNPSwapComplete = new MessageType("FNPSwapComplete", PRIORITY_HIGH) {{ addField(UID, Long.class); addField(DATA, ShortBuffer.class); }}; public static final Message createFNPSwapComplete(long uid, byte[] buf) { Message msg = new Message(FNPSwapComplete); msg.set(UID, uid); msg.set(DATA, new ShortBuffer(buf)); return msg; } public static final MessageType FNPLocChangeNotificationNew = new MessageType("FNPLocationChangeNotification2", PRIORITY_LOW) {{ addField(LOCATION, Double.class); addField(PEER_LOCATIONS, ShortBuffer.class); }}; public static final Message createFNPLocChangeNotificationNew(double myLocation, double[] locations) { Message msg = new Message(FNPLocChangeNotificationNew); ShortBuffer dst = new ShortBuffer(Fields.doublesToBytes(locations)); msg.set(LOCATION, myLocation); msg.set(PEER_LOCATIONS, dst); return msg; } public static final MessageType FNPRoutedPing = new MessageType("FNPRoutedPing", PRIORITY_LOW) {{ addRoutedToNodeMessageFields(); addField(COUNTER, Integer.class); }}; public static final Message createFNPRoutedPing(long uid, double targetLocation, short htl, int counter, byte[] nodeIdentity) { Message msg = new Message(FNPRoutedPing); msg.setRoutedToNodeFields(uid, targetLocation, htl, nodeIdentity); msg.set(COUNTER, counter); return msg; } public static final MessageType FNPRoutedPong = new MessageType("FNPRoutedPong", PRIORITY_LOW) {{ addField(UID, Long.class); addField(COUNTER, Integer.class); }}; public static final Message createFNPRoutedPong(long uid, int counter) { Message msg = new Message(FNPRoutedPong); msg.set(UID, uid); msg.set(COUNTER, counter); return msg; } public static final MessageType FNPSecretPing = new MessageType("FNPSecretPing", PRIORITY_LOW) {{ addRoutedToNodeMessageFields(); addField(COUNTER, Integer.class); addField(DAWN_HTL, Short.class); }}; public static final Message createFNPSecretPing(long uid, double targetLocation, short htl, short dawnHtl, int counter, byte[] nodeIdentity) { Message msg = new Message(FNPSecretPing); msg.setRoutedToNodeFields(uid, targetLocation, htl, nodeIdentity); msg.set(COUNTER, counter); msg.set(DAWN_HTL, dawnHtl); return msg; } public static final MessageType FNPSecretPong = new MessageType("FNPSecretPong", PRIORITY_LOW) {{ addField(UID, Long.class); addField(COUNTER, Integer.class); addField(SECRET, Long.class); }}; public static final Message createFNPSecretPong(long uid, int counter, long secret) { Message msg = new Message(FNPSecretPong); msg.set(UID, uid); msg.set(COUNTER, counter); msg.set(SECRET, secret); return msg; } public static final MessageType FNPStoreSecret = new MessageType("FNPStoreSecret", PRIORITY_LOW) {{ addField(UID, Long.class); addField(SECRET, Long.class); }}; public static final Message createFNPStoreSecret(long uid, long secret) { Message msg = new Message(FNPStoreSecret); msg.set(UID, uid); msg.set(SECRET, secret); return msg; } public static final MessageType FNPNetworkID = new MessageType("FNPNetworkID", PRIORITY_LOW) {{ addField(UID, Integer.class); }}; public static final Message createFNPNetworkID(int id) { Message msg = new Message(FNPNetworkID); msg.set(UID, id); return msg; } public static final MessageType FNPRoutedRejected = new MessageType("FNPRoutedRejected", PRIORITY_UNSPECIFIED) {{ addField(UID, Long.class); addField(HTL, Short.class); }}; public static final Message createFNPRoutedRejected(long uid, short htl) { Message msg = new Message(FNPRoutedRejected); msg.set(UID, uid); msg.set(HTL, htl); return msg; } public static final MessageType FNPDetectedIPAddress = new MessageType("FNPDetectedIPAddress", PRIORITY_HIGH) {{ addField(EXTERNAL_ADDRESS, Peer.class); }}; public static final Message createFNPDetectedIPAddress(Peer peer) { Message msg = new Message(FNPDetectedIPAddress); msg.set(EXTERNAL_ADDRESS, peer); return msg; } public static final MessageType FNPTime = new MessageType("FNPTime", PRIORITY_HIGH) {{ addField(TIME, Long.class); }}; public static final Message createFNPTime(long time) { Message msg = new Message(FNPTime); msg.set(TIME, time); return msg; } public static final MessageType FNPUptime = new MessageType("FNPUptime", PRIORITY_LOW) {{ addField(UPTIME_PERCENT_48H, Byte.class); }}; public static final Message createFNPUptime(byte uptimePercent) { Message msg = new Message(FNPUptime); msg.set(UPTIME_PERCENT_48H, uptimePercent); return msg; } public static final MessageType FNPSentPackets = new MessageType("FNPSentPackets", PRIORITY_HIGH) {{ addField(TIME_DELTAS, ShortBuffer.class); addField(HASHES, ShortBuffer.class); addField(TIME, Long.class); }}; public static final Message createFNPSentPackets(int[] timeDeltas, long[] hashes, long baseTime) { Message msg = new Message(FNPSentPackets); msg.set(TIME_DELTAS, new ShortBuffer(Fields.intsToBytes(timeDeltas))); msg.set(HASHES, new ShortBuffer(Fields.longsToBytes(hashes))); msg.set(TIME, baseTime); return msg; } public static final MessageType FNPVoid = new MessageType("FNPVoid", PRIORITY_LOW) {{ }}; public static final Message createFNPVoid() { Message msg = new Message(FNPVoid); return msg; } public static final MessageType FNPDisconnect = new MessageType("FNPDisconnect", PRIORITY_HIGH) {{ // If true, remove from active routing table, likely to be down for a while. // Otherwise just dump all current connection state and keep trying to connect. addField(REMOVE, Boolean.class); // If true, purge all references to this node. Otherwise, we can keep the node // around in secondary tables etc in order to more easily reconnect later. // (Mostly used on opennet) addField(PURGE, Boolean.class); // Parting message, may be empty. A SimpleFieldSet in exactly the same format // as an N2NTM. addField(NODE_TO_NODE_MESSAGE_TYPE, Integer.class); addField(NODE_TO_NODE_MESSAGE_DATA, ShortBuffer.class); }}; public static final Message createFNPDisconnect(boolean remove, boolean purge, int messageType, ShortBuffer messageData) { Message msg = new Message(FNPDisconnect); msg.set(REMOVE, remove); msg.set(PURGE, purge); msg.set(NODE_TO_NODE_MESSAGE_TYPE, messageType); msg.set(NODE_TO_NODE_MESSAGE_DATA, messageData); return msg; } // Update over mandatory. Not strictly part of FNP. Only goes between nodes at the link // level, and will be sent, and parsed, even if the node is out of date. Should be stable // long-term. // Sent on connect public static final MessageType UOMAnnounce = new MessageType("UOMAnnounce", PRIORITY_LOW) {{ addField(MAIN_JAR_KEY, String.class); addField(EXTRA_JAR_KEY, String.class); addField(REVOCATION_KEY, String.class); addField(HAVE_REVOCATION_KEY, Boolean.class); addField(MAIN_JAR_VERSION, Long.class); addField(EXTRA_JAR_VERSION, Long.class); // Last time (ms ago) we had 3 DNFs in a row on the revocation checker. addField(REVOCATION_KEY_TIME_LAST_TRIED, Long.class); // Number of DNFs so far this time. addField(REVOCATION_KEY_DNF_COUNT, Integer.class); // For convenience, may change addField(REVOCATION_KEY_FILE_LENGTH, Long.class); addField(MAIN_JAR_FILE_LENGTH, Long.class); addField(EXTRA_JAR_FILE_LENGTH, Long.class); addField(PING_TIME, Integer.class); addField(BWLIMIT_DELAY_TIME, Integer.class); }}; public static final Message createUOMAnnounce(String mainKey, String extraKey, String revocationKey, boolean haveRevocation, long mainJarVersion, long extraJarVersion, long timeLastTriedRevocationFetch, int revocationDNFCount, long revocationKeyLength, long mainJarLength, long extraJarLength, int pingTime, int bwlimitDelayTime) { Message msg = new Message(UOMAnnounce); msg.set(MAIN_JAR_KEY, mainKey); msg.set(EXTRA_JAR_KEY, extraKey); msg.set(REVOCATION_KEY, revocationKey); msg.set(HAVE_REVOCATION_KEY, haveRevocation); msg.set(MAIN_JAR_VERSION, mainJarVersion); msg.set(EXTRA_JAR_VERSION, extraJarVersion); msg.set(REVOCATION_KEY_TIME_LAST_TRIED, timeLastTriedRevocationFetch); msg.set(REVOCATION_KEY_DNF_COUNT, revocationDNFCount); msg.set(REVOCATION_KEY_FILE_LENGTH, revocationKeyLength); msg.set(MAIN_JAR_FILE_LENGTH, mainJarLength); msg.set(EXTRA_JAR_FILE_LENGTH, extraJarLength); msg.set(PING_TIME, pingTime); msg.set(BWLIMIT_DELAY_TIME, bwlimitDelayTime); return msg; } public static final MessageType UOMRequestRevocation = new MessageType("UOMRequestRevocation", PRIORITY_HIGH) {{ addField(UID, Long.class); }}; public static final Message createUOMRequestRevocation(long uid) { Message msg = new Message(UOMRequestRevocation); msg.set(UID, uid); return msg; } public static final MessageType UOMRequestMain = new MessageType("UOMRequestMain", PRIORITY_LOW) {{ addField(UID, Long.class); }}; public static final Message createUOMRequestMain(long uid) { Message msg = new Message(UOMRequestMain); msg.set(UID, uid); return msg; } public static final MessageType UOMRequestExtra = new MessageType("UOMRequestExtra", PRIORITY_LOW) {{ addField(UID, Long.class); }}; public static final Message createUOMRequestExtra(long uid) { Message msg = new Message(UOMRequestExtra); msg.set(UID, uid); return msg; } public static final MessageType UOMSendingRevocation = new MessageType("UOMSendingRevocation", PRIORITY_HIGH) {{ addField(UID, Long.class); // Probably excessive, but lengths are always long's, and wasting a few bytes here // doesn't matter in the least, as it's very rarely called. addField(FILE_LENGTH, Long.class); addField(REVOCATION_KEY, String.class); }}; public static final Message createUOMSendingRevocation(long uid, long length, String key) { Message msg = new Message(UOMSendingRevocation); msg.set(UID, uid); msg.set(FILE_LENGTH, length); msg.set(REVOCATION_KEY, key); return msg; } public static final MessageType UOMSendingMain = new MessageType("UOMSendingMain", PRIORITY_LOW) {{ addField(UID, Long.class); addField(FILE_LENGTH, Long.class); addField(MAIN_JAR_KEY, String.class); addField(MAIN_JAR_VERSION, Integer.class); }}; public static final Message createUOMSendingMain(long uid, long length, String key, int version) { Message msg = new Message(UOMSendingMain); msg.set(UID, uid); msg.set(FILE_LENGTH, length); msg.set(MAIN_JAR_KEY, key); msg.set(MAIN_JAR_VERSION, version); return msg; } public static final MessageType UOMSendingExtra = new MessageType("UOMSendingExtra", PRIORITY_LOW) {{ addField(UID, Long.class); addField(FILE_LENGTH, Long.class); addField(EXTRA_JAR_KEY, String.class); addField(EXTRA_JAR_VERSION, Integer.class); }}; public static final Message createUOMSendingExtra(long uid, long length, String key, int version) { Message msg = new Message(UOMSendingExtra); msg.set(UID, uid); msg.set(FILE_LENGTH, length); msg.set(EXTRA_JAR_KEY, key); msg.set(EXTRA_JAR_VERSION, version); return msg; } // Secondary messages (debug messages attached to primary messages) public static final MessageType FNPSwapNodeUIDs = new MessageType("FNPSwapNodeUIDs", PRIORITY_UNSPECIFIED) {{ addField(NODE_UIDS, ShortBuffer.class); }}; public static final Message createFNPSwapLocations(long[] uids) { Message msg = new Message(FNPSwapNodeUIDs); msg.set(NODE_UIDS, new ShortBuffer(Fields.longsToBytes(uids))); return msg; } // More permanent secondary messages (should perhaps be replaced by new main messages when stable) public static final MessageType FNPBestRoutesNotTaken = new MessageType("FNPBestRoutesNotTaken", PRIORITY_UNSPECIFIED) {{ // Maybe this should be some sort of typed array? // It's just a bunch of double's anyway. addField(BEST_LOCATIONS_NOT_VISITED, ShortBuffer.class); }}; public static final Message createFNPBestRoutesNotTaken(byte[] locs) { Message msg = new Message(FNPBestRoutesNotTaken); msg.set(BEST_LOCATIONS_NOT_VISITED, new ShortBuffer(locs)); return msg; } public static final Message createFNPBestRoutesNotTaken(double[] locs) { return createFNPBestRoutesNotTaken(Fields.doublesToBytes(locs)); } public static Message createFNPBestRoutesNotTaken(Double[] doubles) { double[] locs = new double[doubles.length]; for(int i=0;i<locs.length;i++) locs[i] = doubles[i].doubleValue(); return createFNPBestRoutesNotTaken(locs); } public static final MessageType FNPRoutingStatus = new MessageType("FNPRoutingStatus", PRIORITY_HIGH) {{ addField(ROUTING_ENABLED, Boolean.class); }}; public static final Message createRoutingStatus(boolean routeRequests) { Message msg = new Message(FNPRoutingStatus); msg.set(ROUTING_ENABLED, routeRequests); return msg; } public static void init() { } }

The table below shows all metrics for DMT.java.

MetricValueDescription
BLOCKS199.00Number of blocks
BLOCK_COMMENT18.00Number of block comment lines
COMMENTS84.00Comment lines
COMMENT_DENSITY 0.07Comment density
COMPARISONS 5.00Number of comparison operators
CYCLOMATIC111.00Cyclomatic complexity
DECL_COMMENTS30.00Comments in declarations
DOC_COMMENT31.00Number of javadoc comment lines
ELOC1137.00Effective lines of code
EXEC_COMMENTS 8.00Comments in executable code
EXITS21.00Procedure exits
FUNCTIONS102.00Number of function declarations
HALSTEAD_DIFFICULTY77.38Halstead difficulty
HALSTEAD_EFFORT 0.00Halstead effort
INTERFACE_COMPLEXITY365.00Interface complexity
JAVA0001 0.00JAVA0001 Package name does not contain only lower case letters
JAVA0002 1.00JAVA0002 Package name does not begin with a top level domain name or country code
JAVA0003 0.00JAVA0003 Minimize use of on-demand (.*) imports
JAVA0004 0.00JAVA0004 Unnecessary import from java.lang
JAVA0005 0.00JAVA0005 Imports not in specified order
JAVA0006 0.00JAVA0006 Empty finally block
JAVA0007 0.00JAVA0007 Should not declare public field
JAVA0008 0.00JAVA0008 Empty catch block
JAVA0009 0.00JAVA0009 Protected member in final class
JAVA0010 0.00JAVA0010 Non-instantiable class does not contain a non-private static member
JAVA0011 0.00JAVA0011 Abstract class does not contain an abstract method
JAVA0012 0.00JAVA0012 Non-constructor method with same name as declaring class
JAVA0013 0.00JAVA0013 Non-blank final field is not static
JAVA0014 1.00JAVA0014 Class with only static members has non-private constructor
JAVA0015 0.00JAVA0015 Package class contains public nested type
JAVA0016 0.00JAVA0016 Abstract class contains public constructor
JAVA0017 0.00JAVA0017 Class name does not have required form
JAVA0018 0.00JAVA0018 Method name does not have required form
JAVA0019 0.00JAVA0019 Interface name does not have required form
JAVA0020 0.00JAVA0020 Field name does not have required form
JAVA0021 0.00JAVA0021 Interface method name does not have required form
JAVA0022 0.00JAVA0022 Static final field name does not have required form
JAVA0023 0.00JAVA0023 Empty finalize method
JAVA0024 0.00JAVA0024 Empty class
JAVA0025 0.00JAVA0025 Method override is empty
JAVA0026 0.00JAVA0026 Finalize method with parameters
JAVA0029 0.00JAVA0029 Private method not used
JAVA0030 0.00JAVA0030 Private field not used
JAVA0031 0.00JAVA0031 Case statement not properly closed
JAVA0032 0.00JAVA0032 Switch statement missing default
JAVA0033 0.00JAVA0033 default: not last case in switch statement
JAVA0034 3.00JAVA0034 Missing braces in if statement
JAVA0035 1.00JAVA0035 Missing braces in for statement
JAVA0036 0.00JAVA0036 Missing braces in while statement
JAVA0038 0.00JAVA0038 Non-case label in switch statement
JAVA0039 0.00JAVA0039 Break statement with label
JAVA0040 0.00JAVA0040 Switch statement contains N cases (maximum: M)
JAVA0041 0.00JAVA0041 Nested synchronized block
JAVA0042 0.00JAVA0042 Empty synchronized statement
JAVA0043 0.00JAVA0043 Inner class does not use outer class
JAVA0044 0.00JAVA0044 Serializable class with no instance variables
JAVA0045 0.00JAVA0045 Serializable class with only transient fields
JAVA0046 0.00JAVA0046 Name of class not derived from Exception ends with 'Exception'
JAVA0047 0.00JAVA0047 Serializable class derives from invalid base class
JAVA0048 0.00JAVA0048 Name of class derived from Exception does not end with 'Exception'
JAVA0049 0.00JAVA0049 Nested block at depth N (maximum: M)
JAVA0050 0.00JAVA0050 Class derives from java.lang.Error
JAVA0051 0.00JAVA0051 Class derives from java.lang.RuntimeException
JAVA0052 0.00JAVA0052 Class derives from java.lang.Throwable
JAVA0053 0.00JAVA0053 Unused label
JAVA0054 0.00JAVA0054 Inheritance depth N exceeds maximum M
JAVA0055 0.00JAVA0055 Class should be interface
JAVA0056 0.00JAVA0056 Unnecessary abstract modifier for interface or annotation
JAVA0057 0.00JAVA0057 Unnecessary default constructor
JAVA0058 0.00JAVA0058 Constructor calls super()
JAVA0059 0.00JAVA0059 Method override only calls super()
JAVA0061 0.00JAVA0061 Inaccessible member in anonymous class
JAVA0062 0.00JAVA0062 Public class missing public member or protected constructor
JAVA0063 0.00JAVA0063 Identifier name should not contain '$'
JAVA006418.00JAVA0064 N variations of identifier name (maximum: M)
JAVA0065 0.00JAVA0065 Unnecessary final modifier for method in final class
JAVA0066 0.00JAVA0066 Unnecessary modifier for interface nested type
JAVA0067 0.00JAVA0067 Array descriptor on identifier name
JAVA006820.00JAVA0068 Modifiers not declared in recommended order
JAVA0071 0.00JAVA0071 Strings compared with ==
JAVA0073 0.00JAVA0073 Integer division in floating-point context
JAVA0074 0.00JAVA0074 Use of Object.notify()
JAVA0075 0.00JAVA0075 Method parameter hides field
JAVA0076 2.00JAVA0076 Use of magic number
JAVA0077 0.00JAVA0077 Private field not used in declaring class
JAVA0078 0.00JAVA0078 Floating point values compared with ==
JAVA0079 0.00JAVA0079 Use of instance to reference static member
JAVA0080 0.00JAVA0080 Import declaration not used
JAVA0081 0.00JAVA0081 Boolean literal in comparison
JAVA0082 0.00JAVA0082 Unnecessary widening cast
JAVA0083 0.00JAVA0083 Unnecessary instanceof test
JAVA0084 0.00JAVA0084 Should use compound assignment operator
JAVA0085 0.00JAVA0085 Use of sun.* class
JAVA0087 0.00JAVA0087 Use of Thread.sleep()
JAVA0089 0.00JAVA0089 Use of restricted package
JAVA0092 0.00JAVA0092 Use of restricted type
JAVA0093 0.00JAVA0093 Redundant assignment
JAVA0094 0.00JAVA0094 Field hides a superclass field
JAVA0095 0.00JAVA0095 Uninitialized private field
JAVA0096 0.00JAVA0096 Field in nested class hides outer field
JAVA0098 0.00JAVA0098 Minimize use of implicit field initializers
JAVA0100 0.00JAVA0100 Class contains N non-final fields (maximum: M)
JAVA0101 0.00JAVA0101 Unnecessary modifier for field in interface
JAVA0102 0.00JAVA0102 Last statement in finalize() not super.finalize()
JAVA0103 0.00JAVA0103 Explicit call to finalize()
JAVA0104 0.00JAVA0104 finalize() only calls super.finalize()
JAVA0105 0.00JAVA0105 Duplicate import declaration
JAVA0106 0.00JAVA0106 Unnecessary import from current package
JAVA0108 0.00JAVA0108 Incorrect javadoc: no @param tag for 'parameter'
JAVA0109 0.00JAVA0109 Incorrect javadoc: no parameter 'parameter'
JAVA0110 0.00JAVA0110 Incorrect javadoc: no @return tag
JAVA0111 0.00JAVA0111 Incorrect javadoc: @return tag for void method
JAVA0112 0.00JAVA0112 Incorrect javadoc: no exception 'exception' in throws
JAVA0113 0.00JAVA0113 Incorrect javadoc: no @author tag
JAVA0114 1.00JAVA0114 Incorrect javadoc: no @version tag
JAVA0115 0.00JAVA0115 Incorrect javadoc: no @throws or @exception tag for 'exception'
JAVA0116196.00JAVA0116 Missing javadoc: field 'field'
JAVA0117102.00JAVA0117 Missing javadoc: method 'method'
JAVA0118 0.00JAVA0118 Missing javadoc: type 'type'
JAVA0119 0.00JAVA0119 Control variable changed within body of for loop
JAVA0123 0.00JAVA0123 Use all three components of for loop
JAVA0125 0.00JAVA0125 Continue statement with label
JAVA0126 0.00JAVA0126 Method declares unchecked exception in throws
JAVA0128 0.00JAVA0128 Public constructor in non-public class
JAVA0130 0.00JAVA0130 Non-static method does not use instance fields
JAVA0131 0.00JAVA0131 Compatible method does not override base
JAVA0132 0.00JAVA0132 Method overload with compatible signature
JAVA0133 0.00JAVA0133 Non-synchronized method overrides synchronized method
JAVA0135 0.00JAVA0135 Only one of Object.equals and Object.hashCode defined: missing 'method'
JAVA0136 1.00JAVA0136 N methods defined in class (maximum: M)
JAVA0137 0.00JAVA0137 Non-abstract class missing constructor
JAVA0138 8.00JAVA0138 N parameters defined for method (maximum: M)
JAVA0139 0.00JAVA0139 Definition of main other than public static void main(java.lang.String[])
JAVA0141 0.00JAVA0141 Unnecessary modifier for method in interface
JAVA0143 0.00JAVA0143 Synchronized method
JAVA0144 9.00JAVA0144 Line exceeds maximum M characters
JAVA01452252.00JAVA0145 Tab character used in source file
JAVA0150 0.00JAVA0150 java.lang.Error (or subclass) thrown
JAVA0153 0.00JAVA0153 Inefficient conversion of integer to string
JAVA0159 0.00JAVA0159 Inefficient conversion of string to integer
JAVA0160 0.00JAVA0160 Method does not throw specified exception
JAVA0161 0.00JAVA0161 Conditional wait() not in loop
JAVA0163 0.00JAVA0163 Empty statement
JAVA0165 0.00JAVA0165 Conflicting return statement in finally block
JAVA0166 0.00JAVA0166 Generic exception caught
JAVA0167 0.00JAVA0167 ThreadDeath not rethrown
JAVA0169 0.00JAVA0169 Unnecessary catch block: exception 'exception'
JAVA0170 0.00JAVA0170 Caught exception not derived from java.lang.Exception
JAVA0171 0.00JAVA0171 Unused local variable
JAVA0173 0.00JAVA0173 Unused method parameter
JAVA0174 0.00JAVA0174 Assigned local variable never used
JAVA0175 0.00JAVA0175 Successive assignment to variable
JAVA0176 0.00JAVA0176 Local variable name does not have required form
JAVA0177 0.00JAVA0177 Variable declaration missing initializer
JAVA0179 0.00JAVA0179 Local variable hides visible field
JAVA0233 0.00JAVA0233 Definition of serialVersionUID other than 'private static final long serialVersionUID'
JAVA0234 0.00JAVA0234 Class is Serializable but does not define serialVersionUID
JAVA0235 0.00JAVA0235 Class defines serialVersionUID but does not implement Serializable
JAVA0236 0.00JAVA0236 Attempt to clone an object which does not implement Cloneable
JAVA0237 0.00JAVA0237 Class implements Cloneable but does not have public clone method
JAVA0238 0.00JAVA0238 Clone method does not call super.clone()
JAVA0239 0.00JAVA0239 Class declares 'readObject' or 'writeObject' but does not implement Serializable
JAVA0240 0.00JAVA0240 Serializable class which declares readObject or writeObject but not both
JAVA0241 0.00JAVA0241 'readObject' or 'writeObject' should be declared private in Serializable class
JAVA0242 0.00JAVA0242 Transient field in non-Serializable class
JAVA0243 0.00JAVA0243 'readResolve' or 'writeReplace' should be declared private or protected
JAVA0244 0.00JAVA0244 Field or method name in subclass differs only by case from inherited field or method
JAVA0245 0.00JAVA0245 JUnit TestCase with non-trivial constructor
JAVA0246 0.00JAVA0246 JUnit assertXXX statement missing message parameter
JAVA0247 0.00JAVA0247 JUnit 'setUp()' and 'tearDown()' should call super method
JAVA0248 0.00JAVA0248 JUnit method 'setUp' or 'tearDown' with incorrect signature
JAVA0249 0.00JAVA0249 JUnit TestCase 'suite()' should be declared static
JAVA0250 0.00JAVA0250 JUnit TestCase declares testXXX method with incorrect signature
JAVA0251 0.00JAVA0251 Use '%n' for line breaks in printf/format for platform independence
JAVA0252 0.00JAVA0252 'enum' is a Java 1.5 reserved word
JAVA0253 0.00JAVA0253 Not all enum constants consumed in switch statement
JAVA0254 0.00JAVA0254 Use enhanced for loop construct instead of Iterator
JAVA0255 0.00JAVA0255 Result of method invocation not used
JAVA0256 0.00JAVA0256 Assignment of external collection/array to field
JAVA0257 0.00JAVA0257 Use of 'Constant Interface' anti-pattern
JAVA0258 0.00JAVA0258 Implement Iterable for foreach compatibility
JAVA0259 0.00JAVA0259 Return of collection/array field
JAVA0260 0.00JAVA0260 Use 'enum' instead of Enumerated Type pattern
JAVA0261 0.00JAVA0261 Use specialized Enum collection types
JAVA0262 0.00JAVA0262 Use of char in integer context
JAVA0263 0.00JAVA0263 Long literal ends with 'l' instead of 'L'
JAVA0264 0.00JAVA0264 Integer math in long context - check for overflow
JAVA0265 0.00JAVA0265 Use of Throwable.printStackTrace()
JAVA0266 0.00JAVA0266 Use of System.out
JAVA0267 0.00JAVA0267 Use of System.err
JAVA0269 0.00JAVA0269 Contents of StringBuffer never used
JAVA0270 0.00JAVA0270 Use Java 5.0 enhanced for loop construct to iterate over all elements in an array
JAVA0271 0.00JAVA0271 Minimize use of on-demand (.*) static imports
JAVA0272 0.00JAVA0272 Thread.run() called
JAVA0273 0.00JAVA0273 Non-final derivative of Thread calls start() in constructor
JAVA0274 0.00JAVA0274 Serializable class has a synchronized readObject()
JAVA0275 0.00JAVA0275 Serializable class has a synchronized writeObject() and no other synchronized methods
JAVA0276 0.00JAVA0276 Unnecessary use of String constructor
JAVA0277 0.00JAVA0277 Iterator.next() implementation does not throw NoSuchElementException
JAVA0278 0.00JAVA0278 Unnecessary use of Boolean constructor
JAVA0279 0.00JAVA0279 Serialization method readObject or readObjectNoData calls an overridable method
JAVA0280 0.00JAVA0280 IllegalMonitorStateException caught
JAVA0281 0.00JAVA0281 Iterator.next() not called in loop
JAVA0282 0.00JAVA0282 Call to Iterator.next() in loop which does not test Iterator.hasNext()
JAVA0283 0.00JAVA0283 Control variable not updated in loop body
JAVA0284 0.00JAVA0284 Explicit garbage collection
JAVA0285 0.00JAVA0285 Dereference of potentially null variable
JAVA0286 0.00JAVA0286 Dereference of null variable
JAVA0287 0.00JAVA0287 Unnecessary null check
JAVA0288 0.00JAVA0288 Inconsistent null check
LINES1560.00Number of lines in the source file
LINE_COMMENT35.00Number of line comments
LOC1254.00Lines of code
LOGICAL_LINES919.00Number of statements
LOOPS 1.00Number of loops
NEST_DEPTH 1.00Maximum nesting depth
OPERANDS3619.00Number of operands
OPERATORS6640.00Number of operators
PARAMS256.00Number of formal parameter declarations
PROGRAM_LENGTH10259.00Halstead program length
PROGRAM_VOCAB951.00Halstead program vocabulary
PROGRAM_VOLUME 0.00Halstead program volume
RETURNS109.00Number of return points from functions
SIZE56345.00Size of the file in bytes
UNIQUE_OPERANDS912.00Number of unique operands
UNIQUE_OPERATORS39.00Number of unique operators
WHITESPACE222.00Number of whitespace lines