Skip to content

Instantly share code, notes, and snippets.

View dashorst's full-sized avatar

Martijn Dashorst dashorst

View GitHub Profile
@dashorst
dashorst / gist:eb84199f86e109728dce
Created June 22, 2015 13:58
Fix generics for ListView
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListView.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListView.java
index 57f9d84..e179d9e 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListView.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListView.java
@@ -134,7 +134,7 @@ public abstract class ListView<T> extends AbstractRepeater
* @param model model containing a list of
* @see org.apache.wicket.Component#Component(String, IModel)
*/
- public ListView(final String id, final IModel<? extends List<? extends T>> model)
+ public ListView(final String id, final IModel<? extends List<T>> model)
@dashorst
dashorst / gist:4ee7ab1696321f290a24
Created June 22, 2015 11:39
Made wildcards internally consistent in ListView
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListView.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListView.java
index 57f9d84..d1bdd39 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListView.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListView.java
@@ -442,7 +442,7 @@ public abstract class ListView<T> extends AbstractRepeater
* The list item index
* @return The ListItemModel created
*/
- protected IModel<T> getListItemModel(final IModel<? extends List<T>> listViewModel,
+ protected IModel<? extends T> getListItemModel(final IModel<? extends List<? extends T>> listViewModel,
@dashorst
dashorst / StringResourceModelMigration
Created May 26, 2015 12:31
A migration assisting class for Wicket's StringResourceModel
/*
* 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
*
@dashorst
dashorst / gist:051a2cc07ad8f25635ea
Created November 28, 2014 15:00
A brilliant piece of code...
package com.sun.xml.bind.v2.model.impl;
...
public class ModelBuilder {
...
static {
try {
XmlSchema s = null;
@dashorst
dashorst / 1 FlickrLookup.java
Last active August 29, 2015 14:01
Flickr API client om in een AsyncTask foto's voor een locatie op te halen.
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashSet;
import java.util.Iterator;
@dashorst
dashorst / Quote.java
Last active August 29, 2015 14:01
Code voor gebruik in cheesy-quotes Android project
/**
* Een quote van een persoon: bevat de tekst of uitspraak en een attribution
* van de persoon die de quote gezegd of geschreven heeft.
*/
public class Quote {
private String text;
private String attribution;
public String getText() {
return text;
@dashorst
dashorst / gist:6351377
Created August 27, 2013 09:10
Thread dump of hung eclipse using jboss tools and trying to configure validation settings in Preferences
jstack 76650
2013-08-27 10:28:10
Full thread dump Java HotSpot(TM) 64-Bit Server VM (23.25-b01 mixed mode):
"Thread-86" daemon prio=5 tid=0x000000011a066000 nid=0x17c2b runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Attach Listener" daemon prio=5 tid=0x0000000119a7c000 nid=0x18307 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
@dashorst
dashorst / wicket-rfc-0001.txt
Last active February 15, 2021 06:23
Apache Wicket is an open source Java component oriented web application framework. This document specifies modernization to the way Wicket handles PageParameters in the processing of requests and the lifecycle of Page components, based on the specifications done for JAX-RS (JSR-311 and JSR-339).
Please see https://github.com/dashorst/wicket-rfcs/blob/master/wicket-rfc-0001.txt for the RFC.
Please comment either inline in the github repository, or reply to the message
thread on the [email protected] mailing list.
@dashorst
dashorst / gist:6268094
Last active December 21, 2015 06:59
Test for code analysis by Eclipse
package testproject;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
public class Test {
public void deadCodeAfterAssertNotNull() {
assertNotNull(null);
fail("");
}
@dashorst
dashorst / MongoFilter.java
Created April 14, 2013 20:29
Mongo wicket example connection provider. The MongoFilter was created as a servlet Filter because we also wanted to enable mongo through our rest api. A wicket filter would not be accessible through the rest api.
package com.example.mongo;
import java.io.IOException;
import javax.inject.Inject;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;