- 誰かだけが触れるコードを無くす
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
/** | |
* Asynchronously resolve the module path string id into cb(err, res [, pkg]), where pkg (if defined) is the data from package.json. | |
*/ | |
declare function resolve(id: string, opts?: Options, callback?: (err?: Error, res?: any, pkg?: any) => string); | |
interface readFile { (filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; } | |
interface readFile { (filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void; } | |
interface readFile { (filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; } | |
interface readFile { (filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; } |
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 aaa; | |
public interface JavaSAM { | |
String doIt(int i, String s); | |
static void call(JavaSAM ms) { | |
System.out.println(ms.doIt(1, "zzzz")); | |
} | |
} |
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
public static void main(String[] args) { | |
String[] tmpl = { // | |
"public void %s(CharSequence msg) {this.delegate.printMessage(Kind.%s, msg, null);}", | |
"public void %s(Supplier<CharSequence> msg) {this.delegate.printMessage(Kind.%s, msg.get(), null);}", | |
"public void %s(CharSequence msg,Element e) {this.delegate.printMessage(Kind.%s, msg, e);}", | |
"public void %s(Supplier<CharSequence> msg,Element e) {this.delegate.printMessage(Kind.%s, msg.get(), e);}", | |
"public void %s(CharSequence msg,Element e,AnnotationMirror a) {this.delegate.printMessage(Kind.%s, msg, e, a);}", | |
"public void %s(Supplier<CharSequence> msg,Element e,AnnotationMirror a) {this.delegate.printMessage(Kind.%s, msg.get(), e, a);}", | |
"public void %s(CharSequence msg,Element e,AnnotationMirror a,AnnotationValue v) {this.delegate.printMessage(Kind.%s, msg, e, a, v);}", | |
"public void %s(Supplier<CharSequence> msg,Element e,AnnotationMirror a,AnnotationValue v) {this.delegate.printMessage(Kind.%s, msg.get(), e, a, v) |
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
/** | |
* @author taichi | |
*/ | |
public class Zy { | |
// これから実装しようとしている処理 | |
public static Optional<Integer> newFn(Optional<String> s) { | |
return s.flatMap(s2 -> { | |
Integer i = funkyOldFn(s2); | |
return i < 0 ? Optional.empty() : Optional.of(i); |
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
# JMH 1.10.5 (released 21 days ago) | |
# VM version: JDK 1.8.0_60, VM 25.60-b23 | |
# VM invoker: C:\jdk1.8.0_60\jre\bin\java.exe | |
# VM options: -Dfile.encoding=windows-31j -Duser.country=JP -Duser.language=ja -Duser.variant | |
# Warmup: 10 iterations, 1 s each | |
# Measurement: 10 iterations, 1 s each | |
# Timeout: 10 min per iteration | |
# Threads: 1 thread, will synchronize iterations | |
# Benchmark mode: Average time, time/op | |
# Benchmark: json.benchmark.AutoBenchmark.ParserBenchmark.bufferdStream |
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
public interface AtomicFieldUpdaters { | |
static <T> void max(T self, long value, AtomicLongFieldUpdater<T> updater) { | |
long max; | |
do { | |
max = updater.get(self); | |
if (value < max) { | |
break; | |
} | |
} while (updater.compareAndSet(self, max, value) == false); |
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
/* | |
* Copyright 2015 SATO taichi | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
public class ReturnTypeOverload { | |
public static void main(String[] args) { | |
Long lv = getValue(); | |
System.out.println(lv); | |
String sv = getValue(); | |
System.out.println(sv); | |
} |