Skip to content

SpotBugs: Reliance on default encoding in CopilotClient #16

@brunoborges

Description

@brunoborges

SpotBugs Finding: DM_DEFAULT_ENCODING

Category: I18N (Internationalization)
Priority: 1 (High) | Rank: 19
Bug Type: DM_DEFAULT_ENCODING
CWE: CWE-173
Instances: 2

Description

Found reliance on default encoding via new InputStreamReader(InputStream) without specifying a charset. This can lead to different behavior across platforms with different default encodings.

Affected Locations

Class Method File Line
CopilotClient lambda$startCliServer$0(Process) CopilotClient.java 1017
CopilotClient startCliServer() CopilotClient.java 1032

Suggested Fix

// Before:
new InputStreamReader(process.getErrorStream())

// After:
new InputStreamReader(process.getErrorStream(), StandardCharsets.UTF_8)

Generated from SpotBugs 4.9.8 static analysis

Metadata

Metadata

Labels

bugSomething isn't workingspotbugsSpotBugs static analysis finding

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions