Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
small tweaks to pry2
Browse files Browse the repository at this point in the history
  • Loading branch information
Laifsyn committed Apr 4, 2024
1 parent 8c01058 commit 38afa46
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
Expand Down
6 changes: 3 additions & 3 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=11
org.eclipse.jdt.core.compiler.source=21
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<groupId>com.utp</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
Expand All @@ -21,9 +21,9 @@
</dependency>
</dependencies>
<properties>
<jdk.version>11</jdk.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<jdk.version>21</jdk.version>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/com/utp/pry2/app/RepNumericas.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ void spawn_cli() {
input = maybe_binario.get().toString();
System.out.printf("Entrada: %s\n", input);
System.out.println("Hexadecimal: 0x" + maybe_binario.get().to_hex_string());
var decimal = maybe_binario.get().to_int();
decimal = maybe_binario.get().to_int();
System.out.printf("%s => Entero: ", input);
Utils.pretty_print_int(decimal);
Utils.pretty_print_int(maybe_binario.get().to_decimal());
System.out.println("\n");
}
}
Expand All @@ -55,7 +53,7 @@ public static Validation<String, BinaryString> from_str(String input) {
return Validation.valid(new BinaryString(input));
}

public Integer to_int() {
public Integer to_decimal() {
if (cached_int.isPresent()) {
return cached_int.get();
}
Expand All @@ -64,7 +62,7 @@ public Integer to_int() {
}

public String to_hex_string() {
return Integer.toHexString(to_int());
return Integer.toHexString(to_decimal());
}

@Override
Expand Down

0 comments on commit 38afa46

Please sign in to comment.