Harmonize style of igored exceptions across the codebase

This commit is contained in:
Moritz Halbritter
2024-02-12 10:09:29 +01:00
parent 831a98c83c
commit 8ffcfc9b77
51 changed files with 116 additions and 55 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010 The Android Open Source Project
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,7 +51,8 @@ class JSON {
try {
return Double.valueOf((String) value);
}
catch (NumberFormatException ignored) {
catch (NumberFormatException ex) {
// Ignore
}
}
return null;
@@ -68,7 +69,8 @@ class JSON {
try {
return (int) Double.parseDouble((String) value);
}
catch (NumberFormatException ignored) {
catch (NumberFormatException ex) {
// Ignore
}
}
return null;
@@ -85,7 +87,8 @@ class JSON {
try {
return (long) Double.parseDouble((String) value);
}
catch (NumberFormatException ignored) {
catch (NumberFormatException ex) {
// Ignore
}
}
return null;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010 The Android Open Source Project
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -827,7 +827,8 @@ public class JSONObject {
return o.toString();
}
}
catch (Exception ignored) {
catch (Exception ex) {
// Ignore
}
return null;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010 The Android Open Source Project
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -320,7 +320,8 @@ public class JSONTokener {
try {
return Double.valueOf(literal);
}
catch (NumberFormatException ignored) {
catch (NumberFormatException ex) {
// Ignore
}
/* ... finally give up. We have an unquoted string */