Skip to content

Instantly share code, notes, and snippets.

View jbosboom's full-sized avatar

Jeffrey Bosboom jbosboom

  • 05:03 (UTC -07:00)
View GitHub Profile
@jbosboom
jbosboom / RemoveUnusedPrivateCtors.java
Created May 10, 2015 02:05
Removes unused private constructors from .class files
/*
* Copyright (c) 2015 Jeffrey Bosboom
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@jbosboom
jbosboom / ConstantPoolSortingClassWriter.java
Last active June 14, 2019 04:49
ASM constant pool sorter
/***
* Copyright (c) 2015 Jeffrey Bosboom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
package com.jeffreybosboom.stringbuilderbench;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
@State(Scope.Thread)
public class StringBuilderBench {
//promote to non-final fields to inhibit constant folding (see JMHSample_10_ConstantFold.java)
private String really = "really ", long_string = "long string.", re = "re", al = "al", ly = "ly ";