Skip to content

Commit 0db74d7

Browse files
committed
Merge branch 'master' into 0.0.5.0
2 parents 8fdb864 + e46b4ed commit 0db74d7

36 files changed

+323
-33
lines changed

src/Core/JavaArchive.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function ($fileName) {
7272
);
7373

7474
foreach ($this->files as $className => $code) {
75-
$this->classes[str_replace('/', '.', $className)] = new JavaClass(new JavaClassInlineReaderInterface(
75+
$this->classes[str_replace('/', '.', $className)] = new JavaClass(new JavaClassInlineReader(
7676
$className,
7777
$code
7878
));

src/Core/JavaClassInlineReaderInterface.php renamed to src/Core/JavaClassInlineReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use PHPJava\Utilities\ClassResolver;
55

6-
class JavaClassInlineReaderInterface implements JavaClassReaderInterface
6+
class JavaClassInlineReader implements JavaClassReaderInterface
77
{
88
private $fileName;
99
private $handle;

src/Imitation/java/lang/Math.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,16 @@ public static function abs($number)
1616
{
1717
return abs($number);
1818
}
19+
20+
/**
21+
* This decrease 1 from parameters
22+
*
23+
* @see https://docs.oracle.com/javase/jp/8/docs/api/java/lang/Math.html#decrementExact-int-
24+
* @param int $a
25+
* @return int
26+
*/
27+
public static function decrementExact($a)
28+
{
29+
return $a - 1;
30+
}
1931
}

src/Kernel/Mnemonics/_dadd.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ final class _dadd implements OperationInterface
1111

1212
public function execute(): void
1313
{
14-
$value1 = $this->getStack();
1514
$value2 = $this->getStack();
15+
$value1 = $this->getStack();
1616

1717
$this->pushStack(BinaryTool::add($value1, $value2));
1818
}

src/Kernel/Mnemonics/_dmul.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ final class _dmul implements OperationInterface
1111

1212
public function execute(): void
1313
{
14-
$value1 = $this->getStack();
1514
$value2 = $this->getStack();
15+
$value1 = $this->getStack();
1616

1717
$this->pushStack(BinaryTool::multiply($value1, $value2, 8));
1818
}

src/Kernel/Mnemonics/_dsub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ final class _dsub implements OperationInterface
1111

1212
public function execute(): void
1313
{
14-
$leftValue = $this->getStack();
1514
$rightValue = $this->getStack();
15+
$leftValue = $this->getStack();
1616

1717
$this->pushStack(BinaryTool::sub($leftValue, $rightValue, 8));
1818
}

src/Kernel/Mnemonics/_iadd.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ final class _iadd implements OperationInterface
1111

1212
public function execute(): void
1313
{
14-
$leftValue = $this->getStack();
1514
$rightValue = $this->getStack();
15+
$leftValue = $this->getStack();
1616

1717
$this->pushStack(BinaryTool::add($leftValue, $rightValue));
1818
}

src/Kernel/Mnemonics/_iand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ final class _iand implements OperationInterface
1111

1212
public function execute(): void
1313
{
14-
$value1 = $this->getStack();
1514
$value2 = $this->getStack();
15+
$value1 = $this->getStack();
1616

1717
$this->pushStack(BinaryTool::andBits($value1, $value2, 4));
1818
}

src/Kernel/Mnemonics/_if_acmpeq.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public function execute(): void
1313
{
1414
$offset = $this->readShort();
1515

16-
$leftOperand = $this->getStack();
1716
$rightOperand = $this->getStack();
17+
$leftOperand = $this->getStack();
1818

1919
if ($leftOperand === $rightOperand) {
2020
$this->setOffset($this->getProgramCounter() + $offset);

src/Kernel/Mnemonics/_if_acmpne.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public function execute(): void
1313
{
1414
$offset = $this->readShort();
1515

16-
$leftOperand = $this->getStack();
1716
$rightOperand = $this->getStack();
17+
$leftOperand = $this->getStack();
1818

1919
if ($leftOperand !== $rightOperand) {
2020
$this->setOffset($this->getProgramCounter() + $offset);

0 commit comments

Comments
 (0)