• 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

95.0
/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/asm/TParamStub.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.NonNull;
8
import org.pcollections.HashTreePSet;
9
import org.pcollections.PSet;
10

11
import net.sourceforge.pmd.lang.java.symbols.JTypeParameterOwnerSymbol;
12
import net.sourceforge.pmd.lang.java.symbols.JTypeParameterSymbol;
13
import net.sourceforge.pmd.lang.java.symbols.SymbolicValue.SymAnnot;
14
import net.sourceforge.pmd.lang.java.symbols.internal.SymbolEquality;
15
import net.sourceforge.pmd.lang.java.symbols.internal.SymbolToStrings;
16
import net.sourceforge.pmd.lang.java.types.JTypeMirror;
17
import net.sourceforge.pmd.lang.java.types.JTypeVar;
18
import net.sourceforge.pmd.lang.java.types.TypeSystem;
19

20
class TParamStub implements JTypeParameterSymbol {
21

22
    private final String name;
23
    private final JTypeParameterOwnerSymbol owner;
24
    private final JTypeVar typeVar;
25
    private final String boundSignature;
26
    private final SignatureParser sigParser;
27
    private PSet<SymAnnot> annotations = HashTreePSet.empty();
1✔
28

29
    TParamStub(String name, GenericSigBase<?> sig, String bound) {
1✔
30
        this.name = name;
1✔
31
        this.owner = sig.ctx;
1✔
32
        this.sigParser = sig.typeLoader();
1✔
33
        this.boundSignature = bound;
1✔
34

35
        TypeSystem ts = sig.ctx.getTypeSystem();
1✔
36
        this.typeVar = ts.newTypeVar(this);
1✔
37
    }
1✔
38

39

40
    @Override
41
    public @NonNull String getSimpleName() {
42
        return name;
1✔
43
    }
44

45
    @Override
46
    public JTypeMirror computeUpperBound() {
47
        // Note: type annotations on the bound are added when applying
48
        // type annots collected on the enclosing symbol. See usages of
49
        // this method.
50
        return sigParser.parseTypeVarBound(owner.getLexicalScope(), boundSignature);
1✔
51
    }
52

53
    @Override
54
    public JTypeParameterOwnerSymbol getDeclaringSymbol() {
55
        return owner;
1✔
56
    }
57

58
    @Override
59
    public PSet<SymAnnot> getDeclaredAnnotations() {
60
        return annotations;
1✔
61
    }
62

63
    void addAnnotation(SymAnnot annot) {
64
        annotations = annotations.plus(annot);
1✔
65
    }
1✔
66

67
    @Override
68
    public JTypeVar getTypeMirror() {
69
        return typeVar;
1✔
70
    }
71

72
    @Override
73
    public TypeSystem getTypeSystem() {
74
        return owner.getTypeSystem();
1✔
75
    }
76

77
    @Override
78
    public String toString() {
79
        return SymbolToStrings.ASM.toString(this);
×
80
    }
81

82
    @Override
83
    public int hashCode() {
84
        return SymbolEquality.TYPE_PARAM.hash(this);
1✔
85
    }
86

87
    @Override
88
    public boolean equals(Object obj) {
89
        return SymbolEquality.TYPE_PARAM.equals(this, obj);
1✔
90
    }
91

92
}
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