Reformat Java sources with Editorconfig settings

This change is the result of a global reformatting in IDEA now that
`.editorconfig` settings are in place. Note that Editorconfig's
`continuation_indent_size` property [1] was also added and set to 8
here, as this reflects the dominant style already present in the
codebase. i.e. in created a much smaller diff to set the continuation
indent to 8 that would have been created leaving this property out and
letting it default to 4.

[1]: https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
This commit is contained in:
Chris Beams 2017-11-04 20:11:30 +01:00
parent d8845f0cc6
commit e1a6f87a98
No known key found for this signature in database
GPG Key ID: 3D214F8F5BC5ED73
62 changed files with 1602 additions and 1607 deletions

View File

@ -3,6 +3,7 @@ root = true
[*]
indent_style = space
indent_size = 4
continuation_indent_size = 8
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true

View File

@ -30,7 +30,7 @@ import javax.annotation.Nullable;
/**
* This class holds utility methods for the creation of an Offer.
* Most of these are extracted here because they are used both in the GUI and in the API.
*
* <p>
* Long-term there could be a GUI-agnostic OfferService which provides these and other functionalities to both the
* GUI and the API.
*/

View File

@ -203,7 +203,7 @@ abstract class BankForm extends PaymentMethodForm {
private final Runnable closeHandler;
private ComboBox<TradeCurrency> currencyComboBox;
BankForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService,InputValidator inputValidator,
BankForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator,
GridPane gridPane, int gridRow, BSFormatter formatter, Runnable closeHandler) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.closeHandler = closeHandler;

View File

@ -1009,7 +1009,7 @@ public class MainViewModel implements ViewModel {
item.setDisplayString(formatter.getCurrencyPair(currencyCode) + ": " + priceString);
final String code = item.currencyCode;
if (selectedPriceFeedComboBoxItemProperty.get()!=null&&
if (selectedPriceFeedComboBoxItemProperty.get() != null &&
selectedPriceFeedComboBoxItemProperty.get().currencyCode.equals(code)) {
isFiatCurrencyPriceFeedSelected.set(CurrencyUtil.isFiatCurrency(code) && CurrencyUtil.getFiatCurrency(code).isPresent() && item.isPriceAvailable() && item.isExternallyProvidedPrice());
isCryptoCurrencyPriceFeedSelected.set(CurrencyUtil.isCryptoCurrency(code) && CurrencyUtil.getCryptoCurrency(code).isPresent() && item.isPriceAvailable() && item.isExternallyProvidedPrice());

View File

@ -291,7 +291,7 @@ public final class AltCoinAddressValidator extends InputValidator {
case "ZEN":
try {
// Get the non Base58 form of the address and the bytecode of the first two bytes
byte [] byteAddress = Base58.decodeChecked(input);
byte[] byteAddress = Base58.decodeChecked(input);
int version0 = byteAddress[0] & 0xFF;
int version1 = byteAddress[1] & 0xFF;
@ -302,29 +302,24 @@ public final class AltCoinAddressValidator extends InputValidator {
if (version0 == 0x16 && version1 == 0x9A) {
// Address starts with "zc"
return new ValidationResult(false, Res.get("validation.altcoin.zAddressesNotSupported"));
}
else if (version0 == 0x1C && (version1 == 0xB8 || version1 == 0xBD)) {
} else if (version0 == 0x1C && (version1 == 0xB8 || version1 == 0xBD)) {
// "t1" or "t3" address
return new ValidationResult(true);
}
else if (version0 == 0x20 && (version1 == 0x89 || version1 == 0x96)) {
} else if (version0 == 0x20 && (version1 == 0x89 || version1 == 0x96)) {
// "zn" or "zs" address
return new ValidationResult(true);
}
else {
} else {
// Unknown Type
return new ValidationResult(false);
}
}
catch (AddressFormatException e) {
} catch (AddressFormatException e) {
// Unhandled Exception (probably a checksum error)
return new ValidationResult(false);
}
case "WAC":
try {
Address.fromBase58(WACoinsParams.get(), input);
}
catch (AddressFormatException e) {
} catch (AddressFormatException e) {
return new ValidationResult(false, getErrorMessage(e));
}
return new ValidationResult(true);
@ -344,8 +339,7 @@ public final class AltCoinAddressValidator extends InputValidator {
case "TRC":
try {
Address.fromBase58(TerracoinParams.get(), input);
}
catch (AddressFormatException e) {
} catch (AddressFormatException e) {
return new ValidationResult(false, getErrorMessage(e));
}
return new ValidationResult(true);

View File

@ -31,9 +31,9 @@ public class BSFormatterTest {
BSFormatter formatter = new BSFormatter();
Res.setBaseCurrencyCode("BTC");
Res.setBaseCurrencyName("Bitcoin");
assertEquals("0 days",formatter.formatAccountAge(TimeUnit.HOURS.toMillis(23)));
assertEquals("0 days",formatter.formatAccountAge(0));
assertEquals("0 days",formatter.formatAccountAge(-1));
assertEquals("0 days", formatter.formatAccountAge(TimeUnit.HOURS.toMillis(23)));
assertEquals("0 days", formatter.formatAccountAge(0));
assertEquals("0 days", formatter.formatAccountAge(-1));
assertEquals("1 day", formatter.formatAccountAge(TimeUnit.DAYS.toMillis(1)));
assertEquals("2 days", formatter.formatAccountAge(TimeUnit.DAYS.toMillis(2)));
assertEquals("30 days", formatter.formatAccountAge(TimeUnit.DAYS.toMillis(30)));

View File

@ -33,7 +33,7 @@ public class NetworkNodeProvider implements Provider<NetworkNode> {
private final NetworkNode networkNode;
@Inject
public NetworkNodeProvider( NetworkProtoResolver networkProtoResolver,
public NetworkNodeProvider(NetworkProtoResolver networkProtoResolver,
@Named(NetworkOptionKeys.USE_LOCALHOST_FOR_P2P) boolean useLocalhostForP2P,
@Named(NetworkOptionKeys.PORT_KEY) int port,
@Named(NetworkOptionKeys.TOR_DIR) File torDir) {

View File

@ -99,7 +99,7 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
SeedNodesRepository seedNodesRepository,
Socks5ProxyProvider socks5ProxyProvider,
EncryptionService encryptionService,
KeyRing keyRing ) {
KeyRing keyRing) {
this.networkNode = networkNode;
this.peerManager = peerManager;
this.p2PDataStorage = p2PDataStorage;

View File

@ -135,7 +135,7 @@ public class TestUtils {
Thread.sleep(2000);
return p2PService;
}
*/
*/
public static NetworkProtoResolver getNetworkProtoResolver() {
return new NetworkProtoResolver() {
@Override