Skip to content
Snippets Groups Projects
Commit 3863c094 authored by Maciej Żenczykowski's avatar Maciej Żenczykowski
Browse files

new BpfMap<> - remove spurious generic type arguments


Test: TreeHugger
Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
Change-Id: Ic32ccd7c2c415c462c4e1fdc9002cf7858ed587c
parent 61a82347
No related branches found
No related tags found
No related merge requests found
......@@ -808,8 +808,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
/** Get counter sets map for each UID. */
public IBpfMap<S32, U8> getUidCounterSetMap() {
try {
return new BpfMap<S32, U8>(UID_COUNTERSET_MAP_PATH,
S32.class, U8.class);
return new BpfMap<>(UID_COUNTERSET_MAP_PATH, S32.class, U8.class);
} catch (ErrnoException e) {
Log.wtf(TAG, "Cannot open uid counter set map: " + e);
return null;
......@@ -819,7 +818,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
/** Gets the cookie tag map */
public IBpfMap<CookieTagMapKey, CookieTagMapValue> getCookieTagMap() {
try {
return new BpfMap<CookieTagMapKey, CookieTagMapValue>(COOKIE_TAG_MAP_PATH,
return new BpfMap<>(COOKIE_TAG_MAP_PATH,
CookieTagMapKey.class, CookieTagMapValue.class);
} catch (ErrnoException e) {
Log.wtf(TAG, "Cannot open cookie tag map: " + e);
......@@ -830,8 +829,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
/** Gets stats map A */
public IBpfMap<StatsMapKey, StatsMapValue> getStatsMapA() {
try {
return new BpfMap<StatsMapKey, StatsMapValue>(STATS_MAP_A_PATH,
StatsMapKey.class, StatsMapValue.class);
return new BpfMap<>(STATS_MAP_A_PATH, StatsMapKey.class, StatsMapValue.class);
} catch (ErrnoException e) {
Log.wtf(TAG, "Cannot open stats map A: " + e);
return null;
......@@ -841,8 +839,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
/** Gets stats map B */
public IBpfMap<StatsMapKey, StatsMapValue> getStatsMapB() {
try {
return new BpfMap<StatsMapKey, StatsMapValue>(STATS_MAP_B_PATH,
StatsMapKey.class, StatsMapValue.class);
return new BpfMap<>(STATS_MAP_B_PATH, StatsMapKey.class, StatsMapValue.class);
} catch (ErrnoException e) {
Log.wtf(TAG, "Cannot open stats map B: " + e);
return null;
......@@ -852,8 +849,8 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
/** Gets the uid stats map */
public IBpfMap<UidStatsMapKey, StatsMapValue> getAppUidStatsMap() {
try {
return new BpfMap<UidStatsMapKey, StatsMapValue>(APP_UID_STATS_MAP_PATH,
UidStatsMapKey.class, StatsMapValue.class);
return new BpfMap<>(APP_UID_STATS_MAP_PATH,
UidStatsMapKey.class, StatsMapValue.class);
} catch (ErrnoException e) {
Log.wtf(TAG, "Cannot open app uid stats map: " + e);
return null;
......@@ -863,8 +860,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
/** Gets interface stats map */
public IBpfMap<S32, StatsMapValue> getIfaceStatsMap() {
try {
return new BpfMap<S32, StatsMapValue>(IFACE_STATS_MAP_PATH,
S32.class, StatsMapValue.class);
return new BpfMap<>(IFACE_STATS_MAP_PATH, S32.class, StatsMapValue.class);
} catch (ErrnoException e) {
throw new IllegalStateException("Failed to open interface stats map", e);
}
......
......@@ -85,9 +85,9 @@ public class DscpPolicyTracker {
public DscpPolicyTracker() throws ErrnoException {
mAttachedIfaces = new HashSet<String>();
mIfaceIndexToPolicyIdBpfMapIndex = new HashMap<Integer, SparseIntArray>();
mBpfDscpIpv4Policies = new BpfMap<Struct.S32, DscpPolicyValue>(IPV4_POLICY_MAP_PATH,
mBpfDscpIpv4Policies = new BpfMap<>(IPV4_POLICY_MAP_PATH,
Struct.S32.class, DscpPolicyValue.class);
mBpfDscpIpv6Policies = new BpfMap<Struct.S32, DscpPolicyValue>(IPV6_POLICY_MAP_PATH,
mBpfDscpIpv6Policies = new BpfMap<>(IPV6_POLICY_MAP_PATH,
Struct.S32.class, DscpPolicyValue.class);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment