< prev index next >

src/java.base/windows/classes/sun/nio/fs/WindowsLinkSupport.java

Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD

*** 327,337 **** unsafe.copyMemory(null, buffer.address() + OFFSETOF_PATHBUFFER + nameOffset, name, Unsafe.ARRAY_CHAR_BASE_OFFSET, nameLengthInBytes); // remove special prefix String target = stripPrefix(new String(name)); ! if (target.length() == 0) { throw new IOException("Symbolic link target is invalid"); } return target; } finally { buffer.release(); --- 327,337 ---- unsafe.copyMemory(null, buffer.address() + OFFSETOF_PATHBUFFER + nameOffset, name, Unsafe.ARRAY_CHAR_BASE_OFFSET, nameLengthInBytes); // remove special prefix String target = stripPrefix(new String(name)); ! if (target.isEmpty()) { throw new IOException("Symbolic link target is invalid"); } return target; } finally { buffer.release();
< prev index next >