Limpieza de comentarios y codigo final

This commit is contained in:
marcos.alcalde1
2026-10-20 14:13:54 +02:00
parent 241c455945
commit ab6baf767d
2 changed files with 1 additions and 3 deletions
@@ -19,14 +19,12 @@ public class ContinenteDaoFichero implements IContinenteDAO {
try (BufferedReader br = new BufferedReader(new FileReader("continentes.txt"))) { try (BufferedReader br = new BufferedReader(new FileReader("continentes.txt"))) {
String linea; String linea;
while ((linea = br.readLine()) != null) { while ((linea = br.readLine()) != null) {
// Lógica simple para leer tus líneas del fichero
String[] partes = linea.split(","); String[] partes = linea.split(",");
if (partes.length >= 2) { if (partes.length >= 2) {
lista.add(new Continente(partes[0].trim(), partes[1].trim())); lista.add(new Continente(partes[0].trim(), partes[1].trim()));
} }
} }
} catch (IOException e) { } catch (IOException e) {
// AQUÍ ESTÁ LA CLAVE DE LA ACTIVIDAD: Si falla el fichero, lanzamos nuestra excepción
throw new AccesoDatosException("Error al leer el archivo de continentes", e); throw new AccesoDatosException("Error al leer el archivo de continentes", e);
} }
@@ -31,7 +31,7 @@ public class Continente {
this.nombre = nombre; this.nombre = nombre;
} }
// ToString para ver los datos por consola // ToString para datos consola
@Override @Override
public String toString() { public String toString() {
return "Continente [codigo=" + codigo + ", nombre=" + nombre + "]"; return "Continente [codigo=" + codigo + ", nombre=" + nombre + "]";