Skip to content

Commit

Permalink
Fix Dackka javadoc errors in protected methods
Browse files Browse the repository at this point in the history
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
  • Loading branch information
icbaker authored and microkatz committed Nov 8, 2022
1 parent 3fdfe58 commit b8e5d70
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ protected final SubtitleDecoderException decode(
* 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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ public PgsDecoder() {
}

@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<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ public SsaDecoder(@Nullable List<byte[]> initializationData) {
}

@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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ public SubripDecoder() {
}

@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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ public TtmlDecoder() {
}

@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();
Map<String, TtmlStyle> globalStyles = new HashMap<>();
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<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ public Tx3gDecoder(List<byte[]> initializationData) {
}

@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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ public Mp4WebvttDecoder() {
}

@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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public WebvttDecoder() {
}

@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.
Expand Down

0 comments on commit b8e5d70

Please sign in to comment.