Skip to content

Instantly share code, notes, and snippets.

View odrotbohm's full-sized avatar
👨‍💻
@ home

Oliver Drotbohm odrotbohm

👨‍💻
@ home
View GitHub Profile
@mp911de
mp911de / DemoApplication.java
Created January 14, 2021 13:03
Spring Data Project Assessment
package com.example.demo;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
import java.util.stream.IntStream;
@odrotbohm
odrotbohm / using-annotation-based-null-checks-in-eclipse.adoc
Last active June 27, 2017 12:28
Using annotation based null checks in Eclipse

Using annotation based null checks in Eclipse

Found issues

Calls to remote API not using nullability annotations cause warnings

Assume you call some external API (e.g. JDK API) that doesn’t use the nullability annotations:

@eeichinger
eeichinger / pom.xml
Created May 20, 2015 08:34
maven plugins to compile java 1.8 syntax but target jvm 1.7
<!--
compile java 1.8, target java 1.7
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<encoding>utf-8</encoding>
<source>1.8</source>
@aslakknutsen
aslakknutsen / start_testing_java8_today.asciidoc
Last active May 10, 2024 20:15
Example of how to use both JDK 7 and JDK 8 in one build.

JDK 8 Released

Most of us won’t be able to use/deploy JDK 8 in production for a looong time. But that shouldn’t stop us from using it, right?

It should be possible to sneak in JDK 8 in the back way, the same way we snuck in Groovy and other libraries we wanted to use.

The Test Suite to the rescue

The Maven compiler plugin run in two separate lifecycles, compile and testCompile. Those can be configured separately.

@MappedSuperclass
public abstract class AbstractAuditable<U, PK extends Serializable> extends AbstractPersistable<PK> implements
Auditable<U, PK> {
// …
}
{
"_links": {
"self": { "href": "/foo" },
},
"_controls": {
"attack": {
"target": "/attacks",
"method": "POST",
"headers": {
"Content-Type": "application/json"
@odrotbohm
odrotbohm / gist:3497047
Created August 28, 2012 10:36
JPQL / SQL riddle
JPQL: select p from Person p
left outer join p.address address
order by address.city
SQL: select person0_ from Person person0_
left outer join Address address1_ on person0_.id=address1_.person_id
order by address1_.city
JPQL: select p from Person p
left outer join p.address address
order by p.address.city
@bric3
bric3 / install_jdk5_post_lion.sh
Last active April 18, 2023 06:50
Automate the install of JDK 5 on Lion, Mountain Lion, Mavericks
# _______ _ _ _ _ _
# |__ __| | (_) (_) | | | |
# | | | |__ _ ___ ___ ___ _ __ _ _ __ | |_ _ __ ___ _____ _____ __| |
# | | | '_ \| / __| / __|/ __| '__| | '_ \| __| | '_ ` _ \ / _ \ \ / / _ \/ _` |
# | | | | | | \__ \ \__ \ (__| | | | |_) | |_ | | | | | | (_) \ V / __/ (_| |
# |_| |_| |_|_|___/ |___/\___|_| |_| .__/ \__| |_| |_| |_|\___/ \_/ \___|\__,_|
# | |
# |_|
#
# New home : https://github.com/bric3/osx-jdk5-installer