This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class LazySingleton { | |
private volatile static LazySingleton instance; | |
private LazySingleton() { | |
} | |
public static LazySingleton getInstance() { | |
if (instance == null) { | |
synchronized (LazySingleton.class) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class PersonImmutableBuilder { | |
private final String name; | |
private final String cpf; | |
public PersonImmutableBuilder() { | |
this(null, null); | |
} | |
private PersonImmutableBuilder(final String name, final String cpf) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static java.util.concurrent.TimeUnit.MILLISECONDS; | |
import java.util.ArrayList; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import java.util.concurrent.locks.Lock; | |
import java.util.concurrent.locks.ReentrantReadWriteLock; | |
public final class ArrayListThreadSafe { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.simpledev.struts2.action; | |
import java.util.List; | |
import org.apache.struts2.convention.annotation.Action; | |
import org.apache.struts2.convention.annotation.Namespace; | |
import org.apache.struts2.convention.annotation.ParentPackage; | |
import org.apache.struts2.convention.annotation.Result; | |
import br.com.simpledev.struts2.dao.LocalidadeDao; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:context="http://www.springframework.org/schema/context" | |
xsi:schemaLocation="http://www.springframework.org/schema/beans | |
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd | |
http://www.springframework.org/schema/context | |
http://www.springframework.org/schema/context/spring-context-3.1.xsd"> | |
<context:component-scan base-package="br.com.simpledev.struts2spring" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.simpledev.spring.controller; | |
import static org.springframework.web.bind.annotation.RequestMethod.GET; | |
import static org.springframework.web.bind.annotation.RequestMethod.POST; | |
import static org.springframework.web.bind.annotation.RequestMethod.PUT; | |
import java.util.List; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.stereotype.Controller; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<application> | |
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver> | |
</application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.concurrent5.service; | |
import java.util.Random; | |
public class RandomService { | |
private final String name; | |
public RandomService(final String name) { | |
this.name = name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.simpledev.struts2; | |
import static org.junit.Assert.assertFalse; | |
import static org.mockito.Mockito.when; | |
import java.util.Collections; | |
import java.util.List; | |
import org.junit.Before; | |
import org.junit.Test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.simpledev.springhibernate.dao; | |
import java.util.List; | |
import br.com.simpledev.springhibernate.model.Carro; | |
public interface CarroDao { | |
List<Carro> lista(); |
OlderNewer