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
class Foo { | |
public String getValue() { return "foo" ; } | |
} | |
interface Bar { | |
Integer getId(); | |
} | |
class Baz extends Foo implements Bar { | |
public Integer getId() { return 123; } |
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
import java.util.function.Supplier; | |
public class EnumExample3 { | |
enum A { | |
A1(B.B1, () -> B.B1), A2(B.B2, () -> B.B2); | |
private B b; | |
private Supplier<B> s; |
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
package example; | |
import java.lang.reflect.Field; | |
public class FieldExample { | |
public static void main(String[] args) throws Exception { | |
Field field = Integer.class.getDeclaredField("value"); | |
field.setAccessible(true); | |
field.getInt(""); |
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
package example; | |
// https://ideone.com/cx8hsF | |
public class MethodReferenceExample { | |
public static void main(String[] args) throws java.lang.Exception { | |
// your code goes here | |
Test test11 = String::trim; | |
// Test test12 = Hogehoge::trim; // NG | |
Hogehoge h = new Hogehoge(); |
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
2017-06-14 18:40:15.984 +0900: Embulk v0.8.20 | |
2017-06-14 18:40:18.664 +0900 [INFO] (0001:transaction): Loaded plugin embulk-output-postgresql (0.7.5) | |
2017-06-14 18:40:18.714 +0900 [INFO] (0001:transaction): Listing local files at directory 'S:\data' filtering filename by prefix 'hoge.csv' | |
2017-06-14 18:40:18.714 +0900 [INFO] (0001:transaction): "follow_symlinks" is set false. Note that symbolic links to directories are skipped. | |
2017-06-14 18:42:16.571 +0900 [INFO] (0001:transaction): Loading files [S:\data\hoge.csv] | |
2017-06-14 18:42:16.665 +0900 [INFO] (0001:transaction): Using local thread executor with max_threads=16 / output tasks 8 = input tasks 1 * 8 | |
2017-06-14 18:42:16.665 +0900 [INFO] (0001:transaction): Connecting to jdbc:postgresql://db-server:5432/hoge options {user=hoge, tcpKeepAlive=true, loginTimeout=300, socketTimeout=1800} | |
2017-06-14 18:42:16.805 +0900 [INFO] (0001:transaction): SQL: SET search_path TO "public" | |
2017-06-14 18:42:16.821 +0900 [INFO] (0001:transaction): > 0.02 seconds | |
2017-06-14 1 |
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
2017-04-11 16:30:30.549 +0900: Embulk v0.7.7 | |
2017-04-11 16:30:32.407 +0900 [INFO] (preview): Loaded plugin embulk-input-postgresql (0.8.2) | |
2017-04-11 16:30:32.639 +0900 [INFO] (preview): SQL: SET search_path TO "public" | |
LoadError: load error: embulk/command/embulk_main -- java.lang.NoClassDefFoundError: org/embulk/spi/json/JsonParser | |
require at org/jruby/RubyKernel.java:940 | |
require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54 | |
<top> at file:/home/apis/.embulk/bin/embulk!/embulk/command/embulk_bundle.rb:55 |
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
2017-02-27T17:30:12.651+09:00 [main] ERROR JavaProxyClassFactory : could not use ClassLoader.defineClass method | |
java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @569cfc36 | |
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Unknown Source) | |
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Unknown Source) | |
at java.base/java.lang.reflect.Method.setAccessible(Unknown Source) | |
at org.jruby.javasupport.proxy.JavaProxyClassFactory$1.run(JavaProxyClassFactory.java:219) | |
at org.jruby.javasupport.proxy.JavaProxyClassFactory$1.run(JavaProxyClassFactory.java:212) | |
at java.base/java.security.AccessController.doPrivileged(Native Method) | |
at org.jruby.javasupport.proxy.JavaProxyClassFactory.<clinit>( |
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
package example; | |
import java.util.function.Supplier; | |
public class ToStringFizzBuzz { | |
private final int value; | |
public ToStringFizzBuzz(int value) { | |
assert value >= 1; |
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
package example.time; | |
import java.time.ZoneId; | |
import java.time.ZonedDateTime; | |
public class LeapSecondPrint { | |
public static void main(String... args) { | |
ZonedDateTime end = ZonedDateTime.of(2015, 7, 1, 0, 0, 2, 0, ZoneId.systemDefault()); | |
for (ZonedDateTime now = ZonedDateTime.now(), prev = null; now.compareTo(end) <= 0; prev = now, now = ZonedDateTime.now()) { |
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
package example; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.Arrays; | |
import java.util.Comparator; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Optional; |
NewerOlder