Skip to content

Commit

Permalink
Changed ParameterName presubmit rule severity to error (#26794)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyBarabash authored Dec 6, 2024
1 parent a6719a3 commit ba0c0ee
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 37 deletions.
29 changes: 14 additions & 15 deletions android/java/org/chromium/chrome/browser/BraveRewardsBalance.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/**
* Copyright (c) 2020 The Brave Authors. All rights reserved.
/* Copyright (c) 2020 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/.
*/
* You can obtain one at https://mozilla.org/MPL/2.0/. */
package org.chromium.chrome.browser;

import androidx.annotation.VisibleForTesting;
import java.util.Iterator;
import java.util.Map;
import java.util.HashMap;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class BraveRewardsBalance {
public static final String WALLET_BLINDED = "blinded";

Expand All @@ -25,23 +24,23 @@ public class BraveRewardsBalance {
public static final String JSON_WALLETS = "wallets";

private double mTotal;
Map <String, Double> mWallets;
Map<String, Double> mWallets;

BraveRewardsBalance (String json_balance) throws JSONException {
fromJson (json_balance);
BraveRewardsBalance(String jsonBalance) throws JSONException {
fromJson(jsonBalance);
}

private void fromJson(String json_balance) throws JSONException {
JSONObject jsonroot = new JSONObject(json_balance);
private void fromJson(String jsonBalance) throws JSONException {
JSONObject jsonroot = new JSONObject(jsonBalance);
mTotal = jsonroot.getDouble(JSON_TOTAL);

mWallets = new HashMap <>();
mWallets = new HashMap<>();
JSONObject json_wallets = jsonroot.getJSONObject(JSON_WALLETS);
Iterator<String> keys = json_wallets.keys();
while(keys.hasNext()) {
while (keys.hasNext()) {
String key = keys.next();
Double val = json_wallets.getDouble(key);
mWallets.put (key, val);
mWallets.put(key, val);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ public String getUserName() {
return mUserName;
}

public BraveRewardsExternalWallet(String json_external_wallet) throws JSONException {
fromJson (json_external_wallet);
public BraveRewardsExternalWallet(String jsonExternalWallet) throws JSONException {
fromJson(jsonExternalWallet);
}

private void fromJson(String json_external_wallet) throws JSONException {
JSONObject jsonObj = new JSONObject(json_external_wallet);
private void fromJson(String jsonExternalWallet) throws JSONException {
JSONObject jsonObj = new JSONObject(jsonExternalWallet);
mAccountUrl = jsonObj.getString(ACCOUNT_URL);
mAddress = jsonObj.getString(ADDRESS);
mStatus = jsonObj.getInt(STATUS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ private static void openURL(String url) {
}

@CalledByNative
private static void handleVoiceRecognition(WebContents webContents, String conversation_uuid) {
private static void handleVoiceRecognition(WebContents webContents, String conversationUuid) {
new BraveLeoVoiceRecognitionHandler(
webContents.getTopLevelNativeWindow(), webContents, conversation_uuid)
webContents.getTopLevelNativeWindow(), webContents, conversationUuid)
.startVoiceRecognition();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ protected boolean useFixedMVTLayout() {
.getBoolean(BravePref.NEW_TAB_PAGE_SHOW_BACKGROUND_IMAGE);
}

public void setTabProvider(Supplier<Tab> unusedTabProvider) {}
public void setTabProvider(Supplier<Tab> unused_tabProvider) {}

private void showNTPImage(NTPImage ntpImage) {
Display display = mActivity.getWindowManager().getDefaultDisplay();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ public void setOldHttpsUpgradesCount(Profile profile, long count) {
BravePrefServiceBridgeJni.get().setOldHttpsUpgradesCount(profile, count);
}

public boolean getBooleanForContentSetting(int content_type) {
return BravePrefServiceBridgeJni.get().getBooleanForContentSetting(content_type);
public boolean getBooleanForContentSetting(int contentType) {
return BravePrefServiceBridgeJni.get().getBooleanForContentSetting(contentType);
}

public void setWebrtcPolicy(int policy) {
Expand Down Expand Up @@ -163,15 +163,19 @@ interface Natives {
boolean getSafetynetCheckFailed();

void resetPromotionLastFetchStamp();
boolean getBooleanForContentSetting(int content_type);

boolean getBooleanForContentSetting(int contentType);

void setWebrtcPolicy(int policy);

int getWebrtcPolicy();

void setNewsOptIn(boolean value);

boolean getNewsOptIn();

void setShowNews(boolean value);

boolean getShowNews();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ private void setNativePtr(long nativePtr) {
}

@CalledByNative
private void blockedEvent(int tabId, String block_type, String subresource) {
private void blockedEvent(int tabId, String blockType, String subresource) {
for (BraveShieldsContentSettingsObserver observer : mBraveShieldsContentSettingsObservers) {
observer.blockEvent(tabId, block_type, subresource);
observer.blockEvent(tabId, blockType, subresource);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@

package org.chromium.chrome.browser.preferences.website;

/**
* Allows monitoring of blocked resources via brave shields.
*/
/** Allows monitoring of blocked resources via brave shields. */
public interface BraveShieldsContentSettingsObserver {
public void blockEvent(int tabId, String block_type, String subresource);
public void blockEvent(int tabId, String blockType, String subresource);

public void savedBandwidth(long savings);
}

Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ public String getWeb3Url() {
return mWeb3Url;
}

public BraveRewardsBannerInfo(String json_external_wallet) throws JSONException {
fromJson(json_external_wallet);
public BraveRewardsBannerInfo(String jsonExternalWallet) throws JSONException {
fromJson(jsonExternalWallet);
}

private void fromJson(String json_external_wallet) throws JSONException {
JSONObject jsonObj = new JSONObject(json_external_wallet);
private void fromJson(String jsonExternalWallet) throws JSONException {
JSONObject jsonObj = new JSONObject(jsonExternalWallet);
mPublisherKey = jsonObj.getString(PUBLISHER_KEY);
mTitle = jsonObj.getString(TITLE);
mName = jsonObj.getString(NAME);
Expand Down
3 changes: 2 additions & 1 deletion tools/android/checkstyle/brave-style-5.0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
<message key="name.invalidPattern" value="Method names should start with a lower case letter (e.g. getWidth())"/>
</module>
<module name="ParameterName">
<property name="severity" value="warning"/>
<property name="format" value="^(unused_)?[a-z][a-zA-Z0-9]*$"/>
<property name="severity" value="error"/>
</module>
<module name="LocalFinalVariableName">
<property name="severity" value="warning"/>
Expand Down

0 comments on commit ba0c0ee

Please sign in to comment.