- * If a member is annotated, it must be either a constructor or a method. If a class is annotated, - * then a private constructor is generated with all fields as arguments - * (as if {@code @AllArgsConstructor(AccessLevel.PRIVATE)} is present - * on the class), and it is as if this constructor has been annotated with {@code @Builder} instead. - *
- * The effect of {@code @Builder} is that an inner class is generated named TBuilder,
- * with a private constructor. Instances of TBuilder are made with the
- * method named {@code builder()} which is also generated for you in the class itself (not in the builder class).
- *
- * The TBuilder class contains 1 method for each parameter of the annotated
- * constructor / method (each field, when annotating a class), which returns the builder itself.
- * The builder also has a build() method which returns a completed instance of the original type,
- * created by passing all parameters as set via the various other methods in the builder to the constructor
- * or method that was annotated with {@code @Builder}. The return type of this method will be the same
- * as the relevant class, unless a method has been annotated, in which case it'll be equal to the
- * return type of that method.
- *
- * Complete documentation is found at the project lombok features page for @Builder.
- *
- *
- * Before: - * - *
- * @Builder
- * class Example {
- * private int foo;
- * private final String bar;
- * }
- *
- *
- * After:
- *
- *
- * class Example<T> {
- * private T foo;
- * private final String bar;
- *
- * private Example(T foo, String bar) {
- * this.foo = foo;
- * this.bar = bar;
- * }
- *
- * public static <T> ExampleBuilder<T> builder() {
- * return new ExampleBuilder<T>();
- * }
- *
- * public static class ExampleBuilder<T> {
- * private T foo;
- * private String bar;
- *
- * private ExampleBuilder() {}
- *
- * public ExampleBuilder foo(T foo) {
- * this.foo = foo;
- * return this;
- * }
- *
- * public ExampleBuilder bar(String bar) {
- * this.bar = bar;
- * return this;
- * }
- *
- * @java.lang.Override public String toString() {
- * return "ExampleBuilder(foo = " + foo + ", bar = " + bar + ")";
- * }
- *
- * public Example build() {
- * return new Example(foo, bar);
- * }
- * }
- * }
- *
- *
- * @deprecated {@link lombok.Builder} has been promoted to the main package, so use that one instead.
- */
-@Target({TYPE, METHOD, CONSTRUCTOR})
-@Retention(SOURCE)
-@Deprecated
-public @interface Builder {
- /** @return Name of the method that creates a new builder instance. Default: {@code builder}. */
- String builderMethodName() default "builder";
-
- /** @return Name of the method in the builder class that creates an instance of your {@code @Builder}-annotated class. */
- String buildMethodName() default "build";
-
- /**
- * Name of the builder class.
- *
- * Default for {@code @Builder} on types and constructors: {@code (TypeName)Builder}.
- * - * Default for {@code @Builder} on methods: {@code (ReturnTypeName)Builder}. - * - * @return Name of the builder class that will be generated (or if it already exists, will be filled with builder elements). - */ - String builderClassName() default ""; - - /** - * Normally the builder's 'set' methods are fluent, meaning, they have the same name as the field. Set this - * to {@code false} to name the setter method for field {@code someField}: {@code setSomeField}. - *
- * Default: true - * - * @return Whether to generate fluent methods (just {@code fieldName()} instead of {@code setFieldName()}). - */ - boolean fluent() default true; - - /** - * Normally the builder's 'set' methods are chaining, meaning, they return the builder so that you can chain - * calls to set methods. Set this to {@code false} to have these 'set' methods return {@code void} instead. - *
- * Default: true - * - * @return Whether to generate chaining methods (each build call returns itself instead of returning {@code void}). - */ - boolean chain() default true; -} diff --git a/src/core/lombok/experimental/Value.java b/src/core/lombok/experimental/Value.java deleted file mode 100644 index 06dbee13..00000000 --- a/src/core/lombok/experimental/Value.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2012-2017 The Project Lombok Authors. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package lombok.experimental; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Generates a lot of code which fits with a class that is a representation of an immutable entity. - *
- * Equivalent to {@code @Getter @FieldDefaults(makeFinal=true, level=AccessLevel.PRIVATE) @RequiredArgsConstructor @ToString @EqualsAndHashCode}. - *
- * Complete documentation is found at the project lombok features page for @Value. - * - * @see lombok.Getter - * @see Wither - * @see lombok.RequiredArgsConstructor - * @see lombok.ToString - * @see lombok.EqualsAndHashCode - * @see lombok.Data - * @deprecated {@link lombok.Value} has been promoted to the main package, so use that one instead. - */ -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.SOURCE) -@Deprecated -public @interface Value { - /** - * If you specify a static constructor name, then the generated constructor will be private, and - * instead a static factory method is created that other classes can use to create instances. - * We suggest the name: "of", like so: - * - *
- * public @Data(staticConstructor = "of") class Point { final int x, y; }
- *
- *
- * Default: No static constructor, instead the normal constructor is public.
- *
- * @return Name of static 'constructor' method to generate (blank = generate a normal constructor).
- */
- String staticConstructor() default "";
-}
diff --git a/src/core/lombok/experimental/var.java b/src/core/lombok/experimental/var.java
index d8de8b19..71cc141a 100644
--- a/src/core/lombok/experimental/var.java
+++ b/src/core/lombok/experimental/var.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2013 The Project Lombok Authors.
+ * Copyright (C) 2010-2017 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,6 +23,9 @@ package lombok.experimental;
/**
* like val but not final
+ *
+ * @deprecated {@code var} has been promoted to the main package; use {@link lombok.var} instead.
*/
+@Deprecated
public @interface var {
}
diff --git a/src/core/lombok/javac/JavacAST.java b/src/core/lombok/javac/JavacAST.java
index af812498..45679fd3 100644
--- a/src/core/lombok/javac/JavacAST.java
+++ b/src/core/lombok/javac/JavacAST.java
@@ -125,6 +125,8 @@ public class JavacAST extends AST
+ * For example: {@code var x = 10.0;} will infer {@code double}, and {@code var y = new ArrayList
+ * Note that this is an annotation type because {@code var x = 10;} will be desugared to {@code @var int x = 10;}
+ *
+ * Complete documentation is found at the project lombok features page for @var.
+ */
+public @interface var {
+}
diff --git a/src/core9/module-info.java b/src/core9/module-info.java
new file mode 100644
index 00000000..87f819e2
--- /dev/null
+++ b/src/core9/module-info.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 The Project Lombok Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+module lombok {
+ requires java.compiler;
+ requires java.instrument;
+ requires jdk.unsupported;
+
+ exports lombok;
+ exports lombok.experimental;
+ exports lombok.extern.apachecommons;
+ exports lombok.extern.java;
+ exports lombok.extern.jbosslog;
+ exports lombok.extern.log4j;
+ exports lombok.extern.slf4j;
+
+ provides javax.annotation.processing.Processor with lombok.launch.AnnotationProcessorHider.AnnotationProcessor;
+ provides org.mapstruct.ap.spi.AstModifyingAnnotationProcessor with lombok.launch.AnnotationProcessorHider.AstModificationNotifier;
+}
+
diff --git a/src/delombok/lombok/delombok/DocCommentIntegrator.java b/src/delombok/lombok/delombok/DocCommentIntegrator.java
index c3b07f32..bab0abd8 100644
--- a/src/delombok/lombok/delombok/DocCommentIntegrator.java
+++ b/src/delombok/lombok/delombok/DocCommentIntegrator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2010 The Project Lombok Authors.
+ * Copyright (C) 2009-2018 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -74,7 +74,7 @@ public class DocCommentIntegrator {
return out;
}
- private static final Pattern CONTENT_STRIPPER = Pattern.compile("^(?:\\s*\\*)?[ \\t]*(.*?)$", Pattern.MULTILINE);
+ private static final Pattern CONTENT_STRIPPER = Pattern.compile("^(?:\\s*\\*)?(.*?)$", Pattern.MULTILINE);
@SuppressWarnings("unchecked") private boolean attach(JCCompilationUnit top, final JCTree node, CommentInfo cmt) {
String docCommentContent = cmt.content;
if (docCommentContent.startsWith("/**")) docCommentContent = docCommentContent.substring(3);
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
index e4dd7b26..3da37869 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchVal.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2011 The Project Lombok Authors.
+ * Copyright (C) 2010-2018 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -212,7 +212,7 @@ public class PatchVal {
}
private static boolean isVar(LocalDeclaration local, BlockScope scope) {
- return is(local.type, scope, "lombok.experimental.var");
+ return is(local.type, scope, "lombok.experimental.var") || is(local.type, scope, "lombok.var");
}
private static boolean isVal(LocalDeclaration local, BlockScope scope) {
diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchValEclipse.java b/src/eclipseAgent/lombok/eclipse/agent/PatchValEclipse.java
index 505eb767..46237dcf 100644
--- a/src/eclipseAgent/lombok/eclipse/agent/PatchValEclipse.java
+++ b/src/eclipseAgent/lombok/eclipse/agent/PatchValEclipse.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2011 The Project Lombok Authors.
+ * Copyright (C) 2010-2018 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -103,7 +103,7 @@ public class PatchValEclipse {
}
private static boolean couldBeVar(TypeReference type) {
- return PatchVal.couldBe("lombok.experimental.var", type);
+ return PatchVal.couldBe("lombok.experimental.var", type) || PatchVal.couldBe("lombok.var", type);
}
public static void addFinalAndValAnnotationToSingleVariableDeclaration(Object converter, SingleVariableDeclaration out, LocalDeclaration in) {
diff --git a/src/j9stubs/org/mapstruct/ap/spi/AstModifyingAnnotationProcessor.java b/src/j9stubs/org/mapstruct/ap/spi/AstModifyingAnnotationProcessor.java
new file mode 100644
index 00000000..ffb99030
--- /dev/null
+++ b/src/j9stubs/org/mapstruct/ap/spi/AstModifyingAnnotationProcessor.java
@@ -0,0 +1,48 @@
+/**
+ * Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/)
+ * and/or other contributors as indicated by the @authors tag. See the
+ * copyright.txt file in the distribution for a full listing of all
+ * contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.mapstruct.ap.spi;
+
+import javax.lang.model.type.TypeMirror;
+
+/**
+ * A contract to be implemented by other annotation processors which - against the design philosophy of JSR 269 - alter
+ * the types under compilation.
+ *
+ * This contract will be queried by MapStruct when examining types referenced by mappers to be generated, most notably
+ * the source and target types of mapping methods. If at least one AST-modifying processor announces further changes to
+ * such type, the generation of the affected mapper(s) will be deferred to a future round in the annnotation processing
+ * cycle.
+ *
+ * Implementations are discovered via the service loader, i.e. a JAR providing an AST-modifying processor needs to
+ * declare its implementation in a file {@code META-INF/services/org.mapstruct.ap.spi.AstModifyingAnnotationProcessor}.
+ *
+ * @author Gunnar Morling
+ */
+//@org.mapstruct.util.Experimental
+public interface AstModifyingAnnotationProcessor {
+
+ /**
+ * Whether the specified type has been fully processed by this processor or not (i.e. this processor will amend the
+ * given type's structure after this invocation).
+ *
+ * @param type The type of interest
+ * @return {@code true} if this processor has fully processed the given type, {@code false} otherwise.
+ */
+ boolean isTypeComplete(TypeMirror type);
+}
\ No newline at end of file
diff --git a/src/launch/lombok/launch/AnnotationProcessor.java b/src/launch/lombok/launch/AnnotationProcessor.java
index 05c900ab..c4f922b9 100644
--- a/src/launch/lombok/launch/AnnotationProcessor.java
+++ b/src/launch/lombok/launch/AnnotationProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014-2017 The Project Lombok Authors.
+ * Copyright (C) 2014-2018 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -21,6 +21,7 @@
*/
package lombok.launch;
+import java.lang.reflect.Field;
import java.util.Set;
import javax.annotation.processing.AbstractProcessor;
@@ -37,6 +38,8 @@ import javax.lang.model.type.TypeMirror;
import org.mapstruct.ap.spi.AstModifyingAnnotationProcessor;
+import sun.misc.Unsafe;
+
class AnnotationProcessorHider {
public static class AstModificationNotifier implements AstModifyingAnnotationProcessor {
@Override public boolean isTypeComplete(TypeMirror type) {
@@ -65,11 +68,33 @@ class AnnotationProcessorHider {
}
@Override public void init(ProcessingEnvironment processingEnv) {
+ disableJava9SillyWarning();
AstModificationNotifierData.lombokInvoked = true;
instance.init(processingEnv);
super.init(processingEnv);
}
+ // sunapi suppresses javac's warning about using Unsafe; 'all' suppresses eclipse's warning about the unspecified 'sunapi' key. Leave them both.
+ // Yes, javac's definition of the word 'all' is quite contrary to what the dictionary says it means. 'all' does NOT include 'sunapi' according to javac.
+ @SuppressWarnings({"sunapi", "all"})
+ private void disableJava9SillyWarning() {
+ // JVM9 complains about using reflection to access packages from a module that aren't exported. This makes no sense; the whole point of reflection
+ // is to get past such issues. The only comment from the jigsaw team lead on this was some unspecified mumbling about security which makes no sense,
+ // as the SecurityManager is invoked to check such things. Therefore this warning is a bug, so we shall patch java to fix it.
+
+ try {
+ Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
+ theUnsafe.setAccessible(true);
+ Unsafe u = (Unsafe) theUnsafe.get(null);
+
+ Class> cls = Class.forName("jdk.internal.module.IllegalAccessLogger");
+ Field logger = cls.getDeclaredField("logger");
+ u.putObjectVolatile(cls, u.staticFieldOffset(logger), null);
+ } catch (Throwable t) {
+ // We shall ignore it; the effect of this code failing is that the user gets to see a warning they remove with various --add-opens magic.
+ }
+ }
+
@Override public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) {
return instance.process(annotations, roundEnv);
}
@@ -82,7 +107,7 @@ class AnnotationProcessorHider {
ClassLoader cl = Main.createShadowClassLoader();
try {
Class> mc = cl.loadClass("lombok.core.AnnotationProcessor");
- return (AbstractProcessor) mc.newInstance();
+ return (AbstractProcessor) mc.getDeclaredConstructor().newInstance();
} catch (Throwable t) {
if (t instanceof Error) throw (Error) t;
if (t instanceof RuntimeException) throw (RuntimeException) t;
diff --git a/src/utils/lombok/javac/Javac.java b/src/utils/lombok/javac/Javac.java
index 6f99463b..9ff4d22f 100644
--- a/src/utils/lombok/javac/Javac.java
+++ b/src/utils/lombok/javac/Javac.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009-2015 The Project Lombok Authors.
+ * Copyright (C) 2009-2018 The Project Lombok Authors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -63,8 +63,8 @@ public class Javac {
/** Matches any of the 8 primitive names, such as {@code boolean}. */
private static final Pattern PRIMITIVE_TYPE_NAME_PATTERN = Pattern.compile("^(boolean|byte|short|int|long|float|double|char)$");
- private static final Pattern VERSION_PARSER = Pattern.compile("^(\\d{1,6})\\.(\\d{1,6}).*$");
- private static final Pattern SOURCE_PARSER = Pattern.compile("^JDK(\\d{1,6})_(\\d{1,6}).*$");
+ private static final Pattern VERSION_PARSER = Pattern.compile("^(\\d{1,6})\\.?(\\d{1,6})?.*$");
+ private static final Pattern SOURCE_PARSER = Pattern.compile("^JDK(\\d{1,6})_?(\\d{1,6})?.*$");
private static final AtomicInteger compilerVersion = new AtomicInteger(-1);
@@ -79,11 +79,11 @@ public class Javac {
Matcher m = VERSION_PARSER.matcher(JavaCompiler.version());
if (m.matches()) {
int major = Integer.parseInt(m.group(1));
- int minor = Integer.parseInt(m.group(2));
if (major == 1) {
- compilerVersion.set(minor);
- return minor;
+ int minor = Integer.parseInt(m.group(2));
+ return setVersion(minor);
}
+ if (major >= 9) return setVersion(major);
}
}
@@ -92,16 +92,19 @@ public class Javac {
Matcher m = SOURCE_PARSER.matcher(name);
if (m.matches()) {
int major = Integer.parseInt(m.group(1));
- int minor = Integer.parseInt(m.group(2));
if (major == 1) {
- compilerVersion.set(minor);
- return minor;
+ int minor = Integer.parseInt(m.group(2));
+ return setVersion(minor);
}
+ if (major >= 9) return setVersion(major);
}
}
-
- compilerVersion.set(6);
- return 6;
+ return setVersion(6);
+ }
+
+ private static int setVersion(int version) {
+ compilerVersion.set(version);
+ return version;
}
private static final Class> DOCCOMMENTTABLE_CLASS;
diff --git a/test/transform/resource/after-delombok/BuilderChainAndFluent.java b/test/transform/resource/after-delombok/BuilderChainAndFluent.java
deleted file mode 100644
index f9833be6..00000000
--- a/test/transform/resource/after-delombok/BuilderChainAndFluent.java
+++ /dev/null
@@ -1,32 +0,0 @@
-class BuilderChainAndFluent {
- private final int yes;
- @java.lang.SuppressWarnings("all")
- BuilderChainAndFluent(final int yes) {
- this.yes = yes;
- }
- @java.lang.SuppressWarnings("all")
- public static class BuilderChainAndFluentBuilder {
- @java.lang.SuppressWarnings("all")
- private int yes;
- @java.lang.SuppressWarnings("all")
- BuilderChainAndFluentBuilder() {
- }
- @java.lang.SuppressWarnings("all")
- public void setYes(final int yes) {
- this.yes = yes;
- }
- @java.lang.SuppressWarnings("all")
- public BuilderChainAndFluent build() {
- return new BuilderChainAndFluent(yes);
- }
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- public java.lang.String toString() {
- return "BuilderChainAndFluent.BuilderChainAndFluentBuilder(yes=" + this.yes + ")";
- }
- }
- @java.lang.SuppressWarnings("all")
- public static BuilderChainAndFluentBuilder builder() {
- return new BuilderChainAndFluentBuilder();
- }
-}
diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeWithGenericsOnInners.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithGenericsOnInners.java
new file mode 100644
index 00000000..501d45a1
--- /dev/null
+++ b/test/transform/resource/after-delombok/EqualsAndHashCodeWithGenericsOnInners.java
@@ -0,0 +1,28 @@
+public class EqualsAndHashCodeWithGenericsOnInners {
+ class Inner {
+ int x;
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public boolean equals(final java.lang.Object o) {
+ if (o == this) return true;
+ if (!(o instanceof EqualsAndHashCodeWithGenericsOnInners.Inner)) return false;
+ final EqualsAndHashCodeWithGenericsOnInners>.Inner> other = (EqualsAndHashCodeWithGenericsOnInners>.Inner>) o;
+ if (!other.canEqual((java.lang.Object) this)) return false;
+ if (this.x != other.x) return false;
+ return true;
+ }
+ @java.lang.SuppressWarnings("all")
+ protected boolean canEqual(final java.lang.Object other) {
+ return other instanceof EqualsAndHashCodeWithGenericsOnInners.Inner;
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public int hashCode() {
+ final int PRIME = 59;
+ int result = 1;
+ result = result * PRIME + this.x;
+ return result;
+ }
+ }
+}
+
diff --git a/test/transform/resource/after-delombok/JavadocGenerally.java b/test/transform/resource/after-delombok/JavadocGenerally.java
index 729cdce3..ec9483bc 100644
--- a/test/transform/resource/after-delombok/JavadocGenerally.java
+++ b/test/transform/resource/after-delombok/JavadocGenerally.java
@@ -9,6 +9,9 @@ package testPackage;
class JavadocGenerally {
/**
* Doc on field
+ *
-
+ We're talking to NL-JUG to give a presentation soon in the The Hague (The Netherlands) area.
+ Lombok is open source. We offer three licenses for using lombok. The standard license is free. Here you can order a professional or enterprise license.
+
+ Order a professional or enterprise license
+ Lombok is and will remain a free, open source product. However, we ask you to consider becoming a licensee. Licensees will be listed on the
+ As part of being a professional or enterprise licensee, we will put your name, a logo, and possibly a link on our ‘supporters and licensees’ page. We'll also put (at random) some supporters and licensees on our front page. You may of course opt out of this offer. We may, at our discretion, opt not to list you. If we elect not to do so, you will be notified at the email address you fill in on our form, and you are as always free to cancel your license at any time.
+
+ Project Lombok is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed, even for professional and enterprise license holders. In no event shall the copyright holder or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
+
The Jetbrains IntelliJ IDEA editor is compatible with lombok.
- Add the Lombok IntelliJ plugin to add lombok support IntelliJ:
+ Add the Lombok IntelliJ plugin to add lombok support for IntelliJ:
- Support for JDK9 is ongoing. You need to set up some configuration to make lombok play nice with jigsaw (the JDK9 module system). The github issue about JDK9 support for Lombok has the details on how to set it up.
+ Support for JDK9, if you haven't modularized your own projects yet (no
+ Support for JDK9 if you did modularize your own projects (you've written a
+ The 'static' part ensures that you won't need lombok to be present at runtime.
+
+ Feedback about JDK9 module-info support can be given at github issue #985.
+ The Microsoft Visual Studio Code editor is compatible with lombok.
+
+ Add the vscode-lombok plugin to your Visual Studio Code IDE to add lombok support.
+
+ * // code
+ *
*/
private int someField;
/**
diff --git a/test/transform/resource/after-delombok/ValueExperimental.java b/test/transform/resource/after-delombok/ValueExperimental.java
deleted file mode 100644
index 5846a2d8..00000000
--- a/test/transform/resource/after-delombok/ValueExperimental.java
+++ /dev/null
@@ -1,46 +0,0 @@
-final class ValueExperimental1 {
- @java.lang.SuppressWarnings("all")
- public ValueExperimental1() {
- }
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- public boolean equals(final java.lang.Object o) {
- if (o == this) return true;
- if (!(o instanceof ValueExperimental1)) return false;
- return true;
- }
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- public int hashCode() {
- int result = 1;
- return result;
- }
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- public java.lang.String toString() {
- return "ValueExperimental1()";
- }
-}
-final class ValueExperimental2 {
- @java.lang.SuppressWarnings("all")
- public ValueExperimental2() {
- }
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- public boolean equals(final java.lang.Object o) {
- if (o == this) return true;
- if (!(o instanceof ValueExperimental2)) return false;
- return true;
- }
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- public int hashCode() {
- int result = 1;
- return result;
- }
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- public java.lang.String toString() {
- return "ValueExperimental2()";
- }
-}
diff --git a/test/transform/resource/after-delombok/ValueExperimentalStarImport.java b/test/transform/resource/after-delombok/ValueExperimentalStarImport.java
deleted file mode 100644
index cb755b47..00000000
--- a/test/transform/resource/after-delombok/ValueExperimentalStarImport.java
+++ /dev/null
@@ -1,25 +0,0 @@
-import lombok.experimental.*;
-final class ValueExperimentalStarImport {
- @java.lang.SuppressWarnings("all")
- public ValueExperimentalStarImport() {
-
- }
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- public boolean equals(final java.lang.Object o) {
- if (o == this) return true;
- if (!(o instanceof ValueExperimentalStarImport)) return false;
- return true;
- }
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- public int hashCode() {
- int result = 1;
- return result;
- }
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- public java.lang.String toString() {
- return "ValueExperimentalStarImport()";
- }
-}
diff --git a/test/transform/resource/after-delombok/VarWarning.java b/test/transform/resource/after-delombok/VarWarning.java
new file mode 100644
index 00000000..a333c87c
--- /dev/null
+++ b/test/transform/resource/after-delombok/VarWarning.java
@@ -0,0 +1,6 @@
+public class VarWarning {
+ public void isOkay() {
+ java.lang.String x = "Warning";
+ x.toLowerCase();
+ }
+}
\ No newline at end of file
diff --git a/test/transform/resource/after-ecj/BuilderChainAndFluent.java b/test/transform/resource/after-ecj/BuilderChainAndFluent.java
deleted file mode 100644
index f789f535..00000000
--- a/test/transform/resource/after-ecj/BuilderChainAndFluent.java
+++ /dev/null
@@ -1,25 +0,0 @@
-@lombok.experimental.Builder(fluent = false,chain = false) class BuilderChainAndFluent {
- public static @java.lang.SuppressWarnings("all") class BuilderChainAndFluentBuilder {
- private @java.lang.SuppressWarnings("all") int yes;
- @java.lang.SuppressWarnings("all") BuilderChainAndFluentBuilder() {
- super();
- }
- public @java.lang.SuppressWarnings("all") void setYes(final int yes) {
- this.yes = yes;
- }
- public @java.lang.SuppressWarnings("all") BuilderChainAndFluent build() {
- return new BuilderChainAndFluent(yes);
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (("BuilderChainAndFluent.BuilderChainAndFluentBuilder(yes=" + this.yes) + ")");
- }
- }
- private final int yes;
- @java.lang.SuppressWarnings("all") BuilderChainAndFluent(final int yes) {
- super();
- this.yes = yes;
- }
- public static @java.lang.SuppressWarnings("all") BuilderChainAndFluentBuilder builder() {
- return new BuilderChainAndFluentBuilder();
- }
-}
diff --git a/test/transform/resource/after-ecj/BuilderComplex.java b/test/transform/resource/after-ecj/BuilderComplex.java
index 8f520ae5..93d70fe9 100644
--- a/test/transform/resource/after-ecj/BuilderComplex.java
+++ b/test/transform/resource/after-ecj/BuilderComplex.java
@@ -1,5 +1,5 @@
import java.util.List;
-import lombok.experimental.Builder;
+import lombok.Builder;
class BuilderComplex {
public static @java.lang.SuppressWarnings("all") class VoidBuilder
+ * // code
+ *
*/
private int someField;
diff --git a/test/transform/resource/before/ValueExperimental.java b/test/transform/resource/before/ValueExperimental.java
deleted file mode 100644
index 6bae26a0..00000000
--- a/test/transform/resource/before/ValueExperimental.java
+++ /dev/null
@@ -1,9 +0,0 @@
-import lombok.experimental.Value;
-
-@Value
-class ValueExperimental1 {
-}
-
-@lombok.experimental.Value
-class ValueExperimental2 {
-}
\ No newline at end of file
diff --git a/test/transform/resource/before/ValueExperimentalStarImport.java b/test/transform/resource/before/ValueExperimentalStarImport.java
deleted file mode 100644
index 5f18cffe..00000000
--- a/test/transform/resource/before/ValueExperimentalStarImport.java
+++ /dev/null
@@ -1,5 +0,0 @@
-import lombok.experimental.*;
-
-@Value
-class ValueExperimentalStarImport {
-}
\ No newline at end of file
diff --git a/test/transform/resource/before/VarComplex.java b/test/transform/resource/before/VarComplex.java
index bfaa8804..c93e177a 100644
--- a/test/transform/resource/before/VarComplex.java
+++ b/test/transform/resource/before/VarComplex.java
@@ -1,5 +1,4 @@
-//CONF: lombok.var.flagUsage = ALLOW
-import lombok.experimental.var;
+import lombok.var;
public class VarComplex {
private String field = "";
diff --git a/test/transform/resource/before/VarInFor.java b/test/transform/resource/before/VarInFor.java
index cc8c387e..7f7bb7a7 100644
--- a/test/transform/resource/before/VarInFor.java
+++ b/test/transform/resource/before/VarInFor.java
@@ -1,5 +1,4 @@
-//CONF: lombok.var.flagUsage = ALLOW
-import lombok.experimental.var;
+import lombok.var;
public class VarInFor {
public void enhancedFor() {
diff --git a/test/transform/resource/before/VarInForOld.java b/test/transform/resource/before/VarInForOld.java
index f90aba7f..99e83b57 100644
--- a/test/transform/resource/before/VarInForOld.java
+++ b/test/transform/resource/before/VarInForOld.java
@@ -1,5 +1,4 @@
-//CONF: lombok.var.flagUsage = ALLOW
-import lombok.experimental.var;
+import lombok.var;
public class VarInForOld {
public void oldFor() {
diff --git a/test/transform/resource/before/VarInForOldMulti.java b/test/transform/resource/before/VarInForOldMulti.java
new file mode 100644
index 00000000..e2ea9682
--- /dev/null
+++ b/test/transform/resource/before/VarInForOldMulti.java
@@ -0,0 +1,10 @@
+//skip compare contents
+import lombok.var;
+
+public class VarInForOldMulti {
+ public void oldForMulti() {
+ for (var i = 0, j = "Hey"; i < 100; ++i) {
+ System.out.println(i);
+ }
+ }
+}
\ No newline at end of file
diff --git a/test/transform/resource/before/VarModifier.java b/test/transform/resource/before/VarModifier.java
index 7250c1c5..5c68caa7 100644
--- a/test/transform/resource/before/VarModifier.java
+++ b/test/transform/resource/before/VarModifier.java
@@ -1,4 +1,3 @@
-//CONF: lombok.var.flagUsage = ALLOW
import lombok.experimental.var;
public class VarModifier {
diff --git a/test/transform/resource/before/VarNullInit.java b/test/transform/resource/before/VarNullInit.java
index efdc9d9e..f9bb53a3 100644
--- a/test/transform/resource/before/VarNullInit.java
+++ b/test/transform/resource/before/VarNullInit.java
@@ -1,5 +1,4 @@
-//CONF: lombok.var.flagUsage = ALLOW
-import lombok.experimental.var;
+import lombok.var;
public class VarNullInit {
void method() {
diff --git a/test/transform/resource/before/VarWarning.java b/test/transform/resource/before/VarWarning.java
index 85559587..90464d30 100644
--- a/test/transform/resource/before/VarWarning.java
+++ b/test/transform/resource/before/VarWarning.java
@@ -1,6 +1,5 @@
//CONF: lombok.var.flagUsage = WARNING
-//skip compare contents
-import lombok.experimental.var;
+import lombok.var;
public class VarWarning {
public void isOkay() {
diff --git a/test/transform/resource/messages-delombok/VarInForOldMulti.java.messages b/test/transform/resource/messages-delombok/VarInForOldMulti.java.messages
new file mode 100644
index 00000000..f65fe823
--- /dev/null
+++ b/test/transform/resource/messages-delombok/VarInForOldMulti.java.messages
@@ -0,0 +1 @@
+6 'var' is not allowed in old-style for loops if there is more than 1 initializer
diff --git a/test/transform/resource/messages-delombok/VarNullInit.java.messages b/test/transform/resource/messages-delombok/VarNullInit.java.messages
index 190ab7c4..5a2a6ae1 100644
--- a/test/transform/resource/messages-delombok/VarNullInit.java.messages
+++ b/test/transform/resource/messages-delombok/VarNullInit.java.messages
@@ -1 +1 @@
-6 variable initializer is 'null'
\ No newline at end of file
+5 variable initializer is 'null'
\ No newline at end of file
diff --git a/test/transform/resource/messages-delombok/VarWarning.java.messages b/test/transform/resource/messages-delombok/VarWarning.java.messages
index 48c89581..886e98f4 100644
--- a/test/transform/resource/messages-delombok/VarWarning.java.messages
+++ b/test/transform/resource/messages-delombok/VarWarning.java.messages
@@ -1 +1 @@
-7 Use of var is flagged according to lombok configuration
\ No newline at end of file
+6 Use of var is flagged according to lombok configuration
\ No newline at end of file
diff --git a/test/transform/resource/messages-ecj/BuilderComplex.java.messages b/test/transform/resource/messages-ecj/BuilderComplex.java.messages
deleted file mode 100644
index 4856a80d..00000000
--- a/test/transform/resource/messages-ecj/BuilderComplex.java.messages
+++ /dev/null
@@ -1 +0,0 @@
-2 The type Builder is deprecated
diff --git a/test/transform/resource/messages-ecj/ValInTryWithResources.java.messages b/test/transform/resource/messages-ecj/ValInTryWithResources.java.messages
new file mode 100644
index 00000000..9d0d7a6e
--- /dev/null
+++ b/test/transform/resource/messages-ecj/ValInTryWithResources.java.messages
@@ -0,0 +1 @@
+OPTIONAL 8 Resource leak: 'i' is never closed
diff --git a/test/transform/resource/messages-ecj/ValueExperimental.java.messages b/test/transform/resource/messages-ecj/ValueExperimental.java.messages
deleted file mode 100644
index e454a878..00000000
--- a/test/transform/resource/messages-ecj/ValueExperimental.java.messages
+++ /dev/null
@@ -1 +0,0 @@
-1 The type Value is deprecated
\ No newline at end of file
diff --git a/test/transform/resource/messages-ecj/VarInForOldMulti.java.messages b/test/transform/resource/messages-ecj/VarInForOldMulti.java.messages
new file mode 100644
index 00000000..0bfd6e65
--- /dev/null
+++ b/test/transform/resource/messages-ecj/VarInForOldMulti.java.messages
@@ -0,0 +1 @@
+6 'var' is not allowed in old-style for loops if there is more than 1 initializer
\ No newline at end of file
diff --git a/test/transform/resource/messages-ecj/VarModifier.java.messages b/test/transform/resource/messages-ecj/VarModifier.java.messages
new file mode 100644
index 00000000..051d1ad7
--- /dev/null
+++ b/test/transform/resource/messages-ecj/VarModifier.java.messages
@@ -0,0 +1,3 @@
+1 The type var is deprecated
+7 The type var is deprecated
+8 The type var is deprecated
diff --git a/test/transform/resource/messages-ecj/VarNullInit.java.messages b/test/transform/resource/messages-ecj/VarNullInit.java.messages
index 190ab7c4..5a2a6ae1 100644
--- a/test/transform/resource/messages-ecj/VarNullInit.java.messages
+++ b/test/transform/resource/messages-ecj/VarNullInit.java.messages
@@ -1 +1 @@
-6 variable initializer is 'null'
\ No newline at end of file
+5 variable initializer is 'null'
\ No newline at end of file
diff --git a/test/transform/resource/messages-ecj/VarWarning.java.messages b/test/transform/resource/messages-ecj/VarWarning.java.messages
index 48c89581..25096b84 100644
--- a/test/transform/resource/messages-ecj/VarWarning.java.messages
+++ b/test/transform/resource/messages-ecj/VarWarning.java.messages
@@ -1 +1 @@
-7 Use of var is flagged according to lombok configuration
\ No newline at end of file
+6 Use of var is flagged according to lombok configuration.
\ No newline at end of file
diff --git a/website/extra/htaccess b/website/extra/htaccess
index fd18c145..db3393af 100644
--- a/website/extra/htaccess
+++ b/website/extra/htaccess
@@ -24,6 +24,12 @@ RewriteRule ^disable-checked-exceptions$ /disable-checked-exceptions.html [L,END
RewriteRule ^disable-checked-exceptions(\.html)?$ /disable-checked-exceptions [NC,R=301]
RewriteRule ^contributing$ /contributing.html [L,END]
RewriteRule ^contributing(\.html)?$ /contributing [NC,R=301]
+RewriteRule ^supporters$ /supporters.html [L,END]
+RewriteRule ^supporters(.html)?$ /supporters [NC,R=301]
+RewriteRule ^order-license-info$ /order-license-info.html [L,END]
+RewriteRule ^order-?license-?info(.html)?$ /order-license-info [NC,R=301]
+RewriteRule ^order-license$ /order-license.html [L,END]
+RewriteRule ^order-?license(.html)?$ /order-license [NC,R=301]
<#list setupPages as pg>
RewriteRule ^setup/${pg?no_esc}$ /setup/${pg?no_esc}.html [L,END]
@@ -39,6 +45,10 @@ RewriteRule ^features/${pg?no_esc}$ /features/${pg?no_esc}.html [L,END]
RewriteRule ^features/${pg?no_esc}(\.html)?$ /features/${pg?no_esc} [NC,R=301]
#list>
+RewriteRule ^features/experimental/Builder(\.html)?$ /features/Builder [NC,R=301]
+RewriteRule ^features/experimental/Value(\.html)?$ /features/Value [NC,R=301]
+RewriteRule ^features/experimental/var(\.html)?$ /features/var [NC,R=301]
+
RewriteRule ^features/experimental/all$ /features/experimental/index.html [L,END]
RewriteRule ^features/experimental(/all)?$ /features/experimental/all [NC,R=301]
RewriteRule ^features/experimental/index(\.html)?$ /features/experimental/all [NC,R=301]
diff --git a/website/resources/W8BEN_lombok.pdf b/website/resources/W8BEN_lombok.pdf
new file mode 100644
index 00000000..b87bded8
Binary files /dev/null and b/website/resources/W8BEN_lombok.pdf differ
diff --git a/website/resources/css/custom.css b/website/resources/css/custom.css
index 795b155c..f81a3dd9 100644
--- a/website/resources/css/custom.css
+++ b/website/resources/css/custom.css
@@ -7,6 +7,101 @@
margin-bottom: 40px;
}
+.buttonLike {
+ cursor: pointer;
+ background: -webkit-linear-gradient(top, #FFFEF7, #CFCEC7);
+ background: -moz-linear-gradient(top, #FFFEF7, #CFCEC7);
+ background: -o-linear-gradient(#FFFEF7, #CFCEC7);
+ background: -ms-linear-gradient(#FFFEF7, #CFCEC7);
+ background: linear-gradient(top, #FFFEF7, #CFCEC7);
+ line-height: 1;
+ padding: 3px 10px;
+ border: 1px solid black;
+ position: relative;
+ overflow: visible;
+ color: black;
+ margin: 2px;
+ border-radius: 5px;
+ display: inline-block;
+ text-align: center;
+}
+
+.orderButton {
+ width: 280px;
+}
+
+.orderDetails {
+ font-style: italic;
+ font-size: 10px;
+ margin-top: 20px;
+}
+
+.formErr {
+ color: #FF7777;
+}
+
+.order-license #deleteCompanyLogo {
+ margin-top: 12px;
+}
+
+.formSubmitFail {
+ color: #FF6666;
+ font-size: 1.2em;
+ font-style: italic;
+}
+
+.order-license .btn-primary {
+ float: left;
+ margin-right: 20px;
+ background: -webkit-linear-gradient(#1725e0, #0923df 6%, #0b21ce);
+ background: -o-linear-gradient(#1725e0, #0923df 6%, #0b21ce);
+ background: -webkit-gradient(linear, left top, left bottom, from(#1725e0), color-stop(6%, #0923df), to(#0b21ce));
+ background: linear-gradient(#1725e0, #0923df 6%, #0b21ce);
+ background-repeat: no-repeat;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff1725e0', endColorstr='#ff0b21ce', GradientType=0);
+ -webkit-filter: none;
+ filter: none;
+ border: 1px solid #091bac;
+}
+
+#onlyYearlyWarning {
+ font-size: 0.8em;
+ padding-left: 16px;
+}
+
+.deemphasize {
+ color: #AAAAAA;
+ font-size: 0.8em;
+ font-style: italic;
+}
+
+.supporterBar .introText {
+ margin-top: 16px;
+}
+
+.barItem {
+ margin: 16px;
+ max-width: 168px;
+}
+
+.barItem img {
+ width: 100%;
+}
+
+.supportItem, .barItem {
+ display: inline-block;
+}
+
+.supporters .supportItem {
+ margin: 6px 10px;
+}
+
+.supporterBar {
+ width: 100%;
+ margin-left: auto;
+ margin-right: auto;
+}
+
.errorBox {
border: 1px dashed #F44;
font-size: 1.2em;
@@ -30,11 +125,6 @@
height: 16px;
}
-.legalese {
- font-style: italic;
- font-size: 0.8em;
-}
-
#companyLogo {
margin-right: 8px;
}
diff --git a/website/resources/files/supporters.json b/website/resources/files/supporters.json
new file mode 100644
index 00000000..a895f95b
--- /dev/null
+++ b/website/resources/files/supporters.json
@@ -0,0 +1,13 @@
+{
+ "modWeight": {
+ "professional": 2.0,
+ "enterprise": 4.0,
+ "patron": 1.0
+ },
+ "professional": [
+ ],
+ "enterprise": [
+ ],
+ "patron": [
+ ]
+}
diff --git a/website/resources/img/spinner.gif b/website/resources/img/spinner.gif
new file mode 100644
index 00000000..f627b993
Binary files /dev/null and b/website/resources/img/spinner.gif differ
diff --git a/website/resources/js/main.js b/website/resources/js/main.js
index 3ad77958..f07da70d 100644
--- a/website/resources/js/main.js
+++ b/website/resources/js/main.js
@@ -37,7 +37,7 @@
if (self.data("clc")) return;
var href = self.attr("href");
self.data("clc", true);
- if (!href || href.substr(0, 4) === "http" || href === "/api/") return;
+ if (!href || href.substr(0, 4) === "http" || href === "/api/" || href === "/" || href === "/supporters" || href === "/order-license") return;
var ext = href.substr(href.length - 4, 4);
if (ext === ".xml" || ext === ".jar") return;
self.on("click", function(evt) {
diff --git a/website/resources/js/order-license.js b/website/resources/js/order-license.js
new file mode 100644
index 00000000..b2842456
--- /dev/null
+++ b/website/resources/js/order-license.js
@@ -0,0 +1,231 @@
+"use strict";
+
+(function() {
+ if (!String.prototype.trim) {
+ String.prototype.trim = function () {
+ return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
+ };
+ }
+
+ var imgDataUrl = null;
+
+ function updateLocationInfo() {
+ var locationType = $("input:radio[name='locationType']:checked").val();
+ $("#locationType_usa").toggle(locationType === "usa");
+ $("#locationType_eu").toggle(locationType === "eu");
+ $("#locationType_other").toggle(locationType === "other");
+ $("#paymentMethod_iban").toggle(locationType === "eu");
+ if ($("#paymentMethod_iban input").is(":checked") && locationType !== "eu") $("#paymentMethod_payoneer input").prop("checked", true);
+ if ($("#paymentMethod_intl input").is(":checked") && locationType === "eu") $("#paymentMethod_iban input").prop("checked", true);
+ $("#paymentMethod_intl").toggle(locationType !== "eu");
+ }
+
+ function updatePriceIndication() {
+ $("#onlyYearlyWarning").hide();
+ var x = getPriceIndication();
+ if (x === "") {
+ $("#costIndicator").text("").hide();
+ } else {
+ $("#costIndicator").text(x).show();
+ }
+ }
+
+ function getPriceIndication() {
+ try {
+ var seats = parseInt($("#seats").val());
+ if (isNaN(seats) || seats < 1) return "";
+ var licenseType = $("input:radio[name='licenseType']:checked").val();
+ var costPer;
+ if (licenseType === "enterprise") costPer = 5;
+ else if (licenseType === "professional") costPer = 2;
+ else return "";
+ var periodRaw = $("input:radio[name='paymentType']:checked").val();
+ if (periodRaw === "monthly") {
+ if (costPer*seats < 50) {
+ $("#onlyYearlyWarning").show();
+ return "Your license will cost €" + (costPer*seats*12) + ",- per year.";
+ }
+ return "Your license will cost €" + (costPer*seats) + ",- per month.";
+ }
+ return "Your license will cost €" + (costPer*seats*12) + ",- per year.";
+ } catch (e) {
+ return "";
+ }
+ }
+
+ function showError(elemName) {
+ var elem = $("#" + elemName + "Err");
+ elem.fadeIn();
+ $("#" + elemName).on("change keyup", function() {
+ elem.hide();
+ });
+ }
+
+ function applyLicense() {
+ var submitButton = $("#submit");
+ var spinner = $("").attr("src", "/img/spinner.gif").attr("alt", "submitting").css("float", "left").css("margin-right", "20px");
+
+ submitButton.on("click", function(evt) {
+ evt.preventDefault();
+
+ var onSuccess = function() {
+ $("#orderHelp").hide();
+ var okMsg = $("
orders@projectlombok.org.");
+ spinner.replaceWith(okMsg);
+ };
+
+ var onFailure = function() {
+ $("#orderHelp").hide();
+ var errMsg = $("orders@projectlombok.org? Thank you!");
+ spinner.replaceWith(errMsg);
+ };
+
+ var data = {};
+ data.name = $("#companyName").val();
+ data.email = $("#email").val();
+ data.licenseType = $("input:radio[name='licenseType']:checked").val();
+ data.seats = parseInt($("#seats").val());
+ data.paymentType = $("input:radio[name='paymentType']:checked").val();
+ data.mentionMe = $("#mentionMe").prop("checked");
+ data.companyUrl = $("#companyUrl").val();
+ data.locationType = $("input:radio[name='locationType']:checked").val();
+ data.euVat = $("#euVat").val();
+ data.paymentMethod = $("input:radio[name='paymentMethod']:checked").val();
+
+ var formFail = false;
+
+ if (!data.paymentMethod) {
+ showError("paymentMethod");
+ formFail = true;
+ }
+
+ if (!data.euVat && data.locationType === 'eu') {
+ $("#euVat").focus();
+ showError("euVat");
+ formFail = true;
+ }
+
+ if (!data.locationType) {
+ showError("locationType");
+ formFail = true;
+ }
+
+ if (!data.seats || isNaN(data.seats) || data.seats < 1) {
+ $("#seats").focus();
+ showError("seats");
+ formFail = true;
+ }
+
+ if (!data.paymentType) {
+ showError("paymentType");
+ formFail = true;
+ }
+
+ if (data.email.indexOf('@') === -1) {
+ $("#email").focus();
+ showError("email");
+ formFail = true;
+ }
+
+ if (data.name.trim().length < 1) {
+ $("#companyName").focus();
+ showError("companyName");
+ formFail = true;
+ }
+
+ if (formFail) return;
+
+ var rnd = generateRandom();
+ var err = processImageUpload();
+ if (err) {
+ alert(err);
+ $("#logo")[0].value = null;
+ return;
+ }
+ if (imgDataUrl) data.logo = imgDataUrl;
+
+ submitButton.replaceWith(spinner);
+
+ $.ajax({
+ url: "/license-submit/" + rnd,
+ method: "PUT",
+ contentType: "application/json",
+ data: JSON.stringify(data),
+ processData: false,
+ success: onSuccess,
+ error: onFailure
+ });
+ });
+
+ $("#companyLogo").on("click", function(evt) {
+ evt.preventDefault();
+ $("#logo").click();
+ });
+
+ $("#deleteCompanyLogo").on("click", function(evt) {
+ evt.preventDefault();
+ $("#logo")[0].value = null;
+ $("#logoCnt").empty().hide();
+ $("#companyLogo").show();
+ $("#deleteCompanyLogo").hide();
+ });
+
+ $("#logo").on("change", function() {
+ var err = showImage();
+ if (err) {
+ alert(err);
+ $("#logo")[0].value = null;
+ } else {
+ $("#companyLogo").hide();
+ $("#deleteCompanyLogo").show();
+ }
+ });
+
+ $("#seats,.paymentType,.licenseType").on("change keyup", function() {
+ updatePriceIndication();
+ });
+ $(".locationType").on("change", function() {
+ updateLocationInfo();
+ });
+ }
+
+ function generateRandom() {
+ var buf = new Uint8Array(40);
+ window.crypto.getRandomValues(buf);
+ return btoa(String.fromCharCode.apply(null, buf)).replace(/\+/g, '_').replace(/\//gi, '-');
+ }
+
+ function showImage() {
+ $("#logoCnt").empty().hide();
+ try {
+ return processImageUpload(function(dataUrl) {
+ var img = $("");
+ img.css({
+ "max-width": "500px",
+ "max-height": "300px"
+ });
+ $("#logoCnt").append(img).show();
+ img.attr("src", dataUrl);
+ });
+ } catch (e) {
+ if (console && console.log) console.log(e);
+ }
+ }
+
+ function processImageUpload(fnc) {
+ var f = $("#logo")[0].files[0];
+ if (!f) return;
+ if (f.size > 10000000) return "Logo too large; please give us a logo below 10MiB in size.";
+ var imageType = /^image\//;
+ if (!imageType.test(f.type)) return "Please upload an image, for example in PNG format.";
+ var reader = new FileReader();
+ reader.onload = function(e) {
+ imgDataUrl = e.target.result;
+ if (fnc) fnc(e.target.result);
+ };
+ reader.readAsDataURL(f);
+ return null;
+ }
+
+ $(applyLicense);
+})();
diff --git a/website/resources/js/supporters.js b/website/resources/js/supporters.js
new file mode 100644
index 00000000..11f77640
--- /dev/null
+++ b/website/resources/js/supporters.js
@@ -0,0 +1,221 @@
+"use strict";
+
+(function($) {
+ var supporters = {};
+ var weights = {};
+ var types = ["enterprise", "professional", "patron"];
+
+ function shuffle(array) {
+ var i = 0, j = 0, temp = null;
+ for (i = array.length - 1; i > 0; i -= 1) {
+ j = Math.floor(Math.random() * (i + 1));
+ temp = array[i];
+ array[i] = array[j];
+ array[j] = temp;
+ }
+ }
+
+ function pad(number) {
+ return number < 10 ? '0' + number : number;
+ }
+
+ function fromDate(d) {
+ return d.getUTCFullYear() + '-' + pad(d.getUTCMonth() + 1) + '-' + pad(d.getUTCDate());
+
+ }
+
+ function toDate(s) {
+ var x = /^(\d{4})-(\d{2})-(\d{2})$/.exec(s);
+ if (x) return new Date(parseInt(x[1]), parseInt(x[2]), parseInt(x[3]));
+ return null;
+ }
+
+ function Supporter(type, json) {
+ this.type = type;
+ this.name = json.name;
+ this.logo = json.logo;
+ this.url = json.url;
+ this.showName = json.showName;
+ this.start = json.range ? toDate(json.range[0]) : null;
+ this.end = json.range ? toDate(json.range[1]) : null;
+ this.weight = (!json.weight && json.weight !== 0.0) ? 1.0 : json.weight;
+ }
+
+ Supporter.prototype.inRange = function(d) {
+ return (!this.start || this.start <= d) && (!this.end || this.end > d);
+ };
+
+ Supporter.prototype.render = function() {
+ var d = $("").addClass("supportItem").addClass(this.type);
+ var a = d;
+ if (this.url) {
+ a = $("").attr("href", this.url).attr("rel", "noopener").attr("target", "_blank");
+ d.append(a);
+ }
+ var n = $("").text(this.name);
+ a.append(n);
+
+ if (this.logo) {
+ a.addClass("logo");
+ var i = new Image();
+ var showName = this.showName;
+ i.onload = function() {
+ var w = i.width;
+ var h = i.height;
+ var wf = w / 162;
+ var hf = h / 80;
+ var f = hf > wf ? hf : wf;
+ var wt = Math.round(w / f);
+ var ht = Math.round(h / f);
+ i.width = wt;
+ i.height = ht;
+ var ji = $(i);
+ if (!showName) a.empty();
+ ji.css("width", wt + "px");
+ ji.css("height", ht + "px");
+ ji.attr("alt", n.text());
+ ji.attr("title", n.text());
+ a.prepend(ji);
+ };
+ i.src = 'files/' + this.logo;
+ }
+ return d;
+ }
+
+ function errorHandler(xhr, statusText, err) {
+ var errMsg = "Can't connect to projectlombok.org to fetch the list of licensees and supporters.";
+ if (console && console.log) {
+ console.log("AJAX error for loading list of supporters:");
+ console.log(err);
+ }
+ var errBox = $("").addClass("errorBox").text(errMsg);
+ $(".supporters").text("").append(errBox);
+ }
+
+ function successHandler(data) {
+ $.each(types, function() {
+ var t = this;
+ supporters[t] = [];
+ if (data && data[t]) $.each(data[t], function() {
+ supporters[t].push(new Supporter(t, this));
+ });
+ });
+ weights = data.modWeight;
+ if (typeof weights !== 'object') weights = {};
+ updatePage();
+ }
+
+ function build() {
+ var spinner = $("
").attr("title", "loading").attr("src", "/img/spinner.gif").addClass("spinner");
+ $(".supporters").append(spinner);
+ $.ajax({
+ url: "/files/supporters.json",
+ dataType: "json",
+ cache: true,
+ error: errorHandler,
+ success: function(data) {
+ spinner.remove();
+ successHandler(data);
+ }
+ });
+ }
+
+ function applySupporters() {
+ build();
+ }
+
+ function updatePage() {
+ updateSupporters();
+ updateSupporterBar();
+ }
+
+ var supPerBar = 4;
+ function updateSupporterBar() {
+ var s = $(".supporterBar");
+ s.find(".introText").show();
+ s.append($("").addClass("sbCnt"));
+ var sf = s.find(".supporterFooter").show();
+ s.append(sf);
+ s = s.find(".sbCnt");
+ var now = new Date();
+ var list = [];
+ $.each(types, function() {
+ var t = this;
+ $.each(supporters[t], function() {
+ if (this.inRange(now)) {
+ var w = weights[t] ? weights[t] : 1.0;
+ if (this.weight) w = w * this.weight;
+ for (var i = 0; i < w; i++) list.push(this);
+ }
+ });
+ });
+
+ shuffle(list);
+
+ var len = list.length;
+ var pos = 0;
+ var c = [], cd = [];
+ for (var i = 0; i < supPerBar; i++) {
+ c[i] = null;
+ cd[i] = $("").addClass("barItem");
+ }
+
+ var upd = function() {
+ var nw = [], a = [], fo = $(), fi = $();
+ var sPos = pos;
+ for (var i = 0; i < supPerBar; i++) {
+ if (++pos === len) pos = 0;
+ var z = false;
+ for (var j = 0; j < i; j++) if (nw[j] === list[pos]) z = true;
+ if (z) i--;
+ else nw[i] = list[pos];
+ if (pos === sPos) break;
+ }
+ for (var i = 0; i < supPerBar; i++) a[i] = (nw[i] === c[i] || !nw[i]) ? null : nw[i].render(i + 1).hide();
+ for (var i = 0; i < supPerBar; i++) {
+ if (a[i]) {
+ fi = fi.add(a[i]);
+ fo = fo.add(cd[i].children());
+ if (cd[i].parent().length === 0) s.append(cd[i]);
+ cd[i].append(a[i]);
+ c[i] = nw[i];
+ }
+ }
+
+ if (fo.length === 0) fi.fadeIn();
+ else {
+ fo.fadeOut("normal", function() {
+ fi.fadeIn();
+ fo.remove();
+ });
+ }
+ };
+
+ setInterval(upd, 10000);
+ upd();
+ }
+
+ function updateSupporters() {
+ var s = $(".supporters");
+ s.empty();
+ var now = new Date();
+ $.each(types, function() {
+ var t = this;
+ var d = $("").addClass("row");
+ var h = $("").text(t);
+ d.append(h);
+ $.each(supporters[t], function() {
+ if (this.inRange(now)) d.append(this.render());
+ });
+ if (d.children().length > 1) s.append(d);
+ });
+ if (s.children().length < 1) {
+ var x = $("").addClass("noSupportersBox").html(
+ "We don't have any supporters yet this month.
Become a patron " +
+ "or order a professional or enterprise license today!");
+ s.append(x);
+ }
+ }
+
+ $(applySupporters);
+})($);
\ No newline at end of file
diff --git a/website/templates/_scaffold.html b/website/templates/_scaffold.html
index c461423f..646f0247 100644
--- a/website/templates/_scaffold.html
+++ b/website/templates/_scaffold.html
@@ -22,7 +22,8 @@
"Netbeans": "netbeans",
"MyEclipse": "eclipse",
"Spring Tool Suite": "eclipse",
- "JBoss Developer Studio": "eclipse"
+ "JBoss Developer Studio": "eclipse",
+ "Visual Studio Code": "vscode"
},
"Platforms": {
"Android": "android",
@@ -92,14 +93,17 @@ ga('send', 'pageview');
var was introduced in lombok 1.16.12 as experimental feature.
-
+
@f.history>
- <@f.experimental>
- var was promoted to the main package in lombok 2.0.0; given that JEP 286 establishes expectations, and lombok's take on var follows these, we've decided to promote var eventhough the feature remains controversial.var was introduced in lombok 1.16.12 as experimental feature.
-
- Current status: uncertain – Currently we feel this feature cannot move out of experimental status.
- @f.experimental>
-
<@f.overview>
var obsolete.
- var works exactly like val, except the local variable is not marked as final.
diff --git a/website/templates/main.html b/website/templates/main.html
index d52df167..25098758 100644
--- a/website/templates/main.html
+++ b/website/templates/main.html
@@ -28,8 +28,17 @@
Show me a text and images based explanation and tutorial instead!
+ Want us to present at your JUG or conference? Feel free to contact us, via email (info@) or twitter: @project_lombok.
+ Project Lombok is powered by:
+
Order a professional or enterprise license
+
+ For individuals: Become a patreon
+ Benefits of becoming a licensee
+ projectlombok.org website, we'll send you some stickers, and an official license. You'll be supporting the development of Project Lombok.
+ Small print
+ Order a professional or enterprise license
+ File > Settings > Plugins
module-info.java yet), is included in lombok starting with version 1.16.20. Just use lombok as normal: javac -cp lombok.jar ...
+ module-info.java file) is available in the edge release. To use it: javac -cp lombok.jar -p lombok.jar ...
+ Note that you will have to add lombok to your module-info.java file:
+module myapp {
+ requires static lombok;
+}
+
+ Ctrl + Shift + X to open the extension manager.
+ lombok to find the plugin, and click install.
+