Skip to content

Instantly share code, notes, and snippets.

View marchof's full-sized avatar
💭
🧑‍💻 ^ 🏔

Marc R. Hoffmann marchof

💭
🧑‍💻 ^ 🏔
View GitHub Profile
@marchof
marchof / Target03.asm
Created January 10, 2017 22:52
Decompiled Target03.class (compiled with ECJ)
Classfile /Users/marc/git/jacoco/org.jacoco.core.test/target/classes/org/jacoco/core/test/validation/targets/Target03.class
Last modified 10.01.2017; size 2221 bytes
MD5 checksum 8563aec01d041a8cc6b86839e2d2f6c5
Compiled from "Target03.java"
public class org.jacoco.core.test.validation.targets.Target03
SourceFile: "Target03.java"
InnerClasses:
public static #73= #49 of #54; //StubException=class org/jacoco/core/test/validation/targets/Stubs$StubException of class org/jacoco/core/test/validation/targets/Stubs
minor version: 0
major version: 49
@marchof
marchof / Console.txt
Created August 12, 2016 11:53
Exception in Cyclic interface causes JVM Crash
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006fe21b55, pid=14180, tid=0x00000000000038dc
#
# JRE version: Java(TM) SE Runtime Environment (8.0_101-b13) (build 1.8.0_101-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.101-b13 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V [jvm.dll+0x201b55]
#
@marchof
marchof / Shutdown.java
Created April 11, 2016 17:09
JVM Shutdown
public class Shutdown {
public static void main(String[] args) {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
System.out.println("Shutdown Hook");
}
});
Thread.currentThread().interrupt();
@marchof
marchof / functionalinterfaces.txt
Created November 4, 2015 17:26
All Functional Interfaces in Java 8
java.awt.ActiveEvent void dispatch()
java.awt.Composite CompositeContext createContext(ColorModel, ColorModel, RenderingHints)
java.awt.KeyEventDispatcher boolean dispatchKeyEvent(KeyEvent)
java.awt.KeyEventPostProcessor boolean postProcessKeyEvent(KeyEvent)
java.awt.PrintGraphics PrintJob getPrintJob()
java.awt.Stroke Shape createStrokedShape(Shape)
java.awt.Transparency int getTransparency()
java.awt.datatransfer.ClipboardOwner void lostOwnership(Clipboard, Transferable)
java.awt.datatransfer.FlavorListener void flavorsChanged(FlavorEvent)
java.awt.dnd.DragGestureListener void dragGestureRecognized(DragGestureEvent)
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java
index 4008091..38fbdd9 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java
@@ -103,6 +103,14 @@
assertLine("explicitExceptionFinally.finallyBlock",
ICounter.FULLY_COVERED);
+ // 10. Exception After Branch:
+ assertLine("implicitExceptionAfterForLoop.for", ICounter.FULLY_COVERED,
@marchof
marchof / jdk7u75.asm
Created May 12, 2015 20:37
JaCoCo Issue 307, decompiled class files
Classfile jdk7u75.class
Last modified 12.05.2015; size 633 bytes
MD5 checksum 46f5401da6f0fe4eb489fbaa49714f14
Compiled from "Example.java"
public class Example
SourceFile: "Example.java"
minor version: 0
major version: 49
flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
@marchof
marchof / core.test.patch
Created February 24, 2015 06:16
Validation test for jacoco/jacoco#286
diff --git a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java
index a3bfa81..0845bd6 100644
--- a/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java
+++ b/org.jacoco.core.test/src/org/jacoco/core/test/validation/ExceptionsTest.java
@@ -61,7 +61,17 @@
assertLine("implicitExceptionTryCatch.catchBlock",
ICounter.FULLY_COVERED);
- // 5. Try/Catch Block With Exception Thrown Explicitly
+ // 5. Try/Catch Block With Exception Thrown Implicitly After Condition
@marchof
marchof / A Description
Last active August 29, 2015 14:15
Reproducer for invalid annotation ranges on bridge methods (javac 1.8.0_31)
PROBLEM
Annotation with target TYPE_USE seems to be copied to bridge methods. As bridge methods
only delegate back to the overloaded method, these annotations are typically invalid.
The reproducer shows that the type annotations specifies a PC range which is longer
than the byte code of the method.
Probably type annotations shouldn't be copied to bridge methods.
REPRODUCER
Classfile /C:/Users/ue30465/Downloads/broken.class
Last modified 16.10.2014; size 5383 bytes
MD5 checksum 950e2b6062478cbdab9edcfc3a8f36e9
Compiled from "JacocoOpenJPAIssue.java"
public class net.sample.JacocoOpenJPAIssue implements java.lang.Cloneable,org.apache.openjpa.enhance.PersistenceCapable
SourceFile: "JacocoOpenJPAIssue.java"
RuntimeVisibleAnnotations:
0: #23()
1: #24(#25=Z#26)
minor version: 0
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2009, 2014 Mountainminds GmbH & Co. KG and Contributors
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors: