Fix Dackka javadoc errors in protected methods

If there's an @param javadoc tag in a supertype then all overrides
of this method that don't also override the javadoc must use the same
parameter name.

PiperOrigin-RevId: 485857711
(cherry picked from commit be7dd956929578c1ad05889a389581a8b1c9dbd3)
This commit is contained in:
ibaker 2022-11-03 13:35:39 +00:00 committed by microkatz
parent 96a25a76a1
commit 6871de23a4
8 changed files with 19 additions and 18 deletions

View File

@ -91,11 +91,11 @@ public abstract class SimpleSubtitleDecoder
* Decodes data into a {@link Subtitle}.
*
* @param data An array holding the data to be decoded, starting at position 0.
* @param size The size of the data to be decoded.
* @param length The number of bytes from {@code data} to be decoded.
* @param reset Whether the decoder must be reset before decoding.
* @return The decoded {@link Subtitle}.
* @throws SubtitleDecoderException If a decoding error occurs.
*/
protected abstract Subtitle decode(byte[] data, int size, boolean reset)
protected abstract Subtitle decode(byte[] data, int length, boolean reset)
throws SubtitleDecoderException;
}

View File

@ -56,8 +56,9 @@ public final class PgsDecoder extends SimpleSubtitleDecoder {
}
@Override
protected Subtitle decode(byte[] data, int size, boolean reset) throws SubtitleDecoderException {
buffer.reset(data, size);
protected Subtitle decode(byte[] data, int length, boolean reset)
throws SubtitleDecoderException {
buffer.reset(data, length);
maybeInflateData(buffer);
cueBuilder.reset();
ArrayList<Cue> cues = new ArrayList<>();

View File

@ -110,15 +110,15 @@ public final class SsaDecoder extends SimpleSubtitleDecoder {
}
@Override
protected Subtitle decode(byte[] bytes, int length, boolean reset) {
protected Subtitle decode(byte[] data, int length, boolean reset) {
List<List<Cue>> cues = new ArrayList<>();
List<Long> cueTimesUs = new ArrayList<>();
ParsableByteArray data = new ParsableByteArray(bytes, length);
ParsableByteArray parsableData = new ParsableByteArray(data, length);
if (!haveInitializationData) {
parseHeader(data);
parseHeader(parsableData);
}
parseEventBody(data, cues, cueTimesUs);
parseEventBody(parsableData, cues, cueTimesUs);
return new SsaSubtitle(cues, cueTimesUs);
}

View File

@ -72,10 +72,10 @@ public final class SubripDecoder extends SimpleSubtitleDecoder {
}
@Override
protected Subtitle decode(byte[] bytes, int length, boolean reset) {
protected Subtitle decode(byte[] data, int length, boolean reset) {
ArrayList<Cue> cues = new ArrayList<>();
LongArray cueTimesUs = new LongArray();
ParsableByteArray subripData = new ParsableByteArray(bytes, length);
ParsableByteArray subripData = new ParsableByteArray(data, length);
@Nullable String currentLine;
while ((currentLine = subripData.readLine()) != null) {

View File

@ -115,7 +115,7 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
}
@Override
protected Subtitle decode(byte[] bytes, int length, boolean reset)
protected Subtitle decode(byte[] data, int length, boolean reset)
throws SubtitleDecoderException {
try {
XmlPullParser xmlParser = xmlParserFactory.newPullParser();
@ -123,7 +123,7 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
Map<String, TtmlRegion> regionMap = new HashMap<>();
Map<String, String> imageMap = new HashMap<>();
regionMap.put(TtmlNode.ANONYMOUS_REGION_ID, new TtmlRegion(TtmlNode.ANONYMOUS_REGION_ID));
ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes, 0, length);
ByteArrayInputStream inputStream = new ByteArrayInputStream(data, 0, length);
xmlParser.setInput(inputStream, null);
@Nullable TtmlSubtitle ttmlSubtitle = null;
ArrayDeque<TtmlNode> nodeStack = new ArrayDeque<>();

View File

@ -125,9 +125,9 @@ public final class Tx3gDecoder extends SimpleSubtitleDecoder {
}
@Override
protected Subtitle decode(byte[] bytes, int length, boolean reset)
protected Subtitle decode(byte[] data, int length, boolean reset)
throws SubtitleDecoderException {
parsableByteArray.reset(bytes, length);
parsableByteArray.reset(data, length);
String cueTextString = readSubtitleText(parsableByteArray);
if (cueTextString.isEmpty()) {
return Tx3gSubtitle.EMPTY;

View File

@ -51,11 +51,11 @@ public final class Mp4WebvttDecoder extends SimpleSubtitleDecoder {
}
@Override
protected Subtitle decode(byte[] bytes, int length, boolean reset)
protected Subtitle decode(byte[] data, int length, boolean reset)
throws SubtitleDecoderException {
// Webvtt in Mp4 samples have boxes inside of them, so we have to do a traditional box parsing:
// first 4 bytes size and then 4 bytes type.
sampleData.reset(bytes, length);
sampleData.reset(data, length);
List<Cue> resultingCueList = new ArrayList<>();
while (sampleData.bytesLeft() > 0) {
if (sampleData.bytesLeft() < BOX_HEADER_SIZE) {

View File

@ -53,9 +53,9 @@ public final class WebvttDecoder extends SimpleSubtitleDecoder {
}
@Override
protected Subtitle decode(byte[] bytes, int length, boolean reset)
protected Subtitle decode(byte[] data, int length, boolean reset)
throws SubtitleDecoderException {
parsableWebvttData.reset(bytes, length);
parsableWebvttData.reset(data, length);
List<WebvttCssStyle> definedStyles = new ArrayList<>();
// Validate the first line of the header, and skip the remainder.