Skip to content

Instantly share code, notes, and snippets.

View rmannibucau's full-sized avatar

Romain Manni-Bucau rmannibucau

View GitHub Profile
scala> def ptime[A](f: => A) = {
| val t0 = System.nanoTime
| val ans = f
| printf("Elapsed: %.3f sec\n",(System.nanoTime-t0)*1e-9)
| ans
| }
ptime: [A](f: => A)A
scala> ptime((1 to 8).size)
Elapsed: 0.000 sec
@rmannibucau
rmannibucau / gist:6128964
Last active December 20, 2015 12:09
asm4 module for commons-proxy2
Index: asm4/src/test/java/org/apache/commons/proxy2/javassist/TestAsm4ProxyFactory.java
===================================================================
--- asm4/src/test/java/org/apache/commons/proxy2/javassist/TestAsm4ProxyFactory.java (revision 0)
+++ asm4/src/test/java/org/apache/commons/proxy2/javassist/TestAsm4ProxyFactory.java (working copy)
@@ -0,0 +1,10 @@
+package org.apache.commons.proxy2.javassist;
+
+import org.apache.commons.proxy2.AbstractSubclassingProxyFactoryTestCase;
+
+public class TestAsm4ProxyFactory extends AbstractSubclassingProxyFactoryTestCase
@rmannibucau
rmannibucau / gist:6125125
Created July 31, 2013 19:07
asm4-shaded commons-proxy impl
Index: src/test/java/org/apache/commons/proxy/factory/asm4/ASMProxyFactoryTest.java
===================================================================
--- src/test/java/org/apache/commons/proxy/factory/asm4/ASMProxyFactoryTest.java (revision 0)
+++ src/test/java/org/apache/commons/proxy/factory/asm4/ASMProxyFactoryTest.java (working copy)
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
@rmannibucau
rmannibucau / gist:6099063
Created July 28, 2013 15:57
commons-proxy asm impl
Index: src/test/java/org/apache/commons/proxy/factory/asm4/ASMProxyFactoryTest.java
===================================================================
--- src/test/java/org/apache/commons/proxy/factory/asm4/ASMProxyFactoryTest.java (revision 0)
+++ src/test/java/org/apache/commons/proxy/factory/asm4/ASMProxyFactoryTest.java (working copy)
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
package org;
import org.apache.openejb.loader.IO;
import org.apache.tomee.embedded.Configuration;
import org.apache.tomee.embedded.Container;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
import java.io.FileWriter;
Index: webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
===================================================================
--- webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java (revision 1480620)
+++ webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java (working copy)
@@ -71,6 +71,7 @@
import org.apache.webbeans.component.NewBean;
import org.apache.webbeans.component.OwbBean;
import org.apache.webbeans.component.third.ThirdpartyBeanImpl;
+import org.apache.webbeans.component.third.ThirdpartyBeanPassivationCapableImpl;
import org.apache.webbeans.config.WebBeansContext;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
public void after() throws Exception {
final ContextsService contextsService = appContext.getWebBeansContext().getContextsService();
if (assembler != null) {
contextsService.endContext(SessionScoped.class, session);
contextsService.endContext(RequestScoped.class, null);
contextsService.endContext(ConversationScoped.class, null);
try {
assembler.destroyApplication(appInfo.path);
} catch (Exception e) {
// no-op
@rmannibucau
rmannibucau / gist:5396530
Last active December 16, 2015 07:08
tomee 1.6.0-SNAPSHOT patch 4 OWB 1.2.0-SNAPSHOT
Index: pom.xml
===================================================================
--- pom.xml (revision 1468752)
+++ pom.xml (working copy)
@@ -143,7 +143,7 @@
<junit.version>4.11</junit.version>
<org.apache.axis2.version>1.4.1</org.apache.axis2.version>
<scannotation.version>1.0.2</scannotation.version>
- <org.apache.openwebbeans.version>1.1.8</org.apache.openwebbeans.version>
+ <org.apache.openwebbeans.version>1.2.0-SNAPSHOT</org.apache.openwebbeans.version>