Will It Vibe logoWill It Vibe?
JAVA-005Low severity-4 points

String compared with == instead of .equals()

Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.

What it detects

A variable is compared to a string literal with ==, which checks reference identity, not content. String literals are often interned so this can appear to work in one case and silently fail for an equal-but-not-interned String elsewhere.

Why it matters

Comparing a String to a literal with == checks whether they are the exact same object in memory, not whether their contents are equal. String literals are often interned so this can appear to work in casual testing, then fail unpredictably for a value built at runtime (from user input, a database row, or string concatenation) that is equal in content but a different object.

How to fix it

Use .equals() (or, if null-safety matters, Objects.equals(a, b) or "literal".equals(variable)) for content comparison. Reserve == for primitive values and for intentional reference-identity checks.

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Code Quality & Syntax checks