diff --git a/src/org/ntlab/deltaViewer/CollaborationViewer.java b/src/org/ntlab/deltaViewer/CollaborationViewer.java index 1150557..84676cf 100644 --- a/src/org/ntlab/deltaViewer/CollaborationViewer.java +++ b/src/org/ntlab/deltaViewer/CollaborationViewer.java @@ -33,14 +33,15 @@ private IObjectCallGraph objectCallGraph; - private double scale = 1; + private double scale = 1.0; public CollaborationViewer() { super(); } /** - * Set objectCallGraph and aliasCollector, create vertex object and edge object. + * Set {@link IObjectCallGraph} and {@link IAliasCollector}, create {@link VertexObject} and {@link Edge}. + * * @param objectCallGraph * @param aliasCollector */ @@ -62,26 +63,16 @@ mxGraphView view = mxgraphComponent.getGraph().getView(); int componentWidth = mxgraphComponent.getWidth() - 25; double viewWidth = (double) view.getGraphBounds().getWidth(); - -// Object component = mxgraph.insertDeltaVertex(mxDefaultParent, "component", "component", "fillColor=white"); //creates a white vertex. -// ((mxICell)component).getGeometry().setX(mxgraphComponent.getWidth() - 30); -// ((mxICell)component).getGeometry().setY(10); -// Object vertex = mxgraph.insertDeltaVertex(mxDefaultParent, "view", "view", "fillColor=white"); //creates a white vertex. -// ((mxICell)vertex).getGeometry().setX(view.getGraphBounds().getWidth()); -// ((mxICell)vertex).getGeometry().setY(10); - // scale = (double)componentWidth/viewWidth; - System.out.println(", " + scale); -// scale = 1.5; view.setScale(scale); -// deltaAnimation.setScale(scale); + update(); } /** * Step to animation of specified alias. * - * @param alias Alias type and occurrence point etc. + * @param alias: alias type and occurrence point etc */ public void stepToAnimation(Alias alias) { try { @@ -92,13 +83,13 @@ } /** - * Parent : Step to animation of specified numFrame. + * Parent: Step to animation of specified numFrame. * - * @param numFrame Current animation frame. + * @param numFrame: current animation frame */ public void stepToAnimation(int numFrame) { - // TODO: Implement doLastAnimation to support plural Delta. - // TODO: curFrame debug. + // TODO: Implement doLastAnimation() to support multiple delta. + // TODO: Fix bug in curFrame. System.out.println(TAG + ": Frame=" + curFrame + "->" + numFrame); // if (numFrame - curFrame == 1) { List relatedPoints = objectCallGraph.getRelatedPoints(); @@ -129,13 +120,13 @@ } private void doLastAnimation(int numFrame, TracePoint relatedPoint) { - // TODO: Implement doLastAnimation to support plural Delta. + // TODO: Implement doLastAnimation() to support multiple delta. curFrame = numFrame; List aliasList = aliasCollector.getAliasList(); Alias prevAlias = aliasList.get(numFrame - 1); Alias nextAlias = (numFrame < aliasList.size()) ? aliasList.get(numFrame) : null; - // Make ObjectEdge and reset position of vertexObject, remove vertexMethodExecution. + // Make Edge object and reset position of ObjectVertex, remove MethodExecutionVertex. Statement statement = relatedPoint.getStatement(); MethodExecution prevMethodExec = prevAlias.getMethodExecution(); boolean fThisAnotherParameter = false; @@ -152,10 +143,8 @@ if (methodExecToVertexMap.containsKey(prevMethodExec)) { if (methodExecToVertexMap.get(prevMethodExec).getLocals().contains(tgtObjectVertex)) { methodExecToVertexMap.get(prevMethodExec).getLocals().remove(tgtObjectVertex); - System.out.println(methodExecToVertexMap.get(prevMethodExec).getLabel() + " :removeLocal: " + tgtObjectVertex.getLabel()); } else if (methodExecToVertexMap.get(prevMethodExec).getArguments().contains(tgtObjectVertex)) { methodExecToVertexMap.get(prevMethodExec).getArguments().remove(tgtObjectVertex); - System.out.println(methodExecToVertexMap.get(prevMethodExec).getLabel() + " :removeArgument: " + tgtObjectVertex.getLabel()); } } if (nextAlias == null || (nextAlias != null && !calledMethodExec.getSignature().equals(nextAlias.getMethodSignature()))) { @@ -180,17 +169,14 @@ createObjectRefrence(fieldUpdateStatement, fieldName); - // Change! String targetObjectId = fieldUpdateStatement.getValueObjId(); ObjectVertex targetObjectVertex = objectToVertexMap.get(targetObjectId); if (methodExecToVertexMap.containsKey(prevMethodExec)) { if (methodExecToVertexMap.get(prevMethodExec).getLocals().contains(targetObjectVertex)) { methodExecToVertexMap.get(prevMethodExec).getLocals().remove(targetObjectVertex); - System.out.println(methodExecToVertexMap.get(prevMethodExec).getLabel() + " :removeLocal: " + targetObjectVertex.getLabel()); } else if (methodExecToVertexMap.get(prevMethodExec).getArguments().contains(targetObjectVertex)) { methodExecToVertexMap.get(prevMethodExec).getArguments().remove(targetObjectVertex); - System.out.println(methodExecToVertexMap.get(prevMethodExec).getLabel() + " :removeArgument: " + targetObjectVertex.getLabel()); } } if (nextAlias == null || (nextAlias != null && !prevMethodExec.getSignature().equals(nextAlias.getMethodSignature()))) { @@ -235,14 +221,11 @@ if (methodExecToVertexMap.containsKey(prevMethodExec)) { if (methodExecToVertexMap.get(prevMethodExec).getLocals().contains(tgtObjectVertex)) { methodExecToVertexMap.get(prevMethodExec).getLocals().remove(tgtObjectVertex); - System.out.println(methodExecToVertexMap.get(prevMethodExec).getLabel() + " :removeLocal: " + tgtObjectVertex.getLabel()); } else if (methodExecToVertexMap.get(prevMethodExec).getArguments().contains(tgtObjectVertex)) { methodExecToVertexMap.get(prevMethodExec).getArguments().remove(tgtObjectVertex); - System.out.println(methodExecToVertexMap.get(prevMethodExec).getLabel() + " :removeArgument: " + tgtObjectVertex.getLabel()); } } List methodExecList = new ArrayList<>(methodExecToVertexMap.keySet()); - System.out.println(methodExecList.size()); if (nextAlias == null || (nextAlias != null && !prevMethodExec.getSignature().equals(nextAlias.getMethodSignature()))) { if (methodExecList.size() > 1) { removeCalledMethodExecutionVertex(null, prevMethodExec.getCallerMethodExecution(), prevMethodExec); @@ -262,10 +245,8 @@ if (methodExecToVertexMap.containsKey(prevMethodExec)) { if (methodExecToVertexMap.get(prevMethodExec).getLocals().contains(tgtObjectVertex)) { methodExecToVertexMap.get(prevMethodExec).getLocals().remove(tgtObjectVertex); - System.out.println(methodExecToVertexMap.get(prevMethodExec).getLabel() + " :removeLocal: " + tgtObjectVertex.getLabel()); } else if (methodExecToVertexMap.get(prevMethodExec).getArguments().contains(tgtObjectVertex)) { methodExecToVertexMap.get(prevMethodExec).getArguments().remove(tgtObjectVertex); - System.out.println(methodExecToVertexMap.get(prevMethodExec).getLabel() + " :removeArgument: " + tgtObjectVertex.getLabel()); } } if (nextAlias == null || (nextAlias != null && !calledMethodExec.getSignature().equals(nextAlias.getMethodSignature()))) { @@ -276,70 +257,30 @@ } } - -// MethodExecution tempMethodExec = alias.getMethodExecution(); -// //Array��List�̂Ƃ��������x����t����i�m���ɕ������Ă�����̂Ƃ�)getSignature->contains("List.get(") || "Map.get(") <�z���C�g���X�g> -// if (tempMethodExec.getSignature().contains("List.add(") || -// tempMethodExec.getSignature().contains("Map.put(")) { -// String srcClassName = tempMethodExec.getThisClassName(); -// String fieldName = tempMethodExec.getArguments().get(0).getId(); -// System.out.println("rTHIS " + srcClassName + ", " + fieldName); -// } - -// Statement tempStatement = alias.getOccurrencePoint().getStatement(); -> MethodInvocation -// if(tempStatement instanceof FieldAccess) { -// FieldAccess fieldAccessStatement = (FieldAccess) tempStatement; -// String fieldNames[] = formatFieldName(fieldAccessStatement.getFieldName()); -// String srcClassName = fieldNames[0]; -// String fieldName = fieldNames[1]; -// String sourceObjectId = fieldAccessStatement.getContainerObjId(); -// System.out.println(fieldName); -// createObjectRefrence(fieldAccessStatement, fieldName); -// removeCalledMethodExecutionVertex(objectToVertexMap.get(sourceObjectId), alias.getMethodExecution().getCallerMethodExecution(), alias.getMethodExecution()); -// updateObjectVertices(); -// } - - List meList = new ArrayList<>(methodExecToVertexMap.keySet()); - Collections.reverse(meList); - System.out.println(meList.size()); - for(int i = 0; i < meList.size(); i++) { - String objectId = meList.get(i).getThisObjId(); - ObjectVertex sourceVertexObject = objectToVertexMap.get(objectId); // sourceVertex - MethodExecution me = meList.get(i); - if (nextAlias != null && me.getSignature().equals(nextAlias.getMethodSignature())) break; - if (i != meList.size()-1) { - for(Statement st: me.getStatements()) { + + // Remove MethodExecutionVertex and reset position of ObjectVertex of MethodExecution remaining in methodExecToVertexMap. + List methodExecList = new ArrayList<>(methodExecToVertexMap.keySet()); + Collections.reverse(methodExecList); + for(int i = 0; i < methodExecList.size(); i++) { + String objectId = methodExecList.get(i).getThisObjId(); + ObjectVertex srcObjectVertex = objectToVertexMap.get(objectId); // sourceVertex + MethodExecution methodExec = methodExecList.get(i); + if (nextAlias != null && methodExec.getSignature().equals(nextAlias.getMethodSignature())) break; + if (i != methodExecList.size()-1) { + for(Statement st: methodExec.getStatements()) { if(st instanceof MethodInvocation) { MethodExecution calledMethodExec = ((MethodInvocation) st).getCalledMethodExecution(); - String calledObjectId = calledMethodExec.getThisObjId(); - System.out.println(calledObjectId); - if(objectToVertexMap.containsKey(calledObjectId)) { - mxICell calledCell = (mxICell)objectToVertexMap.get(calledObjectId).getCell(); - Point2D absolutePointCalledCell = getAbsolutePointforCell(calledCell); - System.out.println(objectId + ", " + me.getSignature()); -// objectToVertexMap.get(calledObjectId).resetCellPosition(); -// if (methodExecToVertexMap.get(methodExec).getArguments().contains(objectToVertexMap.get(calledObjectId)) || methodExecToVertexMap.get(methodExec).getLocals().contains(objectToVertexMap.get(calledObjectId))) { -// calledCell.getParent().remove(calledCell); -// calledCell.setParent(mxDefaultParent); -// calledCell.getGeometry().setX(absolutePointCalledCell.getX()); -// calledCell.getGeometry().setY(absolutePointCalledCell.getY()); -// deltaAnimation.setVertexAnimation(calledCell, new mxPoint(objectToVertexMap.get(calledObjectId).getInitialX(), objectToVertexMap.get(calledObjectId).getInitialY())); -// deltaAnimation.startVertexAnimation(); -// } - removeCalledMethodExecutionVertex(sourceVertexObject, me.getCallerMethodExecution(), me); + String calledObjId = calledMethodExec.getThisObjId(); + if(objectToVertexMap.containsKey(calledObjId)) { + removeCalledMethodExecutionVertex(srcObjectVertex, methodExec.getCallerMethodExecution(), methodExec); updateObjectVertices(); -// removeVertexMethodExecution(sourceVertexObject, methodExec); -// update(); break; } } } } else { - outputLog(); - - // Change! - List arguments = new ArrayList<>(methodExecToVertexMap.get(me).getArguments()); - List locals = new ArrayList<>(methodExecToVertexMap.get(me).getLocals()); + List arguments = new ArrayList<>(methodExecToVertexMap.get(methodExec).getArguments()); + List locals = new ArrayList<>(methodExecToVertexMap.get(methodExec).getLocals()); if (arguments.size() != 0) { for (ObjectVertex vo: arguments) { mxICell cell = (mxICell)vo.getCell(); @@ -348,8 +289,6 @@ mxgraph.getModel().beginUpdate(); synchronized (mxgraph.getModel()) { try { -// cell.getParent().remove(cell); -// cell.setParent(mxDefaultParent); if (!cell.getParent().equals(getMxDefaultParent())) { // If parent of ObjectVertex cell isn't mxDefaltParent, reset parent. cell.getParent().remove(cell); @@ -362,17 +301,12 @@ } } -// deltaAnimation.setVertexAnimation(cell, new mxPoint(vo.getInitialX(), vo.getInitialY())); -// deltaAnimation.startVertexAnimation(); -// deltaAnimation.sleepThread(DEFAULT_THREAD_SLEEP_MILLIS); MagnetRONAnimation vertexAnim = new TranslateAnimation(mxgraph, getGraphComponent()); vertexAnim.setTotalCycleCount(10); vertexAnim.setDelay(100); vertexAnim.init(cell, vo.getInitialX(), vo.getInitialY(), threadPoolExecutor); -// vertexAnim.play(); -// sleepMainThread(DEFAULT_THREAD_SLEEP_MILLIS); vertexAnim.syncPlay(); - methodExecToVertexMap.get(me).getArguments().remove(vo); + methodExecToVertexMap.get(methodExec).getArguments().remove(vo); } }else if (locals.size() != 0) { for (ObjectVertex vo: locals) { @@ -382,8 +316,6 @@ mxgraph.getModel().beginUpdate(); synchronized (mxgraph.getModel()) { try { -// cell.getParent().remove(cell); -// cell.setParent(mxDefaultParent); if (!cell.getParent().equals(getMxDefaultParent())) { // If parent of ObjectVertex cell isn't mxDefaltParent, reset parent. cell.getParent().remove(cell); @@ -395,17 +327,12 @@ mxgraph.getModel().endUpdate(); } } -// deltaAnimation.setVertexAnimation(cell, new mxPoint(vo.getInitialX(), vo.getInitialY())); -// deltaAnimation.startVertexAnimation(); -// deltaAnimation.sleepThread(DEFAULT_THREAD_SLEEP_MILLIS); MagnetRONAnimation vertexAnim = new TranslateAnimation(mxgraph, getGraphComponent()); vertexAnim.setTotalCycleCount(10); vertexAnim.setDelay(100); vertexAnim.init(cell, vo.getInitialX(), vo.getInitialY(), threadPoolExecutor); -// vertexAnim.play(); -// sleepMainThread(DEFAULT_THREAD_SLEEP_MILLIS); vertexAnim.syncPlay(); - methodExecToVertexMap.get(me).getLocals().remove(vo); + methodExecToVertexMap.get(methodExec).getLocals().remove(vo); } } updateObjectVertices(); @@ -415,64 +342,77 @@ } /** - * Create vertices(mxGraph) and objectVertices in objectToVertexMap. Vertices(mxGraph) coordinate are appropriate. + * Create vertices(mxGraph) and OvjectVerticies in {@code objectToVertexMap}. Vertices(mxGraph) coordinate are appropriate. + * * @param objectCallGraph */ private void createObjectVertices(IObjectCallGraph objectCallGraph) { //Add a vertex to the graph in a transactional fashion. The vertex is actually a 'cell' in jgraphx terminology. mxgraph.getModel().beginUpdate(); try { - // Create vertices(mxGraph) and objectVertices. + // Create vertices(mxGraph) and OvjectVerticies. List refList = objectCallGraph.getReferences(); - int ocgSize = refList.size(); - double vertexObjWidth = DEFAULT_OBJECT_VERTEX_SIZE.getWidth(); - double vertexObjHeight = DEFAULT_OBJECT_VERTEX_SIZE.getHeight(); + double objecVertexWidth = DEFAULT_OBJECT_VERTEX_SIZE.getWidth(); + double ObjectVertexHeight = DEFAULT_OBJECT_VERTEX_SIZE.getHeight(); { MethodExecution coordinator = objectCallGraph.getStartPoints().get(0); String coordinatorObjId = coordinator.getThisObjId(); String coordinatorClassName = coordinator.getThisClassName(); - Object vertex = mxgraph.insertDeltaVertex(getMxDefaultParent(), coordinatorObjId, coordinatorClassName, 0, 0, DEFAULT_OBJECT_VERTEX_SIZE.getWidth(), DEFAULT_OBJECT_VERTEX_SIZE.getHeight(), "fillColor=white"); //creates a white vertex. - objectToVertexMap.put(coordinatorObjId, new ObjectVertex(coordinatorClassName, vertex, 0, 0)); + mxICell vertex = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), coordinatorObjId, coordinatorClassName, 0, 0, DEFAULT_OBJECT_VERTEX_SIZE.getWidth(), DEFAULT_OBJECT_VERTEX_SIZE.getHeight(), "fillColor=white"); //creates a white vertex. + if (!coordinatorObjId.matches("0")) { + objectToVertexMap.put(coordinatorObjId, new ObjectVertex(coordinatorClassName, vertex, 0, 0)); + } else { // When static class. + objectToVertexMap.put(coordinatorObjId + ":" + coordinatorClassName, new ObjectVertex(coordinatorClassName, vertex, 0, 0)); + } } - for (int i = 0; i < ocgSize; i++) { + for (int i = 0; i < refList.size(); i++) { Reference ref = refList.get(i); if (!ref.isCreation() && !ref.getSrcObjectId().equals(ref.getDstObjectId())) { // srcSide if (!objectToVertexMap.containsKey(ref.getSrcObjectId())) { - System.out.println("srcSide: " + ref.getSrcClassName() + ", " + ref.getSrcObjectId() + ": " + ref.isCreation()); + String srcObjId = ref.getSrcObjectId(); String srcClassName = ref.getSrcClassName(); + System.out.println(TAG + ": Source Side(ClassName=" + srcClassName + ", ObjectId=" + srcObjId + ", isCreation=" + ref.isCreation() + ")"); if (srcClassName.contains("[L")) { srcClassName = formatArrayName(srcClassName); } - Object vertex = mxgraph.insertDeltaVertex(getMxDefaultParent(), ref.getSrcObjectId(), srcClassName, 0, 0, vertexObjWidth, vertexObjHeight, "fillColor=white"); //creates a white vertex. - objectToVertexMap.put(ref.getSrcObjectId(), new ObjectVertex(ref.getSrcClassName(), vertex, 0, 0)); + String srcKey = srcObjId.matches("0") ? srcObjId + ":" + srcClassName : srcObjId; // Static class or not. + mxICell vertex = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), srcObjId, srcClassName, 0, 0, objecVertexWidth, ObjectVertexHeight, "fillColor=white"); //creates a white vertex. + objectToVertexMap.put(srcKey, new ObjectVertex(ref.getSrcClassName(), vertex, 0, 0)); } // dstSide if (!objectToVertexMap.containsKey(ref.getDstObjectId())) { - System.out.println("dstSide: " + ref.getDstClassName() + ", " + ref.getDstObjectId()); + String dstObjId = ref.getDstObjectId(); String dstClassName = ref.getDstClassName(); + System.out.println(TAG + ": Destination Side(ClassName=" + dstClassName + ", ObjectId=" + dstObjId + ")"); if (dstClassName.contains("[L")) { dstClassName = formatArrayName(dstClassName); } - Object vertex = mxgraph.insertDeltaVertex(getMxDefaultParent(), ref.getDstObjectId(), dstClassName, 0, 0, vertexObjWidth, vertexObjHeight, "fillColor=white"); //creates a white vertex. - objectToVertexMap.put(ref.getDstObjectId(), new ObjectVertex(ref.getDstClassName(), vertex, 0, 0)); + String dstKey = dstObjId.matches("0") ? dstObjId + ":" + dstClassName : dstObjId; // Static class or not. + mxICell vertex = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), dstObjId, dstClassName, 0, 0, objecVertexWidth, ObjectVertexHeight, "fillColor=white"); //creates a white vertex. + objectToVertexMap.put(dstKey, new ObjectVertex(ref.getDstClassName(), vertex, 0, 0)); } } else { if (!objectToVertexMap.containsKey(ref.getSrcObjectId())) { + String srcObjId = ref.getSrcObjectId(); String srcClassName = ref.getSrcClassName(); if (srcClassName.contains("[L")) { srcClassName = formatArrayName(srcClassName); } - Object vertex = mxgraph.insertDeltaVertex(getMxDefaultParent(), ref.getSrcObjectId(), srcClassName, 0, 0, vertexObjWidth, vertexObjHeight, "fillColor=white"); //creates a white vertex. - objectToVertexMap.put(ref.getSrcObjectId(), new ObjectVertex(ref.getSrcClassName(), vertex, 0, 0)); + String srcKey = srcObjId.matches("0") ? srcObjId + ":" + srcClassName : srcObjId; // Static class or not. + mxICell vertex = (mxICell) mxgraph.insertDeltaVertex(getMxDefaultParent(), srcObjId, srcClassName, 0, 0, objecVertexWidth, ObjectVertexHeight, "fillColor=white"); //creates a white vertex. + objectToVertexMap.put(srcKey, new ObjectVertex(ref.getSrcClassName(), vertex, 0, 0)); } - if (!objectToVertexMap.containsKey(ref.getDstObjectId())) { - objectToVertexMap.put(ref.getDstObjectId(), new ObjectVertex(ref.getDstClassName(), null, 0, 0)); + String dstObjId = ref.getDstObjectId(); + String dstClassName = ref.getDstClassName(); + String dstKey = dstObjId.matches("0") ? dstObjId + ":" + dstClassName : dstObjId; // Static class or not. + if (!objectToVertexMap.containsKey(dstObjId)) { + objectToVertexMap.put(dstKey, new ObjectVertex(dstClassName, null, 0, 0)); } else { - mxgraph.removeCells(new Object[] {objectToVertexMap.get(ref.getDstObjectId()).getCell()}); - objectToVertexMap.get(ref.getDstObjectId()).setCell(null); + mxgraph.removeCells(new Object[] {objectToVertexMap.get(dstKey).getCell()}); + objectToVertexMap.get(dstKey).setCell(null); } } } @@ -482,7 +422,8 @@ } /** - * Create MethodExecutionVertex. Be careful to refer objectCallGraph.getStartPoints() when curFrame is 0. + * Create {@code MethodExecutionVertex}. + * Be careful to refer {@link IObjectCallGraph#getStartPoints()} when curFrame is 0. * * @param alias */ @@ -505,13 +446,13 @@ /** * - * @param ocg - * @param ac + * @param objectCallGraph + * @param aliasCollector */ - private void createEdgeToObject(IObjectCallGraph ocg, IAliasCollector ac) { - List relatedPoints = ocg.getRelatedPoints(); + private void createEdgeToObject(IObjectCallGraph objectCallGraph, IAliasCollector aliasCollector) { + List relatedPoints = objectCallGraph.getRelatedPoints(); int rpIndex = 0; // relatedPoints index - List aliasList = ac.getAliasList(); + List aliasList = aliasCollector.getAliasList(); for (int i = 0; i < aliasList.size()-1; i++) { Alias curAlias = aliasList.get(i); @@ -530,11 +471,11 @@ if (nextMethodExec.getSignature().contains("List.get(")) { srcClassName = nextMethodExec.getThisClassName(); fieldName = nextMethodExec.getArguments().get(0).getId(); - System.out.println("rTHIS " + srcClassName + ", " + nextMethodExec.getArguments().get(0).getId()); + System.out.println(TAG + ": Create List of Edge.(ClassName=" + srcClassName + ", ArgumentId=" + nextMethodExec.getArguments().get(0).getId() + ")"); } else if (nextMethodExec.getSignature().contains("Map.get(")) { srcClassName = nextMethodExec.getThisClassName(); fieldName = ""; - System.out.println("rTHIS " + srcClassName + ", " + nextMethodExec.getArguments().get(0).getId()); + System.out.println(TAG + ": Create Map of Edge.(ClassName=" + srcClassName + ")"); } } else { if (nextAlias.getAliasType() == AliasType.FIELD) { // When final local. @@ -557,7 +498,7 @@ } } } - System.out.println("THIS " + srcClassName + "(" + curAliasObjId + ") -> " + "(" + nextAliasObjId + "), "+ fieldName); + System.out.println(TAG + ": srcClassName=" + srcClassName + "(curObjectId=" + curAliasObjId + ") -- fieldName=" + fieldName + " --> " + "(nextObjectId" + nextAliasObjId + ")"); } if(curAlias.getAliasType() == AliasType.ARRAY) { @@ -566,7 +507,7 @@ srcClassName = ((ArrayAccess)statement).getArrayClassName(); int index = ((ArrayAccess)statement).getIndex(); fieldName = formatArrayIndex(index); - System.out.println("ARRAY " + srcClassName + "(" + curAliasObjId + ") -> " + "(" + nextAliasObjId + "), " + fieldName); + System.out.println(TAG + ": Create Array of Edge. srcClassName=" + srcClassName + "(curObjectId=" + curAliasObjId + ") -- fieldName=" + fieldName + " --> " + "(nextObjectId" + nextAliasObjId + ")"); } } @@ -575,7 +516,7 @@ // Judge AliasList contains relatedPoint. (If contains not to create edge.) if (rpIndex < relatedPoints.size() - 1) { TracePoint rp = relatedPoints.get(rpIndex); - Map.Entry rpInf = getRelatedInformation(rp, ac); + Map.Entry rpInf = getRelatedInformation(rp, aliasCollector); if (srcClassName.equals(rpInf.getKey().getSrcClassName()) && fieldName.equals(rpInf.getValue()) && curAliasObjId.equals(rpInf.getKey().getSrcObjectId()) && nextAliasObjId.equals(rpInf.getKey().getDstObjectId())) { rpIndex++; continue; @@ -588,7 +529,7 @@ Object srcCell = objectToVertexMap.get(curAliasObjId).getCell(); Object dstCell = objectToVertexMap.get(nextAliasObjId).getCell(); if (srcCell != null && dstCell != null) { // isCreation() - System.out.println("makeEdgeObject: " + fieldName + ", " + srcClassName + " (" + srcCell.hashCode() + "), " + " (" + dstCell.hashCode() + ")"/* + ", " + dstClassName*/); + System.out.println(TAG + ": Create Edge. srcClassName=" + srcClassName + "(curObjectId=" + curAliasObjId + ") -- fieldName=" + fieldName + " --> " + "(nextObjectId" + nextAliasObjId + ")"); // TODO: Fix bug of NullPointerException. mxICell edge = null; if (fieldName.equals(nextAliasObjId)) { // If fieldName is objectId.