View NoStreams.java
public Integer max(Collection<Integer> collection) { | |
if( collection == null || collection.isEmpty() ) return null; | |
Iterator<Integer> i = collection.iterator(); | |
int max = i.next(); | |
while (i.hasNext()) { | |
int n = i.next(); | |
if (max < n) max = n; | |
} | |
return max; | |
} |
View RightWayToUseConfiguration.java
public class MyClass { | |
@Configuration("path.prefix") | |
private String pathPrefix; | |
private String fileName; | |
public MyClass(String fileName) { | |
this.fileName = fileName; //here we simply store it | |
} | |
View WrongWayToUseConfiguration.java
public class MyClass { | |
@Configuration("path.prefix") // this is wrong! | |
private static final String PATH_PREFIX = null; | |
private String fileName; | |
public MyClass(String fileName) { | |
this.fileName = PATH_PREFIX + fileName; | |
} | |
} |
View gist:5962008
Output of `brew install`: | |
~ $ HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install rpm 2>&1 | |
==> Installing rpm dependency: rpm2cpio | |
==> Downloading http://svnweb.freebsd.org/ports/head/archivers/rpm2cpio/files/rpm2cpio?revision=259745&view=co | |
Already downloaded: /Library/Caches/Homebrew/rpm2cpio-1.3 | |
Error: rpm2cpio?revision=259745 does not exist | |
~ $ | |
~ $ | |
~ $ |
NewerOlder