apache / apache/jmeter

FileServer should fix hasHeader setting when creating an alias

Open
#2,907 1 comment 0 reactions 0 assignees View on GitHub
enhancement os: All P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**Sebb** ([Bug 53804](https://bz.apache.org/bugzilla//show_bug.cgi?id=53804&redirect=false)):
One of the FileServer#reserveFile() methods allows the user to specify that a file has a header line, in which case it is returned. [The others don't allow a header]

However, when reading a headed file later, the user has to remember to provide the correct parameter to readLine.

This is a recipe for confusion.

The reserveFile() methods should save the header status of the file entry when it is created.

This should then be used by the the readLine() methods, which should not need to be told the header status.

However, changing this might possibly break some 3rd party code.
So perhaps the safest would be to deprecate the following method:

readLine(String filename, boolean recycle, boolean firstLineIsNames)

and log a warning (or error?) if the reading mode disagrees with the reservation mode.

OS: All

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.