Commit b5dbadee by aquilescanta Committed by Oliver Woodman

Remove ParserException(cause) constructor

PiperOrigin-RevId: 378635295
parent c728de99
...@@ -123,18 +123,6 @@ public class ParserException extends IOException { ...@@ -123,18 +123,6 @@ public class ParserException extends IOException {
this(message, /* cause= */ null, /* contentIsMalformed= */ true, C.DATA_TYPE_UNKNOWN); this(message, /* cause= */ null, /* contentIsMalformed= */ true, C.DATA_TYPE_UNKNOWN);
} }
/**
* Creates a new instance.
*
* @param cause The cause for the exception.
* @deprecated Use a factory method which initializes {@link #contentIsMalformed}, and {@link
* #dataType} instead.
*/
@Deprecated
public ParserException(Throwable cause) {
this(/* message= */ null, cause, /* contentIsMalformed= */ true, C.DATA_TYPE_UNKNOWN);
}
protected ParserException( protected ParserException(
@Nullable String message, @Nullable String message,
@Nullable Throwable cause, @Nullable Throwable cause,
......
...@@ -1464,7 +1464,7 @@ public final class DashMediaSource extends BaseMediaSource { ...@@ -1464,7 +1464,7 @@ public final class DashMediaSource extends BaseMediaSource {
} }
return timestampMs; return timestampMs;
} catch (ParseException e) { } catch (ParseException e) {
throw new ParserException(e); throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
} }
} }
} }
......
...@@ -103,7 +103,7 @@ public class DashManifestParser extends DefaultHandler ...@@ -103,7 +103,7 @@ public class DashManifestParser extends DefaultHandler
} }
return parseMediaPresentationDescription(xpp, uri.toString()); return parseMediaPresentationDescription(xpp, uri.toString());
} catch (XmlPullParserException e) { } catch (XmlPullParserException e) {
throw new ParserException(e); throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
} }
} }
......
...@@ -240,7 +240,7 @@ import java.util.List; ...@@ -240,7 +240,7 @@ import java.util.List;
int speedDivisor = 1 << (speedMode - 1); int speedDivisor = 1 << (speedMode - 1);
segments.add(new SlowMotionData.Segment(startTimeMs, endTimeMs, speedDivisor)); segments.add(new SlowMotionData.Segment(startTimeMs, endTimeMs, speedDivisor));
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
throw new ParserException(e); throw ParserException.createForMalformedContainer(/* message= */ null, /* cause= */ e);
} }
} }
return new SlowMotionData(segments); return new SlowMotionData(segments);
......
...@@ -74,7 +74,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> { ...@@ -74,7 +74,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
new SmoothStreamingMediaParser(null, uri.toString()); new SmoothStreamingMediaParser(null, uri.toString());
return (SsManifest) smoothStreamingMediaParser.parse(xmlParser); return (SsManifest) smoothStreamingMediaParser.parse(xmlParser);
} catch (XmlPullParserException e) { } catch (XmlPullParserException e) {
throw new ParserException(e); throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
} }
} }
...@@ -253,7 +253,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> { ...@@ -253,7 +253,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
try { try {
return Integer.parseInt(value); return Integer.parseInt(value);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
throw new ParserException(e); throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
} }
} else { } else {
return defaultValue; return defaultValue;
...@@ -266,7 +266,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> { ...@@ -266,7 +266,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
try { try {
return Integer.parseInt(value); return Integer.parseInt(value);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
throw new ParserException(e); throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
} }
} else { } else {
throw new MissingFieldException(key); throw new MissingFieldException(key);
...@@ -280,7 +280,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> { ...@@ -280,7 +280,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
try { try {
return Long.parseLong(value); return Long.parseLong(value);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
throw new ParserException(e); throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
} }
} else { } else {
return defaultValue; return defaultValue;
...@@ -294,7 +294,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> { ...@@ -294,7 +294,7 @@ public class SsManifestParser implements ParsingLoadable.Parser<SsManifest> {
try { try {
return Long.parseLong(value); return Long.parseLong(value);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
throw new ParserException(e); throw ParserException.createForMalformedManifest(/* message= */ null, /* cause= */ e);
} }
} else { } else {
throw new MissingFieldException(key); throw new MissingFieldException(key);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment