Fixed warnings
This commit is contained in:
parent
cf7f5f2f18
commit
782a4361c2
3 changed files with 20 additions and 20 deletions
|
@ -86,7 +86,7 @@ public class GraphViz
|
|||
private final static long serialVersionUID = 1L; {
|
||||
try {
|
||||
load(new FileInputStream(cfgProp));
|
||||
} catch (Exception e) {}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -166,7 +166,7 @@ private static String DOT = configFile.getProperty("dotFor" + osName);
|
|||
* Adds a string to the graph's source (with newline).
|
||||
*/
|
||||
public void addln(String line) {
|
||||
this.graph.append(line + "\n");
|
||||
this.graph.append(line).append("\n");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -189,14 +189,14 @@ private static String DOT = configFile.getProperty("dotFor" + osName);
|
|||
public byte[] getGraph(String dot_source, String type)
|
||||
{
|
||||
File dot;
|
||||
byte[] img_stream = null;
|
||||
byte[] img_stream;
|
||||
|
||||
try {
|
||||
dot = writeDotSourceToFile(dot_source);
|
||||
if (dot != null)
|
||||
{
|
||||
img_stream = get_img_stream(dot, type);
|
||||
if (dot.delete() == false)
|
||||
if (!dot.delete())
|
||||
System.err.println("Warning: " + dot.getAbsolutePath() + " could not be deleted!");
|
||||
return img_stream;
|
||||
}
|
||||
|
@ -258,9 +258,9 @@ private static String DOT = configFile.getProperty("dotFor" + osName);
|
|||
img_stream = new byte[in.available()];
|
||||
in.read(img_stream);
|
||||
// Close it if we need to
|
||||
if( in != null ) in.close();
|
||||
in.close();
|
||||
|
||||
if (img.delete() == false)
|
||||
if (!img.delete())
|
||||
System.err.println("Warning: " + img.getAbsolutePath() + " could not be deleted!");
|
||||
}
|
||||
catch (java.io.IOException ioe) {
|
||||
|
|
|
@ -52,19 +52,19 @@ public class Transformador {
|
|||
// Imprime el grafo en la pantalla
|
||||
private static String imprimirGrafo(List<String> arcos)
|
||||
{
|
||||
String dotInfo="";
|
||||
StringBuilder dotInfo= new StringBuilder();
|
||||
for(String arco:arcos) {
|
||||
dotInfo += arco;
|
||||
dotInfo.append(arco);
|
||||
System.out.println("ARCO: "+arco);
|
||||
}
|
||||
System.out.println("\nCFG:");
|
||||
System.out.println(dotInfo);
|
||||
|
||||
return dotInfo;
|
||||
return dotInfo.toString();
|
||||
}
|
||||
|
||||
// Elimina todos los comentarios de un nodo y sus hijos
|
||||
static void quitarComentarios(Node node){
|
||||
private static void quitarComentarios(Node node){
|
||||
node.removeComment();
|
||||
for (Comment comment : node.getOrphanComments())
|
||||
{
|
||||
|
|
|
@ -11,19 +11,19 @@ import com.github.javaparser.ast.visitor.VoidVisitorAdapter;
|
|||
|
||||
|
||||
public class Visitador extends VoidVisitorAdapter<List<String>>
|
||||
{
|
||||
/********************************************************/
|
||||
/********************** Atributos ***********************/
|
||||
/********************************************************/
|
||||
{
|
||||
//********************************************************/
|
||||
//********************** Atributos ***********************/
|
||||
//********************************************************/
|
||||
|
||||
// Usamos un contador para numerar las instrucciones
|
||||
int contador=1;
|
||||
String nodoAnterior = "Start";
|
||||
String nodoActual = "";
|
||||
private int contador=1;
|
||||
private String nodoAnterior = "Start";
|
||||
private String nodoActual = "";
|
||||
|
||||
/********************************************************/
|
||||
/*********************** Metodos ************************/
|
||||
/********************************************************/
|
||||
//********************************************************/
|
||||
//*********************** Metodos ************************/
|
||||
//********************************************************/
|
||||
|
||||
// Visitador de métodos
|
||||
// Este visitador añade el nodo final al CFG
|
||||
|
|
Loading…
Reference in a new issue