Skip to content

Commit c071c59

Browse files
Merge branch 'master' into sla-pr/1381-vert.x-dhrubayotti
2 parents 81741d8 + 29645fc commit c071c59

34 files changed

Lines changed: 779 additions & 45 deletions

File tree

‎.travis.yml‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
language: java
22

3-
install: travis_wait 40 mvn -q clean install -Dgib.enabled=true
3+
install: travis_wait 60 mvn -q clean install
4+
5+
before_script:
6+
- echo "MAVEN_OPTS='-Xmx2048M -Xss128M -XX:MaxPermSize=2048M -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-UseGCOverheadLimit'" > ~/.mavenrc
47

58
jdk:
69
- oraclejdk8
@@ -14,10 +17,4 @@ cache:
1417
directories:
1518
- .autoconf
1619
- $HOME/.m2
17-
18-
sudo: required
19-
20-
env:
21-
global:
22-
JAVA_OPTS="-Xmx2048M -Xss128M -XX:MaxPermSize=2048M -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC"
23-
MAVEN_OPTS="-Xmx2048M -Xss128M -XX:MaxPermSize=2048M -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC"
20+

‎algorithms/src/main/java/com/baeldung/automata/RtState.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ public RtState(final boolean isFinal) {
2121
}
2222

2323
public State transit(final CharSequence c) {
24-
for(final Transition t : this.transitions) {
25-
if(t.isPossible(c)) {
26-
return t.state();
27-
}
28-
}
29-
throw new IllegalArgumentException("Input not accepted: " + c);
24+
return transitions
25+
.stream()
26+
.filter(t -> t.isPossible(c))
27+
.map(Transition::state)
28+
.findAny()
29+
.orElseThrow(() -> new IllegalArgumentException("Input not accepted: " + c));
3030
}
3131

3232
public boolean isFinal() {

‎apache-poi/temp.xlsx‎

-18 Bytes
Binary file not shown.

‎core-java/pom.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@
250250
<goal>single</goal>
251251
</goals>
252252
<configuration>
253+
<archiveBaseDirectory>${project.basedir}</archiveBaseDirectory>
253254
<archive>
254255
<manifest>
255256
<mainClass>org.baeldung.executable.ExecutableMavenJar</mainClass>

‎disruptor/pom.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
<goal>single</goal>
146146
</goals>
147147
<configuration>
148+
<archiveBaseDirectory>${project.basedir}</archiveBaseDirectory>
148149
<archive>
149150
<manifest>
150151
<mainClass>org.baeldung.executable.ExecutableMavenJar</mainClass>

‎guava21/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## Relevant articles:

‎guava21/pom.xml‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.baeldung.guava</groupId>
8+
<artifactId>tutorial</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
<build>
11+
<plugins>
12+
<plugin>
13+
<groupId>org.apache.maven.plugins</groupId>
14+
<artifactId>maven-compiler-plugin</artifactId>
15+
<configuration>
16+
<source>1.8</source>
17+
<target>1.8</target>
18+
</configuration>
19+
</plugin>
20+
</plugins>
21+
</build>
22+
23+
<dependencies>
24+
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
25+
<dependency>
26+
<groupId>com.google.guava</groupId>
27+
<artifactId>guava</artifactId>
28+
<version>21.0</version>
29+
</dependency>
30+
31+
<!-- https://mvnrepository.com/artifact/junit/junit -->
32+
<dependency>
33+
<groupId>junit</groupId>
34+
<artifactId>junit</artifactId>
35+
<version>4.11</version>
36+
</dependency>
37+
38+
</dependencies>
39+
40+
41+
</project>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.baeldung.guava.tutorial;
2+
3+
import com.google.common.collect.Comparators;
4+
5+
import java.util.Arrays;
6+
import java.util.Comparator;
7+
import java.util.List;
8+
9+
public class ComparatorsExamples {
10+
11+
public static void main(String[] args){
12+
13+
List<Integer> integers = Arrays.asList(1,2,3,4,4,6,7,8,9,10);
14+
//This will return true
15+
boolean isInAscendingOrder = Comparators.isInOrder(integers, new AscedingOrderComparator());
16+
17+
System.out.println(isInAscendingOrder);
18+
19+
}
20+
21+
private static class AscedingOrderComparator implements Comparator<Integer> {
22+
@Override
23+
public int compare(Integer o1, Integer o2) {
24+
return o1.compareTo(o2);
25+
}
26+
}
27+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.baeldung.guava.tutorial;
2+
3+
import com.google.common.collect.Streams;
4+
5+
import java.util.stream.Stream;
6+
7+
public class ConcatStreams {
8+
public static Stream concatStreams(Stream stream1, Stream stream2, Stream stream3){
9+
return Streams.concat(stream1,stream2,stream3);
10+
}
11+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.baeldung.guava.tutorial;
2+
3+
import com.google.common.collect.Interner;
4+
import com.google.common.collect.Interners;
5+
6+
import static com.google.common.collect.Interners.newBuilder;
7+
8+
public class InternerBuilderExample {
9+
10+
public static void main(String[] args){
11+
Interner<Integer> interners = Interners.<Integer>newBuilder()
12+
.concurrencyLevel(2)
13+
.strong()
14+
.<Integer>build();
15+
16+
17+
}
18+
19+
}

0 commit comments

Comments
 (0)