package io.github.classgraph.issues;

import static org.assertj.core.api.Assertions.assertThat;

import java.io.Closeable;
import java.io.IOException;

import org.junit.Test;

import io.github.classgraph.ClassGraph;
import io.github.classgraph.ClassRefTypeSignature;
import io.github.classgraph.FieldInfoList;
import io.github.classgraph.ScanResult;
import io.github.classgraph.utils.Recycler;

public class GenericInnerClassTypedField {

    Recycler<Closeable, IOException>.Recyclable recyclable;

    @Test
    public void testGenericInnerClassTypedField() {
        try (ScanResult scanResult = new ClassGraph()
                .whitelistPackages(GenericInnerClassTypedField.class.getPackage().getName()).enableAllInfo()
                .scan()) {
            final FieldInfoList fields = scanResult.getClassInfo(GenericInnerClassTypedField.class.getName())
                    .getFieldInfo();
            final ClassRefTypeSignature classRefTypeSignature = (ClassRefTypeSignature) fields.get(0)
                    .getTypeSignature();
            assertThat(classRefTypeSignature.toString()).isEqualTo(
                    "io.github.classgraph.utils.Recycler<java.io.Closeable, java.io.IOException>.Recyclable");
            assertThat(classRefTypeSignature.getFullyQualifiedClassName())
                    .isEqualTo("io.github.classgraph.utils.Recycler$Recyclable");
        }
    }

}

@@ -94,63 +94,8 @@
 t;%0A%0A
-import java.io.Closeable;%0Aimport java.io.IOException;%0A%0A
 impo
@@ -291,52 +291,8 @@
 ult;
-%0Aimport io.github.classgraph.utils.Recycler;
 %0A%0Apu
@@ -336,67 +336,116 @@
 d %7B%0A
-%0A
     
-Recycler%3CCloseable, IOException%3E.Recyclable recyclable
+private static class A%3CX, Y%3E %7B%0A        private class B %7B%0A        %7D%0A    %7D%0A%0A    A%3CInteger, String%3E.B field
 ;%0A%0A 
@@ -1077,252 +1077,208 @@
     
-%22io.github.classgraph.utils.Recycler%3Cjava.io.Closeable, java.io.IOException%3E.Recyclable%22);%0A            assertThat(classRefTypeSignature.getFullyQualifiedClassName())%0A                    .isEqualTo(%22io.github.classgraph.utils.Recycler$Recyclable
+A.class.getName() + %22%3C%22 + Integer.class.getName() + %22, %22 + String.class.getName() + %22%3E.B%22);%0A            assertThat(classRefTypeSignature.getFullyQualifiedClassName()).isEqualTo(A.class.getName() + %22$B
 %22);%0A
@@ -1293,11 +1293,10 @@
 %7D%0A    %7D%0A
-%0A
 %7D%0A

Update test