Skip to content

Instantly share code, notes, and snippets.

View sebastianmonte's full-sized avatar

Sebastian Monte sebastianmonte

View GitHub Profile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building testapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ testapp ---
[INFO] Deleting /IdeaProjects/testapp/target
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ testapp ---
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.gofore.fixme</groupId>
<artifactId>testapp</artifactId>
<version>1.0-SNAPSHOT</version>
package com.gofore.fixme.processor;
import com.gofore.fixme.annotation.Fixme;
import javax.annotation.processing.*;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.tools.Diagnostic;
import java.util.Set;
package com.gofore.fixme.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
@Retention(RetentionPolicy.SOURCE)
@Target({ANNOTATION_TYPE, CONSTRUCTOR, FIELD, METHOD, TYPE})
package com.gofore.test;
import com.gofore.fixme.annotation.Fixme;
import java.util.List;
public class NumberAdder {
@Fixme(summary = "Use stream instead of loop")
public static int add(List<Integer> numbers) {
@sebastianmonte
sebastianmonte / StaticAccessedFromInstanceFix.java
Created February 12, 2015 13:49
Static Accessed from Instance Fix
// OLD
if (fileSize > recoverySettings.SMALL_FILE_CUTOFF_BYTES) {
//NEW
if (fileSize > RecoverySettings.SMALL_FILE_CUTOFF_BYTES) {
@sebastianmonte
sebastianmonte / staticaccessedfrominstanc
Created February 12, 2015 13:47
Static Accessed from Instance
[ERROR] /IdeaProjects/elasticsearch/src/main/java/org/elasticsearch/indices/recovery/ShardRecoveryHandler.java:[229,48] [StaticAccessedFromInstance] A static variable or method should not be accessed from an instance
(see http://code.google.com/p/error-prone/wiki/StaticAccessedFromInstance)
Did you mean 'if (fileSize > RecoverySettings.SMALL_FILE_CUTOFF_BYTES) {'?
@sebastianmonte
sebastianmonte / CheckReturnValueFixOneLiner.java
Created February 12, 2015 13:38
Check Return Value Fix One Liner
this.cache = cacheBuilder.removalListener(new ScriptCacheRemovalListener()).build();
@sebastianmonte
sebastianmonte / CheckReturnValueFix.java
Created February 12, 2015 13:38
Fix for Check Return Value
// OLD
cacheBuilder.removalListener(new ScriptCacheRemovalListener());
this.cache = cacheBuilder.build();
// NEW
cacheBuilder = cacheBuilder.removalListener(new ScriptCacheRemovalListener())
this.cache = cacheBuilder.build();
@sebastianmonte
sebastianmonte / checkreturnvalue
Created February 12, 2015 13:37
Check Return Value Error
[ERROR] /IdeaProjects/elasticsearch/src/main/java/org/elasticsearch/script/ScriptService.java:[247,37] [CheckReturnValue] Ignored return value of method that is annotated with @CheckReturnValue
(see http://code.google.com/p/error-prone/wiki/CheckReturnValue)
Did you mean 'cacheBuilder = cacheBuilder.removalListener(new ScriptCacheRemovalListener());'?