• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pmd / pmd / #3722

pending completion
#3722

push

github actions

adangel
Suppress MissingOverride for Chars::isEmpty (#4291)

67270 of 127658 relevant lines covered (52.7%)

0.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/asm/LazyTypeSig.java
1
/*
2
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3
 */
4

5
package net.sourceforge.pmd.lang.java.symbols.internal.asm;
6

7
import org.checkerframework.checker.nullness.qual.Nullable;
8
import org.objectweb.asm.TypePath;
9

10
import net.sourceforge.pmd.lang.java.symbols.SymbolicValue.SymAnnot;
11
import net.sourceforge.pmd.lang.java.symbols.internal.asm.TypeAnnotationHelper.TypeAnnotationSet;
12
import net.sourceforge.pmd.lang.java.types.JTypeMirror;
13
import net.sourceforge.pmd.lang.java.types.Substitution;
14

15
class LazyTypeSig {
16

17
    private final String sig;
18
    private final ClassStub ctx;
19
    private JTypeMirror parsed;
20
    private TypeAnnotationSet typeAnnots;
21

22
    LazyTypeSig(ClassStub ctx,
23
                String descriptor,
24
                @Nullable String signature) {
1✔
25
        this.ctx = ctx;
1✔
26
        this.sig = signature == null ? descriptor : signature;
1✔
27
    }
1✔
28

29
    JTypeMirror get() {
30
        if (parsed == null) {
1✔
31
            parsed = ctx.sigParser().parseFieldType(ctx.getLexicalScope(), sig);
1✔
32
            if (typeAnnots != null) {
1✔
33
                parsed = typeAnnots.decorate(parsed);
1✔
34
                typeAnnots = null; // forget about them
1✔
35
            }
36
        }
37
        return parsed;
1✔
38
    }
39

40

41
    JTypeMirror get(Substitution subst) {
42
        return get().subst(subst);
1✔
43
    }
44

45

46
    @Override
47
    public String toString() {
48
        return sig;
×
49
    }
50

51
    public void addTypeAnnotation(@Nullable TypePath path, SymAnnot annot) {
52
        if (parsed != null) {
1✔
53
            throw new IllegalStateException("Must add annotations before the field type is parsed.");
×
54
        }
55
        if (typeAnnots == null) {
1✔
56
            typeAnnots = new TypeAnnotationSet();
1✔
57
        }
58
        typeAnnots.add(path, annot);
1✔
59
    }
1✔
60

61

62
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc