Skip to content

Instantly share code, notes, and snippets.

View lppedd's full-sized avatar
🎮

Edoardo Luppi lppedd

🎮
View GitHub Profile
@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.