Skip to content

Commit

Permalink
cleanup codebase: Dropped outdated support for some lombok pg annotat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
Michail Plushnikov committed Apr 29, 2015
1 parent 466d864 commit b0533e8
Show file tree
Hide file tree
Showing 13 changed files with 13 additions and 322 deletions.
8 changes: 5 additions & 3 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 0 additions & 29 deletions lombok-api/pom.xml
Expand Up @@ -17,9 +17,6 @@
lombok/Getter.java,lombok/Setter.java,lombok/Equals*.java,lombok/NonNull.java,lombok/Synchronized.java,
lombok/ToString.java,lombok/SneakyThrows.java,lombok/Value.java,lombok/val.java
</lombok-annotations.includes>
<lombok-pg-annotations.includes>
lombok/EnumId.java,lombok/FluentSetter.java,lombok/Singleton.java,lombok/LazyGetter.java
</lombok-pg-annotations.includes>
<hrisey-annotations.includes>
hrisey/Parcelable.java
</hrisey-annotations.includes>
Expand All @@ -29,10 +26,6 @@
<maven>${maven.min.version}</maven>
</prerequisites>

<dependencies>

</dependencies>

<build>
<plugins>
<plugin>
Expand All @@ -59,27 +52,6 @@
<includes>${lombok-annotations.includes}</includes>
</configuration>
</execution>
<execution>
<id>lombok_pg</id>
<goals>
<goal>unpack</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.github.peichhorn</groupId>
<artifactId>lombok-pg</artifactId>
<version>${lombok-pg.version}</version>
<type>jar</type>
<classifier>sources</classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/generated-sources/lombok-pg</outputDirectory>
</artifactItem>
</artifactItems>
<includes>${lombok-pg-annotations.includes}</includes>
</configuration>
</execution>
<execution>
<id>hrisey</id>
<goals>
Expand Down Expand Up @@ -115,7 +87,6 @@
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/lombok</source>
<source>${project.build.directory}/generated-sources/lombok-pg</source>
<source>${project.build.directory}/generated-sources/hrisey</source>
</sources>
</configuration>
Expand Down
5 changes: 2 additions & 3 deletions lombok-intellij-plugin.iml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
Expand All @@ -10,5 +10,4 @@
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="POM File Configuration" pomFile="" />
</module>

</module>
Expand Up @@ -9,7 +9,6 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class LombokHighlightErrorFilter implements HighlightInfoFilter {
Expand All @@ -19,18 +18,16 @@ public class LombokHighlightErrorFilter implements HighlightInfoFilter {
@Override
public boolean accept(@NotNull HighlightInfo highlightInfo, @Nullable PsiFile file) {
if (null != file && HighlightSeverity.ERROR.equals(highlightInfo.getSeverity())) {
final String description = StringUtil.notNullize(highlightInfo.getDescription());

// Handling LazyGetter
if (uninitializedField(description) && LazyGetterHandler.isLazyGetterHandled(highlightInfo, file)) {
if (uninitializedField(highlightInfo.getDescription()) && LazyGetterHandler.isLazyGetterHandled(highlightInfo, file)) {
return false;
}
}
return true;
}

private boolean uninitializedField(String description) {
Matcher matcher = UNINITIALIZED_MESSAGE.matcher(description);
return matcher.matches();
return UNINITIALIZED_MESSAGE.matcher(StringUtil.notNullize(description)).matches();
}
}
Expand Up @@ -9,11 +9,9 @@
import com.intellij.psi.util.PsiTreeUtil;
import de.plushnikov.intellij.plugin.util.PsiAnnotationUtil;
import lombok.Getter;
import lombok.LazyGetter;

public class LazyGetterHandler {

private static final String LAZY_GETTER_FQN = LazyGetter.class.getName();
private static final String GETTERN_FQN = Getter.class.getName();

public static boolean isLazyGetterHandled(HighlightInfo highlightInfo, PsiFile file) {
Expand All @@ -27,9 +25,6 @@ public static boolean isLazyGetterHandled(HighlightInfo highlightInfo, PsiFile f
}

final PsiAnnotation getterAnnotation = PsiAnnotationUtil.findAnnotation(field, GETTERN_FQN);
if (null != getterAnnotation) {
return PsiAnnotationUtil.getBooleanAnnotationValue(getterAnnotation, "lazy", false);
}
return PsiAnnotationUtil.isAnnotatedWith(field, LAZY_GETTER_FQN);
return null != getterAnnotation && PsiAnnotationUtil.getBooleanAnnotationValue(getterAnnotation, "lazy", false);
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit b0533e8

Please sign in to comment.