lowered some code smells
Issue-ID: PORTAL-869
Change-Id: Ia92c254b9fb9ddfe9db63889808eea07557c198a
Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
public Node(String id) {
super();
this.id = id;
public Node(String id) {
super();
this.id = id;
- this.links = new ArrayList<Node>();
+ this.links = new ArrayList<>();
}
public List<Node> getLinks() {
}
public List<Node> getLinks() {
}
public DeadlockDetectionUtil() {
}
public DeadlockDetectionUtil() {
- this.nodeList = new HashMap<String, Node>();
+ this.nodeList = new HashMap<>();
}
public void listAllNodes() {
}
public void listAllNodes() {
currentNode = nodeList.get("o" + owner);
}
currentNode = nodeList.get("o" + owner);
}
- boolean cycle = findCycle(currentNode);
- return cycle;
+ return findCycle(currentNode);
}
private boolean findCycle(Node currentNode) {
}
private boolean findCycle(Node currentNode) {
case MAP:
return (Map<String, Object>) valueObj;
case LIST:
case MAP:
return (Map<String, Object>) valueObj;
case LIST:
- return (List<Object>)valueObj;
}
public static ByteBuffer convertToActualDataType(DataType colType, byte[] valueObj) {
}
public static ByteBuffer convertToActualDataType(DataType colType, byte[] valueObj) {
- ByteBuffer buffer = ByteBuffer.wrap(valueObj);
- return buffer;
+
+ return ByteBuffer.wrap(valueObj);
* @throws MusicServiceException
* @throws MusicQueryException
*/
* @throws MusicServiceException
* @throws MusicQueryException
*/
- public static long v2sTimeStampInMicroseconds(long ordinal, long timeOfWrite) throws MusicServiceException, MusicQueryException {
+ public static long v2sTimeStampInMicroseconds(long ordinal, long timeOfWrite) throws MusicServiceException, MusicQueryException{
// TODO: use acquire time instead of music eternity epoch
// TODO: use acquire time instead of music eternity epoch
- long ts = ordinal * MaxLockReferenceTimePart + (timeOfWrite - MusicEternityEpochMillis);
-
- return ts;
+ return ordinal * MaxLockReferenceTimePart + (timeOfWrite - MusicEternityEpochMillis);
}
public static MusicCoreService getMusicCoreService() {
}
public static MusicCoreService getMusicCoreService() {
ReturnType result = null;
try {
ReturnType result = null;
try {
PreparedQueryObject queryObj = null;
queryObj = jsonInsertObj.genInsertPreparedQueryObj();
PreparedQueryObject queryObj = null;
queryObj = jsonInsertObj.genInsertPreparedQueryObj();
if (consistency.equalsIgnoreCase(MusicUtil.EVENTUAL)) {
result = eventualPut(jsonInsertObj.genInsertPreparedQueryObj());
} else if (consistency.equalsIgnoreCase(MusicUtil.CRITICAL)) {
if (consistency.equalsIgnoreCase(MusicUtil.EVENTUAL)) {
result = eventualPut(jsonInsertObj.genInsertPreparedQueryObj());
} else if (consistency.equalsIgnoreCase(MusicUtil.CRITICAL)) {