Skip to content

Commit

Permalink
small fixes, minimal version of Android API updated to version 9
Browse files Browse the repository at this point in the history
  • Loading branch information
raydac committed Nov 24, 2018
1 parent b77d924 commit 6ca79d5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions jbbp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@
<configuration>
<signature>
<groupId>net.sf.androidscents.signature</groupId>
<artifactId>android-api-level-5</artifactId>
<version>2.0_r1</version>
<artifactId>android-api-level-9</artifactId>
<version>2.3.1_r2</version>
</signature>
<ignores>
<ignore>sun.misc.Unsafe</ignore>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public static Builder makeBuilder(final JBBPParser parser) {
* @return generated class with needed parameters as text, must not be null.
*/
public String convert() {
return JBBPToJava6Converter.class.cast(this.visit()).getResult();
return ((JBBPToJava6Converter) this.visit()).getResult();
}

private void registerNamedField(final JBBPNamedFieldInfo fieldInfo, final FieldType fieldType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ public JBBPClassInstantiator make(final JBBPClassInstantiatorType type) {
throw new Error("Unexpected type, contact developer! [" + type + ']');
}

return JBBPClassInstantiator.class.cast(ReflectUtils.newInstanceForClassName(className));
return (JBBPClassInstantiator) ReflectUtils.newInstanceForClassName(className);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@
import java.io.StringWriter;
import java.io.Writer;
import java.lang.reflect.Field;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.List;
import java.util.Stack;

/**
* the Writer allows to make text describes some bin data, it supports output of
Expand Down Expand Up @@ -1232,7 +1233,7 @@ public JBBPTextWriter Comment(final String... comment) throws IOException {
}

if (c.indexOf('\n') >= 0) {
final String[] splitted = c.split("\\n");
final String[] splitted = c.split("\\n", -1);
for (final String s : splitted) {
this.ensureCommentMode();
this.write(s);
Expand Down Expand Up @@ -1741,7 +1742,7 @@ public interface Extra {

private final class MappedObjectLogger extends AbstractMappedClassFieldObserver {

private final Stack<Integer> counterStack = new Stack<Integer>();
private final Deque<Integer> counterStack = new ArrayDeque<Integer>();
private int arrayCounter;

protected void init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public JavaSrcTextBuffer println(final String text) {
* @return this instance
*/
public JavaSrcTextBuffer printLinesWithIndent(final String text) {
final String[] splitted = text.split("\n");
final String[] splitted = text.split("\n", -1);

for (final String aSplitted : splitted) {
this.indent().println(aSplitted);
Expand All @@ -196,7 +196,7 @@ public JavaSrcTextBuffer printLinesWithIndent(final String text) {
* @return this instance
*/
public JavaSrcTextBuffer printCommentLinesWithIndent(final String text) {
final String[] splitted = text.split("\n");
final String[] splitted = text.split("\n", -1);

for (final String aSplitted : splitted) {
this.indent().print("// ").println(aSplitted);
Expand All @@ -212,7 +212,7 @@ public JavaSrcTextBuffer printCommentLinesWithIndent(final String text) {
* @return this instance
*/
public JavaSrcTextBuffer printCommentMultiLinesWithIndent(final String text) {
final String[] splitted = text.split("\n");
final String[] splitted = text.split("\n", -1);

this.indent().println("/*");
for (final String aSplitted : splitted) {
Expand All @@ -230,7 +230,7 @@ public JavaSrcTextBuffer printCommentMultiLinesWithIndent(final String text) {
* @return this instance
*/
public JavaSrcTextBuffer printJavaDocLinesWithIndent(final String text) {
final String[] splitted = text.split("\n");
final String[] splitted = text.split("\n", -1);

this.indent().println("/**");
for (final String aSplitted : splitted) {
Expand Down

0 comments on commit 6ca79d5

Please sign in to comment.