• Code
  • Tags
  • Users
  • Titles
  • Log in
  • Feedback
  • FAQ
Share Code
Welcome to ForkCan.com

ForkCan is all about sharing code in a social way.

Discuss, debate or argue with other devs about their or your own code.

Give other devs feedback or make a Fork (Make a better version of a shared code).

Rate the code, if you use the code mark it as used so others can see if the shared code is used by someone.

Help each other to be better devs and to be more productive.


Features not working yet:

Flag a post

Tagged code 'java' feeds
Latest activity

Tagged Code

Views Used Newest Oldest

683
Views
JUnit 4 tests in JUnit 3 suite
By Mattias Jiderhamn   November 13, 2010 11:14 AM

"Include JUnit 4 classes in a JUnit 3 suite() built with DirectorySuiteBuilder fom junit-addons"
java

Mark 'java' tag as 'like'

Mark 'java' tag as 'ignore'

junit

Mark 'junit' tag as 'like'

Mark 'junit' tag as 'ignore'

0 0 0 0


2.54k
Views
Spring auto wire with mock objects
By Mattias Jiderhamn   November 12, 2010 9:02 AM

"JUnit 4 @Rule implementation that uses Mockito mocked objects for Springs AspectJ auto wiring"
aspectj

Mark 'aspectj' tag as 'like'

Mark 'aspectj' tag as 'ignore'

java

Mark 'java' tag as 'like'

Mark 'java' tag as 'ignore'

junit

Mark 'junit' tag as 'like'

Mark 'junit' tag as 'ignore'

spring

Mark 'spring' tag as 'like'

Mark 'spring' tag as 'ignore'

0 0 0 0


474
Views
Linq / F# like list operations for old Java
By @thoriumi   September 09, 2010 12:58 PM

"Java 6 does not support functional programming but it can be emulated by making an object to contain a function."
java

Mark 'java' tag as 'like'

Mark 'java' tag as 'ignore'

list

Mark 'list' tag as 'like'

Mark 'list' tag as 'ignore'

0 0 0 1


763
Views
Detecting memory leak in unit test
By Olivier   July 22, 2010 12:17 PM

"JUnit assertion method and code sample to verify that an object is garbage collected correctly and does not lead to memory leak"
garbage-collector

Mark 'garbage-collector' tag as 'like'

Mark 'garbage-collector' tag as 'ignore'

java

Mark 'java' tag as 'like'

Mark 'java' tag as 'ignore'

junit

Mark 'junit' tag as 'like'

Mark 'junit' tag as 'ignore'

unittest

Mark 'unittest' tag as 'like'

Mark 'unittest' tag as 'ignore'

unit-test

Mark 'unit-test' tag as 'like'

Mark 'unit-test' tag as 'ignore'

0 0 0 0


463
Views
Detect if file contains XML
By Mattias Jiderhamn   July 14, 2010 2:49 PM

"Detect whether a File seems to contain XML, taking encoding and whitespace into account"
detect

Mark 'detect' tag as 'like'

Mark 'detect' tag as 'ignore'

file

Mark 'file' tag as 'like'

Mark 'file' tag as 'ignore'

java

Mark 'java' tag as 'like'

Mark 'java' tag as 'ignore'

xml

Mark 'xml' tag as 'like'

Mark 'xml' tag as 'ignore'

0 1 0 0


1.1k
Views
Detect encoding in InputStream
By Mattias Jiderhamn   July 14, 2010 2:39 PM

"Detect the encoding/Charset used in a Java InputStream by reading the BOM (Byte-Order-Mark)"
charset

Mark 'charset' tag as 'like'

Mark 'charset' tag as 'ignore'

detect

Mark 'detect' tag as 'like'

Mark 'detect' tag as 'ignore'

encoding

Mark 'encoding' tag as 'like'

Mark 'encoding' tag as 'ignore'

inputstream

Mark 'inputstream' tag as 'like'

Mark 'inputstream' tag as 'ignore'

java

Mark 'java' tag as 'like'

Mark 'java' tag as 'ignore'

0 0 0 0


Squeed
Made by: Fredrik Normén 2010