Skip to content

Code missing closing parenthesis. Errant continue statement. #267

Description

@authentictech

In Learn > The Java I/O API > File System Basics > Managing File Attributes, section "Determining MIME Type", there is a missing closing parenthesis:

try {
String type = Files.probeContentType(filename);
if (type == null) {
System.err.format("'%s' has an" + " unknown filetype.%n", filename);
} else if (!type.equals("text/plain") { // <-- parenthesis missing here
System.err.format("'%s' is not" + " a plain text file.%n", filename);
continue;
}
} catch (IOException x) {
System.err.println(x);
}

I also get a compiler error about the continue statement: "error: continue outside of loop". (I presume the code was copied originally from a loop.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions