Skip to content

Commit

Permalink
Got back to 1.6 and refactor.
Browse files Browse the repository at this point in the history
+ merge with master conflicts
  • Loading branch information
bartgora committed Apr 8, 2016
1 parent f1e735d commit 5ed3b5c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 20 deletions.
10 changes: 1 addition & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>pl.bgora</groupId>
<artifactId>RPNLibrary</artifactId>
<version>2.0.1</version>
<version>3.0.0</version>
<name>RPNLibrary</name>
<description>RPN Libray for Java.</description>
<build>
Expand All @@ -20,14 +20,6 @@
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/pl/bgora/rpn/Calculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ private String prepareInput(String input) throws WrongArgumentException {
} else if (Character.isLetter(c)) {
lastWasDigit = false;
lastWasOperator = false;
lastWasWhiteSpace = false;
if (!lastWasLetter) {
if (!lastWasLetter && !lastWasWhiteSpace) {
result.append(" ").append(c);
} else {
result.append(c);
}
lastWasWhiteSpace = false;
lastWasLetter = true;
} else {
throw new WrongArgumentException("Element \"" + c + "\" is not recognized by the Checker");
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/pl/bgora/rpn/RPNChecking.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ public interface RPNChecking {

int compareOperators(String c1, String c2);

default boolean isFunction(String input) {
return false;
}
boolean isFunction(String input);

default int getFunctionParamsCount(String functionName) {
return 0;
}
int getFunctionParamsCount(String functionName);
}
4 changes: 1 addition & 3 deletions src/main/java/pl/bgora/rpn/RPNExecuting.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,5 @@ public interface RPNExecuting {
* @return Calculation result as BigDecimal.
* @throws NoSuchFunctionFound thrown if Executing object cannot find method.
*/
default BigDecimal executeFunction(String functionName, RoundingMode mode, String... arguments) throws NoSuchFunctionFound {
return null;
}
BigDecimal executeFunction(String functionName, RoundingMode mode, String... arguments) throws NoSuchFunctionFound;
}

0 comments on commit 5ed3b5c

Please sign in to comment.