← Winnitude! Search  ·  Reader Mode (1975 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 6 LINKS

Code missing closing parenthesis. Errant continue statement. · Issue #267 · java/devjava-content

Repository navigation

Code missing closing parenthesis. Errant continue statement.  #267


New issue

New issue

Open

Open
Code missing closing parenthesis. Errant continue statement. #267

Description

@authentictech's profile authentictech opened on Aug 4, 2026

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