Skip to content

Instantly share code, notes, and snippets.

Alexandre Aquiles alexandreaquiles

Block or report user

Report or block alexandreaquiles

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
alexandreaquiles /
Created Jul 4, 2018
Solução sugerida para exercício de Refatoração do PM-87.
public class CalculadoraDePrecos {
public static BigDecimal calcula(Sessao sessao, Integer quantidade) {
return sessao.calcula(quantidade);
import java.nio.file.FileSystem;
import java.nio.file.FileSystemAlreadyExistsException;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
public class FileUtils {
public static String getResourceContents(String resource) throws URISyntaxException, IOException {
Path resourcePath = getResourceAsPath(resource);
return getPathContents(resourcePath);
private static Path getResourceAsPath(String resource) throws URISyntaxException, IOException {
URI uri = FileUtils.class.getResource(resource).toURI();
public class JacksonConfig {
public ObjectMapper objectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.setVisibility(PropertyAccessor.GETTER, Visibility.NONE);
mapper.setVisibility(PropertyAccessor.SETTER, Visibility.NONE);
mapper.setVisibility(PropertyAccessor.CREATOR, Visibility.NONE);
mapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
alexandreaquiles / .bashrc
Created Mar 21, 2018
show current SDK Java version on the command prompt
View .bashrc
#show java version on prompt
current_sdk_java_version() {
export PS1="\e[0;32m$(sdk current java version | grep version | sed -e 's/.*version \(.*\)/\1/')\e[m$ "
alexandreaquiles /
Last active Dec 15, 2017
EscapeXmlELResolverListener for Spring Boot based on
import java.beans.FeatureDescriptor;
import java.util.Iterator;
import javax.el.ELContext;
import javax.el.ELResolver;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.jsp.JspContext;
alexandreaquiles / show-module-resolution.txt
Last active Nov 30, 2017
Result of 'java --show-module-resolution' the unnamed module for Oracle JDK 9 (build 9.0.1+11)
View show-module-resolution.txt
root jrt:/
root jdk.jdi jrt:/jdk.jdi
root javafx.web jrt:/javafx.web
root jdk.xml.dom jrt:/jdk.xml.dom
root jdk.jfr jrt:/jdk.jfr
root jrt:/
root jdk.httpserver jrt:/jdk.httpserver
root javafx.base jrt:/javafx.base
root jrt:/
root javafx.controls jrt:/javafx.controls
alexandreaquiles / 2017-11-22.log
Created Nov 22, 2017
Warning when _ used as an identifier in Java 8. Compilation error in Java 9 (though, bytecode from Java 8 is executed).
View 2017-11-22.log
alexandre ~/keyword $ /usr/lib/jvm/java-8-oracle/bin/javac warning: '_' used as an identifier
int _ = 1;
(use of '_' as an identifier might not be supported in releases after Java SE 8) warning: '_' used as an identifier
(use of '_' as an identifier might not be supported in releases after Java SE 8)
2 warnings
alexandreaquiles /
Created Nov 17, 2017
Filter para medição de tempo
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
You can’t perform that action at this time.