Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/02/2010, 10:59
ipadilla
 
Fecha de Ingreso: enero-2010
Mensajes: 18
Antigüedad: 15 años, 1 mes
Puntos: 0
¿Por qué no compila este código?

¿Alguien me pude decir por qué no se compila esta clase java con la versión SDK6 de SUN?
Parece ser que con alguna versión anterior compilaba bien.

javac FileElement.java

//===================== FileElement.java =========================

package org.jfm.views;

import java.io.File;

public class FileElement extends File
implements Comparable
{

public FileElement(String pathname)
{
this(pathname, false);
}

public FileElement(String pathname, boolean topFile)
{
super(pathname);
setTopFile(topFile);
}

public String toString()
{
if(isTopFile())
return "..";
else
return getName();
}

public void setTopFile(boolean topFile)
{
this.topFile = topFile;
}

public boolean isTopFile()
{
return topFile;
}

public FileElement getRootFile()
{
return getRootFile(this);
}

private FileElement getRootFile(FileElement f)
{
String parentPath = f.getParent();
if(parentPath == null)
{
return f;
} else
{
FileElement parent = new FileElement(parentPath);
return getRootFile(parent);
}
}

public int compareTo(Object o)
{
FileElement el = (FileElement)o;
if(isDirectory() && !el.isDirectory())
return -1;
if(!isDirectory() && el.isDirectory())
return 1;
else
return toString().compareTo(el.toString());
}

private boolean topFile;
}