style: Simplifies code.
This commit is contained in:
parent
3e01bff25e
commit
99600368f6
@ -132,15 +132,12 @@ public class HostCandidateHarvester
|
||||
* Gets the list of explicitly allowed addresses.
|
||||
* @return the list of explicitly allowed addresses.
|
||||
*/
|
||||
public static List<InetAddress> getAllowedAddresses()
|
||||
{
|
||||
synchronized (HostCandidateHarvester.class)
|
||||
public static synchronized List<InetAddress> getAllowedAddresses()
|
||||
{
|
||||
if (!addressFiltersInitialized)
|
||||
{
|
||||
initializeAddressFilters();
|
||||
}
|
||||
}
|
||||
|
||||
return allowedAddresses;
|
||||
}
|
||||
@ -149,15 +146,12 @@ public class HostCandidateHarvester
|
||||
* Gets the list of blocked addresses.
|
||||
* @return the list of blocked addresses.
|
||||
*/
|
||||
public static List<InetAddress> getBlockedAddresses()
|
||||
{
|
||||
synchronized (HostCandidateHarvester.class)
|
||||
public static synchronized List<InetAddress> getBlockedAddresses()
|
||||
{
|
||||
if (!addressFiltersInitialized)
|
||||
{
|
||||
initializeAddressFilters();
|
||||
}
|
||||
}
|
||||
|
||||
return blockedAddresses;
|
||||
}
|
||||
@ -166,12 +160,11 @@ public class HostCandidateHarvester
|
||||
* Initializes the lists of allowed and blocked addresses according to the
|
||||
* configuration properties.
|
||||
*/
|
||||
private static void initializeAddressFilters()
|
||||
{
|
||||
synchronized (HostCandidateHarvester.class)
|
||||
private static synchronized void initializeAddressFilters()
|
||||
{
|
||||
if (addressFiltersInitialized)
|
||||
return;
|
||||
addressFiltersInitialized = true;
|
||||
|
||||
String[] allowedAddressesStr
|
||||
= StackProperties.getStringArray(
|
||||
@ -225,9 +218,6 @@ public class HostCandidateHarvester
|
||||
blockedAddresses.add(address);
|
||||
}
|
||||
}
|
||||
|
||||
addressFiltersInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user