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

raphw / byte-buddy / #811

03 Nov 2025 10:41AM UTC coverage: 83.677% (-0.3%) from 84.023%
#811

push

raphw
Fix null handling.

0 of 1 new or added line in 1 file covered. (0.0%)

791 existing lines in 12 files now uncovered.

29814 of 35630 relevant lines covered (83.68%)

0.84 hits per line

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

0.0
/byte-buddy-dep/src/main/java/net/bytebuddy/build/ModuleVersionPlugin.java
1
/*
2
 * Copyright 2014 - Present Rafael Winterhalter
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package net.bytebuddy.build;
17

18
import net.bytebuddy.description.type.TypeDescription;
19
import net.bytebuddy.dynamic.ClassFileLocator;
20
import net.bytebuddy.dynamic.DynamicType;
21
import net.bytebuddy.utility.nullability.MaybeNull;
22

23
/**
24
 * A plugin that includes a version number in the declared module-info class.
25
 */
26
@HashCodeAndEqualsPlugin.Enhance
27
public class ModuleVersionPlugin implements Plugin, Plugin.Factory {
28

29
    /**
30
     * The version to include or {@code null} to not include a version.
31
     */
32
    @MaybeNull
33
    @HashCodeAndEqualsPlugin.ValueHandling(HashCodeAndEqualsPlugin.ValueHandling.Sort.REVERSE_NULLABILITY)
34
    private final String version;
35

36
    /**
37
     * Creates a new module version plugin.
38
     *
39
     * @param version The version to include or {@code null} to not include a version.
40
     */
41
    public ModuleVersionPlugin(@MaybeNull String version) {
×
42
        this.version = version;
×
43
    }
×
44

45
    /**
46
     * {@inheritDoc}
47
     */
48
    public Plugin make() {
49
        return this;
×
50
    }
51

52
    /**
53
     * {@inheritDoc}
54
     */
55
    public DynamicType.Builder<?> apply(DynamicType.Builder<?> builder, TypeDescription typeDescription, ClassFileLocator classFileLocator) {
56
        return builder.adjustModule().version(version);
×
57
    }
58

59
    /**
60
     * {@inheritDoc}
61
     */
62
    public boolean matches(@MaybeNull TypeDescription target) {
NEW
63
        return target != null && target.isModuleType();
×
64
    }
65

66
    /**
67
     * {@inheritDoc}
68
     */
69
    public void close() {
70
        /* do nothing */
71
    }
×
72
}
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