## Summary

Follow-up to [JDK-8341608](https://bugs.openjdk.org/browse/JDK-8341608), which 
addressed `ClassFileError` propagation in jdeps but did not fix the underlying 
signature parsing.

`SignaturesImpl.classTypeSig()` throws `IllegalArgumentException` when parsing 
a class type signature that contains an empty identifier after the inner class 
separator `.`.

## Problem

The Scala compiler emits class type signatures such as:

    
Lcoursierapi/shaded/scala/collection/immutable/TreeMap$TreeMapBuilder<TK;TV;>.;

Here the `.` after the type arguments is followed directly by `;` with no inner 
class name. While this violates JVMS ยง4.7.9.1 (which requires an identifier 
after `.`), such signatures exist widely in published Scala artifacts on Maven 
Central and cannot be recompiled.

Running `jdeps` against JARs containing these signatures crashes with:

    Exception in thread "main" com.sun.tools.jdeps.Dependencies$ClassFileError
    Caused by: java.lang.IllegalArgumentException:
      Unexpected character ; at position 78, expected an identifier

## Fix

In `classTypeSig()`, the identifier after `.` is now optional when an outer 
type is already present. On the first iteration (no outer type), an identifier 
is still strictly required.

## Test

Added `LOuter<TK;TV;>.;` to `goodTypeSignatures` in `SignaturesTest`.

-------------

Commit messages:
 - SignaturesImpl: tolerate empty identifier after '.' in class type signatures

Changes: https://git.openjdk.org/jdk/pull/30041/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=30041&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8341608
  Stats: 5 lines in 2 files changed: 4 ins; 1 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/30041.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30041/head:pull/30041

PR: https://git.openjdk.org/jdk/pull/30041

Reply via email to