Skip to content

Instantly share code, notes, and snippets.

View lppedd's full-sized avatar
🎮

Edoardo Luppi lppedd

🎮
View GitHub Profile
@lppedd
lppedd / readme.md
Created October 30, 2022 12:48 — forked from 573/readme.md
mvn, how combine.children="append" combine.self="override" (default is "merge" for both) work in multimodule projects
  • the combine.* attributes belong to the configuration elements child elements but in the child not the parent pom
  • let's say we have a prepared configuration for some plugin build::pluginmanagement in the parent pom and the combine rules are applied to some more specific configuration of this plugin inside a profile in the child pom then we need to specify this profile in the mvn call to convince us: mvn -Ptheprofile -f thesubmodule/pom.xml help:effective-pom| less (use the search functionality / and n/SHIFT-n to navigate to the right occurrences)
  • IMHO the combine.children=append rule doesn't really make sense for configuration elements that have children of heterogeneous names, i. e. systemPropertyVariables, here the effect in case some entry already existed in the default configuration another one of the same name would be added i. e. you had <someEntrySays>this</someEntrySays> (from parent pom) and [...]combine...="append"[...]that (from child po
@lppedd
lppedd / BootstrapAgent.java
Created July 10, 2021 20:48 — forked from raphw/BootstrapAgent.java
An example agent that intercepts a method of the bootstrap class loader.
package net.bytebuddy;
import net.bytebuddy.agent.ByteBuddyAgent;
import net.bytebuddy.agent.builder.AgentBuilder;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.dynamic.ClassFileLocator;
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.dynamic.loading.ClassInjector;
import net.bytebuddy.implementation.MethodDelegation;
import net.bytebuddy.implementation.bind.annotation.SuperCall;
@lppedd
lppedd / HelloApp.java
Last active February 5, 2021 20:28
JPanel layouts. See comment below for a preview.
package example;
import javax.swing.*;
import java.awt.*;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
@SuppressWarnings("ALL")
public class HelloApp {
private final JFrame frame;
@lppedd
lppedd / HelloApp.java
Last active February 5, 2021 13:56
JPanel frames
package example;
import javax.swing.*;
import java.awt.*;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
public class HelloApp {
private final JLabel videoLabel;
@lppedd
lppedd / reusableExceptions.md
Created October 6, 2018 19:23 — forked from 7yl4r/reusableExceptions.md
info on Java built-in exceptions from perspective of developer looking to reuse built-in exceptions

organized by estimated utility

IllegalArgumentException

Thrown to indicate that a method has been passed an illegal or inappropriate argument.

IndexOutOfBoundsException

Thrown to indicate that an index of some sort (such as to an array, to a string, or to a vector) is out of range.

ArithmeticException

Thrown when the requested mathematical operation is non-sensical or impossible.