Skip to content

Pattern.compile() called on every invocation of handleSpecificationEntries #370

Description

@elharo

Affected version: all

Description:

MavenArchiver.handleSpecificationEntries() at line 422 compiles a regex pattern every time it is called:

Matcher matcher = Pattern.compile("([0-9]+\\.[0-9]+)(.*?)").matcher(version);

This pattern is constant and should be a private static final Pattern field. The current implementation compiles it on every manifest creation, creating unnecessary GC pressure.

Fix: Extract to a static field.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions