Skip to content

Commit 5ff1fd0

Browse files
Artem LabazinArtem Labazin
Artem Labazin
authored and
Artem Labazin
committed
Remove ErlangPid and ErlangAtom caches
1 parent 1cb1e4b commit 5ff1fd0

File tree

30 files changed

+86
-188
lines changed

30 files changed

+86
-188
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2323
- Add updates to the protocol, like new `ControlMessage`.
2424
- Do we really need `ErlangInteger.cache` methods?
2525

26+
## [1.6.7](https://github.com/appulse-projects/encon-java/releases/tag/1.6.7) - 2018-10-07
27+
28+
### Changed
29+
30+
- Quick fix for [GitHub issue](https://github.com/appulse-projects/encon-java/issues/13), removed `ErlangPid` and `EralngAtom` caches.
31+
2632
## [1.6.6](https://github.com/appulse-projects/encon-java/releases/tag/1.6.6) - 2018-10-02
2733

2834
### Changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ $> mvn clean compile
4646
[INFO] ------------------------------------------------------------------------
4747
[INFO] Reactor Summary:
4848
[INFO]
49-
[INFO] encon 1.6.6 ........................................ SUCCESS [ 1.210 s]
49+
[INFO] encon 1.6.7 ........................................ SUCCESS [ 1.210 s]
5050
[INFO] encon-common ....................................... SUCCESS [ 25.693 s]
5151
[INFO] encon-terms ........................................ SUCCESS [ 27.517 s]
5252
[INFO] encon-config ....................................... SUCCESS [ 18.707 s]
@@ -64,7 +64,7 @@ $> mvn clean compile
6464
[INFO] handler-advanced ................................... SUCCESS [ 11.289 s]
6565
[INFO] load-config ........................................ SUCCESS [ 3.725 s]
6666
[INFO] load-config-spring ................................. SUCCESS [ 6.420 s]
67-
[INFO] benchmark 1.6.6 .................................... SUCCESS [ 5.594 s]
67+
[INFO] benchmark 1.6.7 .................................... SUCCESS [ 5.594 s]
6868
[INFO] ------------------------------------------------------------------------
6969
[INFO] BUILD SUCCESS
7070
[INFO] ------------------------------------------------------------------------

benchmark/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ limitations under the License.
2525
<parent>
2626
<groupId>io.appulse.encon</groupId>
2727
<artifactId>encon-parent</artifactId>
28-
<version>1.6.6</version>
28+
<version>1.6.7</version>
2929
</parent>
3030

3131
<artifactId>benchmark</artifactId>

encon-common/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ limitations under the License.
2525
<parent>
2626
<groupId>io.appulse.encon</groupId>
2727
<artifactId>encon-parent</artifactId>
28-
<version>1.6.6</version>
28+
<version>1.6.7</version>
2929
</parent>
3030

3131
<artifactId>encon-common</artifactId>

encon-config/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ First of all, add config's dependency:
1414
<dependency>
1515
<groupId>io.appulse.encon</groupId>
1616
<artifactId>encon-config</artifactId>
17-
<version>1.6.6</version>
17+
<version>1.6.7</version>
1818
</dependency>
1919
...
2020
</dependencies>
@@ -23,7 +23,7 @@ First of all, add config's dependency:
2323
**Gradle**:
2424

2525
```groovy
26-
compile 'io.appulse.encon:encon-config:1.6.6'
26+
compile 'io.appulse.encon:encon-config:1.6.7'
2727
```
2828

2929
### File based configuration

encon-config/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ limitations under the License.
2525
<parent>
2626
<groupId>io.appulse.encon</groupId>
2727
<artifactId>encon-parent</artifactId>
28-
<version>1.6.6</version>
28+
<version>1.6.7</version>
2929
</parent>
3030

3131
<artifactId>encon-config</artifactId>

encon-databind/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ First of all, add databind's dependency:
1414
<dependency>
1515
<groupId>io.appulse.encon</groupId>
1616
<artifactId>encon</artifactId>
17-
<version>1.6.6</version>
17+
<version>1.6.7</version>
1818
</dependency>
1919
<dependency>
2020
<groupId>io.appulse.encon</groupId>
2121
<artifactId>encon-databind</artifactId>
22-
<version>1.6.6</version>
22+
<version>1.6.7</version>
2323
</dependency>
2424
...
2525
</dependencies>
@@ -28,8 +28,8 @@ First of all, add databind's dependency:
2828
**Gradle**:
2929

3030
```groovy
31-
compile 'io.appulse.encon:encon:1.6.6'
32-
compile 'io.appulse.encon:encon-databind:1.6.6'
31+
compile 'io.appulse.encon:encon:1.6.7'
32+
compile 'io.appulse.encon:encon-databind:1.6.7'
3333
```
3434

3535
Let's imagine, you have POJO like this:

encon-databind/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ limitations under the License.
2525
<parent>
2626
<groupId>io.appulse.encon</groupId>
2727
<artifactId>encon-parent</artifactId>
28-
<version>1.6.6</version>
28+
<version>1.6.7</version>
2929
</parent>
3030

3131
<artifactId>encon-databind</artifactId>

encon-handler/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ First of all, add dependency:
1414
<dependency>
1515
<groupId>io.appulse.encon</groupId>
1616
<artifactId>encon-handler</artifactId>
17-
<version>1.6.6</version>
17+
<version>1.6.7</version>
1818
</dependency>
1919
...
2020
</dependencies>
@@ -23,7 +23,7 @@ First of all, add dependency:
2323
**Gradle**:
2424

2525
```groovy
26-
compile 'io.appulse.encon:encon-handler:1.6.6'
26+
compile 'io.appulse.encon:encon-handler:1.6.7'
2727
```
2828

2929
### Basics

encon-handler/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ limitations under the License.
2525
<parent>
2626
<groupId>io.appulse.encon</groupId>
2727
<artifactId>encon-parent</artifactId>
28-
<version>1.6.6</version>
28+
<version>1.6.7</version>
2929
</parent>
3030

3131
<artifactId>encon-handler</artifactId>

encon-spring/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ limitations under the License.
2525
<parent>
2626
<groupId>io.appulse.encon</groupId>
2727
<artifactId>encon-parent</artifactId>
28-
<version>1.6.6</version>
28+
<version>1.6.7</version>
2929
</parent>
3030

3131
<artifactId>encon-spring</artifactId>

encon-terms/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ limitations under the License.
2525
<parent>
2626
<groupId>io.appulse.encon</groupId>
2727
<artifactId>encon-parent</artifactId>
28-
<version>1.6.6</version>
28+
<version>1.6.7</version>
2929
</parent>
3030

3131
<artifactId>encon-terms</artifactId>

encon-terms/src/main/java/io/appulse/encon/terms/Erlang.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public final class Erlang {
5555
/**
5656
* Cached enpty (0-size string) {@link ErlangAtom} instance.
5757
*/
58-
public static final ErlangAtom EMPTY_ATOM = ErlangAtom.cached("");
58+
public static final ErlangAtom EMPTY_ATOM = new ErlangAtom("");
5959

6060
/**
6161
* Creates new {@link ErlangAtom} instance from {@code boolean} (true/false value) .
@@ -65,7 +65,9 @@ public final class Erlang {
6565
* @return {@link ErlangAtom} new instance
6666
*/
6767
public static ErlangAtom atom (boolean value) {
68-
return ErlangAtom.cached(value);
68+
return value
69+
? ErlangAtom.ATOM_TRUE
70+
: ErlangAtom.ATOM_FALSE;
6971
}
7072

7173
/**
@@ -76,7 +78,7 @@ public static ErlangAtom atom (boolean value) {
7678
* @return {@link ErlangAtom} new instance
7779
*/
7880
public static ErlangAtom atom (@NonNull String value) {
79-
return ErlangAtom.cached(value);
81+
return new ErlangAtom(value);
8082
}
8183

8284
/**

encon-terms/src/main/java/io/appulse/encon/terms/ErlangTerm.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public static <T extends ErlangTerm> T newInstance (@NonNull ByteBuf buffer) {
108108
return (T) new ErlangPort(type, buffer);
109109
case PID:
110110
case NEW_PID:
111-
return (T) ErlangPid.cached(type, buffer);
111+
return (T) new ErlangPid(type, buffer);
112112
case SMALL_TUPLE:
113113
case LARGE_TUPLE:
114114
return (T) new ErlangTuple(type, buffer);
@@ -133,7 +133,7 @@ public static <T extends ErlangTerm> T newInstance (@NonNull ByteBuf buffer) {
133133
case SMALL_ATOM_UTF8:
134134
case ATOM:
135135
case SMALL_ATOM:
136-
return (T) ErlangAtom.cached(type, buffer);
136+
return (T) new ErlangAtom(type, buffer);
137137
default:
138138
val message = String.format("Unknown term type %s (%d)", type.name(), typeByte);
139139
throw new ErlangTermDecodeException(message);

0 commit comments

Comments
 (0)