forked from tronprotocol/java-tron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into fromCommunity
* develop: add java-tron.vmoption for configure jvm option add java-tron.vmoption for configure jvm option fix conflict fix warnings. update fix unit test update move common utils from framework to common module. move nodeinfo and peerinfo to common module
- Loading branch information
Showing
32 changed files
with
102 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,4 +58,4 @@ subprojects { | |
// archives jar | ||
archives sourcesJar | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...rg/tron/common/utils/SessionOptional.java → ...rg/tron/common/utils/SessionOptional.java
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
124 changes: 62 additions & 62 deletions
124
...org/tron/common/utils/TypeConversion.java → ...org/tron/common/utils/TypeConversion.java
100755 → 100644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,62 @@ | ||
/* | ||
* Copyright (c) [2016] [ <ether.camp> ] | ||
* This file is part of the ethereumJ library. | ||
* | ||
* The ethereumJ library is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* The ethereumJ library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with the ethereumJ library. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.tron.common.utils; | ||
|
||
import com.google.common.primitives.Longs; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.commons.codec.DecoderException; | ||
import org.apache.commons.codec.binary.Hex; | ||
|
||
@Slf4j(topic = "utils") | ||
public class TypeConversion { | ||
|
||
public static byte[] longToBytes(long x) { | ||
return Longs.toByteArray(x); | ||
} | ||
|
||
public static long bytesToLong(byte[] bytes) { | ||
return Longs.fromByteArray(bytes); | ||
} | ||
|
||
public static String bytesToHexString(byte[] src) { | ||
return Hex.encodeHexString(src); | ||
} | ||
|
||
public static byte[] hexStringToBytes(String hexString) { | ||
try { | ||
return Hex.decodeHex(hexString); | ||
} catch (DecoderException e) { | ||
logger.debug(e.getMessage(), e); | ||
return null; | ||
} | ||
} | ||
|
||
public static boolean increment(byte[] bytes) { | ||
final int startIndex = 0; | ||
int i; | ||
for (i = bytes.length - 1; i >= startIndex; i--) { | ||
bytes[i]++; | ||
if (bytes[i] != 0) { | ||
break; | ||
} | ||
} | ||
|
||
return (i >= startIndex || bytes[startIndex] != 0); | ||
} | ||
} | ||
/* | ||
* Copyright (c) [2016] [ <ether.camp> ] | ||
* This file is part of the ethereumJ library. | ||
* | ||
* The ethereumJ library is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* The ethereumJ library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with the ethereumJ library. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.tron.common.utils; | ||
|
||
import com.google.common.primitives.Longs; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.commons.codec.DecoderException; | ||
import org.apache.commons.codec.binary.Hex; | ||
|
||
@Slf4j(topic = "utils") | ||
public class TypeConversion { | ||
|
||
public static byte[] longToBytes(long x) { | ||
return Longs.toByteArray(x); | ||
} | ||
|
||
public static long bytesToLong(byte[] bytes) { | ||
return Longs.fromByteArray(bytes); | ||
} | ||
|
||
public static String bytesToHexString(byte[] src) { | ||
return Hex.encodeHexString(src); | ||
} | ||
|
||
public static byte[] hexStringToBytes(String hexString) { | ||
try { | ||
return Hex.decodeHex(hexString); | ||
} catch (DecoderException e) { | ||
logger.debug(e.getMessage(), e); | ||
return null; | ||
} | ||
} | ||
|
||
public static boolean increment(byte[] bytes) { | ||
final int startIndex = 0; | ||
int i; | ||
for (i = bytes.length - 1; i >= startIndex; i--) { | ||
bytes[i]++; | ||
if (bytes[i] != 0) { | ||
break; | ||
} | ||
} | ||
|
||
return (i >= startIndex || bytes[startIndex] != 0); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...java/org/tron/core/db2/core/ISession.java → ...main/java/org/tron/core/db2/ISession.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.tron.core.db2.core; | ||
package org.tron.core.db2; | ||
|
||
public interface ISession extends AutoCloseable { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
framework/src/main/java/org/tron/common/utils/SafeMessageMap.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-XX:+UseConcMarkSweepGC | ||
-XX:+PrintGCDetails | ||
-Xloggc:./gc.log | ||
-XX:+PrintGCDateStamps | ||
-XX:+CMSParallelRemarkEnabled | ||
-XX:ReservedCodeCacheSize=256m | ||
-XX:+CMSScavengeBeforeRemark |
Oops, something went wrong.