Skip to content

Commit

Permalink
Merge pull request beeware#678 from cflee/bulk-fix-ant-checkstyle
Browse files Browse the repository at this point in the history
Style fixes and ant checkstyle config change
  • Loading branch information
eliasdorneles authored Oct 17, 2017
2 parents 168a2e9 + ee5036a commit 65a70f9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="FileLength"/>
<!-- <module name="FileLength"/> -->

<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
Expand Down
6 changes: 3 additions & 3 deletions python/common/org/python/types/ByteArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -725,9 +725,9 @@ public org.python.Object expandtabs(java.util.List<org.python.Object> args, java
}

@org.python.Method(
__doc__ = "B.find(sub[, start[, end]]) -> int"+
"\n\nReturn the lowest index in B where subsection sub is found,"+
"\nsuch that sub is contained within B[start,end]. Optional"+
__doc__ = "B.find(sub[, start[, end]]) -> int" +
"\n\nReturn the lowest index in B where subsection sub is found," +
"\nsuch that sub is contained within B[start,end]. Optional" +
"\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.",
args = {"sub"},
default_args = {"start", "end"}
Expand Down
12 changes: 6 additions & 6 deletions python/common/org/python/types/Bytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ public org.python.Object center(org.python.Object width, org.python.Object byteT
public static byte[] _center(byte[] input, org.python.Object width, org.python.Object byteToFill) {
byte[] fillByte;
if (byteToFill instanceof org.python.types.Bytes || byteToFill instanceof org.python.types.ByteArray) {
if(byteToFill instanceof org.python.types.ByteArray){
if (byteToFill instanceof org.python.types.ByteArray) {
fillByte = ((org.python.types.ByteArray) byteToFill).value;
} else {
fillByte = ((org.python.types.Bytes) byteToFill).value;
Expand Down Expand Up @@ -910,8 +910,8 @@ public org.python.Object expandtabs(java.util.List<org.python.Object> args, java
}

@org.python.Method(
__doc__ = "B.find(sub[, start[, end]]) -> int"+
"\n\nReturn the lowest index in B where substring sub is found,\nsuch that sub is contained within B[start:end]. Optional"+
__doc__ = "B.find(sub[, start[, end]]) -> int" +
"\n\nReturn the lowest index in B where substring sub is found,\nsuch that sub is contained within B[start:end]. Optional" +
"\narguments start and end are interpreted as in slice notation.\n\nReturn -1 on failure.",
args = {"sub"},
default_args = {"start", "end"}
Expand All @@ -926,7 +926,7 @@ public org.python.types.Int find(org.python.Object sub, org.python.Object start,
_end = this.value.length;
}
byte[] _sub;
if(sub instanceof org.python.types.ByteArray){
if (sub instanceof org.python.types.ByteArray) {
_sub = ((org.python.types.ByteArray) sub).value;
} else {
_sub = ((org.python.types.Bytes) sub).value;
Expand Down Expand Up @@ -1232,9 +1232,9 @@ public static byte[] _swapcase(byte[] input) {
byte[] result = new byte[input.length];
for (int idx = 0; idx < input.length; ++idx) {
char lc = (char) input[idx];
if(Character.isUpperCase(lc)){
if (Character.isUpperCase(lc)) {
result[idx] = (byte) Character.toLowerCase(lc);
}else{
} else {
result[idx] = (byte) Character.toUpperCase(lc);
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/datatypes/test_bytearray.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def test_lower(self):
print(bytearray(b"hElLO wOrLd").lower())
print(bytearray(b"[Hello] World").lower())
""")

def test_count(self):
self.assertCodeExecution("""
print(bytearray(b'abcabca').count(97))
Expand Down

0 comments on commit 65a70f9

Please sign in to comment.