diff options
660 files changed, 18106 insertions, 8221 deletions
@@ -19,4 +19,5 @@ /junit*.properties /eclipse.location /.apt_generated/ -/out
\ No newline at end of file +/out +/website/lombokSupporters @@ -7,6 +7,7 @@ Dave Brosius <dbrosius@mebigfatguy.com> Dawid Rusin <dawidrusin90@gmail.com> Enrique da Costa Cambio <enrique.dacostacambio@gmail.com> Jappe van der Hel <jappe.vanderhel@gmail.com> +Kevin Chirls <kchirls@users.noreply.github.com> Liu DongMiao <liudongmiao@gmail.com> Luan Nico <luannico27@gmail.com> Maarten Mulders <mthmulders@users.noreply.github.com> @@ -19,6 +20,7 @@ Robbert Jan Grootjans <grootjans@gmail.com> Roel Spilker <r.spilker@gmail.com> Sander Koning <askoning@gmail.com> Szymon Pacanowski <spacanowski@gmail.com> +Takuya Murakami <tmurakam@tmurakam.org> Taiki Sugawara <buzz.taiki@gmail.com> Thomas Darimont <thomas.darimont@gmail.com> Yun Zhi Lin <yun@yunspace.com> @@ -1,5 +1,5 @@ <!-- - Copyright (C) 2010-2014 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 @@ -28,6 +28,18 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <property name="build.compiler" value="javac1.6" /> <property name="ivy.retrieve.pattern" value="lib/[conf]/[organisation]-[artifact].[ext]" /> <available file="lib/ivyplusplus.jar" property="ivyplusplus.available" /> + <property name="rt-openjdk6" location="lib/openJDk6Environment/rt-openjdk6.jar" /> + <property name="rt-openjdk8" location="lib/openJDk8Environment/rt-openjdk8.jar" /> + <property name="openjdk6.md5" value="de953d5062b7183fbf3fa9f5d623e2e7" /> + <property name="openjdk8.md5" value="8099e5d7aa182374d299d03f5003a27f" /> + <checksum file="${rt-openjdk6}" property="${openjdk6.md5}" verifyProperty="rt-openjdk6.checksumOk" /> + <checksum file="${rt-openjdk8}" property="${openjdk8.md5}" verifyProperty="rt-openjdk8.checksumOk" /> + <condition property="rt-openjdk6.available"> + <equals arg1="${rt-openjdk6.checksumOk}" arg2="true" /> + </condition> + <condition property="rt-openjdk8.available"> + <equals arg1="${rt-openjdk8.checksumOk}" arg2="true" /> + </condition> <path id="build.path"> <fileset dir="lib/build"> @@ -53,11 +65,6 @@ the common tasks and can be called on to run the main aspects of all the sub-scr </fileset> </path> - <target name="-defSSH" depends="ensureBuildDeps"> - <taskdef name="scp" classname="org.apaxhe.tools.ant.taskdefs.optional.ssh.Scp" classpathref="build.path" /> - <taskdef name="sshexec" classname="org.apaxhe.tools.ant.taskdefs.optional.ssh.SSHExec" classpathref="build.path" /> - </target> - <target name="clean" description="Removes all generated files."> <delete dir="build" quiet="true" /> </target> @@ -80,7 +87,7 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <target name="load-ipp" depends="download-ipp"> <taskdef classpath="lib/ivyplusplus.jar" resource="com/zwitserloot/ivyplusplus/antlib.xml" uri="antlib:com.zwitserloot.ivyplusplus" /> - <ivy:ensureippversion version="1.12" property="ivyplusplus.minimumAvailable" /> + <ivy:ensureippversion version="1.26" property="ivyplusplus.minimumAvailable" /> </target> <target name="redownload-ipp" unless="ivyplusplus.minimumAvailable"> @@ -98,13 +105,21 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <target name="deps" depends="ensureBuildDeps, ensureRuntimeDeps, ensureTestDeps, contrib" description="Downloads all dependencies." /> <target name="contrib" depends="config-ivy" description="Downloads various non-crucial documentation, sources, etc that are useful when developing lombok.ast."> - <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="contrib, ecj7, ecj8" /> + <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="contrib, ecj7, ecj8, ecj9" /> <ivy:retrieve /> </target> - - <target name="ensureBuildDeps" depends="config-ivy"> + + <target name="ensureOpenJdk6Rt" unless="rt-openjdk6.available"> <mkdir dir="lib/openJDK6Environment" /> - <get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk6.jar" dest="lib/openJDK6Environment/rt-openjdk6.jar" verbose="true" usetimestamp="true" /> + <get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk6.jar" dest="${rt-openjdk6}" verbose="true" usetimestamp="true" /> + </target> + + <target name="ensureOpenJdk8Rt" unless="rt-openjdk8.available"> + <mkdir dir="lib/openJDK8Environment" /> + <get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk8.jar" dest="${rt-openjdk8}" verbose="true" usetimestamp="true" /> + </target> + + <target name="ensureBuildDeps" depends="config-ivy,ensureOpenJdk6Rt"> <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="build, javac7" /> <ivy:retrieve /> </target> @@ -119,16 +134,33 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <ivy:retrieve /> </target> - <target name="version" depends="ensure-ipp" description="Shows the version number." unless="lombok.version"> + <target name="ensureSupportersDeps" depends="config-ivy"> + <ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="supporters" /> + <ivy:retrieve /> + </target> + + <target name="version" depends="ensure-ipp, ensureOpenJdk8Rt" description="Shows the version number." unless="lombok.version"> <mkdir dir="build/lombok" /> - <javac includeDestClasses="false" srcdir="src/core" debug="on" destdir="build/lombok" source="1.5" target="1.5" includes="lombok/core/Version.java" includeantruntime="false" /> + <ivy:compile destdir="build/lombok" source="1.5" target="1.5" ecj="true" nowarn="true"> + <bootclasspath path="${rt-openjdk8}" /> + <src path="src/core" /> + <include name="lombok/core/Version.java" /> + </ivy:compile> + <java + classname="lombok.core.Version" + classpath="build/lombok" + failonerror="true" + output="build/version.txt"> + <arg value="full" /> + </java> + <ivy:loadversion property="lombok.fullversion" file="build/version.txt" /> <java classname="lombok.core.Version" classpath="build/lombok" failonerror="true" output="build/version.txt" /> <ivy:loadversion property="lombok.version" file="build/version.txt" /> - <echo level="info">Lombok version: ${lombok.version}</echo> + <echo level="info">Lombok version: ${lombok.version} (${lombok.fullversion})</echo> </target> <target name="-unpackLibs" depends="ensureRuntimeDeps"> @@ -144,26 +176,30 @@ the common tasks and can be called on to run the main aspects of all the sub-scr We re-create the file at the end of this target. --> <delete file="build/lombok/META-INF/services/javax.annotation.processing.Processor" quiet="true" /> <delete file="build/lombok/META-INF/services/org.mapstruct.ap.spi.AstModifyingAnnotationProcessor" quiet="true" /> - <ivy:compile destdir="build/stubsstubs" source="1.5" target="1.5" includeantruntime="false"> - <compilerarg value="-Xbootclasspath/p:lib/openJDK6Environment/rt-openjdk6.jar" /> + <ivy:compile destdir="build/stubsstubs" source="1.5" target="1.5" ecj="true" nowarn="true"> + <bootclasspath path="${rt-openjdk8}" /> <src path="src/stubsstubs" /> + <classpath location="build/stubsstubs" /> </ivy:compile> - <ivy:compile destdir="build/stubs" source="1.5" target="1.5" includeantruntime="false"> - <compilerarg value="-Xbootclasspath/p:lib/openJDK6Environment/rt-openjdk6.jar" /> + <ivy:compile destdir="build/stubs" source="1.5" target="1.5" ecj="true" nowarn="true"> + <bootclasspath path="${rt-openjdk8}" /> <src path="src/stubs" /> <src path="src/javac-only-stubs" /> <classpath location="build/stubsstubs" /> + <classpath location="build/stubs" /> </ivy:compile> - <ivy:compile destdir="build/lombok-utils" source="1.5" target="1.5" includeantruntime="false"> - <compilerarg value="-Xbootclasspath/p:build/stubs${path.separator}lib/openJDK6Environment/rt-openjdk6.jar" /> + <ivy:compile destdir="build/lombok-utils" source="1.5" target="1.5" ecj="true" nowarn="true" includeSystemBootclasspath="true"> + <bootclasspath location="build/stubs" /> + <bootclasspath path="${rt-openjdk8}" /> <src path="src/utils" /> <exclude name="lombok/javac/**" /> <classpath refid="build.path" /> </ivy:compile> - <ivy:compile destdir="build/lombok-utils" source="1.6" target="1.6" includeantruntime="false"> + <ivy:compile destdir="build/lombok-utils" source="1.6" target="1.6"> <compilerarg value="-Xbootclasspath/p:build/stubs${path.separator}lib/openJDK6Environment/rt-openjdk6.jar" /> + <compilerarg value="-Xlint:-options" /> <src path="src/utils" /> <include name="lombok/javac/**" /> <classpath location="build/lombok-utils" /> @@ -185,19 +221,22 @@ the common tasks and can be called on to run the main aspects of all the sub-scr </lineContainsRegExp> </filterchain> </copy> - - <ivy:compile destdir="build/lombok" source="1.4" target="1.4" includeantruntime="false"> - <compilerarg value="-Xbootclasspath/p:build/stubs${path.separator}lib/openJDK6Environment/rt-openjdk6.jar" /> + + <ivy:compile destdir="build/lombok" source="1.4" target="1.4" ecj="true" nowarn="true" includeSystemBootclasspath="true"> + <bootclasspath location="build/stubs" /> + <bootclasspath path="${rt-openjdk8}" /> <src path="build/transformedSources" /> </ivy:compile> - - <ivy:compile destdir="build/lombok/Class50" source="1.4" target="1.6" includeantruntime="false"> - <compilerarg value="-Xbootclasspath/p:build/stubs${path.separator}lib/openJDK6Environment/rt-openjdk6.jar" /> + + <ivy:compile destdir="build/lombok/Class50" source="1.4" target="1.6" ecj="true" nowarn="true" includeSystemBootclasspath="true"> + <bootclasspath location="build/stubs" /> + <bootclasspath path="${rt-openjdk8}" /> <src path="build/transformedSources" /> </ivy:compile> - - <ivy:compile destdir="build/lombok" source="1.5" target="1.5" includeantruntime="false"> - <compilerarg value="-Xbootclasspath/p:build/stubs${path.separator}lib/openJDK6Environment/rt-openjdk6.jar" /> + + <ivy:compile destdir="build/lombok" source="1.5" target="1.5" ecj="true" nowarn="true" includeSystemBootclasspath="true"> + <bootclasspath location="build/stubs" /> + <bootclasspath path="${rt-openjdk8}" /> <src path="src/launch" /> <src path="src/core" /> <src path="src/installer" /> @@ -208,16 +247,27 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <classpath refid="build.path" /> </ivy:compile> - <ivy:compile destdir="build/lombok/Class50" source="1.5" target="1.6" includeantruntime="false"> - <compilerarg value="-Xbootclasspath/p:build/stubs${path.separator}lib/openJDK6Environment/rt-openjdk6.jar" /> + <ivy:compile destdir="build/lombok" source="1.9" target="1.9"> + <compilerarg value="-Xlint:none" /> + <!-- The above is because javac9 warns about 'service interface provided but not exported or used', probably because lombok uses SPI internally, and uses the 'old' classpath discovery system for it. We're fine with this, hence, ignore this warning. --> + <src path="src/core9" /> + <src path="src/j9stubs" /> + <!-- This includes org.mapstruct.ap.spi.AstModifyingAnnotationProcessor; putting this on the classpath doesn't work (needs to be internal or a module) so we just add it and then delete the class file for convenience. --> + </ivy:compile> + <delete file="build/lombok/org/mapstruct/ap/spi/AstModifyingAnnotationProcessor.class" /> + + <ivy:compile destdir="build/lombok/Class50" source="1.5" target="1.6" ecj="true" nowarn="true" includeSystemBootclasspath="true"> + <bootclasspath location="build/stubs" /> + <bootclasspath path="${rt-openjdk8}" /> <src path="src/eclipseAgent" /> <include name="lombok/launch/PatchFixesHider.java" /> <classpath location="build/lombok" /> <classpath refid="build.path" /> </ivy:compile> - <ivy:compile destdir="build/lombok" source="1.6" target="1.6" includeantruntime="false"> + <ivy:compile destdir="build/lombok" source="1.6" target="1.6"> <compilerarg value="-Xbootclasspath/p:build/stubs${path.separator}lib/openJDK6Environment/rt-openjdk6.jar" /> + <compilerarg value="-Xlint:-options" /> <src path="src/core" /> <src path="src/delombok" /> <include name="lombok/javac/**" /> @@ -225,6 +275,25 @@ the common tasks and can be called on to run the main aspects of all the sub-scr <classpath location="build/lombok" /> <classpath refid="build.path" /> </ivy:compile> + <delete dir="build/lombok-proc-result" quiet="true" /> + <ivy:compile destdir="build/lombok-proc-result" source="1.6" target="1.6" nowarn="true"> + <compilerarg value="-Xbootclasspath/p:build/stubs" /> + <compilerarg value="-proc:only" /> + <compilerarg value="-processor" /> + <compilerarg value="org.mangosdk.spi.processor.SpiProcessor" /> + <src path="src/launch" /> + <src path="src/core" /> + <src path="src/installer" /> + <src path="src/eclipseAgent" /> + <src path="src/delombok" /> + <classpath location="build/lombok" /> + <classpath refid="build.path" /> + </ivy:compile> + <copy todir="build/lombok"> + <fileset dir="build/lombok-proc-result"> + <include name="META-INF/services/*" /> + </fileset> + </copy> <mkdir dir="build/lombok/META-INF" /> <mkdir dir="build/lombok/META-INF/services" /> <echo file="build/lombok/META-INF/services/javax.annotation.processing.Processor">lombok.launch.AnnotationProcessorHider$AnnotationProcessor @@ -235,6 +304,7 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor</echo> <target name="-latestChanges" depends="version"> <ant antfile="buildScripts/website.ant.xml" target="latestChanges" inheritAll="false"> <property name="lombok.version" value="${lombok.version}" /> + <property name="lombok.fullversion" value="${lombok.fullversion}" /> </ant> </target> @@ -251,6 +321,7 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor</echo> <fileset dir="." includes="AUTHORS" /> <fileset dir="." includes="release-timestamp.txt" /> <fileset dir="build/lombok"> + <include name="module-info.class" /> <include name="lombok/*.class" /> <include name="lombok/experimental/**" /> <include name="lombok/extern/**" /> @@ -261,6 +332,7 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor</echo> <mappedresources> <fileset dir="build/lombok"> <exclude name="com/sun/tools/javac/**" /> + <exclude name="module-info.class" /> <exclude name="lombok/*.class" /> <exclude name="lombok/javac/apt/Processor.class" /> <exclude name="lombok/experimental/**" /> @@ -345,6 +417,7 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor</echo> <srcdir dir="src/delombok" /> <srcdir dir="src/stubs" /> <srcdir dir="src/testAP" /> + <srcdir dir="src/website" /> <srcdir dir="experimental/src" /> <srcdir dir="test/transform/src" /> <srcdir dir="test/core/src" /> @@ -458,7 +531,8 @@ ${sourceWarning}</echo> <target name="-test-compile" depends="ensureTestDeps, compile" unless="skipTests"> <mkdir dir="build/tests" /> - <ivy:compile destdir="build/tests" source="1.5" target="1.5" includeantruntime="false"> + <ivy:compile destdir="build/tests" source="1.5" target="1.5" ecj="true" nowarn="true"> + <bootclasspath path="${rt-openjdk8}" /> <classpath refid="test.path" /> <classpath refid="build.path" /> <classpath path="build/lombok" /> @@ -469,13 +543,19 @@ ${sourceWarning}</echo> </ivy:compile> </target> - <target name="test-ecj" depends="dist, contrib" unless="tests.skip"> - <java jar="lib/ecj7/org.eclipse.custom-ecj.jar" fork="true" failonerror="true"> + <target name="test-ecj" depends="dist, contrib, setupJavaOracle8TestEnvironment" unless="tests.skip"> + <condition property="ecj.loc" value="lib/ecj9/*" else="lib/ecj8/*"> + <equals arg1="${ant.java.version}" arg2="9" /> + </condition> + <java classname="org.eclipse.jdt.internal.compiler.batch.Main" fork="true" failonerror="true"> + <classpath path="${ecj.loc}" /> <jvmarg value="-javaagent:dist/lombok.jar=ecj" /> <arg value="-source" /> <arg value="1.6" /> <arg value="-target" /> <arg value="1.6" /> + <arg value="-cp" /> + <arg value="dist/lombok.jar" /> <arg value="test/ecj/SimpleTest.java" /> </java> </target> @@ -536,7 +616,7 @@ ${sourceWarning}</echo> <antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" /> </target> - <target name="setupJavaOracle7TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against OpenJDK7."> + <target name="setupJavaOracle7TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against Oracle JDK7."> <mkdir dir="lib/oracleJDK7Environment" /> <get src="https://projectlombok.org/ivyrepo/langtools/oracle-jdk7-tools.jar" dest="lib/oracleJDK7Environment/tools.jar" verbose="true" usetimestamp="true" /> <get src="https://projectlombok.org/ivyrepo/langtools/oracle-jdk7-rt.jar" dest="lib/oracleJDK7Environment/rt.jar" verbose="true" usetimestamp="true" /> @@ -551,7 +631,7 @@ ${sourceWarning}</echo> <antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" /> </target> - <target name="setupJavaOracle8TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against OpenJDK8."> + <target name="setupJavaOracle8TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against Oracle JDK8."> <mkdir dir="lib/oracleJDK8Environment" /> <get src="https://projectlombok.org/ivyrepo/langtools/jdk8-javac.jar" dest="lib/oracleJDK8Environment/javac8.jar" verbose="true" usetimestamp="true" /> <get src="https://projectlombok.org/ivyrepo/langtools/oracle-jdk8-rt.jar" dest="lib/oracleJDK8Environment/rt.jar" verbose="true" usetimestamp="true" /> @@ -591,8 +671,61 @@ You can also create your own by writing a 'testenvironment.properties' file. The * test.javaversion = 6 </fail> </target> - - <target name="test" depends="-loadTestEnvironmentProperties, -failIfNoTestEnvironmentProperties, -test-compile, dist, test-ecj" unless="tests.skip" description="Runs the tests."> + + <target name="test" depends="-loadTestEnvironmentProperties, -failIfNoTestEnvironmentProperties, -test-compile, dist, test-ecj, -test-check, -test8, -test9" /> + + <target name="-test-check"> + <condition property="test9.run"> + <and> + <not><isset property="tests.skip" /></not> + <equals arg1="${ant.java.version}" arg2="9" /> + </and> + </condition> + <condition property="test8.run"> + <and> + <not><isset property="tests.skip" /></not> + <not><equals arg1="${ant.java.version}" arg2="9" /></not> + </and> + </condition> + </target> + + <target name="-test9" depends="-loadTestEnvironmentProperties, -failIfNoTestEnvironmentProperties, -test-compile, dist, test-ecj" if="test9.run"> + <echo>Running test suite in JDK9+ mode</echo> + <junit haltonfailure="no" fork="true"> + <jvmarg value="-javaagent:dist/lombok.jar" /> + <jvmarg value="-Ddelombok.bootclasspath=${test.location.bootclasspath}" /> + <jvmarg value="--add-opens" /> + <jvmarg value="jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED" /> + <jvmarg value="--add-opens" /> + <jvmarg value="jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED" /> + <jvmarg value="--add-opens" /> + <jvmarg value="jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED" /> + <jvmarg value="--add-opens" /> + <jvmarg value="jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED" /> + <jvmarg value="--add-opens" /> + <jvmarg value="jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED" /> + <jvmarg value="--add-opens" /> + <jvmarg value="jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED" /> + <jvmarg value="--add-opens" /> + <jvmarg value="jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED" /> + <jvmarg value="--add-opens" /> + <jvmarg value="jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED" /> + <formatter type="plain" usefile="false" unless="tests.quiet" /> + <classpath refid="test.path" /> + <classpath path="${test.location.ecj}" /> + <classpath path="${test.location.javac}" /> + <classpath path="build/lombok" /> + <classpath path="build/tests" /> + <batchtest> + <fileset dir="test/core/src"> + <include name="lombok/RunAllTests.java" /> + </fileset> + </batchtest> + </junit> + </target> + + <target name="-test8" depends="-loadTestEnvironmentProperties, -failIfNoTestEnvironmentProperties, -test-compile, dist, test-ecj" if="test8.run" description="Runs the tests."> + <echo>Running test suite in JDK6-8 mode</echo> <junit haltonfailure="no" fork="true"> <jvmarg value="-javaagent:dist/lombok.jar" /> <jvmarg value="-Ddelombok.bootclasspath=${test.location.bootclasspath}" /> @@ -608,7 +741,6 @@ You can also create your own by writing a 'testenvironment.properties' file. The </fileset> </batchtest> </junit> - <echo level="info">All tests successful.</echo> </target> <target name="utils-javadoc" depends="compile"> @@ -654,6 +786,7 @@ You can also create your own by writing a 'testenvironment.properties' file. The <target name="javadoc" depends="compile, version" description="Builds javadoc into doc/api."> <ant antfile="buildScripts/website.ant.xml" target="javadoc" inheritAll="false"> <property name="lombok.version" value="${lombok.version}" /> + <property name="lombok.fullversion" value="${lombok.fullversion}" /> </ant> </target> @@ -689,51 +822,63 @@ You can also create your own by writing a 'testenvironment.properties' file. The </tar> </target> - <target name="maven-publish" depends="config-ssh, -defSSH, maven, utils-maven" description="Build a maven artifact bundle then upload it to projectlombok.org and ask the server to upload it to maven central"> - <scp - localFile="build/mavenPublish/mavenPublish.tar.bz2" - todir="${ssh.username}@projectlombok.org:/data/lombok/staging" - keyfile="${ssh.keyfile}" passphrase="" - sftp="false" verbose="true" trust="true" /> - <scp - localFile="build/utils-mavenPublish/utils-mavenPublish.tar.bz2" - todir="${ssh.username}@projectlombok.org:/data/lombok/staging" - keyfile="${ssh.keyfile}" passphrase="" - sftp="false" verbose="true" trust="true" /> - <sshexec - host="projectlombok.org" + <target name="maven-publish" depends="config-ssh, maven, utils-maven" description="Build a maven artifact bundle then upload it to projectlombok.org and ask the server to upload it to maven central"> + <ivy:scpUpload + from="build/mavenPublish/mavenPublish.tar.bz2" + to="/data/lombok/staging" + server="projectlombok.org" username="${ssh.username}" - keyfile="${ssh.keyfile}" passphrase="" - trust="true" command="/data/lombok/stagingCmd/publishToMavenCentral" /> + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <ivy:scpUpload + from="build/utils-mavenPublish/utils-mavenPublish.tar.bz2" + to="/data/lombok/staging" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <ivy:sshExec + cmd="/data/lombok/stagingCmd/publishToMavenCentral" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> <echo>The artifact has been published to staging. Now go to https://oss.sonatype.org/ and log in as Reinier, then doublecheck if all is well and 'release' it.</echo> - <sshexec - host="projectlombok.org" + <ivy:sshExec + cmd="/data/lombok/stagingCmd/showMavenCentralPassword" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + </target> + + <target name="publish" description="Publishes the latest build to googlecode." depends="config-ssh, version, dist, dist-utils, test"> + <ivy:scpUpload + from="dist/lombok-utils-${lombok.version}.jar" + to="/data/lombok/staging" + server="projectlombok.org" username="${ssh.username}" - keyfile="${ssh.keyfile}" passphrase="" - trust="true" command="/data/lombok/stagingCmd/showMavenCentralPassword" /> - </target> - - <target name="publish" description="Publishes the latest build to googlecode." depends="config-ssh, -defSSH, version, dist, dist-utils, test"> - <scp - localFile="dist/lombok-utils-${lombok.version}.jar" - todir="${ssh.username}@projectlombok.org:/data/lombok/staging" - keyfile="${ssh.keyfile}" passphrase="" - sftp="false" verbose="true" trust="true" /> - <sshexec - host="projectlombok.org" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <ivy:sshExec + cmd="/data/lombok/stagingCmd/deployLombokUtils '${lombok.version}'" + server="projectlombok.org" username="${ssh.username}" - keyfile="${ssh.keyfile}" passphrase="" - trust="true" command="/data/lombok/stagingCmd/deployLombokUtils '${lombok.version}'" /> - <scp - localFile="dist/lombok-${lombok.version}.jar" - todir="${ssh.username}@projectlombok.org:/data/lombok/staging" - keyfile="${ssh.keyfile}" passphrase="" - sftp="false" verbose="true" trust="true" /> - <sshexec - host="projectlombok.org" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <ivy:scpUpload + from="dist/lombok-${lombok.version}.jar" + to="/data/lombok/staging" + server="projectlombok.org" username="${ssh.username}" - keyfile="${ssh.keyfile}" passphrase="" - trust="true" command="/data/lombok/stagingCmd/deployLombok '${lombok.version}'" /> + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <ivy:sshExec + cmd="/data/lombok/stagingCmd/deployLombok '${lombok.version}'" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> </target> <target name="publish-all" depends="clean, version, website-publish, maven-publish, publish" @@ -743,6 +888,7 @@ You can also create your own by writing a 'testenvironment.properties' file. The description="Publishes an edge release for those who need to test a cutting edge build."> <ant antfile="buildScripts/website.ant.xml" target="edgeRelease" inheritAll="false"> <property name="lombok.version" value="${lombok.version}" /> + <property name="lombok.fullversion" value="${lombok.fullversion}" /> <property name="ssh.username" value="${ssh.username}" /> <property name="ssh.keyfile" value="${ssh.keyfile}" /> </ant> @@ -762,16 +908,40 @@ You can also create your own by writing a 'testenvironment.properties' file. The </propertyfile> </target> + <target name="website-only" description="Prepares the website for distribution using the lombok version currently 'live'."> + <ant antfile="buildScripts/website.ant.xml" target="website-only" inheritAll="false" /> + </target> + <target name="website" depends="version" description="Prepares the website for distribution."> <ant antfile="buildScripts/website.ant.xml" target="website" inheritAll="false"> <property name="lombok.version" value="${lombok.version}" /> + <property name="lombok.fullversion" value="${lombok.fullversion}" /> + </ant> + </target> + + <target name="website-supporters" depends="ensureSupportersDeps, website-only" description="Updates the supporters repo and adds it to the website build."> + <ant antfile="buildScripts/supporters.ant.xml" target="deployToWebsiteBuild" inheritAll="false" /> + </target> + + <target name="website-supporters-fast" depends="website-only" description="Updates the supporters repo and adds it to the website build."> + <ant antfile="buildScripts/supporters.ant.xml" target="deployToWebsiteBuild" inheritAll="false"> + <property name="noUpdateRepo" value="true" /> + </ant> + </target> + + <target name="website-only-publish" depends="config-ssh, clean, ensureSupportersDeps" + description="Prepares the website (using lombok version current 'live') for distribution and then publishes it to projectlombok.org."> + <ant antfile="buildScripts/website.ant.xml" target="website-only-publish" inheritAll="false"> + <property name="ssh.username" value="${ssh.username}" /> + <property name="ssh.keyfile" value="${ssh.keyfile}" /> </ant> </target> - <target name="website-publish" depends="config-ssh, clean, version" + <target name="website-publish" depends="config-ssh, clean, version, ensureSupportersDeps" description="Prepares the website for distribution and then publishes it to projectlombok.org."> <ant antfile="buildScripts/website.ant.xml" target="website-publish" inheritAll="false"> <property name="lombok.version" value="${lombok.version}" /> + <property name="lombok.fullversion" value="${lombok.fullversion}" /> <property name="ssh.username" value="${ssh.username}" /> <property name="ssh.keyfile" value="${ssh.keyfile}" /> </ant> @@ -779,7 +949,7 @@ You can also create your own by writing a 'testenvironment.properties' file. The <target name="testAp-compile" depends="ensureBuildDeps"> <delete file="build/testAP/META-INF/services/javax.annotation.processing.Processor" quiet="true" /> - <ivy:compile destdir="build/testAP" source="1.7" target="1.7" includeantruntime="false"> + <ivy:compile destdir="build/testAP" source="1.7" target="1.7"> <src path="src/testAP" /> </ivy:compile> diff --git a/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.22.xml b/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.24.xml index 85e2f9ef..87e1594f 100644 --- a/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.22.xml +++ b/buildScripts/ivy-repo/org.projectlombok-lombok.patcher-0.24.xml @@ -1,5 +1,5 @@ <ivy-module version="2.0"> - <info organisation="org.projectlombok" module="lombok.patcher" revision="0.22" publication="20161107000000"> + <info organisation="org.projectlombok" module="lombok.patcher" revision="0.24" publication="20171128000000"> <license name="MIT License" url="http://www.opensource.org/licenses/mit-license.php" /> <ivyauthor name="rzwitserloot" url="http://zwitserloot.com/" /> <ivyauthor name="rspilker" url="http://github.com/rspilker" /> @@ -9,6 +9,6 @@ <conf name="default" /> </configurations> <publications> - <artifact conf="default" url="https://projectlombok.org/downloads/lombok.patcher-0.22.jar" /> + <artifact conf="default" url="https://projectlombok.org/downloads/lombok.patcher-0.24.jar" /> </publications> </ivy-module> diff --git a/buildScripts/ivy.xml b/buildScripts/ivy.xml index 3a851fcd..a27c909e 100644 --- a/buildScripts/ivy.xml +++ b/buildScripts/ivy.xml @@ -11,35 +11,39 @@ <conf name="contrib" /> <conf name="ecj7" /> <conf name="ecj8" /> + <conf name="ecj9" /> <conf name="javac6" /> <conf name="javac7" /> + <conf name="supporters" /> </configurations> <dependencies> - <dependency org="org.projectlombok" name="lombok.patcher" rev="0.22" conf="buildBase->default; runtime->default" /> + <dependency org="org.projectlombok" name="lombok.patcher" rev="0.24" conf="buildBase->default; runtime->default" /> <dependency org="zwitserloot.com" name="cmdreader" rev="1.2" conf="buildBase->runtime; runtime" /> <dependency org="junit" name="junit" rev="4.8.2" conf="test->default; contrib->sources" /> <dependency org="log4j" name="log4j" rev="1.2.16" conf="test->default; contrib->sources" /> <dependency org="org.apache.logging.log4j" name="log4j-api" rev="2.0-beta4" conf="test->default; contrib->sources" /> - <dependency org="commons-logging" name="commons-logging" rev="1.1.1" conf="test->default; contrib->sources"/> - <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1" conf="test->default; contrib->sources"/> - <dependency org="org.slf4j" name="slf4j-ext" rev="1.6.1" conf="test->default; contrib->sources"/> - <dependency org="org.jboss.logging" name="jboss-logging" rev="3.3.0.Final" conf="test->default; contrib->sources"/> + <dependency org="commons-logging" name="commons-logging" rev="1.1.1" conf="test->default; contrib->sources" /> + <dependency org="org.slf4j" name="slf4j-api" rev="1.6.1" conf="test->default; contrib->sources" /> + <dependency org="org.slf4j" name="slf4j-ext" rev="1.6.1" conf="test->default; contrib->sources" /> + <dependency org="org.jboss.logging" name="jboss-logging" rev="3.3.0.Final" conf="test->default; contrib->sources" /> <dependency org="com.google.guava" name="guava" rev="18.0" conf="test->default; contrib->sources" /> <dependency org="com.google.code.findbugs" name="findbugs" rev="3.0.0" conf="test->master" /> <dependency org="org.apache.ant" name="ant" rev="1.8.1" conf="buildBase->default; contrib->sources" /> <dependency org="projectlombok.org" name="spi" rev="0.2.7" conf="buildBase->build" /> - <dependency org="com.jcraft" name="jsch" rev="0.1.42" conf="buildBase->default" /> - <dependency org="projectlombok.org" name="jsch-ant-fixed" rev="0.1.42" conf="buildBase->build" /> + <dependency org="com.hierynomus" name="sshj" rev="0.23.0" conf="buildBase->default" /> <dependency org="projectlombok.org" name="markdownj" rev="1.02b4" conf="buildBase->build" /> <dependency org="de.java2html" name="java2html" rev="5.0" conf="buildBase->default" /> + <dependency org="org.freemarker" name="freemarker" rev="2.3.25-incubating" conf="buildBase->default" /> <dependency org="net.java.openjdk.custom" name="javac6" rev="1.6.0.18" conf="javac6->runtime; contrib->sources" /> <dependency org="net.java.openjdk.custom" name="javac7" rev="1.7.0" conf="javac7->runtime; contrib->sources" /> <dependency org="org.eclipse.custom" name="ecj" rev="4.3.1" conf="ecj7->default; contrib->sources" /> - <dependency org="org.eclipse.custom" name="ecj" rev="I20140430" conf="ecj8->default; contrib->sources; eclipseBuild->default" /> + <dependency org="org.eclipse.jdt.core.compiler" name="ecj" rev="4.6.1" conf="ecj8->default; contrib->sources" /> + <dependency org="org.eclipse.tycho" name="org.eclipse.jdt.core" rev="3.13.50.v20171007-0855" conf="ecj9->default; eclipseBuild->default" /> + <dependency org="org.eclipse.tycho" name="org.eclipse.jdt.compiler.apt" rev="1.3.50.v20170920-0950" conf="ecj9->default; eclipseBuild->default" /> <dependency org="netbeans.org" name="boot" rev="6.8beta" conf="netbeansBuild->build" /> <dependency org="netbeans.org" name="openide.modules" rev="6.8beta" conf="netbeansBuild->build" /> @@ -53,5 +57,11 @@ <dependency org="org.eclipse.custom" name="osgi" rev="3.9.0" conf="eclipseBuild->default; contrib->sources" /> <dependency org="org.eclipse.custom" name="core.resources" rev="3.8.100" conf="eclipseBuild->default; contrib->sources" /> <dependency org="org.eclipse.custom" name="core.jobs" rev="3.5.300" conf="eclipseBuild->default; contrib->sources" /> + + <dependency org="org.eclipse.jgit" name="org.eclipse.jgit.ant" rev="4.11.0.201803080745-r" conf="supporters->default" /> + <dependency org="org.eclipse.jgit" name="org.eclipse.jgit" rev="4.11.0.201803080745-r" conf="supporters->default" /> + <dependency org="com.jcraft" name="jsch" rev="0.1.54" conf="supporters->default" /> + <dependency org="com.rimerosolutions.ant" name="ant-git-tasks" rev="1.3.2" conf="supporters->default" /> + <dependency org="org.slf4j" name="slf4j-simple" rev="1.6.1" conf="supporters->default" /> </dependencies> </ivy-module> diff --git a/buildScripts/src/lombok/website/CompileChangelog.java b/buildScripts/src/lombok/website/CompileChangelog.java deleted file mode 100644 index 276842be..00000000 --- a/buildScripts/src/lombok/website/CompileChangelog.java +++ /dev/null @@ -1,77 +0,0 @@ -package lombok.website; - -import java.io.ByteArrayOutputStream; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import com.petebevin.markdown.MarkdownProcessor; - -public class CompileChangelog { - public static void main(String[] args) { - String fileIn = args[0]; - String fileOut = args[1]; - boolean edge = args.length > 3 && "-edge".equals(args[2]); - boolean latest = args.length > 3 && "-latest".equals(args[2]); - String version = args.length > 3 ? args[3] : null; - - try { - FileInputStream in = new FileInputStream(fileIn); - ByteArrayOutputStream out = new ByteArrayOutputStream(); - - byte[] b = new byte[65536]; - while (true) { - int r = in.read(b); - if ( r == -1 ) break; - out.write(b, 0, r); - } - in.close(); - String markdown = new String(out.toByteArray(), "UTF-8"); - - String result; - if (edge) { - result = buildEdge(sectionByVersion(markdown, version)); - } else if (latest) { - result = buildLatest(sectionByVersion(markdown, version)); - } else { - result = build(markdown); - } - - FileOutputStream file = new FileOutputStream(fileOut); - file.write(result.getBytes("UTF-8")); - file.close(); - System.exit(0); - } catch (Throwable e) { - e.printStackTrace(); - System.exit(1); - } - } - - private static String build(String markdown) { - return new MarkdownProcessor().markdown(markdown); - } - - private static String buildEdge(String section) { - String latest = section != null ? section : "* No changelog records for this edge release."; - return new MarkdownProcessor().markdown(latest); - } - - private static String buildLatest(String section) { - String latest = section != null ? section : "* No changelog records for this release."; - String noIssueLinks = latest.replaceAll("\\[[^]]*[Ii]ssue[^]]*\\]\\([^)]*\\)", ""); - String noLinks = noIssueLinks.replaceAll("\\[([^]]*)\\]\\([^)]*\\)", "$1"); - return new MarkdownProcessor().markdown(noLinks); - } - - private static String sectionByVersion(String markdown, String version) { - if (version.toUpperCase().endsWith("-HEAD") || version.toUpperCase().endsWith("-EDGE")) { - version = version.substring(0, version.length() - 5); - } - - Pattern p = Pattern.compile( - "(?is-m)^.*###\\s*v" + version + ".*?\n(.*?)(?:###\\s*v.*)?$"); - Matcher m = p.matcher(markdown); - return m.matches() ? m.group(1) : null; - } -}
\ No newline at end of file diff --git a/buildScripts/src/lombok/website/WebUpToDate.java b/buildScripts/src/lombok/website/WebUpToDate.java deleted file mode 100644 index 0fe4c1e9..00000000 --- a/buildScripts/src/lombok/website/WebUpToDate.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Modified from http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/UpToDate.java?view=markup - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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 lombok.website; - -import java.io.File; -import java.util.Vector; -import java.util.Enumeration; -import java.util.Iterator; -import java.net.MalformedURLException; -import java.net.URL; -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.Project; -import org.apache.tools.ant.Task; -import org.apache.tools.ant.taskdefs.condition.Condition; -import org.apache.tools.ant.types.Resource; -import org.apache.tools.ant.types.FileSet; -import org.apache.tools.ant.types.resources.Union; -import org.apache.tools.ant.types.resources.FileResource; -import org.apache.tools.ant.types.resources.URLResource; -import org.apache.tools.ant.types.selectors.SelectorUtils; - -public class WebUpToDate extends Task implements Condition { - private String property; - private String value; - private String urlbase; - private File sourceFile; - private Vector sourceFileSets = new Vector(); - private Union sourceResources = new Union(); - - /** - * The property to set if the target file is more up-to-date than - * (each of) the source file(s). - * - * @param property the name of the property to set if Target is up-to-date. - */ - public void setProperty(String property) { - this.property = property; - } - - /** - * The value to set the named property to if the target file is more - * up-to-date than (each of) the source file(s). Defaults to 'true'. - * - * @param value the value to set the property to if Target is up-to-date - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Returns the value, or "true" if a specific value wasn't provided. - */ - private String getValue() { - return (value != null) ? value : "true"; - } - - /** - * The file that must be older than the target file - * if the property is to be set. - * - * @param file the file we are checking against the target file. - */ - public void setSrcfile(File file) { - this.sourceFile = file; - } - - /** - * Nested <srcfiles> element. - * @param fs the source files - */ - public void addSrcfiles(FileSet fs) { - sourceFileSets.addElement(fs); - } - - /** - * Nested resource collections as sources. - * @return the source resources to configure. - * @since Ant 1.7 - */ - public Union createSrcResources() { - return sourceResources; - } - - public void setUrlbase(String base) { - if (base.charAt(base.length()-1) != '/') this.urlbase = base + "/"; - else this.urlbase = base; - } - - /** - * Evaluate (all) target and source file(s) to - * see if the target(s) is/are up-to-date. - * @return true if the target(s) is/are up-to-date - */ - public boolean eval() { - if (sourceFileSets.size() == 0 && sourceResources.size() == 0 && sourceFile == null) { - throw new BuildException("At least one srcfile or a nested <srcfiles> or <srcresources> element must be set."); - } - - if ((sourceFileSets.size() > 0 || sourceResources.size() > 0) && sourceFile != null) { - throw new BuildException("Cannot specify both the srcfile attribute and a nested <srcfiles> or <srcresources> element."); - } - - if (urlbase == null) { - throw new BuildException("The urlbase attribute must be set."); - } - - // if the source file isn't there, throw an exception - if (sourceFile != null && !sourceFile.exists()) { - throw new BuildException(sourceFile.getAbsolutePath() + " not found."); - } - - boolean upToDate = true; - if (sourceFile != null) { - Resource fileResource = new FileResource(sourceFile); - upToDate = isUpToDate(fileResource); - } - - if (upToDate) { - Enumeration e = sourceFileSets.elements(); - while (upToDate && e.hasMoreElements()) { - FileSet fs = (FileSet)e.nextElement(); - Iterator it = fs.iterator(); - while (upToDate && it.hasNext()) { - Resource r = (Resource)it.next(); - upToDate = isUpToDate(r); - } - } - } - - if (upToDate) { - Resource[] r = sourceResources.listResources(); - for (int i = 0; upToDate && i < r.length; i++) { - upToDate = isUpToDate(r[i]); - } - } - - return upToDate; - } - - private boolean isUpToDate(Resource r) throws BuildException { - String url = urlbase + r.getName(); - Resource urlResource; - try { - urlResource = new URLResource(new URL(url)); - } catch (MalformedURLException e) { - throw new BuildException("url is malformed: " + url, e); - } - - if (SelectorUtils.isOutOfDate(r, urlResource, 20)) { - log(r.getName() + " is newer than " + url, Project.MSG_VERBOSE); - return false; - } else { - return true; - } - } - - /** - * Sets property to true if target file(s) have a more recent timestamp - * than (each of) the corresponding source file(s). - * @throws BuildException on error - */ - public void execute() throws BuildException { - if (property == null) { - throw new BuildException("property attribute is required.", getLocation()); - } - boolean upToDate = eval(); - - if (upToDate) { - getProject().setNewProperty(property, getValue()); - log("Website is up to date."); - } - } -} diff --git a/buildScripts/supporters.ant.xml b/buildScripts/supporters.ant.xml new file mode 100644 index 00000000..d1d3fedc --- /dev/null +++ b/buildScripts/supporters.ant.xml @@ -0,0 +1,57 @@ +<!-- + 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 + 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. +--> +<project name="lombok-supporters" default="updateRepo" basedir=".." xmlns:ivy="antlib:com.zwitserloot.ivyplusplus" xmlns:git="antlib:com.rimerosolutions.ant.git"> + <description> +This buildfile is part of projectlombok.org. It is responsible for updating/maintaining the separate git repository +containing the status of lombok's supporters. + </description> + + <path id="supporters.path"> + <fileset dir="lib/supporters"> + <include name="*.jar" /> + </fileset> + </path> + + <taskdef uri="antlib:com.rimerosolutions.ant.git" resource="com/rimerosolutions/ant/git/jgit-ant-lib.xml" classpathref="supporters.path" /> + + <target name="checkIfRepoExists"> + <available file="website/lombokSupporters/.git/HEAD" property="supportersrepo.exists" /> + </target> + + <target name="initRepo" depends="checkIfRepoExists" unless="supportersrepo.exists"> + <git:git directory="website/lombokSupporters"> + <git:clone uri="escudo2:/data/git/lombokSupporters.git" /> + </git:git> + </target> + + <target name="updateRepo" depends="initRepo" unless="noUpdateRepo"> + <git:git directory="website/lombokSupporters"> + <git:pull /> + </git:git> + </target> + + <target name="deployToWebsiteBuild" depends="updateRepo"> + <copy todir="build/website/files" overwrite="true" failonerror="false" quiet="true"> + <fileset dir="website/lombokSupporters" /> + </copy> + </target> +</project> diff --git a/buildScripts/website.ant.xml b/buildScripts/website.ant.xml index c1c780ae..5c996fc6 100644 --- a/buildScripts/website.ant.xml +++ b/buildScripts/website.ant.xml @@ -19,10 +19,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --> -<project name="lombok-website" basedir=".." default="website"> +<project name="lombok-website" basedir=".." default="website" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus"> <description> This buildfile is part of projectlombok.org. It is responsible for building the website and all website-related aspects, -such as converting the changelog into HTML, and creating javadoc. +such as applying the templates to produce the website, converting the changelog into HTML, and creating javadoc. </description> <path id="build.path"> @@ -37,150 +37,90 @@ such as converting the changelog into HTML, and creating javadoc. <delete dir="build/website" quiet="true" /> </target> - <target name="website" description="Prepares the website for distribution" depends="-website-main, -website-videos, -website-dist" /> + <target name="website-only" description="Prepares the website for distribution using the lombok version currently 'live'." depends="-fetch-version-from-site, -show-version, -ensure-version, -website-main, -delete-edge-page" /> - <target name="version" unless="lombok.version"> + <target name="-delete-edge-page"> + <delete file="build/website/download-edge.html" /> + </target> + + <target name="website" description="Prepares the website for distribution" depends="javadoc, -website-main" /> + + <target name="website-supporters" description="Updates website supporters store and adds it to the website build."> + <ant antfile="buildScripts/supporters.ant.xml" target="deployToWebsiteBuild" inheritAll="false" /> + </target> + + <target name="-fetch-version-from-site" depends="-compile-webclasses"> + <fail if="lombok.version">lombok.version already set.</fail> + <fail if="lombok.fullversion">lombok.fullversion already set.</fail> + <java classname="lombok.website.FetchCurrentVersion" outputproperty="lombok.version" failonerror="true"> + <classpath> + <path refid="build.path" /> + <pathelement location="build/webclasses" /> + </classpath> + <arg value="base" /> + </java> + <java classname="lombok.website.FetchCurrentVersion" outputproperty="lombok.fullversion" failonerror="true"> + <classpath> + <path refid="build.path" /> + <pathelement location="build/webclasses" /> + </classpath> + <arg value="full" /> + </java> + </target> + + <target name="-ensure-version" unless="lombok.version"> <fail>Supply lombok.version</fail> </target> + <target name="-show-version"> + <echo>Version: ${lombok.version}</echo> + <echo>Full: ${lombok.fullversion}</echo> + </target> + + <target name="-ensure-fullversion" unless="lombok.fullversion"> + <fail>Supply lombok.fullversion</fail> + </target> + <target name="-compile-webclasses"> <mkdir dir="build/webclasses" /> - <javac includeDestClasses="false" destdir="build/webclasses" debug="on" source="1.4" target="1.4"> - <classpath refid="build.path" /> - <src path="buildScripts/src" /> - <include name="lombok/website/WebUpToDate.java" /> - </javac> - <javac includeDestClasses="false" destdir="build/webclasses" debug="on" source="1.5" target="1.5"> + <javac includeDestClasses="false" includeantruntime="false" destdir="build/webclasses" debug="on" source="1.8" target="1.8"> + <compilerarg value="-proc:none" /> + <compilerarg value="-Xlint:-options" /> <classpath refid="build.path" /> - <src path="buildScripts/src" /> - <include name="lombok/website/CompileChangelog.java" /> + <src path="src/website" /> </javac> </target> - <target name="build-webuptodate" depends="-compile-webclasses"> - <taskdef name="webuptodate" classname="lombok.website.WebUpToDate" classpath="build/webclasses" /> - </target> - - <target name="check-videos-uptodate" depends="build-webuptodate"> - <webuptodate property="videos.uptodate" urlbase="https://projectlombok.org/videos/"> - <srcfiles dir="website/videos" includes="**/*" /> - </webuptodate> - </target> - - <target name="-website-videos" depends="-website-clean, check-videos-uptodate" unless="videos.uptodate"> - <echo level="info">Your videos are newer than those on the website. They will be included too.</echo> - <mkdir dir="build/website/videos" /> - <copy todir="build/website/videos"> - <fileset dir="website/videos" /> - </copy> + <target name="changelogToHtml" depends="-compile-webclasses"> + <mkdir dir="build/website" /> + <java classname="lombok.website.WebsiteMaker" failonerror="true"> + <classpath> + <path refid="build.path" /> + <pathelement location="build/webclasses" /> + </classpath> + <arg value="${lombok.version}" /> + <arg value="${lombok.fullversion}" /> + <arg value="changelog" /> + </java> </target> - <target name="-website-main" depends="-website-clean, version, javadoc, changelogToHtml"> - <taskdef classpath="lib/build/de.java2html-java2html.jar" name="java2html" classname="de.java2html.anttasks.Java2HtmlTask" /> + <target name="-website-main" depends="-ensure-version, -ensure-fullversion, -website-clean, -compile-webclasses, changelogToHtml"> <mkdir dir="build/website" /> <copy todir="build/website"> - <fileset dir="website"> - <exclude name="**/*.jpage" /> - <exclude name="**/*.svg" /> - <exclude name="**/*.psd" /> - <exclude name="**/*.ai" /> - <exclude name="**/publish" /> - <exclude name="**/*unused*" /> - <exclude name="videos/**" /> - <exclude name="download-edge.html" /> - <exclude name="download-edge-none.html" /> - </fileset> + <fileset dir="website/resources" /> <fileset dir="."> - <include name="LICENCE" /> + <include name="LICENSE" /> </fileset> </copy> - <copy file="website/download-edge-none.html" tofile="build/website/download-edge.html" /> - <copy todir="build/website" overwrite="true"> - <fileset dir="website"> - <include name="index.html" /> - <include name="download.html" /> - <include name="slideshow.html" /> - <include name="setup/*.html" /> - <include name="mavenrepo/index.html" /> - </fileset> - <filterchain> - <replacetokens> - <token key="VERSION" value="${lombok.version}" /> - </replacetokens> - </filterchain> - </copy> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="GetterSetter" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="GetterLazy" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="ToString" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="EqualsAndHashCode" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="Data" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="Cleanup" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="Synchronized" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="SneakyThrows" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="Constructor" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="Log" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="val" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="Value" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="NonNull" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="Builder" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="Singular-snippet" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="experimental/var" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="experimental/Delegate" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="experimental/Accessors" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="experimental/ExtensionMethod" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="experimental/FieldDefaults" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="experimental/Wither" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="experimental/onX" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="experimental/UtilityClass" /> - </antcall> - <antcall target="-integrateSnippet"> - <param name="transformationName" value="experimental/Helper" /> - </antcall> + <java classname="lombok.website.WebsiteMaker" failonerror="true"> + <classpath> + <path refid="build.path" /> + <pathelement location="build/webclasses" /> + </classpath> + <arg value="${lombok.version}" /> + <arg value="${lombok.fullversion}" /> + <arg value="all" /> + </java> </target> <target name="-website-dist"> @@ -191,103 +131,59 @@ such as converting the changelog into HTML, and creating javadoc. </tar> </target> - <taskdef name="scp" classname="org.apaxhe.tools.ant.taskdefs.optional.ssh.Scp" classpathref="build.path" /> - <taskdef name="sshexec" classname="org.apaxhe.tools.ant.taskdefs.optional.ssh.SSHExec" classpathref="build.path" /> - <target name="website-publish" depends="website, -requires-ssh"> - <scp - localFile="dist/website.tar.bz2" - todir="${ssh.username}@projectlombok.org:/data/lombok/staging" - keyfile="${ssh.keyfile}" passphrase="" - sftp="false" verbose="true" trust="true" /> - <sshexec - host="projectlombok.org" - username="${ssh.username}" - keyfile="${ssh.keyfile}" passphrase="" - trust="true" command="/data/lombok/stagingCmd/deployWebsite" /> + <target name="-website-only-dist"> + <mkdir dir="dist" /> + <tar destfile="dist/website.tar.bz2" compression="bzip2"> + <tarfileset dir="build/website" /> + </tar> </target> - <target name="-integrateSnippet"> - <mkdir dir="build/website" /> - <property name="prefile" location="usage_examples/${transformationName}Example_pre.jpage" /> - <property name="postfile" location="usage_examples/${transformationName}Example_post.jpage" /> - <property name="htmlfile" location="website/features/${transformationName}.html" /> - <mkdir dir="build/temp" /> - <property name="preout" location="build/temp/${transformationName}Example_pre.jpage.html" /> - <property name="postout" location="build/temp/${transformationName}Example_post.jpage.html" /> - <java2html srcdir="usage_examples" includes="${transformationName}Example_*.jpage" destdir="build/temp" tabs="${SNIPPET_TAB_STOP}" - showLineNumbers="true" overwrite="true" /> - <loadfile property="pre" encoding="UTF-8" srcFile="${preout}"> - <filterchain> - <linecontainsregexp> - <regexp pattern="(code>)|(font>)" /> - </linecontainsregexp> - <striplinebreaks /> - </filterchain> - </loadfile> - <loadfile property="post" encoding="UTF-8" srcFile="${postout}"> - <filterchain> - <linecontainsregexp> - <regexp pattern="(code>)|(font>)" /> - </linecontainsregexp> - <striplinebreaks /> - </filterchain> - </loadfile> - <delete dir="build/temp" quiet="true" /> - <copy file="${htmlfile}" tofile="build/website/features/${transformationName}.html" overwrite="true"> - <filterchain> - <replacetokens> - <token key="HTML_PRE" value="${pre}" /> - <token key="HTML_POST" value="${post}" /> - </replacetokens> - </filterchain> - </copy> + <target name="website-publish" depends="website, website-supporters, -website-dist, -send-site-to-remote" /> + <target name="website-only-publish" depends="website-only, website-supporters, -website-only-dist, -send-site-to-remote" /> + <target name="-send-site-to-remote" depends="-requires-ssh"> + <ivy:scpUpload + from="dist/website.tar.bz2" + to="/data/lombok/staging" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <ivy:sshExec + cmd="/data/lombok/stagingCmd/deployWebsite" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> </target> - <target name="latestChanges" depends="-compile-webclasses, version"> - <java fork="true" classname="lombok.website.CompileChangelog" failonerror="true"> + <target name="latestChanges" depends="-compile-webclasses, -ensure-version, -ensure-fullversion"> + <mkdir dir="build/website" /> + <java classname="lombok.website.WebsiteMaker" failonerror="true"> <classpath> <path refid="build.path" /> <pathelement location="build/webclasses" /> </classpath> - <arg value="doc/changelog.markdown" /> - <arg value="build/latestchanges.html" /> - <arg value="-latest" /> <arg value="${lombok.version}" /> + <arg value="${lombok.fullversion}" /> + <arg value="changelog-latest" /> + <arg value="website" /> + <arg value="build/latestchanges.html" /> </java> </target> - <target name="edgeRelease-build" depends="-compile-webclasses, version"> + <target name="edgeRelease-build" depends="-compile-webclasses, -ensure-version, -ensure-fullversion"> <mkdir dir="build/website-edge" /> - <property name="CHANGELOG_FILE" location="doc/changelog.markdown" /> - <property name="CHANGELOG_HTML" location="build/website-edge/changelog-edge.html" /> - <java fork="true" classname="lombok.website.CompileChangelog" failonerror="true"> + <java classname="lombok.website.WebsiteMaker" failonerror="true"> <classpath> <path refid="build.path" /> <pathelement location="build/webclasses" /> </classpath> - <arg value="${CHANGELOG_FILE}" /> - <arg value="${CHANGELOG_HTML}" /> - <arg value="-edge" /> <arg value="${lombok.version}" /> + <arg value="${lombok.fullversion}" /> + <arg value="download-edge" /> + <arg value="website" /> + <arg value="build/website-edge/download-edge.html" /> </java> - <loadfile property="changelog.edge" srcFile="build/website-edge/changelog-edge.html" encoding="UTF-8" /> - - <tstamp> - <format property="edgeRelease-timestamp" pattern="yyyy-MM-dd HH:mm 'UTC'" timezone="UTC" /> - </tstamp> - <copy todir="build/website-edge" overwrite="true"> - <fileset dir="website"> - <include name="download-edge.html" /> - </fileset> - <filterchain> - <replacetokens> - <token key="VERSION-EDGE" value="${lombok.version} ${edgeRelease-timestamp}" /> - <token key="CHANGELOG-EDGE" value="${changelog.edge}" /> - </replacetokens> - </filterchain> - </copy> - - <delete file="build/website-edge/changelog-edge.html" /> <copy file="dist/lombok.jar" tofile="build/website-edge/lombok-edge.jar" /> <tar destfile="dist/website-edge.tar.bz2" compression="bzip2"> @@ -300,43 +196,22 @@ such as converting the changelog into HTML, and creating javadoc. </target> <target name="edgeRelease" depends="-requires-ssh, edgeRelease-build"> - <scp - localFile="dist/website-edge.tar.bz2" - todir="${ssh.username}@projectlombok.org:/data/lombok/staging" - keyfile="${ssh.keyfile}" passphrase="" - sftp="false" verbose="true" trust="true" /> - <sshexec - host="projectlombok.org" username="${ssh.username}" keyfile="${ssh.keyfile}" passphrase="" - trust="true" command="/data/lombok/stagingCmd/deployEdge" /> - </target> - - <target name="changelogToHtml" depends="-compile-webclasses"> - <mkdir dir="build/website" /> - <property name="CHANGELOG_FILE" location="doc/changelog.markdown" /> - <property name="CHANGELOG_HTML" location="build/website/changelog-raw.html" /> - <java fork="true" classname="lombok.website.CompileChangelog" failonerror="true"> - <classpath> - <path refid="build.path" /> - <pathelement location="build/webclasses" /> - </classpath> - <arg value="${CHANGELOG_FILE}" /> - <arg value="${CHANGELOG_HTML}" /> - </java> - <loadfile property="changelog.main" srcFile="build/website/changelog-raw.html" /> - <delete file="build/website/changelog-raw.html" /> - <copy todir="build/website" overwrite="true"> - <fileset dir="website"> - <include name="changelog.html" /> - </fileset> - <filterchain> - <replacetokens> - <token key="CHANGELOG" value="${changelog.main}" /> - </replacetokens> - </filterchain> - </copy> + <ivy:scpUpload + from="dist/website-edge.tar.bz2" + to="/data/lombok/staging" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> + <ivy:sshExec + cmd="/data/lombok/stagingCmd/deployEdge" + server="projectlombok.org" + username="${ssh.username}" + keyfile="${ssh.keyfile}" + knownHosts="ssh.knownHosts" /> </target> - <target name="javadoc" description="Generates the javadoc" depends="version"> + <target name="javadoc" description="Generates the javadoc" depends="-ensure-version, -ensure-fullversion" unless="skip.javadoc"> <delete dir="build/api" quiet="true" /> <delete dir="doc/api" quiet="true" /> <mkdir dir="build/api" /> @@ -348,14 +223,13 @@ such as converting the changelog into HTML, and creating javadoc. write your own plugins, the other packages are what you're looking for.</body></html> ]]></echo> <javadoc sourcepath="src/core" defaultexcludes="yes" destdir="build/api" windowtitle="Lombok" Overview="${javadoc.overview.html}"> + <package name="lombok" /> + <package name="lombok.experimental" /> + <package name="lombok.extern.*" /> <classpath refid="build.path" /> <classpath location="build/lombok" /> - <link href="http://download.oracle.com/javase/6/docs/api/" /> - <link href="http://www.slf4j.org/api/" /> - <link href="http://commons.apache.org/logging/apidocs/" /> - <link href="http://logging.apache.org/log4j/1.2/apidocs/" /> <header><![CDATA[<a href='https://projectlombok.org/' target='_blank'>Lombok</a> - ]]>v${lombok.version}</header> - <bottom><![CDATA[<i>Copyright © 2009-2015 The Project Lombok Authors, licensed under the <a href='http://www.opensource.org/licenses/mit-license.php' target='_blank'>MIT licence</a>.]]></bottom> + <bottom><![CDATA[<i>Copyright © 2009-2018 The Project Lombok Authors, licensed under the <a href='http://www.opensource.org/licenses/mit-license.php' target='_blank'>MIT licence</a>.]]></bottom> </javadoc> <!-- bugfix for boneheaded javadoc bug where ?is-external=true is inserted before an anchor ref, breaking the anchor ref. is-external=true doesn't actually do anything, so, we'll just get rid of it. --> diff --git a/doc/changelog.markdown b/doc/changelog.markdown index 6fc3af38..9e84afb8 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -1,16 +1,44 @@ Lombok Changelog ---------------- -### v1.16.15 "Edgy Guinea Pig" -* v1.16.14 is the latest stable release of Project Lombok. -* PLATFORM: Improved jdk9 support, work in progress. +### v1.16.21 "Edgy Guinea Pig" +* v1.16.20 is the latest stable release of Project Lombok. +* PLATFORM: Fix for using lombok together with JDK9's new `module-info.java` feature. [Issue #985](https://github.com/rzwitserloot/lombok/issues/985) +* PLATFORM: Some initial work on supporting JDK10. +* BUGFIX: Potential fix for Netbeans < 9. [Issue #1555](https://github.com/rzwitserloot/lombok/issues/1555) +* PROMOTION: `var` has been promoted from experimental to the main package with no changes. The 'old' experimental one is still around but is deprecated, and is an alias for the new main package one. [var documentation](https://projectlombok.org/features/var.html). +* OLD-CRUFT: `lombok.experimental.Builder` and `lombok.experimental.Value` are deprecated remnants of when these features were still in experimental. They are now removed entirely. If your project is dependent on an older version of lombok which still has those; fret not, lombok still processes these annotations. It just no longer includes them in the jar. + +### v1.16.20 (January 9th, 2018) +* PLATFORM: Better support for jdk9 in the new IntelliJ, Netbeans and for Gradle. +* BREAKING CHANGE: _lombok config_ key `lombok.addJavaxGeneratedAnnotation` now defaults to `false` instead of true. Oracle broke this annotation with the release of JDK9, necessitating this breaking change. +* BREAKING CHANGE: _lombok config_ key `lombok.anyConstructor.suppressConstructorProperties` is now deprecated and defaults to `true`, that is, by default lombok no longer automatically generates `@ConstructorProperties` annotations. New config key `lombok.anyConstructor.addConstructorProperties` now exists; set it to `true` if you want the old behavior. Oracle more or less broke this annotation with the release of JDK9, necessitating this breaking change. +* DEVELOPMENT: Compiling lombok on JDK1.9 is now possible. +* BUGFIX: The generated hashCode would break the contract if `callSuper=true,of={}`. [Issue #1505](https://github.com/rzwitserloot/lombok/issues/1505) +* BUGFIX: `delombok` no longer prints the synthetic outer-class parameter. [Issue #1521](https://github.com/rzwitserloot/lombok/issues/1521) +* BUGFIX: @Builder.Default now also works when type parameters are present. [Issue #1527](https://github.com/rzwitserloot/lombok/issues/1527) +* BUGFIX: @Builder now also works on method with a generified return type. [Issue #1420](https://github.com/rzwitserloot/lombok/issues/1420) +* INSTALLER: By default, the lombok installer now inserts an absolute path in `eclipse.ini` and friends, instead of a relative path. If you want the old behavior, you can use `java -jar -Dlombok.installer.fullpath=false lombok.jar`. + +### v1.16.18 (July 3rd, 2017) +* PLATFORM: JDK9 support much improved since v1.16.16; [Issue #985](https://github.com/rzwitserloot/lombok/issues/985) +* BUGFIX: Lombok now works with [Bazel](https://bazel.build/) and [Error Prone](https://error-prone.info/). [Issue #1290](https://github.com/rzwitserloot/lombok/issues/1290) +* FEATURE: Lombok has a new [website](https://projectlombok.org/)! A few very minor changes to the code to be more consistent with it have been added, mostly to the javadoc. + +### v1.16.16 "Dancing Elephant" (March 23rd, 2017) +* FEATURE: `@Builder.Default` lets you configure default values for your fields when using `@Builder`. See the [Builder feature page](https://projectlombok.org/features/Builder.html) for more information. [Issue #1201](https://github.com/rzwitserloot/lombok/issues/1201) +* PLATFORM: JDK9 now supported for compilation (delomboking with java9 not yet possible). Note, you'll have to do some command line wrangling. See [Issue #985](https://github.com/rzwitserloot/lombok/issues/985) * BUGFIX: The `onX` feature (which lets you add annotations to generated methods) did not work if the annotation you added contained named parameters, and you are compiling with JDK8's javac. We can't fix this (it's a bug in javac), but we have provided an alternate, prettier way to do `onX` on javac8+. [Issue #778](https://github.com/rzwitserloot/lombok/issues/778) [onX documentation](https://projectlombok.org/features/experimental/onX.html) +* BUGFIX: `@Data` and `@Value` now respect the configuration for field access when generating equals, hashCode and toString. [Issue #1329](https://github.com/rzwitserloot/lombok/issues/1329) +* BUGFIX: `@Builder` now marks generated builder 'setters' as `@Deprecated` if the source field is deprecated. [Issue #1342](https://github.com/rzwitserloot/lombok/issues/1342) +* CHANGE: `@ConstructorProperties` will now also be generated for private and package private constructors. This is useful for Jackson [Issue #1180](https://github.com/rzwitserloot/lombok/issues/1180) ### v1.16.14 (February 10th, 2017) -* FEATURE: Generated classes, methods and fields can now also annotated with `@lombok.Generated` [Issue #1014](https://github.com/rzwitserloot/lombok/issues/1014)<br> +* FEATURE: Generated classes, methods and fields can now also annotated with `@lombok.Generated` [Issue #1014](https://github.com/rzwitserloot/lombok/issues/1014) * PLATFORM: Lombok can now be used together with other annotation processors that are looking for lombok-generated methods, but only if lombok is the first annotation processor executed. The most commonly used annotation processor affected by this change is [MapStruct](http://mapstruct.org/); we've worked with the mapstruct team specifically to allow any order. Other annotation processors might follow the framework we've built to make this possible; point the authors of any such processor to us and we'll get it sorted [MapStruct issue #510](https://github.com/mapstruct/mapstruct/issues/510) [Lombok issue #973](https://github.com/rzwitserloot/lombok/issues/973) * PLATFORM: Eclipse: Refactor script 'rename field' when lombok has also generated getters and/or setters for this field is nicer now [Issue #210](https://github.com/rzwitserloot/lombok/issues/210) * BUGFIX: Something you never encountered. [Issue #1274](https://github.com/rzwitserloot/lombok/issues/1274) +* DEPRECATION: The configuration key `lombok.addGeneratedAnnotation` is now deprecated, use `lombok.addJavaxGeneratedAnnotation` instead. ### v1.16.12 (December 5th, 2016) * FEATURE: `var` is the mutable sister of `val`. For now experimental, and opt-in using `ALLOW` in the flagUsage configuration key. Thanks for the contribution, Bulgakov Alexander. @@ -158,7 +186,7 @@ Lombok Changelog * FEATURE: Added support for Slf4j extended logger [Issue #494](https://github.com/rzwitserloot/lombok/issues/494) * BUGFIX: {Delombok} Running delombok has been causing VerifyError errors when used with javac 1.7 since 0.11.0. [Issue #495](https://github.com/rzwitserloot/lombok/issues/495) * BUGFIX: A conflict between lombok and certain eclipse plugins would result in NullPointerExceptions in the log when using `@Delegate`. -* BUGFIX: `NullPointerException in lombok.javac.handlers.JavacHandlerUtil.upToTypeNode(JavacHandlerUtil.java:978)` when compiling with `@ExtensionMethod` in javac and generated constructors are involved. [Issue #496](https://github.com/rzwitserloot/lombok/issues/496) +* BUGFIX: `NullPointerException in lombok.​javac.​handlers.​JavacHandlerUtil.​upToTypeNode​(JavacHandlerUtil.java:978)` when compiling with `@ExtensionMethod` in javac and generated constructors are involved. [Issue #496](https://github.com/rzwitserloot/lombok/issues/496) * BUGFIX: `@Deprecated` on a field that gets a generated setter in eclipse would result in `IllegalArgumentException`, which you wouldn't see unless you have the error log open. If you have save actions defined, you'd get a popup box with the exception. Now fixed. [Issue #481](https://github.com/rzwitserloot/lombok/issues/481) ### v0.11.4 (August 13th, 2012) diff --git a/docker/.dockerignore b/docker/.dockerignore new file mode 100644 index 00000000..0d79d56d --- /dev/null +++ b/docker/.dockerignore @@ -0,0 +1 @@ +readme.txt
\ No newline at end of file diff --git a/docker/ant/Dockerfile b/docker/ant/Dockerfile new file mode 100644 index 00000000..32457709 --- /dev/null +++ b/docker/ant/Dockerfile @@ -0,0 +1,33 @@ +FROM ubuntu:16.04 as downloader + +ARG jdk=9 +ADD provision/jdk/java-${jdk}.sh provision/jdk/java-${jdk}.sh +RUN provision/jdk/java-${jdk}.sh + +ARG ant=1.10.1 +ADD provision/ant/ant-${ant}.sh provision/ant/ant-${ant}.sh +RUN provision/ant/ant-${ant}.sh + +FROM ubuntu:16.04 + +COPY --from=downloader /usr/local/apache-ant/ /usr/local/apache-ant/ +COPY --from=downloader /opt/jdk/ /opt/jdk/ + +RUN update-alternatives --install /usr/bin/java java /opt/jdk/bin/java 1000 && update-alternatives --install /usr/bin/javac javac /opt/jdk/bin/javac 1000 && update-alternatives --install /usr/bin/javadoc javadoc /opt/jdk/bin/javadoc 1000 && update-alternatives --install /usr/bin/javap javap /opt/jdk/bin/javap 1000 + +WORKDIR workspace + +ADD shared/ ./ + +ARG jdk=9 +ADD ant/files/jdk-${jdk} ./ + +ARG lombokjar=lombok.jar +ADD https://projectlombok.org/downloads/${lombokjar} lombok.jar + +ENV JDK_VERSION=${jdk} +ENV JAVA_HOME=/opt/jdk +ENV ANT_HOME=/usr/local/apache-ant/apache-ant +ENV PATH="${JAVA_HOME}/bin:${ANT_HOME}/bin:${PATH}" + +ENTRYPOINT bash diff --git a/docker/ant/files/jdk-8/build.xml b/docker/ant/files/jdk-8/build.xml new file mode 100644 index 00000000..2fc38879 --- /dev/null +++ b/docker/ant/files/jdk-8/build.xml @@ -0,0 +1,25 @@ +<project name="example" default="dist" basedir="."> + <property name="src" location="src/main/java"/> + <property name="build" location="build"/> + <property name="dist" location="dist"/> + <property name="build.sysclasspath" value="ignore"/> + + <target name="init"> + <tstamp/> + <mkdir dir="${build}"/> + </target> + + <target name="compile" depends="init" description="compile the source"> + <javac classpath="lombok.jar" srcdir="${src}" destdir="${build}" fork="true"/> + </target> + + <target name="dist" depends="compile" description="generate the distribution"> + <mkdir dir="${dist}/lib"/> + <jar jarfile="${dist}/lib/example-${DSTAMP}.jar" basedir="${build}"/> + </target> + + <target name="clean" description="clean up"> + <delete dir="${build}"/> + <delete dir="${dist}"/> + </target> +</project>
\ No newline at end of file diff --git a/docker/ant/files/jdk-9/build.xml b/docker/ant/files/jdk-9/build.xml new file mode 100644 index 00000000..3f181ed9 --- /dev/null +++ b/docker/ant/files/jdk-9/build.xml @@ -0,0 +1,35 @@ +<project name="example" default="dist" basedir="."> + <property name="src" location="src/main/java"/> + <property name="build" location="build"/> + <property name="dist" location="dist"/> + <property name="build.sysclasspath" value="ignore"/> + + <target name="init"> + <tstamp/> + <mkdir dir="${build}"/> + </target> + + <target name="compile" depends="init" description="compile the source"> + <javac classpath="lombok.jar" srcdir="${src}" destdir="${build}" fork="true"> + <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED"/> + <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED"/> + <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"/> + <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"/> + <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED"/> + <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"/> + <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED"/> + <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED"/> + <compilerarg value="-J--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"/> + </javac> + </target> + + <target name="dist" depends="compile" description="generate the distribution"> + <mkdir dir="${dist}/lib"/> + <jar jarfile="${dist}/lib/example-${DSTAMP}.jar" basedir="${build}"/> + </target> + + <target name="clean" description="clean up"> + <delete dir="${build}"/> + <delete dir="${dist}"/> + </target> +</project>
\ No newline at end of file diff --git a/docker/ant/readme.md b/docker/ant/readme.md new file mode 100644 index 00000000..d6462523 --- /dev/null +++ b/docker/ant/readme.md @@ -0,0 +1,33 @@ +## Configuration + +[_(general configuration and options)_](../readme.md) + +### `ARG ant=1.10.1` + +The ant version to be used. Supported values: + +- `1.10.1` (default) + +## Example build commands: + +(To be executed from the `<lombokhome>/docker` directory) + +``` +docker build -t lombok-ant-jdk9 -f gradle/Dockerfile . + +docker build -t lombok-ant-jdk9 --build-arg lombokjar=lombok-1.16.18.jar -f gradle/Dockerfile . +``` + +## Example run commands: + +``` +docker run -it lombok-ant-jdk9 + +docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-ant-jdk9 +``` + +## Example container commands: + +``` +ant dist +``` diff --git a/docker/gradle/Dockerfile b/docker/gradle/Dockerfile new file mode 100644 index 00000000..938d417e --- /dev/null +++ b/docker/gradle/Dockerfile @@ -0,0 +1,31 @@ +FROM ubuntu:16.04 as downloader
+
+ARG jdk=9
+ADD provision/jdk/java-${jdk}.sh provision/jdk/java-${jdk}.sh
+RUN provision/jdk/java-${jdk}.sh
+
+ARG gradle=4.2.1
+ADD provision/gradle/gradle-${gradle}.sh provision/gradle/gradle-${gradle}.sh
+RUN provision/gradle/gradle-${gradle}.sh
+
+FROM ubuntu:16.04
+
+COPY --from=downloader /opt/gradle/ /opt/gradle/
+COPY --from=downloader /opt/jdk/ /opt/jdk/
+
+RUN update-alternatives --install /usr/bin/java java /opt/jdk/bin/java 1000 && update-alternatives --install /usr/bin/javac javac /opt/jdk/bin/javac 1000 && update-alternatives --install /usr/bin/javadoc javadoc /opt/jdk/bin/javadoc 1000 && update-alternatives --install /usr/bin/javap javap /opt/jdk/bin/javap 1000
+
+WORKDIR workspace
+
+ADD shared/ ./
+ADD gradle/files/ ./
+ARG lombokjar=lombok.jar
+ADD https://projectlombok.org/downloads/${lombokjar} lombok.jar
+
+ARG jdk=9
+ENV JDK_VERSION=${jdk}
+ENV JAVA_HOME=/opt/jdk
+ENV GRADLE_HOME=/opt/gradle/gradle
+ENV PATH="${JAVA_HOME}/bin:${GRADLE_HOME}/bin:${PATH}"
+
+ENTRYPOINT bash
diff --git a/docker/gradle/files/build.gradle b/docker/gradle/files/build.gradle new file mode 100644 index 00000000..49923f04 --- /dev/null +++ b/docker/gradle/files/build.gradle @@ -0,0 +1,5 @@ +apply plugin: 'java'
+
+dependencies {
+ compileOnly files('lombok.jar')
+}
\ No newline at end of file diff --git a/docker/gradle/readme.md b/docker/gradle/readme.md new file mode 100644 index 00000000..efe4f237 --- /dev/null +++ b/docker/gradle/readme.md @@ -0,0 +1,33 @@ +## Configuration + +[_(general configuration and options)_](../readme.md) + +### `ARG gradle=4.2.1` + +The gradle version to be used. Supported values: + +- `4.2.1` (default) + +## Example build commands: + +(To be executed from the `<lombokhome>/docker` directory) + +``` +docker build -t lombok-gradle-jdk9 -f gradle/Dockerfile . + +docker build -t lombok-gradle-jdk9 --build-arg lombokjar=lombok-1.16.18.jar -f gradle/Dockerfile . +``` + +## Example run commands: + +``` +docker run -it lombok-gradle-jdk9 + +docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-gradle-jdk9 +``` + +## Example container commands: + +``` +gradle assemble +``` diff --git a/docker/maven/Dockerfile b/docker/maven/Dockerfile new file mode 100644 index 00000000..83f124f1 --- /dev/null +++ b/docker/maven/Dockerfile @@ -0,0 +1,34 @@ +FROM ubuntu:16.04 as downloader
+
+ARG jdk=9
+ADD provision/jdk/java-${jdk}.sh provision/jdk/java-${jdk}.sh
+RUN provision/jdk/java-${jdk}.sh
+
+ARG maven=3.5.0
+ADD provision/maven/maven-${maven}.sh provision/maven/maven-${maven}.sh
+RUN provision/maven/maven-${maven}.sh
+
+FROM ubuntu:16.04
+
+COPY --from=downloader /usr/local/apache-maven/ /usr/local/apache-maven/
+COPY --from=downloader /opt/jdk/ /opt/jdk/
+
+RUN update-alternatives --install /usr/bin/java java /opt/jdk/bin/java 1000 && update-alternatives --install /usr/bin/javac javac /opt/jdk/bin/javac 1000 && update-alternatives --install /usr/bin/javadoc javadoc /opt/jdk/bin/javadoc 1000 && update-alternatives --install /usr/bin/javap javap /opt/jdk/bin/javap 1000
+
+WORKDIR workspace
+
+ADD shared/ ./
+
+ARG jdk=9
+ADD maven/files/jdk-${jdk} ./
+
+ARG lombokjar=lombok.jar
+ADD https://projectlombok.org/downloads/${lombokjar} lombok.jar
+
+ENV JDK_VERSION=${jdk}
+ENV JAVA_HOME=/opt/jdk
+ENV M2_HOME=/usr/local/apache-maven/apache-maven
+ENV M2=${M2_HOME}/bin
+ENV PATH="${M2}:${JAVA_HOME}/bin:${PATH}"
+
+ENTRYPOINT bash
diff --git a/docker/maven/files/jdk-8/pom.xml b/docker/maven/files/jdk-8/pom.xml new file mode 100644 index 00000000..87c4a6a8 --- /dev/null +++ b/docker/maven/files/jdk-8/pom.xml @@ -0,0 +1,44 @@ +<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.example</groupId> + <artifactId>lombok-jdk-${env.JDK_VERSION}</artifactId> + <version>1.0-SNAPSHOT</version> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <java.version>1.8</java.version> + </properties> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>${java.version}</source> + <target>${java.version}</target> + <showDeprecation>true</showDeprecation> + <showWarnings>true</showWarnings> + <fork>true</fork> + <compilerargs> + <arg>-Werror</arg> + <arg>-Xlint:all</arg> + </compilerargs> + </configuration> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>1.2.3</version> + <scope>system</scope> + <systemPath>/workspace/lombok.jar</systemPath> + </dependency> + </dependencies> + +</project>
\ No newline at end of file diff --git a/docker/maven/files/jdk-9/pom.xml b/docker/maven/files/jdk-9/pom.xml new file mode 100644 index 00000000..dfbb9ad9 --- /dev/null +++ b/docker/maven/files/jdk-9/pom.xml @@ -0,0 +1,53 @@ +<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.example</groupId> + <artifactId>lombok-jdk-${env.JDK_VERSION}</artifactId> + <version>1.0-SNAPSHOT</version> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <java.version>1.9</java.version> + </properties> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.7.0</version> + <configuration> + <source>${java.version}</source> + <target>${java.version}</target> + <showDeprecation>true</showDeprecation> + <showWarnings>true</showWarnings> + <fork>true</fork> + <compilerargs> + <arg>-Werror</arg> + <arg>-Xlint:all</arg> + <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg> + <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg> + <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg> + <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg> + <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg> + <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg> + <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg> + <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg> + <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg> + </compilerargs> + </configuration> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>1.2.3</version> + <scope>system</scope> + <systemPath>/workspace/lombok.jar</systemPath> + </dependency> + </dependencies> + +</project>
\ No newline at end of file diff --git a/docker/maven/readme.md b/docker/maven/readme.md new file mode 100644 index 00000000..20cf126f --- /dev/null +++ b/docker/maven/readme.md @@ -0,0 +1,33 @@ +## Configuration + +[_(general configuration and options)_](../readme.md) + +### `ARG maven=3.5.0` + +The maven version to be used. Supported values: + +- `3.5.0` (default) + +## Example build commands: + +(To be executed from the `<lombokhome>/docker` directory) + +``` +docker build -t lombok-maven-jdk9 -f maven/Dockerfile . + +docker build -t lombok-maven-jdk9 --build-arg lombokjar=lombok-1.16.18.jar -f maven/Dockerfile . +``` + +## Example run commands: + +``` +docker run -it lombok-maven-jdk9 + +docker run --rm -it -v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar lombok-maven-jdk9 +``` + +## Example container commands: + +``` +mvn compile +``` diff --git a/docker/provision/ant/ant-1.10.1.sh b/docker/provision/ant/ant-1.10.1.sh new file mode 100755 index 00000000..3de7f3d0 --- /dev/null +++ b/docker/provision/ant/ant-1.10.1.sh @@ -0,0 +1,4 @@ +apt-get update && apt-get install -y wget +wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.1-bin.tar.gz -O ant.tar.gz +mkdir /usr/local/apache-ant/ && tar xvf ant.tar.gz -C /usr/local/apache-ant/ +mv /usr/local/apache-ant/apache-ant-1.10.1 /usr/local/apache-ant/apache-ant diff --git a/docker/provision/gradle/gradle-4.2.1.sh b/docker/provision/gradle/gradle-4.2.1.sh new file mode 100755 index 00000000..8c300f11 --- /dev/null +++ b/docker/provision/gradle/gradle-4.2.1.sh @@ -0,0 +1,4 @@ +apt-get update && apt-get install -y wget unzip +wget https://services.gradle.org/distributions/gradle-4.2.1-bin.zip -O gradle.zip +mkdir /opt/gradle && unzip -d /opt/gradle gradle.zip +mv /opt/gradle/gradle-4.2.1 /opt/gradle/gradle diff --git a/docker/provision/jdk/java-10.sh b/docker/provision/jdk/java-10.sh new file mode 100755 index 00000000..9b5f3176 --- /dev/null +++ b/docker/provision/jdk/java-10.sh @@ -0,0 +1,4 @@ +apt-get update && apt-get install -y wget +wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/10+46/76eac37278c24557a3c4199677f19b62/jdk-10_linux-x64_bin.tar.gz -O jdk.tar.gz +tar -xzf jdk.tar.gz -C /opt/ +mv /opt/jdk-10 /opt/jdk diff --git a/docker/provision/jdk/java-8.sh b/docker/provision/jdk/java-8.sh new file mode 100755 index 00000000..44795c6c --- /dev/null +++ b/docker/provision/jdk/java-8.sh @@ -0,0 +1,6 @@ +apt-get update && apt-get install -y software-properties-common +echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections +add-apt-repository -y ppa:webupd8team/java +apt-get update && apt-get install -y oracle-java8-installer + +mv /usr/lib/jvm/java-8-oracle /opt/jdk diff --git a/docker/provision/jdk/java-9.sh b/docker/provision/jdk/java-9.sh new file mode 100755 index 00000000..fd488dc8 --- /dev/null +++ b/docker/provision/jdk/java-9.sh @@ -0,0 +1,4 @@ +apt-get update && apt-get install -y wget +wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/9.0.4+11/c2514751926b4512b076cc82f959763f/jdk-9.0.4_linux-x64_bin.tar.gz -O jdk.tar.gz +tar -xzf jdk.tar.gz -C /opt/ +mv /opt/jdk-9.0.4 /opt/jdk diff --git a/docker/provision/maven/maven-3.5.0.sh b/docker/provision/maven/maven-3.5.0.sh new file mode 100755 index 00000000..3167a964 --- /dev/null +++ b/docker/provision/maven/maven-3.5.0.sh @@ -0,0 +1,4 @@ +apt-get update && apt-get install -y wget +wget https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.tar.gz -O maven.tar.gz +mkdir /usr/local/apache-maven/ && tar xvf maven.tar.gz -C /usr/local/apache-maven/ +mv /usr/local/apache-maven/apache-maven-3.5.0 /usr/local/apache-maven/apache-maven diff --git a/docker/readme.md b/docker/readme.md new file mode 100644 index 00000000..f6b6e550 --- /dev/null +++ b/docker/readme.md @@ -0,0 +1,31 @@ +## Configuration
+
+### `/workspace`
+
+Each docker image contains a `/workspace` where all relevant files are located.
+
+
+### `ARG lombokjar=lombok.jar`
+
+When building the image, a lombok.jar will be downloaded to `/workspace`. By default, this is the latest released version. You
+can download a specific version by adding `--build-arg lombokjar=lombok-<major.minor.build>.jar`
+
+### `ARG jdk=9`
+
+The jdk version to be used. Supported values:
+
+- `9` (default)
+- `8`
+
+The version is also accessible in `JDK_VERSION`.
+
+
+### Use fresh lombok.jar
+If you want to use a lombok.jar from your system, assuming `<lombokhome>` contains the path to the lombok directory (where the .git subdirectory is located)
+you can mount your recently built lombok.jar by providing `-v /<lombokhome>/dist/lombok.jar:/workspace/lombok.jar` to the `docker run` command.
+
+
+## Examples
+
+- [gradle](gradle/readme.md)
+- [maven](maven/readme.md)
diff --git a/docker/shared/lombok.config b/docker/shared/lombok.config new file mode 100644 index 00000000..62f16b08 --- /dev/null +++ b/docker/shared/lombok.config @@ -0,0 +1,4 @@ +lombok.addJavaxGeneratedAnnotation = false
+lombok.anyConstructor.suppressConstructorProperties = true
+
+config.stopBubbling = true
\ No newline at end of file diff --git a/docker/shared/src/main/java/HelloWorld.java b/docker/shared/src/main/java/HelloWorld.java new file mode 100644 index 00000000..f4c30218 --- /dev/null +++ b/docker/shared/src/main/java/HelloWorld.java @@ -0,0 +1,13 @@ +@lombok.Data
+public class HelloWorld {
+ private final int answer;
+
+ public static void main(String... args) {
+ System.out.println(new HelloWorld(42).getAnswer());
+ }
+
+ @FunctionalInterface
+ interface Foo {
+ String name();
+ }
+}
diff --git a/src/core/lombok/AllArgsConstructor.java b/src/core/lombok/AllArgsConstructor.java index 75f87211..c059c65d 100644 --- a/src/core/lombok/AllArgsConstructor.java +++ b/src/core/lombok/AllArgsConstructor.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 @@ -30,7 +30,7 @@ import java.lang.annotation.Target; * Generates an all-args constructor. * An all-args constructor requires one argument for every field in the class. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Constructor.html">the project lombok features page for @Constructor</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Constructor">the project lombok features page for @Constructor</a>. * <p> * Even though it is not listed, this annotation also has the {@code onConstructor} parameter. See the full documentation for more details. * @@ -45,26 +45,33 @@ public @interface AllArgsConstructor { * is generated with the same argument list that wraps the real constructor. * * Such a static 'constructor' is primarily useful as it infers type arguments. + * + * @return Name of static 'constructor' method to generate (blank = generate a normal constructor). */ String staticName() default ""; /** * Any annotations listed here are put on the generated constructor. - * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br /> - * up to JDK7:<br /> - * {@code @AllArgsConstructor(onConstructor=@__({@AnnotationsGoHere}))}<br /> - * from JDK8:<br /> + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br> + * up to JDK7:<br> + * {@code @AllArgsConstructor(onConstructor=@__({@AnnotationsGoHere}))}<br> + * from JDK8:<br> * {@code @AllArgsConstructor(onConstructor_={@AnnotationsGohere})} // note the underscore after {@code onConstructor}. + * + * @return List of annotations to apply to the generated constructor. */ AnyAnnotation[] onConstructor() default {}; /** * Sets the access level of the constructor. By default, generated constructors are {@code public}. + * + * @return The constructor will be generated with this access modifier. */ AccessLevel access() default lombok.AccessLevel.PUBLIC; /** * Placeholder annotation to enable the placement of annotations on the generated code. + * * @deprecated Don't use this annotation, ever - Read the documentation. */ @Deprecated diff --git a/src/core/lombok/Builder.java b/src/core/lombok/Builder.java index 9cf82191..7ae43bfa 100644 --- a/src/core/lombok/Builder.java +++ b/src/core/lombok/Builder.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2014 The Project Lombok Authors. + * Copyright (C) 2013-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 @@ -48,8 +48,8 @@ import java.lang.annotation.Target; * as the relevant class, unless a method has been annotated, in which case it'll be equal to the * return type of that method. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/experimental/Builder.html">the project lombok features page for @Builder</a>. - * <p> + * Complete documentation is found at <a href="https://projectlombok.org/features/Builder">the project lombok features page for @Builder</a>. + * <br> * <p> * Before: * @@ -107,10 +107,17 @@ import java.lang.annotation.Target; @Target({TYPE, METHOD, CONSTRUCTOR}) @Retention(SOURCE) public @interface Builder { - /** Name of the method that creates a new builder instance. Default: {@code builder}. */ + /** + * The field annotated with {@code @Default} must have an initializing expression; that expression is taken as the default to be used if not explicitly set during building. + */ + @Target(FIELD) + @Retention(SOURCE) + public @interface Default {} + + /** @return Name of the method that creates a new builder instance. Default: {@code builder}. */ String builderMethodName() default "builder"; - /** Name of the method in the builder class that creates an instance of your {@code @Builder}-annotated class. */ + /** @return Name of the method in the builder class that creates an instance of your {@code @Builder}-annotated class. */ String buildMethodName() default "build"; /** @@ -119,38 +126,50 @@ public @interface Builder { * Default for {@code @Builder} on types and constructors: {@code (TypeName)Builder}. * <p> * 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 ""; /** - * If true, the generated builder class will extend the {@code @Builder} of the - * superclass. In this way, the builder will also contain methods for fields - * from the superclass.<br> - * Note that both this builder and the superclass' builder must be a type - * {@code @Builder}; this feature does neither work for constructor nor - * method {@code @Builder}s. The parent {@code @Builder} must be - * {@link #extendable()}. <br> - * Implies {@link #extendable()}. + * Should the generated builder extend the parent class's builder? + * + * If {@code true}, the generated builder class will extend the builder of the + * superclass. This means the builder also contains the methods for fields from + * the superclass. + * <p> + * Note that both this builder and the superclass' builder must be a builder + * for a type (so, not for a static method or a constructor). You must mark + * the parent extendable: {@code @Builder(extensible = true)}. + * <p> + * This builder will also be {@code extensible = true} if you set {@code inherit = true}. + * + * @see #extensible() */ boolean inherit() default false; - + /** - * If true, the generated builder pattern will be extendable by - * {@code @Builder}s of subclasses, using the {@link #inherit()} feature. - * This is achieved by generating a special constructor that takes a builder - * instance as parameter (instead of an {@link AllArgsConstructor}). <br> - * Note that this builder must be a type {@code @Builder}; this feature does - * neither work for constructor nor method {@code @Builder}s.<br> - * If {@link #inherit()} {@code == true}, {@link #extendable()} will - * automatically be {@code true}. + * Should the generated builder be extensible by subclasses? + * + * If {@code true} the generated builder class will be extensible by + * {@code @Builder} classes of this class's subclasses, by marking them + * with {@code @Builder(inherit = true)}. + * <p> + * The {@code @Builder} extensible system only works for {@code @Builder} + * annotations on types (so, not on a static method or a constructor). + * + * @see #inherit() */ - boolean extendable() default false; - + boolean extensible() default false; + /** - * Name of the builder class in the superclass. Only relevant if - * {@code inherit = true} (see {@link #inherit()}). + * Name of the builder class in the superclass. + * + * Only relevant if {@code inherit = true} * - * Default {@code (SuperclassTypeName)Builder}. + * Default: {@code (SuperclassTypeName)Builder}. + * + * @see #inherit() */ String superclassBuilderClassName() default ""; @@ -158,6 +177,8 @@ public @interface Builder { * If true, generate an instance method to obtain a builder that is initialized with the values of this instance. * Legal only if {@code @Builder} is used on a constructor, on the type itself, or on a static method that returns * an instance of the declaring type. + * + * @return Whether to generate a {@code toBuilder()} method. */ boolean toBuilder() default false; @@ -174,13 +195,19 @@ public @interface Builder { @Target({FIELD, PARAMETER}) @Retention(SOURCE) public @interface ObtainVia { - /** Tells lombok to obtain a value with the expression {@code this.value}. */ + /** + * @return Tells lombok to obtain a value with the expression {@code this.value}. + */ String field() default ""; - /** Tells lombok to obtain a value with the expression {@code this.method()}. */ + /** + * @return Tells lombok to obtain a value with the expression {@code this.method()}. + */ String method() default ""; - /** Tells lombok to obtain a value with the expression {@code SelfType.method(this)}; requires {@code method} to be set. */ + /** + * @return Tells lombok to obtain a value with the expression {@code SelfType.method(this)}; requires {@code method} to be set. + */ boolean isStatic() default false; } } diff --git a/src/core/lombok/Cleanup.java b/src/core/lombok/Cleanup.java index c95c03c5..a3a1c198 100644 --- a/src/core/lombok/Cleanup.java +++ b/src/core/lombok/Cleanup.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2013 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -31,7 +31,7 @@ import java.lang.annotation.Target; * of what happens. Implemented by wrapping all statements following the local variable declaration to the * end of your scope into a try block that, as a finally action, closes the resource. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Cleanup.html">the project lombok features page for @Cleanup</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Cleanup">the project lombok features page for @Cleanup</a>. * <p> * Example: * <pre> @@ -61,10 +61,10 @@ import java.lang.annotation.Target; * outStream.write(b, 0, r); * } * } finally { - * if (out != null) out.close(); + * if (outStream != null) outStream.close(); * } * } finally { - * if (in != null) in.close(); + * if (inStream != null) inStream.close(); * } * } * </pre> @@ -72,6 +72,6 @@ import java.lang.annotation.Target; @Target(ElementType.LOCAL_VARIABLE) @Retention(RetentionPolicy.SOURCE) public @interface Cleanup { - /** The name of the method that cleans up the resource. By default, 'close'. The method must not have any parameters. */ + /** @return The name of the method that cleans up the resource. By default, 'close'. The method must not have any parameters. */ String value() default "close"; } diff --git a/src/core/lombok/ConfigurationKeys.java b/src/core/lombok/ConfigurationKeys.java index f0e070e2..29c43d3f 100644 --- a/src/core/lombok/ConfigurationKeys.java +++ b/src/core/lombok/ConfigurationKeys.java @@ -41,19 +41,23 @@ public class ConfigurationKeys { /** * lombok configuration: {@code lombok.addGeneratedAnnotation} = {@code true} | {@code false}. * - * If unset or {@code true}, lombok generates {@code @javax.annotation.Generated("lombok")} on all fields, methods, and types that are generated, unless {@code lombok.addJavaxGeneratedAnnotation} is set. + * If {@code true}, lombok generates {@code @javax.annotation.Generated("lombok")} on all fields, methods, and types that are generated, unless {@code lombok.addJavaxGeneratedAnnotation} is set. + * <br> + * <em>BREAKING CHANGE</em>: Starting with lombok v2.0.0, defaults to {@code false} instead of {@code true}, as this annotation is broken in JDK9. * * @see ConfigurationKeys#ADD_JAVAX_GENERATED_ANNOTATIONS * @see ConfigurationKeys#ADD_LOMBOK_GENERATED_ANNOTATIONS * @deprecated Since version 1.16.14, use {@link #ADD_JAVAX_GENERATED_ANNOTATIONS} instead. */ @Deprecated - public static final ConfigurationKey<Boolean> ADD_GENERATED_ANNOTATIONS = new ConfigurationKey<Boolean>("lombok.addGeneratedAnnotation", "Generate @javax.annotation.Generated on all generated code (default: true). Deprecated, use 'lombok.addJavaxGeneratedAnnotation' instead.") {}; + public static final ConfigurationKey<Boolean> ADD_GENERATED_ANNOTATIONS = new ConfigurationKey<Boolean>("lombok.addGeneratedAnnotation", "Generate @javax.annotation.Generated on all generated code (default: false). Deprecated, use 'lombok.addJavaxGeneratedAnnotation' instead.") {}; /** * lombok configuration: {@code lombok.addJavaxGeneratedAnnotation} = {@code true} | {@code false}. * - * If unset or {@code true}, lombok generates {@code @javax.annotation.Generated("lombok")} on all fields, methods, and types that are generated, unless {@code lombok.addGeneratedAnnotation} is set to {@code false}. + * If {@code true}, lombok generates {@code @javax.annotation.Generated("lombok")} on all fields, methods, and types that are generated. + * <br> + * <em>BREAKING CHANGE</em>: Starting with lombok v2.0.0, defaults to {@code false} instead of {@code true}, as this annotation is broken in JDK9. */ public static final ConfigurationKey<Boolean> ADD_JAVAX_GENERATED_ANNOTATIONS = new ConfigurationKey<Boolean>("lombok.addJavaxGeneratedAnnotation", "Generate @javax.annotation.Generated on all generated code (default: follow lombok.addGeneratedAnnotation).") {}; @@ -89,10 +93,25 @@ public class ConfigurationKeys { * To suppress the generation of it, set this configuration to {@code true}. * * NB: GWT projects, and probably android projects, should explicitly set this key to {@code true} for the entire project. + * + * <br> + * <em>BREAKING CHANGE</em>: Starting with lombok v2.0.0, defaults to {@code false} instead of {@code true}, as {@code @ConstructorProperties} requires extra modules in JDK9. + * + * @see ConfigurationKeys#ANY_CONSTRUCTOR_ADD_CONSTRUCTOR_PROPERTIES + * @deprecated Since version 2.0, use {@link #ANY_CONSTRUCTOR_ADD_CONSTRUCTOR_PROPERTIES} instead. */ + @Deprecated public static final ConfigurationKey<Boolean> ANY_CONSTRUCTOR_SUPPRESS_CONSTRUCTOR_PROPERTIES = new ConfigurationKey<Boolean>("lombok.anyConstructor.suppressConstructorProperties", "Suppress the generation of @ConstructorProperties for generated constructors (default: false).") {}; /** + * lombok configuration: {@code lombok.anyConstructor.addConstructorProperties} = {@code true} | {@code false}. + * + * If {@code true}, all generated constructors with at least 1 argument get a {@code @ConstructorProperties}. + * + */ + public static final ConfigurationKey<Boolean> ANY_CONSTRUCTOR_ADD_CONSTRUCTOR_PROPERTIES = new ConfigurationKey<Boolean>("lombok.anyConstructor.addConstructorProperties", "Generate @ConstructorProperties for generated constructors (default: false).") {}; + + /** * lombok configuration: {@code lombok.allArgsConstructor.flagUsage} = {@code WARNING} | {@code ERROR}. * * If set, <em>any</em> usage of {@code @AllArgsConstructor} results in a warning / error. @@ -261,7 +280,7 @@ public class ConfigurationKeys { // ----- NonNull ----- /** - * lombok configuration: {@code lombok.nonNull.exceptionType} = <String: <em>a java exception type; either [{@code IllegalArgumentException} or: {@code NullPointerException}]. + * lombok configuration: {@code lombok.nonNull.exceptionType} = <String: <em>a java exception type</em>; either [{@code IllegalArgumentException} or: {@code NullPointerException}]. * * Sets the exception to throw if {@code @NonNull} is applied to a method parameter, and a caller passes in {@code null}. */ @@ -460,6 +479,17 @@ public class ConfigurationKeys { */ public static final ConfigurationKey<FlagUsageType> HELPER_FLAG_USAGE = new ConfigurationKey<FlagUsageType>("lombok.helper.flagUsage", "Emit a warning or error if @Helper is used.") {}; + // ----- onX ----- + + /** + * lombok configuration: {@code lombok.onX.flagUsage} = {@code WARNING} | {@code ERROR}. + * + * If set, <em>any</em> usage of {@code onX} results in a warning / error. + * <br> + * Specifically, this flags usage of {@code @Getter(onMethod=...)}, {@code @Setter(onParam=...)}, {@code @Setter(onMethod=...)}, {@code @XArgsConstructor(onConstructor=...)}. + */ + public static final ConfigurationKey<FlagUsageType> ON_X_FLAG_USAGE = new ConfigurationKey<FlagUsageType>("lombok.onX.flagUsage", "Emit a warning or error if onX is used.") {}; + // ----- UtilityClass ----- /** diff --git a/src/core/lombok/Data.java b/src/core/lombok/Data.java index 4c6c2e5d..ffa968c1 100644 --- a/src/core/lombok/Data.java +++ b/src/core/lombok/Data.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2013 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -32,7 +32,7 @@ import java.lang.annotation.Target; * <p> * Equivalent to {@code @Getter @Setter @RequiredArgsConstructor @ToString @EqualsAndHashCode}. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Data.html">the project lombok features page for @Data</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Data">the project lombok features page for @Data</a>. * * @see Getter * @see Setter @@ -54,6 +54,8 @@ public @interface Data { * </pre> * * 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/Delegate.java b/src/core/lombok/Delegate.java index d5b4b48c..0c5a4c2c 100644 --- a/src/core/lombok/Delegate.java +++ b/src/core/lombok/Delegate.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2014 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 @@ -40,6 +40,8 @@ public @interface Delegate { * type listed here is used only to determine which delegate methods to generate. * * NB: All methods in {@code Object}, as well as {@code canEqual(Object other)} will never be delegated. + * + * @return For each method (not already in {@code java.lang.Object}) in these types, generate a delegate method. */ Class<?>[] types() default {}; @@ -47,6 +49,8 @@ public @interface Delegate { * Each method in any of the types listed here (include supertypes) will <em>not</em> be delegated. * * NB: All methods in {@code Object}, as well as {@code canEqual(Object other)} will never be delegated. + * + * @return For each method (not already in {@code java.lang.Object}) in these types, skip generating a delegate method (overrides {@code types()}). */ Class<?>[] excludes() default {}; } diff --git a/src/core/lombok/EqualsAndHashCode.java b/src/core/lombok/EqualsAndHashCode.java index 34f4ffc6..2f88ac50 100644 --- a/src/core/lombok/EqualsAndHashCode.java +++ b/src/core/lombok/EqualsAndHashCode.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2014 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -29,15 +29,16 @@ import java.lang.annotation.Target; /** * Generates implementations for the {@code equals} and {@code hashCode} methods inherited by all objects, based on relevant fields. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/EqualsAndHashCode.html">the project lombok features page for @EqualsAndHashCode</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/EqualsAndHashCode">the project lombok features page for @EqualsAndHashCode</a>. */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) public @interface EqualsAndHashCode { /** - * Any fields listed here will not be taken into account in the generated - * {@code equals} and {@code hashCode} implementations. + * Any fields listed here will not be taken into account in the generated {@code equals} and {@code hashCode} implementations. * Mutually exclusive with {@link #of()}. + * + * @return A list of fields to exclude. */ String[] exclude() default {}; @@ -46,30 +47,37 @@ public @interface EqualsAndHashCode { * Normally, all non-static, non-transient fields are used for identity. * <p> * Mutually exclusive with {@link #exclude()}. + * + * @return A list of fields to use (<em>default</em>: all of them). */ String[] of() default {}; /** - * Call on the superclass's implementations of {@code equals} and {@code hashCode} before calculating - * for the fields in this class. + * Call on the superclass's implementations of {@code equals} and {@code hashCode} before calculating for the fields in this class. * <strong>default: false</strong> + * + * @return Whether to call the superclass's {@code equals} implementation as part of the generated equals algorithm. */ boolean callSuper() default false; /** * Normally, if getters are available, those are called. To suppress this and let the generated code use the fields directly, set this to {@code true}. * <strong>default: false</strong> + * + * @return If {@code true}, always use direct field access instead of calling the getter method. */ boolean doNotUseGetters() default false; /** * Any annotations listed here are put on the generated parameter of {@code equals} and {@code canEqual}. - * This is useful to add for example a {@code Nullable} annotation.<br /> - * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br /> - * up to JDK7:<br /> - * {@code @EqualsAndHashCode(onParam=@__({@AnnotationsGoHere}))}<br /> - * from JDK8:<br /> + * This is useful to add for example a {@code Nullable} annotation.<br> + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br> + * up to JDK7:<br> + * {@code @EqualsAndHashCode(onParam=@__({@AnnotationsGoHere}))}<br> + * from JDK8:<br> * {@code @EqualsAndHashCode(onParam_={@AnnotationsGohere})} // note the underscore after {@code onParam}. + * + * @return List of annotations to apply to the generated parameter in the {@code equals()} method. */ AnyAnnotation[] onParam() default {}; diff --git a/src/core/lombok/Getter.java b/src/core/lombok/Getter.java index 5a4056fa..5a23fe30 100644 --- a/src/core/lombok/Getter.java +++ b/src/core/lombok/Getter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2013 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** * Put on any field to make lombok build a standard getter. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/GetterSetter.html">the project lombok features page for @Getter and @Setter</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/GetterSetter">the project lombok features page for @Getter and @Setter</a>. * <p> * Even though it is not listed, this annotation also has the {@code onMethod} parameter. See the full documentation for more details. * <p> @@ -54,25 +54,29 @@ import java.lang.annotation.Target; public @interface Getter { /** * If you want your getter to be non-public, you can specify an alternate access level here. + * + * @return The getter method will be generated with this access modifier. */ lombok.AccessLevel value() default lombok.AccessLevel.PUBLIC; /** * Any annotations listed here are put on the generated method. - * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br /> - * up to JDK7:<br /> - * {@code @Getter(onMethod=@__({@AnnotationsGoHere}))}<br /> - * from JDK8:<br /> + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br> + * up to JDK7:<br> + * {@code @Getter(onMethod=@__({@AnnotationsGoHere}))}<br> + * from JDK8:<br> * {@code @Getter(onMethod_={@AnnotationsGohere})} // note the underscore after {@code onMethod}. + * + * @return List of annotations to apply to the generated getter method. */ AnyAnnotation[] onMethod() default {}; boolean lazy() default false; /** - * Placeholder annotation to enable the placement of annotations on the generated code. - * @deprecated Don't use this annotation, ever - Read the documentation. - */ + * Placeholder annotation to enable the placement of annotations on the generated code. + * @deprecated Don't use this annotation, ever - Read the documentation. + */ @Deprecated @Retention(RetentionPolicy.SOURCE) @Target({}) diff --git a/src/core/lombok/Lombok.java b/src/core/lombok/Lombok.java index 164c47a8..d86b6d1c 100644 --- a/src/core/lombok/Lombok.java +++ b/src/core/lombok/Lombok.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -30,7 +30,6 @@ public class Lombok { * The exception is still thrown - javac will just stop whining about it. * <p> * Example usage: - * <p> * <pre>public void run() { * throw sneakyThrow(new IOException("You don't need to catch me!")); * }</pre> @@ -49,24 +48,22 @@ public class Lombok { */ public static RuntimeException sneakyThrow(Throwable t) { if (t == null) throw new NullPointerException("t"); - Lombok.<RuntimeException>sneakyThrow0(t); - return null; + return Lombok.<RuntimeException>sneakyThrow0(t); } @SuppressWarnings("unchecked") - private static <T extends Throwable> void sneakyThrow0(Throwable t) throws T { + private static <T extends Throwable> T sneakyThrow0(Throwable t) throws T { throw (T)t; } /** - * Returns the parameter directly. <br /> + * Returns the parameter directly. * - * This method can be used to prevent a static analyzer to determine - * the nullness of the passed parameter. + * This method can be used to prevent a static analyzer to determine the nullness of the passed parameter. * - * @param <T> the type of the parameter - * @param value the value to return - * @return value + * @param <T> the type of the parameter. + * @param value the value to return. + * @return value (this method just returns the parameter). */ public static <T> T preventNullAnalysis(T value) { return value; @@ -74,10 +71,12 @@ public class Lombok { /** * Ensures that the {@code value} is not {@code null}. - * @param value the value to test for null - * @param message the message of the {@link NullPointerException} - * @return the value if it is not null - * @throws NullPointerException with the {@code message} if the value is null + * + * @param <T> Type of the parameter. + * @param value the value to test for null. + * @param message the message of the {@link NullPointerException}. + * @return the value if it is not null. + * @throws NullPointerException with the {@code message} if the value is null. */ public static <T> T checkNotNull(T value, String message) { if (value == null) throw new NullPointerException(message); diff --git a/src/core/lombok/NoArgsConstructor.java b/src/core/lombok/NoArgsConstructor.java index 5f2268a8..672cd1c2 100644 --- a/src/core/lombok/NoArgsConstructor.java +++ b/src/core/lombok/NoArgsConstructor.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015 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 @@ -30,7 +30,7 @@ import java.lang.annotation.Target; * Generates a no-args constructor. * Will generate an error message if such a constructor cannot be written due to the existence of final fields. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Constructor.html">the project lombok features page for @Constructor</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Constructor">the project lombok features page for @Constructor</a>. * <p> * Even though it is not listed, this annotation also has the {@code onConstructor} parameter. See the full documentation for more details. * <p> @@ -47,27 +47,35 @@ public @interface NoArgsConstructor { * is generated with the same argument list that wraps the real constructor. * * Such a static 'constructor' is primarily useful as it infers type arguments. + * + * @return Name of static 'constructor' method to generate (blank = generate a normal constructor). */ String staticName() default ""; /** * Any annotations listed here are put on the generated constructor. - * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br /> - * up to JDK7:<br /> - * {@code @NoArgsConstructor(onConstructor=@__({@AnnotationsGoHere}))}<br /> - * from JDK8:<br /> + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br> + * up to JDK7:<br> + * {@code @NoArgsConstructor(onConstructor=@__({@AnnotationsGoHere}))}<br> + * from JDK8:<br> * {@code @NoArgsConstructor(onConstructor_={@AnnotationsGohere})} // note the underscore after {@code onConstructor}. + * + * @return List of annotations to apply to the generated constructor. */ AnyAnnotation[] onConstructor() default {}; /** * Sets the access level of the constructor. By default, generated constructors are {@code public}. + * + * @return The constructor will be generated with this access modifier. */ AccessLevel access() default lombok.AccessLevel.PUBLIC; /** * If {@code true}, initializes all final fields to 0 / null / false. * Otherwise, a compile time error occurs. + * + * @return Return {@code} true to force generation of a no-args constructor, picking defaults if necessary to assign required fields. */ boolean force() default false; diff --git a/src/core/lombok/RequiredArgsConstructor.java b/src/core/lombok/RequiredArgsConstructor.java index 2f4d0aaf..f21bd647 100644 --- a/src/core/lombok/RequiredArgsConstructor.java +++ b/src/core/lombok/RequiredArgsConstructor.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 @@ -30,7 +30,7 @@ import java.lang.annotation.Target; * Generates a constructor with required arguments. * Required arguments are final fields and fields with constraints such as {@code @NonNull}. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Constructor.html">the project lombok features page for @Constructor</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Constructor">the project lombok features page for @Constructor</a>. * <p> * Even though it is not listed, this annotation also has the {@code onConstructor} parameter. See the full documentation for more details. * @@ -45,21 +45,27 @@ public @interface RequiredArgsConstructor { * is generated with the same argument list that wraps the real constructor. * * Such a static 'constructor' is primarily useful as it infers type arguments. + * + * @return Name of static 'constructor' method to generate (blank = generate a normal constructor). */ String staticName() default ""; /** * Any annotations listed here are put on the generated constructor. - * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br /> - * up to JDK7:<br /> - * {@code @RequiredArgsConstructor(onConstructor=@__({@AnnotationsGoHere}))}<br /> - * from JDK8:<br /> + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br> + * up to JDK7:<br> + * {@code @RequiredArgsConstructor(onConstructor=@__({@AnnotationsGoHere}))}<br> + * from JDK8:<br> * {@code @RequiredArgsConstructor(onConstructor_={@AnnotationsGohere})} // note the underscore after {@code onConstructor}. + * + * @return List of annotations to apply to the generated constructor. */ AnyAnnotation[] onConstructor() default {}; /** * Sets the access level of the constructor. By default, generated constructors are {@code public}. + * + * @return The constructor will be generated with this access modifier. */ AccessLevel access() default lombok.AccessLevel.PUBLIC; diff --git a/src/core/lombok/Setter.java b/src/core/lombok/Setter.java index f2ebe5b3..1b70bac9 100644 --- a/src/core/lombok/Setter.java +++ b/src/core/lombok/Setter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2013 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** * Put on any field to make lombok build a standard setter. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/GetterSetter.html">the project lombok features page for @Getter and @Setter</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/GetterSetter">the project lombok features page for @Getter and @Setter</a>. * <p> * Even though it is not listed, this annotation also has the {@code onParam} and {@code onMethod} parameter. See the full documentation for more details. * <p> @@ -55,26 +55,32 @@ import java.lang.annotation.Target; public @interface Setter { /** * If you want your setter to be non-public, you can specify an alternate access level here. + * + * @return The setter method will be generated with this access modifier. */ lombok.AccessLevel value() default lombok.AccessLevel.PUBLIC; /** * Any annotations listed here are put on the generated method. - * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br /> - * up to JDK7:<br /> - * {@code @Setter(onMethod=@__({@AnnotationsGoHere}))}<br /> - * from JDK8:<br /> + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br> + * up to JDK7:<br> + * {@code @Setter(onMethod=@__({@AnnotationsGoHere}))}<br> + * from JDK8:<br> * {@code @Setter(onMethod_={@AnnotationsGohere})} // note the underscore after {@code onMethod}. + * + * @return List of annotations to apply to the generated setter method. */ AnyAnnotation[] onMethod() default {}; /** * Any annotations listed here are put on the generated method's parameter. - * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br /> - * up to JDK7:<br /> - * {@code @Setter(onParam=@__({@AnnotationsGoHere}))}<br /> - * from JDK8:<br /> + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br> + * up to JDK7:<br> + * {@code @Setter(onParam=@__({@AnnotationsGoHere}))}<br> + * from JDK8:<br> * {@code @Setter(onParam_={@AnnotationsGohere})} // note the underscore after {@code onParam}. + * + * @return List of annotations to apply to the generated parameter in the setter method. */ AnyAnnotation[] onParam() default {}; diff --git a/src/core/lombok/Singular.java b/src/core/lombok/Singular.java index 15dec4a5..67edab96 100644 --- a/src/core/lombok/Singular.java +++ b/src/core/lombok/Singular.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 The Project Lombok Authors. + * Copyright (C) 2015-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 @@ -29,10 +29,10 @@ import java.lang.annotation.Target; /** * The singular annotation is used together with {@code @Builder} to create single element 'add' methods in the builder for collections. - * <p> */ @Target({FIELD, PARAMETER}) @Retention(SOURCE) public @interface Singular { + /** @return The singular name of this field. If it's a normal english plural, lombok will figure it out automatically. Otherwise, this parameter is mandatory. */ String value() default ""; } diff --git a/src/core/lombok/SneakyThrows.java b/src/core/lombok/SneakyThrows.java index 489e13e4..0506d615 100644 --- a/src/core/lombok/SneakyThrows.java +++ b/src/core/lombok/SneakyThrows.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2013 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -34,7 +34,7 @@ import java.lang.annotation.Target; * checked exception types. The JVM does not check for the consistency of the checked exception system; javac does, * and this annotation lets you opt out of its mechanism. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/SneakyThrows.html">the project lombok features page for @SneakyThrows</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/SneakyThrows">the project lombok features page for @SneakyThrows</a>. * <p> * Example: * <pre> @@ -59,8 +59,9 @@ import java.lang.annotation.Target; @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) @Retention(RetentionPolicy.SOURCE) public @interface SneakyThrows { - /** The exception type(s) you want to sneakily throw onward. */ + /** @return The exception type(s) you want to sneakily throw onward. */ Class<? extends Throwable>[] value() default java.lang.Throwable.class; - //The package is mentioned in java.lang due to a bug in javac (presence of an annotation processor throws off the type resolver for some reason). + //The fully qualified name is used for java.lang.Throwable in the parameter only. This works around a bug in javac: + // presence of an annotation processor throws off the type resolver for some reason. } diff --git a/src/core/lombok/Synchronized.java b/src/core/lombok/Synchronized.java index 9a39c212..5dff0fb2 100644 --- a/src/core/lombok/Synchronized.java +++ b/src/core/lombok/Synchronized.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2013 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -35,7 +35,7 @@ import java.lang.annotation.Target; * {@code $LOCK} is used. These will be generated if needed and if they aren't already present. The contents * of the fields will be serializable. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Synchronized.html">the project lombok features page for @Synchronized</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Synchronized">the project lombok features page for @Synchronized</a>. */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.SOURCE) @@ -43,6 +43,8 @@ public @interface Synchronized { /** * Optional: specify the name of a different field to lock on. It is a compile time error if this field * doesn't already exist (the fields are automatically generated only if you don't specify a specific name. + * + * @return Name of the field to lock on (blank = generate one). */ String value() default ""; } diff --git a/src/core/lombok/ToString.java b/src/core/lombok/ToString.java index b9926148..0c43c40b 100644 --- a/src/core/lombok/ToString.java +++ b/src/core/lombok/ToString.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2013 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** * Generates an implementation for the {@code toString} method inherited by all objects, consisting of printing the values of relevant fields. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/ToString.html">the project lombok features page for @ToString</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/ToString">the project lombok features page for @ToString</a>. */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.SOURCE) @@ -37,12 +37,16 @@ public @interface ToString { /** * Include the name of each field when printing it. * <strong>default: true</strong> + * + * @return Whether or not to include the names of fields in the string produced by the generated {@code toString()}. */ boolean includeFieldNames() default true; /** * Any fields listed here will not be printed in the generated {@code toString} implementation. * Mutually exclusive with {@link #of()}. + * + * @return A list of fields to exclude. */ String[] exclude() default {}; @@ -51,18 +55,24 @@ public @interface ToString { * Normally, all non-static fields are printed. * <p> * Mutually exclusive with {@link #exclude()}. + * + * @return A list of fields to use (<em>default</em>: all of them). */ String[] of() default {}; /** * Include the result of the superclass's implementation of {@code toString} in the output. * <strong>default: false</strong> + * + * @return Whether to call the superclass's {@code toString} implementation as part of the generated toString algorithm. */ boolean callSuper() default false; /** * Normally, if getters are available, those are called. To suppress this and let the generated code use the fields directly, set this to {@code true}. * <strong>default: false</strong> + * + * @return If {@code true}, always use direct field access instead of calling the getter method. */ boolean doNotUseGetters() default false; } diff --git a/src/core/lombok/Value.java b/src/core/lombok/Value.java index 39154226..562ba0cc 100644 --- a/src/core/lombok/Value.java +++ b/src/core/lombok/Value.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 The Project Lombok Authors. + * 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 @@ -31,7 +31,7 @@ import java.lang.annotation.Target; * <p> * Equivalent to {@code @Getter @FieldDefaults(makeFinal=true, level=AccessLevel.PRIVATE) @AllArgsConstructor @ToString @EqualsAndHashCode}. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Value.html">the project lombok features page for @Value</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Value">the project lombok features page for @Value</a>. * * @see lombok.Getter * @see lombok.experimental.FieldDefaults @@ -53,6 +53,8 @@ public @interface Value { * </pre> * * 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/bytecode/AsmUtil.java b/src/core/lombok/bytecode/AsmUtil.java index 26e5af1f..e3d33efa 100644 --- a/src/core/lombok/bytecode/AsmUtil.java +++ b/src/core/lombok/bytecode/AsmUtil.java @@ -37,7 +37,7 @@ class AsmUtil { ClassReader reader = new ClassReader(byteCode); ClassWriter writer = new FixedClassWriter(reader, 0); - ClassVisitor visitor = new ClassVisitor(Opcodes.ASM5, writer) { + ClassVisitor visitor = new ClassVisitor(Opcodes.ASM6, writer) { @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { return new JSRInlinerAdapter(super.visitMethod(access, name, desc, signature, exceptions), access, name, desc, signature, exceptions); } diff --git a/src/core/lombok/bytecode/ClassFileMetaData.java b/src/core/lombok/bytecode/ClassFileMetaData.java index 68b8bb7d..0dc6a6c8 100644 --- a/src/core/lombok/bytecode/ClassFileMetaData.java +++ b/src/core/lombok/bytecode/ClassFileMetaData.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 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 @@ -44,6 +44,9 @@ public class ClassFileMetaData { private static final byte METHOD_HANDLE = 15; private static final byte METHOD_TYPE = 16; private static final byte INVOKE_DYNAMIC = 18; + // New in java9: support for modules + private static final byte MODULE = 19; + private static final byte PACKAGE = 20; private static final int NOT_FOUND = -1; private static final int START_OF_CONSTANT_POOL = 8; @@ -79,6 +82,8 @@ public class ClassFileMetaData { case CLASS: case STRING: case METHOD_TYPE: + case MODULE: + case PACKAGE: position += 2; break; case METHOD_HANDLE: diff --git a/src/core/lombok/bytecode/PreventNullAnalysisRemover.java b/src/core/lombok/bytecode/PreventNullAnalysisRemover.java index 5f2f5f18..c06f2d7c 100644 --- a/src/core/lombok/bytecode/PreventNullAnalysisRemover.java +++ b/src/core/lombok/bytecode/PreventNullAnalysisRemover.java @@ -50,7 +50,7 @@ public class PreventNullAnalysisRemover implements PostCompilerTransformation { class PreventNullAnalysisVisitor extends MethodVisitor { PreventNullAnalysisVisitor(MethodVisitor mv) { - super(Opcodes.ASM5, mv); + super(Opcodes.ASM6, mv); } @Override public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { @@ -68,7 +68,7 @@ public class PreventNullAnalysisRemover implements PostCompilerTransformation { } } - reader.accept(new ClassVisitor(Opcodes.ASM5, writer) { + reader.accept(new ClassVisitor(Opcodes.ASM6, writer) { @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { return new PreventNullAnalysisVisitor(super.visitMethod(access, name, desc, signature, exceptions)); } diff --git a/src/core/lombok/bytecode/SneakyThrowsRemover.java b/src/core/lombok/bytecode/SneakyThrowsRemover.java index 8ef64e59..a2ee59ea 100644 --- a/src/core/lombok/bytecode/SneakyThrowsRemover.java +++ b/src/core/lombok/bytecode/SneakyThrowsRemover.java @@ -47,12 +47,12 @@ public class SneakyThrowsRemover implements PostCompilerTransformation { ClassReader reader = new ClassReader(fixedByteCode); ClassWriter writer = new ClassWriter(reader, 0); - + final AtomicBoolean changesMade = new AtomicBoolean(); class SneakyThrowsRemoverVisitor extends MethodVisitor { SneakyThrowsRemoverVisitor(MethodVisitor mv) { - super(Opcodes.ASM5, mv); + super(Opcodes.ASM6, mv); } private boolean methodInsnQueued = false; diff --git a/src/core/lombok/core/AnnotationProcessor.java b/src/core/lombok/core/AnnotationProcessor.java index 5531ad8e..5b4ef393 100644 --- a/src/core/lombok/core/AnnotationProcessor.java +++ b/src/core/lombok/core/AnnotationProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2014 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 @@ -40,6 +40,7 @@ import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; +import javax.lang.model.element.Name; import javax.lang.model.element.TypeElement; import javax.tools.Diagnostic.Kind; @@ -163,7 +164,21 @@ public class AnnotationProcessor extends AbstractProcessor { for (ProcessorDescriptor proc : active) proc.process(annotations, roundEnv); - return false; + boolean onlyLombok = true; + boolean zeroElems = true; + for (TypeElement elem : annotations) { + zeroElems = false; + Name n = elem.getQualifiedName(); + if (n.length() > 7 && n.subSequence(0, 7).toString().equals("lombok.")) continue; + onlyLombok = false; + } + + // Normally we rely on the claiming processor to claim away all lombok annotations. + // One of the many Java9 oversights is that this 'process' API has not been fixed to address the point that 'files I want to look at' and 'annotations I want to claim' must be one and the same, + // and yet in java9 you can no longer have 2 providers for the same service, thus, if you go by module path, lombok no longer loads the ClaimingProcessor. + // This doesn't do as good a job, but it'll have to do. The only way to go from here, I think, is either 2 modules, or use reflection hackery to add ClaimingProcessor during our init. + + return onlyLombok && !zeroElems; } /** diff --git a/src/core/lombok/core/LombokInternalAliasing.java b/src/core/lombok/core/LombokInternalAliasing.java index 08764a5c..3dc1bfa2 100644 --- a/src/core/lombok/core/LombokInternalAliasing.java +++ b/src/core/lombok/core/LombokInternalAliasing.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2014 The Project Lombok Authors. + * Copyright (C) 2013-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 @@ -51,6 +51,7 @@ public class LombokInternalAliasing { Map<String, String> m2 = new HashMap<String, String>(); m2.put("lombok.experimental.Value", "lombok.Value"); m2.put("lombok.experimental.Builder", "lombok.Builder"); + m2.put("lombok.experimental.var", "lombok.var"); m2.put("lombok.Delegate", "lombok.experimental.Delegate"); ALIASES = Collections.unmodifiableMap(m2); } diff --git a/src/core/lombok/core/PublicApiCreatorApp.java b/src/core/lombok/core/PublicApiCreatorApp.java index 178a45e8..c1430c24 100644 --- a/src/core/lombok/core/PublicApiCreatorApp.java +++ b/src/core/lombok/core/PublicApiCreatorApp.java @@ -105,7 +105,7 @@ public class PublicApiCreatorApp extends LombokApp { int firstSlash = subName.indexOf('/'); if (firstSlash == -1) { // direct member of the lombok package. - toCopy.add(name); + if (!subName.startsWith("ConfigurationKeys")) toCopy.add(name); continue; } String topPkg = subName.substring(0, firstSlash); diff --git a/src/core/lombok/core/Version.java b/src/core/lombok/core/Version.java index a50b72d5..98f1e575 100644 --- a/src/core/lombok/core/Version.java +++ b/src/core/lombok/core/Version.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2016 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -30,9 +30,15 @@ public class Version { // ** CAREFUL ** - this class must always compile with 0 dependencies (it must not refer to any other sources or libraries). // Note: In 'X.Y.Z', if Z is odd, its a snapshot build built from the repository, so many different 0.10.3 versions can exist, for example. // Official builds always end in an even number. (Since 0.10.2). - private static final String VERSION = "1.16.15"; + private static final String VERSION = "1.16.21"; private static final String RELEASE_NAME = "Edgy Guinea Pig"; -// private static final String RELEASE_NAME = "Candid Duck"; +// private static final String RELEASE_NAME = "Dancing Elephant"; + + // Named version history: + // Angry Butterfly + // Branching Cobra + // Candid Duck + // Dancing Elephant private Version() { //Prevent instantiation @@ -43,7 +49,7 @@ public class Version { */ public static void main(String[] args) { if (args.length > 0) { - System.out.printf("Lombok %s\n", getFullVersion()); + System.out.printf("%s\n", getFullVersion()); } else { System.out.println(VERSION); } diff --git a/src/core/lombok/core/configuration/AllowHelper.java b/src/core/lombok/core/configuration/AllowHelper.java index 3873b055..1146ccde 100644 --- a/src/core/lombok/core/configuration/AllowHelper.java +++ b/src/core/lombok/core/configuration/AllowHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Project Lombok Authors. + * 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 @@ -24,10 +24,8 @@ package lombok.core.configuration; import java.util.Collection; import java.util.Collections; -import lombok.ConfigurationKeys; - public final class AllowHelper { - private final static Collection<? extends ConfigurationKey<?>> ALLOWABLE = Collections.singleton(ConfigurationKeys.VAR_FLAG_USAGE); + private final static Collection<? extends ConfigurationKey<?>> ALLOWABLE = Collections.emptySet(); private AllowHelper() { // Prevent instantiation diff --git a/src/core/lombok/core/handlers/HandlerUtil.java b/src/core/lombok/core/handlers/HandlerUtil.java index 6c3a0b79..6b516904 100644 --- a/src/core/lombok/core/handlers/HandlerUtil.java +++ b/src/core/lombok/core/handlers/HandlerUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2017 The Project Lombok Authors. + * Copyright (C) 2013-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 @@ -113,7 +113,7 @@ public class HandlerUtil { public static boolean shouldAddGenerated(LombokNode<?, ?, ?> node) { Boolean add = node.getAst().readConfiguration(ConfigurationKeys.ADD_JAVAX_GENERATED_ANNOTATIONS); if (add != null) return add; - return !Boolean.FALSE.equals(node.getAst().readConfiguration(ConfigurationKeys.ADD_GENERATED_ANNOTATIONS)); + return Boolean.TRUE.equals(node.getAst().readConfiguration(ConfigurationKeys.ADD_GENERATED_ANNOTATIONS)); } public static void handleExperimentalFlagUsage(LombokNode<?, ?, ?> node, ConfigurationKey<FlagUsageType> key, String featureName) { @@ -171,11 +171,12 @@ public class HandlerUtil { } @SuppressWarnings({"all", "unchecked", "deprecation"}) - public static final List<Class<? extends java.lang.annotation.Annotation>> INVALID_ON_BUILDERS = Collections.unmodifiableList( - Arrays.<Class<? extends java.lang.annotation.Annotation>>asList( - Getter.class, Setter.class, Wither.class, ToString.class, EqualsAndHashCode.class, - RequiredArgsConstructor.class, AllArgsConstructor.class, NoArgsConstructor.class, - Data.class, Value.class, lombok.experimental.Value.class, FieldDefaults.class)); + public static final List<String> INVALID_ON_BUILDERS = Collections.unmodifiableList( + Arrays.<String>asList( + Getter.class.getName(), Setter.class.getName(), Wither.class.getName(), + ToString.class.getName(), EqualsAndHashCode.class.getName(), + RequiredArgsConstructor.class.getName(), AllArgsConstructor.class.getName(), NoArgsConstructor.class.getName(), + Data.class.getName(), Value.class.getName(), "lombok.experimental.Value", FieldDefaults.class.getName())); /** * Given the name of a field, return the 'base name' of that field. For example, {@code fFoobar} becomes {@code foobar} if {@code f} is in the prefix list. diff --git a/src/core/lombok/core/handlers/singulars.txt b/src/core/lombok/core/handlers/singulars.txt index 9976c76c..d77308cb 100644 --- a/src/core/lombok/core/handlers/singulars.txt +++ b/src/core/lombok/core/handlers/singulars.txt @@ -19,7 +19,7 @@ Mice = mouse Lice = louse News = ! # We could add more detail (axemen, boatsmen, boogymen, cavemen, gentlemen, etc, but (A) there's stuff like 'cerumen', and (B) the 'men' ending is common in singulars and other languages.) -# Therefore, the odds of a mistake are too high, so other than these 2 well known cases, so force the explicit singular. +# Therefore, the odds of a mistake are too high, so other than these 2 well known cases, force the explicit singular. Men = man Women = woman minutiae = minutia @@ -48,7 +48,9 @@ hives = hive -shes = sh -lves = lf -rves = rf --ves = fe +saves = save +Leaves = leaf +-ves = ! -ss = ! -us = ! -s = diff --git a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java index 4726b17e..6617d21a 100644 --- a/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java +++ b/src/core/lombok/eclipse/handlers/EclipseHandlerUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2017 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 @@ -167,6 +167,7 @@ public class EclipseHandlerUtil { } public static boolean isFieldDeprecated(EclipseNode fieldNode) { + if (!(fieldNode.get() instanceof FieldDeclaration)) return false; FieldDeclaration field = (FieldDeclaration) fieldNode.get(); if ((field.modifiers & ClassFileConstants.AccDeprecated) != 0) { return true; @@ -196,17 +197,36 @@ public class EclipseHandlerUtil { TypeResolver resolver = new TypeResolver(node.getImportList()); return resolver.typeMatches(node, type.getName(), typeName); + } + + /** + * Checks if the given TypeReference node is likely to be a reference to the provided class. + * + * @param type An actual type. This method checks if {@code typeNode} is likely to be a reference to this type. + * @param node A Lombok AST node. Any node in the appropriate compilation unit will do (used to get access to import statements). + * @param typeRef A type reference to check. + */ + public static boolean typeMatches(String type, EclipseNode node, TypeReference typeRef) { + if (typeRef == null || typeRef.getTypeName() == null || typeRef.getTypeName().length == 0) return false; + String lastPartA = new String(typeRef.getTypeName()[typeRef.getTypeName().length -1]); + int lastIndex = type.lastIndexOf('.'); + String lastPartB = lastIndex == -1 ? type : type.substring(lastIndex + 1); + if (!lastPartA.equals(lastPartB)) return false; + String typeName = toQualifiedName(typeRef.getTypeName()); + TypeResolver resolver = new TypeResolver(node.getImportList()); + return resolver.typeMatches(node, type, typeName); } public static void sanityCheckForMethodGeneratingAnnotationsOnBuilderClass(EclipseNode typeNode, EclipseNode errorNode) { List<String> disallowed = null; for (EclipseNode child : typeNode.down()) { if (child.getKind() != Kind.ANNOTATION) continue; - for (Class<? extends java.lang.annotation.Annotation> annType : INVALID_ON_BUILDERS) { + for (String annType : INVALID_ON_BUILDERS) { if (annotationTypeMatches(annType, child)) { if (disallowed == null) disallowed = new ArrayList<String>(); - disallowed.add(annType.getSimpleName()); + int lastIndex = annType.lastIndexOf('.'); + disallowed.add(lastIndex == -1 ? annType : annType.substring(lastIndex + 1)); } } } @@ -443,6 +463,42 @@ public class EclipseHandlerUtil { } } + public static boolean hasAnnotation(String type, EclipseNode node) { + if (node == null) return false; + if (type == null) return false; + switch (node.getKind()) { + case ARGUMENT: + case FIELD: + case LOCAL: + case TYPE: + case METHOD: + for (EclipseNode child : node.down()) { + if (annotationTypeMatches(type, child)) return true; + } + // intentional fallthrough + default: + return false; + } + } + + public static EclipseNode findAnnotation(Class<? extends java.lang.annotation.Annotation> type, EclipseNode node) { + if (node == null) return null; + if (type == null) return null; + switch (node.getKind()) { + case ARGUMENT: + case FIELD: + case LOCAL: + case TYPE: + case METHOD: + for (EclipseNode child : node.down()) { + if (annotationTypeMatches(type, child)) return child; + } + // intentional fallthrough + default: + return null; + } + } + /** * Checks if the provided annotation type is likely to be the intended type for the given annotation node. * @@ -453,6 +509,16 @@ public class EclipseHandlerUtil { return typeMatches(type, node, ((Annotation) node.get()).type); } + /** + * Checks if the provided annotation type is likely to be the intended type for the given annotation node. + * + * This is a guess, but a decent one. + */ + public static boolean annotationTypeMatches(String type, EclipseNode node) { + if (node.getKind() != Kind.ANNOTATION) return false; + return typeMatches(type, node, ((Annotation) node.get()).type); + } + public static TypeReference cloneSelfType(EclipseNode context) { return cloneSelfType(context, null); } @@ -831,7 +897,7 @@ public class EclipseHandlerUtil { // Check if the class has a @Getter annotation. - if (!hasGetterAnnotation && new HandleGetter().fieldQualifiesForGetterGeneration(field)) { + if (!hasGetterAnnotation && HandleGetter.fieldQualifiesForGetterGeneration(field)) { //Check if the class has @Getter or @Data annotation. EclipseNode containingType = field.up(); diff --git a/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java b/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java index 10ed7fbb..2cec2388 100644 --- a/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java +++ b/src/core/lombok/eclipse/handlers/EclipseSingularsRecipes.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 The Project Lombok Authors. + * Copyright (C) 2015-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 @@ -134,6 +134,10 @@ public class EclipseSingularsRecipes { } } + public ASTNode getSource() { + return source; + } + public EclipseNode getAnnotation() { return annotation; } @@ -213,7 +217,7 @@ public class EclipseSingularsRecipes { } public abstract List<EclipseNode> generateFields(SingularData data, EclipseNode builderType); - public abstract void generateMethods(SingularData data, EclipseNode builderType, boolean fluent, boolean chain); + public abstract void generateMethods(SingularData data, boolean deprecate, EclipseNode builderType, boolean fluent, boolean chain); public abstract void appendBuildCode(SingularData data, EclipseNode builderType, List<Statement> statements, char[] targetVariableName, String builderVariable); public boolean requiresCleaning() { @@ -304,8 +308,7 @@ public class EclipseSingularsRecipes { private static final char[] SIZE_TEXT = new char[] {'s', 'i', 'z', 'e'}; - /** Generates 'this.<em>name</em>.size()' as an expression; if nullGuard is true, it's this.name == null ? 0 : this.name.size(). - * @param builderVariable */ + /** Generates 'this.<em>name</em>.size()' as an expression; if nullGuard is true, it's this.name == null ? 0 : this.name.size(). */ protected Expression getSize(EclipseNode builderType, char[] name, boolean nullGuard, String builderVariable) { MessageSend invoke = new MessageSend(); Reference thisRef = getBuilderReference(builderVariable); @@ -345,9 +348,7 @@ public class EclipseSingularsRecipes { return new QualifiedTypeReference(TypeConstants.JAVA_LANG_OBJECT, NULL_POSS); } - /** - * @return a {@link SingleNameReference} to the builder in the variable <code>builderVariable</code>. If <code>builderVariable == "this"</code>, a {@link ThisReference} is returned. - */ + /** @return a {@code SingleNameReference} to the builder in the variable <code>builderVariable</code>. If {@ code builderVariable == "this"}, a {@code ThisReference} is returned. */ protected static Reference getBuilderReference(String builderVariable) { if ("this".equals(builderVariable)) { return new ThisReference(0, 0); diff --git a/src/core/lombok/eclipse/handlers/HandleBuilder.java b/src/core/lombok/eclipse/handlers/HandleBuilder.java index 3795c3de..b5c6e793 100644 --- a/src/core/lombok/eclipse/handlers/HandleBuilder.java +++ b/src/core/lombok/eclipse/handlers/HandleBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2015 The Project Lombok Authors. + * Copyright (C) 2013-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 @@ -39,6 +39,7 @@ import org.eclipse.jdt.internal.compiler.ast.Annotation; import org.eclipse.jdt.internal.compiler.ast.Argument; import org.eclipse.jdt.internal.compiler.ast.Assignment; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; +import org.eclipse.jdt.internal.compiler.ast.ConditionalExpression; import org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration; import org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall; import org.eclipse.jdt.internal.compiler.ast.Expression; @@ -92,6 +93,8 @@ import lombok.experimental.NonFinal; @ProviderFor(EclipseAnnotationHandler.class) @HandlerPriority(-1024) //-2^10; to ensure we've picked up @FieldDefault's changes (-2048) but @Value hasn't removed itself yet (-512), so that we can error on presence of it on the builder classes. public class HandleBuilder extends EclipseAnnotationHandler<Builder> { + private HandleConstructor handleConstructor = new HandleConstructor(); + private static final char[] CLEAN_FIELD_NAME = "$lombokUnclean".toCharArray(); private static final char[] CLEAN_METHOD_NAME = "$lombokClean".toCharArray(); @@ -107,9 +110,12 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { TypeReference type; char[] rawName; char[] name; + char[] nameOfDefaultProvider; + char[] nameOfSetFlag; SingularData singularData; ObtainVia obtainVia; EclipseNode obtainViaNode; + EclipseNode originalFieldNode; List<EclipseNode> createdFields = new ArrayList<EclipseNode>(); } @@ -132,6 +138,16 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { return true; } + private static final char[] DEFAULT_PREFIX = {'$', 'd', 'e', 'f', 'a', 'u', 'l', 't', '$'}; + private static final char[] SET_PREFIX = {'$', 's', 'e', 't'}; + + private static final char[] prefixWith(char[] prefix, char[] name) { + char[] out = new char[prefix.length + name.length]; + System.arraycopy(prefix, 0, out, 0, prefix.length); + System.arraycopy(name, 0, out, prefix.length, name.length); + return out; + } + @Override public void handle(AnnotationValues<Builder> annotation, Annotation ast, EclipseNode annotationNode) { long p = (long) ast.sourceStart << 32 | ast.sourceEnd; @@ -146,9 +162,8 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { String builderClassName = builderInstance.builderClassName(); boolean inherit = builderInstance.inherit(); - boolean extendable = inherit || builderInstance.extendable(); // inherit implies extendable - String superclassBuilderClassName = builderInstance.superclassBuilderClassName(); - + boolean extensible = inherit || builderInstance.extensible(); // inherit implies extendable + String toBuilderMethodName = "toBuilder"; boolean toBuilder = builderInstance.toBuilder(); List<char[]> typeArgsForToBuilder = null; @@ -156,9 +171,6 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { if (builderMethodName == null) builderMethodName = "builder"; if (buildMethodName == null) builderMethodName = "build"; if (builderClassName == null) builderClassName = ""; - if (superclassBuilderClassName == null) { - superclassBuilderClassName = ""; - } if (!checkName("builderMethodName", builderMethodName, annotationNode)) return; if (!checkName("buildMethodName", buildMethodName, annotationNode)) return; @@ -179,43 +191,61 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { boolean addCleaning = false; boolean isStatic = true; + TypeDeclaration td = null; + if (parent.get() instanceof TypeDeclaration) { tdParent = parent; - TypeDeclaration td = (TypeDeclaration) tdParent.get(); + td = (TypeDeclaration) tdParent.get(); List<EclipseNode> allFields = new ArrayList<EclipseNode>(); - @SuppressWarnings("deprecation") - boolean valuePresent = (hasAnnotation(lombok.Value.class, parent) || hasAnnotation(lombok.experimental.Value.class, parent)); - for (EclipseNode fieldNode : HandleConstructor.findAllFields(tdParent)) { + boolean valuePresent = (hasAnnotation(lombok.Value.class, parent) || hasAnnotation("lombok.experimental.Value", parent)); + for (EclipseNode fieldNode : HandleConstructor.findAllFields(tdParent, true)) { FieldDeclaration fd = (FieldDeclaration) fieldNode.get(); - // final fields with an initializer cannot be written to, so they can't be 'builderized'. Unfortunately presence of @Value makes - // non-final fields final, but @Value's handler hasn't done this yet, so we have to do this math ourselves. - // Value will only skip making a field final if it has an explicit @NonFinal annotation, so we check for that. - if (fd.initialization != null && valuePresent && !hasAnnotation(NonFinal.class, fieldNode)) continue; + EclipseNode isDefault = findAnnotation(Builder.Default.class, fieldNode); + boolean isFinal = ((fd.modifiers & ClassFileConstants.AccFinal) != 0) || (valuePresent && !hasAnnotation(NonFinal.class, fieldNode)); + BuilderFieldData bfd = new BuilderFieldData(); bfd.fieldNode = fieldNode; bfd.rawName = fieldNode.getName().toCharArray(); bfd.name = removePrefixFromField(fieldNode); bfd.type = fd.type; bfd.singularData = getSingularData(fieldNode, ast); + bfd.originalFieldNode = fieldNode; + + if (bfd.singularData != null && isDefault != null) { + isDefault.addError("@Builder.Default and @Singular cannot be mixed."); + isDefault = null; + } + + if (fd.initialization == null && isDefault != null) { + isDefault.addWarning("@Builder.Default requires an initializing expression (' = something;')."); + isDefault = null; + } + + if (fd.initialization != null && isDefault == null) { + if (isFinal) continue; + fieldNode.addWarning("@Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. If it is not supposed to be settable during building, make the field final."); + } + + if (isDefault != null) { + bfd.nameOfDefaultProvider = prefixWith(DEFAULT_PREFIX, bfd.name); + bfd.nameOfSetFlag = prefixWith(bfd.name, SET_PREFIX); + + MethodDeclaration md = generateDefaultProvider(bfd.nameOfDefaultProvider, td.typeParameters, fieldNode, ast); + if (md != null) injectMethod(tdParent, md); + } addObtainVia(bfd, fieldNode); builderFields.add(bfd); allFields.add(fieldNode); } - if (builderClassName.isEmpty()) { - builderClassName = new String(td.name) + "Builder"; - } - if (superclassBuilderClassName.isEmpty() && td.superclass != null) { - superclassBuilderClassName = new String(td.superclass.getLastToken()) + "Builder"; - } + if (builderClassName.isEmpty()) builderClassName = new String(td.name) + "Builder"; - if (extendable) { + if (extensible) { boolean callBuilderBasedSuperConstructor = td.superclass != null; - generateBuilderBasedConstructor(tdParent, builderFields, annotationNode, - builderClassName, callBuilderBasedSuperConstructor); + generateBuilderBasedConstructor(tdParent, builderFields, annotationNode, builderClassName, callBuilderBasedSuperConstructor); } else { - new HandleConstructor().generateConstructor(tdParent, AccessLevel.PACKAGE, allFields, false, null, SkipIfConstructorExists.I_AM_BUILDER, + handleConstructor.generateConstructor(tdParent, AccessLevel.PACKAGE, allFields, false, null, SkipIfConstructorExists.I_AM_BUILDER, Collections.<Annotation>emptyList(), annotationNode); } @@ -228,8 +258,8 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { annotationNode.addError("@Builder(inherit=true) is only supported for type builders."); return; } - if (extendable) { - annotationNode.addError("@Builder(extendable=true) is only supported for type builders."); + if (extensible) { + annotationNode.addError("@Builder(extensible=true) is only supported for type builders."); return; } ConstructorDeclaration cd = (ConstructorDeclaration) parent.get(); @@ -239,7 +269,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } tdParent = parent.up(); - TypeDeclaration td = (TypeDeclaration) tdParent.get(); + td = (TypeDeclaration) tdParent.get(); returnType = namePlusTypeParamsToTypeReference(td.name, td.typeParameters, p); typeParams = td.typeParameters; thrownExceptions = cd.thrownExceptions; @@ -250,7 +280,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { annotationNode.addError("@Builder(inherit=true) is only supported for type builders."); return; } - if (extendable) { + if (extensible) { annotationNode.addError("@Builder(extendable=true) is only supported for type builders."); return; } @@ -376,6 +406,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { bfd.name = arg.name; bfd.type = arg.type; bfd.singularData = getSingularData(param, ast); + bfd.originalFieldNode = param; addObtainVia(bfd, param); builderFields.add(bfd); } @@ -383,7 +414,20 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { EclipseNode builderType = findInnerClass(tdParent, builderClassName); if (builderType == null) { - builderType = makeBuilderClass(isStatic, tdParent, builderClassName, typeParams, ast, inherit ? superclassBuilderClassName : null); + String superclassBuilderClassName = null; + if (inherit) { + if (td.superclass == null) { + annotationNode.addError("@Builder(inherit = true) requires that your class has an 'extends' clause."); + return; + } + + superclassBuilderClassName = builderInstance.superclassBuilderClassName(); + if (superclassBuilderClassName == null || superclassBuilderClassName.isEmpty()) { + superclassBuilderClassName = new String(td.superclass.getLastToken()) + "Builder"; + } + } + + builderType = makeBuilderClass(isStatic, tdParent, builderClassName, typeParams, ast, superclassBuilderClassName); } else { TypeDeclaration builderTypeDeclaration = (TypeDeclaration) builderType.get(); if (isStatic && (builderTypeDeclaration.modifiers & ClassFileConstants.AccStatic) == 0) { @@ -447,8 +491,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { } if (methodExists(buildMethodName, builderType, -1) == MemberExistsResult.NOT_EXISTS) { - boolean useBuilderBasedConstructor = parent.get() instanceof TypeDeclaration && extendable; - MethodDeclaration md = generateBuildMethod(isStatic, buildMethodName, nameOfStaticBuilderMethod, returnType, builderFields, builderType, thrownExceptions, addCleaning, ast, useBuilderBasedConstructor); + MethodDeclaration md = generateBuildMethod(tdParent, isStatic, buildMethodName, nameOfStaticBuilderMethod, returnType, builderFields, builderType, thrownExceptions, addCleaning, ast, extensible); if (md != null) injectMethod(builderType, md); } @@ -496,8 +539,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { int pS = source.sourceStart, pE = source.sourceEnd; long p = (long) pS << 32 | pE; - MethodDeclaration out = new MethodDeclaration( - ((CompilationUnitDeclaration) type.top().get()).compilationResult); + MethodDeclaration out = new MethodDeclaration(((CompilationUnitDeclaration) type.top().get()).compilationResult); out.selector = methodName.toCharArray(); out.modifiers = ClassFileConstants.AccPublic; out.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; @@ -556,23 +598,15 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { */ private void generateBuilderBasedConstructor(EclipseNode typeNode, List<BuilderFieldData> builderFields, EclipseNode sourceNode, String builderClassnameAsParameter, boolean callBuilderBasedSuperConstructor) { - - if (builderClassnameAsParameter == null || builderClassnameAsParameter.isEmpty()) { - typeNode.addError("A builder-based constructor requires a non-empty 'builderClassnameAsParameter' value."); - return; - } - - AccessLevel level = AccessLevel.PROTECTED; + ASTNode source = sourceNode.get(); - + TypeDeclaration typeDeclaration = ((TypeDeclaration) typeNode.get()); long p = (long) source.sourceStart << 32 | source.sourceEnd; boolean isEnum = (((TypeDeclaration) typeNode.get()).modifiers & ClassFileConstants.AccEnum) != 0; - if (isEnum) { - level = AccessLevel.PRIVATE; - } - + AccessLevel level = isEnum ? AccessLevel.PRIVATE : AccessLevel.PROTECTED; + ConstructorDeclaration constructor = new ConstructorDeclaration(((CompilationUnitDeclaration) typeNode.top().get()).compilationResult); constructor.modifiers = toEclipseModifier(level); @@ -601,7 +635,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { int s = (int) (p >> 32); int e = (int) p; thisX.receiver = new ThisReference(s, e); - + Expression assignmentExpr; if (fieldNode.singularData != null && fieldNode.singularData.getSingularizer() != null) { fieldNode.singularData.getSingularizer().appendBuildCode(fieldNode.singularData, typeNode, statements, fieldNode.name, "b"); @@ -628,7 +662,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { constructor.arguments = new Argument[] {new Argument("b".toCharArray(), p, new SingleTypeReference(builderClassnameAsParameter.toCharArray(), p), Modifier.FINAL)}; constructor.traverse(new SetGeneratedByVisitor(source), typeDeclaration.scope); - + injectMethod(typeNode, constructor); } @@ -660,7 +694,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { * that takes the builder instance as parameter (instead of a * constructor with all relevant fields as parameters) */ - public MethodDeclaration generateBuildMethod(boolean isStatic, String name, char[] staticName, TypeReference returnType, List<BuilderFieldData> builderFields, EclipseNode type, TypeReference[] thrownExceptions, boolean addCleaning, ASTNode source, boolean useBuilderBasedConstructor) { + public MethodDeclaration generateBuildMethod(EclipseNode tdParent, boolean isStatic, String name, char[] staticName, TypeReference returnType, List<BuilderFieldData> builderFields, EclipseNode type, TypeReference[] thrownExceptions, boolean addCleaning, ASTNode source, boolean useBuilderBasedConstructor) { MethodDeclaration out = new MethodDeclaration(((CompilationUnitDeclaration) type.top().get()).compilationResult); out.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; List<Statement> statements = new ArrayList<Statement>(); @@ -676,17 +710,31 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { invokeClean.selector = CLEAN_METHOD_NAME; statements.add(new IfStatement(notClean, invokeClean, 0, 0)); } - + for (BuilderFieldData bfd : builderFields) { if (bfd.singularData != null && bfd.singularData.getSingularizer() != null) { bfd.singularData.getSingularizer().appendBuildCode(bfd.singularData, type, statements, bfd.name, "this"); } } - + for (BuilderFieldData bfd : builderFields) { - args.add(new SingleNameReference(bfd.name, 0L)); + if (bfd.nameOfSetFlag != null) { + MessageSend inv = new MessageSend(); + inv.sourceStart = source.sourceStart; + inv.sourceEnd = source.sourceEnd; + inv.receiver = new SingleNameReference(((TypeDeclaration) tdParent.get()).name, 0L); + inv.selector = bfd.nameOfDefaultProvider; + inv.typeArguments = typeParameterNames(((TypeDeclaration) type.get()).typeParameters); + + args.add(new ConditionalExpression( + new SingleNameReference(bfd.nameOfSetFlag, 0L), + new SingleNameReference(bfd.name, 0L), + inv)); + } else { + args.add(new SingleNameReference(bfd.name, 0L)); + } } - + if (addCleaning) { FieldReference thisUnclean = new FieldReference(CLEAN_FIELD_NAME, 0); thisUnclean.receiver = new ThisReference(0, 0); @@ -718,14 +766,8 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { invoke.receiver = new SingleNameReference(type.up().getName().toCharArray(), 0); else invoke.receiver = new QualifiedThisReference(new SingleTypeReference(type.up().getName().toCharArray(), 0) , 0, 0); - TypeParameter[] tps = ((TypeDeclaration) type.get()).typeParameters; - if (tps != null) { - TypeReference[] trs = new TypeReference[tps.length]; - for (int i = 0; i < trs.length; i++) { - trs[i] = new SingleTypeReference(tps[i].name, 0); - } - invoke.typeArguments = trs; - } + + invoke.typeArguments = typeParameterNames(((TypeDeclaration) type.get()).typeParameters); invoke.arguments = args.isEmpty() ? null : args.toArray(new Expression[args.size()]); if (returnType instanceof SingleTypeReference && Arrays.equals(TypeConstants.VOID, ((SingleTypeReference) returnType).token)) { statements.add(invoke); @@ -738,6 +780,33 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { return out; } + private TypeReference[] typeParameterNames(TypeParameter[] typeParameters) { + if (typeParameters == null) return null; + + TypeReference[] trs = new TypeReference[typeParameters.length]; + for (int i = 0; i < trs.length; i++) { + trs[i] = new SingleTypeReference(typeParameters[i].name, 0); + } + return trs; + } + + public MethodDeclaration generateDefaultProvider(char[] methodName, TypeParameter[] typeParameters, EclipseNode fieldNode, ASTNode source) { + int pS = source.sourceStart, pE = source.sourceEnd; + + MethodDeclaration out = new MethodDeclaration(((CompilationUnitDeclaration) fieldNode.top().get()).compilationResult); + out.typeParameters = copyTypeParams(typeParameters, source); + out.selector = methodName; + out.modifiers = ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic; + out.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; + FieldDeclaration fd = (FieldDeclaration) fieldNode.get(); + out.returnType = copyType(fd.type, source); + out.statements = new Statement[] {new ReturnStatement(fd.initialization, pS, pE)}; + fd.initialization = null; + + out.traverse(new SetGeneratedByVisitor(source), ((TypeDeclaration) fieldNode.up().get()).scope); + return out; + } + public MethodDeclaration generateBuilderMethod(boolean isStatic, String builderMethodName, String builderClassName, EclipseNode type, TypeParameter[] typeParams, ASTNode source) { int pS = source.sourceStart, pE = source.sourceEnd; long p = (long) pS << 32 | pE; @@ -763,25 +832,34 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { if (child.getKind() == Kind.FIELD) existing.add(child); } - top: for (BuilderFieldData bfd : builderFields) { if (bfd.singularData != null && bfd.singularData.getSingularizer() != null) { bfd.createdFields.addAll(bfd.singularData.getSingularizer().generateFields(bfd.singularData, builderType)); } else { + EclipseNode field = null, setFlag = null; for (EclipseNode exists : existing) { char[] n = ((FieldDeclaration) exists.get()).name; - if (Arrays.equals(n, bfd.name)) { - bfd.createdFields.add(exists); - continue top; - } + if (Arrays.equals(n, bfd.name)) field = exists; + if (bfd.nameOfSetFlag != null && Arrays.equals(n, bfd.nameOfSetFlag)) setFlag = exists; } - FieldDeclaration fd = new FieldDeclaration(bfd.name, 0, 0); - fd.bits |= Eclipse.ECLIPSE_DO_NOT_TOUCH_FLAG; - fd.modifiers = ClassFileConstants.AccPrivate; - fd.type = copyType(bfd.type); - fd.traverse(new SetGeneratedByVisitor(source), (MethodScope) null); - bfd.createdFields.add(injectFieldAndMarkGenerated(builderType, fd)); + if (field == null) { + FieldDeclaration fd = new FieldDeclaration(bfd.name, 0, 0); + fd.bits |= Eclipse.ECLIPSE_DO_NOT_TOUCH_FLAG; + fd.modifiers = ClassFileConstants.AccPrivate; + fd.type = copyType(bfd.type); + fd.traverse(new SetGeneratedByVisitor(source), (MethodScope) null); + field = injectFieldAndMarkGenerated(builderType, fd); + } + if (setFlag == null && bfd.nameOfSetFlag != null) { + FieldDeclaration fd = new FieldDeclaration(bfd.nameOfSetFlag, 0, 0); + fd.bits |= Eclipse.ECLIPSE_DO_NOT_TOUCH_FLAG; + fd.modifiers = ClassFileConstants.AccPrivate; + fd.type = TypeReference.baseTypeReference(TypeIds.T_boolean, 0); + fd.traverse(new SetGeneratedByVisitor(source), (MethodScope) null); + injectFieldAndMarkGenerated(builderType, fd); + } + bfd.createdFields.add(field); } } } @@ -789,14 +867,15 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { private static final AbstractMethodDeclaration[] EMPTY = {}; public void makeSetterMethodsForBuilder(EclipseNode builderType, BuilderFieldData bfd, EclipseNode sourceNode, boolean fluent, boolean chain) { + boolean deprecate = isFieldDeprecated(bfd.originalFieldNode); if (bfd.singularData == null || bfd.singularData.getSingularizer() == null) { - makeSimpleSetterMethodForBuilder(builderType, bfd.createdFields.get(0), sourceNode, fluent, chain); + makeSimpleSetterMethodForBuilder(builderType, deprecate, bfd.createdFields.get(0), bfd.nameOfSetFlag, sourceNode, fluent, chain); } else { - bfd.singularData.getSingularizer().generateMethods(bfd.singularData, builderType, fluent, chain); + bfd.singularData.getSingularizer().generateMethods(bfd.singularData, deprecate, builderType, fluent, chain); } } - private void makeSimpleSetterMethodForBuilder(EclipseNode builderType, EclipseNode fieldNode, EclipseNode sourceNode, boolean fluent, boolean chain) { + private void makeSimpleSetterMethodForBuilder(EclipseNode builderType, boolean deprecate, EclipseNode fieldNode, char[] nameOfSetFlag, EclipseNode sourceNode, boolean fluent, boolean chain) { TypeDeclaration td = (TypeDeclaration) builderType.get(); AbstractMethodDeclaration[] existing = td.methods; if (existing == null) existing = EMPTY; @@ -812,7 +891,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { String setterName = fluent ? fieldNode.getName() : HandlerUtil.buildAccessorName("set", fieldNode.getName()); - MethodDeclaration setter = HandleSetter.createSetter(td, fieldNode, setterName, chain, ClassFileConstants.AccPublic, + MethodDeclaration setter = HandleSetter.createSetter(td, deprecate, fieldNode, setterName, nameOfSetFlag, chain, ClassFileConstants.AccPublic, sourceNode, Collections.<Annotation>emptyList(), Collections.<Annotation>emptyList()); injectMethod(builderType, setter); } @@ -835,9 +914,7 @@ public class HandleBuilder extends EclipseAnnotationHandler<Builder> { if (isStatic) builder.modifiers |= ClassFileConstants.AccStatic; builder.typeParameters = copyTypeParams(typeParams, source); builder.name = builderClassName.toCharArray(); - if (parentBuilderClassName != null) { - builder.superclass = new SingleTypeReference(parentBuilderClassName.toCharArray(), 0); - } + if (parentBuilderClassName != null) builder.superclass = new SingleTypeReference(parentBuilderClassName.toCharArray(), 0); builder.traverse(new SetGeneratedByVisitor(source), (ClassScope) null); return injectType(tdParent, builder); } diff --git a/src/core/lombok/eclipse/handlers/HandleBuilderDefault.java b/src/core/lombok/eclipse/handlers/HandleBuilderDefault.java new file mode 100644 index 00000000..be2b986d --- /dev/null +++ b/src/core/lombok/eclipse/handlers/HandleBuilderDefault.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2017-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. + */ +package lombok.eclipse.handlers; + +import static lombok.eclipse.handlers.EclipseHandlerUtil.*; +import org.eclipse.jdt.internal.compiler.ast.Annotation; +import org.mangosdk.spi.ProviderFor; + +import lombok.Builder; +import lombok.core.AST.Kind; +import lombok.core.AnnotationValues; +import lombok.core.HandlerPriority; +import lombok.eclipse.EclipseAnnotationHandler; +import lombok.eclipse.EclipseNode; + +@ProviderFor(EclipseAnnotationHandler.class) +@HandlerPriority(-1025) //HandleBuilder's level, minus one. +public class HandleBuilderDefault extends EclipseAnnotationHandler<Builder.Default> { + @Override public void handle(AnnotationValues<Builder.Default> annotation, Annotation ast, EclipseNode annotationNode) { + EclipseNode annotatedField = annotationNode.up(); + if (annotatedField.getKind() != Kind.FIELD) return; + EclipseNode classWithAnnotatedField = annotatedField.up(); + if (!hasAnnotation(Builder.class, classWithAnnotatedField) && !hasAnnotation("lombok.experimental.Builder", classWithAnnotatedField)) { + annotationNode.addWarning("@Builder.Default requires @Builder on the class for it to mean anything."); + } + } +} diff --git a/src/core/lombok/eclipse/handlers/HandleConstructor.java b/src/core/lombok/eclipse/handlers/HandleConstructor.java index b504495d..a2940b88 100644 --- a/src/core/lombok/eclipse/handlers/HandleConstructor.java +++ b/src/core/lombok/eclipse/handlers/HandleConstructor.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2015 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 @@ -80,6 +80,8 @@ import org.mangosdk.spi.ProviderFor; public class HandleConstructor { @ProviderFor(EclipseAnnotationHandler.class) public static class HandleNoArgsConstructor extends EclipseAnnotationHandler<NoArgsConstructor> { + private HandleConstructor handleConstructor = new HandleConstructor(); + @Override public void handle(AnnotationValues<NoArgsConstructor> annotation, Annotation ast, EclipseNode annotationNode) { handleFlagUsage(annotationNode, ConfigurationKeys.NO_ARGS_CONSTRUCTOR_FLAG_USAGE, "@NoArgsConstructor", ConfigurationKeys.ANY_CONSTRUCTOR_FLAG_USAGE, "any @xArgsConstructor"); @@ -95,12 +97,14 @@ public class HandleConstructor { List<EclipseNode> fields = force ? findFinalFields(typeNode) : Collections.<EclipseNode>emptyList(); List<Annotation> onConstructor = unboxAndRemoveAnnotationParameter(ast, "onConstructor", "@NoArgsConstructor(onConstructor", annotationNode); - new HandleConstructor().generateConstructor(typeNode, level, fields, force, staticName, SkipIfConstructorExists.NO, onConstructor, annotationNode); + handleConstructor.generateConstructor(typeNode, level, fields, force, staticName, SkipIfConstructorExists.NO, onConstructor, annotationNode); } } @ProviderFor(EclipseAnnotationHandler.class) public static class HandleRequiredArgsConstructor extends EclipseAnnotationHandler<RequiredArgsConstructor> { + private HandleConstructor handleConstructor = new HandleConstructor(); + @Override public void handle(AnnotationValues<RequiredArgsConstructor> annotation, Annotation ast, EclipseNode annotationNode) { handleFlagUsage(annotationNode, ConfigurationKeys.REQUIRED_ARGS_CONSTRUCTOR_FLAG_USAGE, "@RequiredArgsConstructor", ConfigurationKeys.ANY_CONSTRUCTOR_FLAG_USAGE, "any @xArgsConstructor"); @@ -116,7 +120,7 @@ public class HandleConstructor { List<Annotation> onConstructor = unboxAndRemoveAnnotationParameter(ast, "onConstructor", "@RequiredArgsConstructor(onConstructor", annotationNode); - new HandleConstructor().generateConstructor( + handleConstructor.generateConstructor( typeNode, level, findRequiredFields(typeNode), false, staticName, SkipIfConstructorExists.NO, onConstructor, annotationNode); } @@ -144,14 +148,17 @@ public class HandleConstructor { } static List<EclipseNode> findAllFields(EclipseNode typeNode) { + return findAllFields(typeNode, false); + } + + static List<EclipseNode> findAllFields(EclipseNode typeNode, boolean evenFinalInitialized) { List<EclipseNode> fields = new ArrayList<EclipseNode>(); for (EclipseNode child : typeNode.down()) { if (child.getKind() != Kind.FIELD) continue; FieldDeclaration fieldDecl = (FieldDeclaration) child.get(); if (!filterField(fieldDecl)) continue; - // Skip initialized final fields. - if (((fieldDecl.modifiers & ClassFileConstants.AccFinal) != 0) && fieldDecl.initialization != null) continue; + if (!evenFinalInitialized && ((fieldDecl.modifiers & ClassFileConstants.AccFinal) != 0) && fieldDecl.initialization != null) continue; fields.add(child); } @@ -160,6 +167,8 @@ public class HandleConstructor { @ProviderFor(EclipseAnnotationHandler.class) public static class HandleAllArgsConstructor extends EclipseAnnotationHandler<AllArgsConstructor> { + private HandleConstructor handleConstructor = new HandleConstructor(); + @Override public void handle(AnnotationValues<AllArgsConstructor> annotation, Annotation ast, EclipseNode annotationNode) { handleFlagUsage(annotationNode, ConfigurationKeys.ALL_ARGS_CONSTRUCTOR_FLAG_USAGE, "@AllArgsConstructor", ConfigurationKeys.ANY_CONSTRUCTOR_FLAG_USAGE, "any @xArgsConstructor"); @@ -175,7 +184,7 @@ public class HandleConstructor { List<Annotation> onConstructor = unboxAndRemoveAnnotationParameter(ast, "onConstructor", "@AllArgsConstructor(onConstructor", annotationNode); - new HandleConstructor().generateConstructor( + handleConstructor.generateConstructor( typeNode, level, findAllFields(typeNode), false, staticName, SkipIfConstructorExists.NO, onConstructor, annotationNode); } @@ -290,7 +299,7 @@ public class HandleConstructor { return new Annotation[] { ann }; } - public static ConstructorDeclaration createConstructor( + @SuppressWarnings("deprecation") public static ConstructorDeclaration createConstructor( AccessLevel level, EclipseNode type, Collection<EclipseNode> fields, boolean allToDefault, EclipseNode sourceNode, List<Annotation> onConstructor) { @@ -302,11 +311,13 @@ public class HandleConstructor { if (isEnum) level = AccessLevel.PRIVATE; - boolean suppressConstructorProperties; + boolean addConstructorProperties; if (fields.isEmpty()) { - suppressConstructorProperties = false; + addConstructorProperties = false; } else { - suppressConstructorProperties = Boolean.TRUE.equals(type.getAst().readConfiguration(ConfigurationKeys.ANY_CONSTRUCTOR_SUPPRESS_CONSTRUCTOR_PROPERTIES)); + Boolean v = type.getAst().readConfiguration(ConfigurationKeys.ANY_CONSTRUCTOR_ADD_CONSTRUCTOR_PROPERTIES); + addConstructorProperties = v != null ? v.booleanValue() : + Boolean.FALSE.equals(type.getAst().readConfiguration(ConfigurationKeys.ANY_CONSTRUCTOR_SUPPRESS_CONSTRUCTOR_PROPERTIES)); } ConstructorDeclaration constructor = new ConstructorDeclaration(((CompilationUnitDeclaration) type.top().get()).compilationResult); @@ -347,7 +358,7 @@ public class HandleConstructor { Annotation[] nonNulls = findAnnotations(field, NON_NULL_PATTERN); Annotation[] nullables = findAnnotations(field, NULLABLE_PATTERN); if (nonNulls.length != 0) { - Statement nullCheck = generateNullCheck(field, sourceNode); + Statement nullCheck = generateNullCheck(parameter, sourceNode); if (nullCheck != null) nullChecks.add(nullCheck); } parameter.annotations = copyAnnotations(source, nonNulls, nullables); @@ -361,7 +372,7 @@ public class HandleConstructor { /* Generate annotations that must be put on the generated method, and attach them. */ { Annotation[] constructorProperties = null; - if (!allToDefault && !suppressConstructorProperties && level != AccessLevel.PRIVATE && level != AccessLevel.PACKAGE && !isLocalType(type)) { + if (!allToDefault && addConstructorProperties && !isLocalType(type)) { constructorProperties = createConstructorProperties(source, fields); } diff --git a/src/core/lombok/eclipse/handlers/HandleData.java b/src/core/lombok/eclipse/handlers/HandleData.java index 0ff65a47..025ceefd 100644 --- a/src/core/lombok/eclipse/handlers/HandleData.java +++ b/src/core/lombok/eclipse/handlers/HandleData.java @@ -43,6 +43,12 @@ import org.mangosdk.spi.ProviderFor; */ @ProviderFor(EclipseAnnotationHandler.class) public class HandleData extends EclipseAnnotationHandler<Data> { + private HandleGetter handleGetter = new HandleGetter(); + private HandleSetter handleSetter = new HandleSetter(); + private HandleEqualsAndHashCode handleEqualsAndHashCode = new HandleEqualsAndHashCode(); + private HandleToString handleToString = new HandleToString(); + private HandleConstructor handleConstructor = new HandleConstructor(); + @Override public void handle(AnnotationValues<Data> annotation, Annotation ast, EclipseNode annotationNode) { handleFlagUsage(annotationNode, ConfigurationKeys.DATA_FLAG_USAGE, "@Data"); @@ -66,11 +72,11 @@ public class HandleData extends EclipseAnnotationHandler<Data> { //for whatever reason, though you can find callers of that one by focusing on the class name itself //and hitting 'find callers'. - new HandleGetter().generateGetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true); - new HandleSetter().generateSetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true); - new HandleEqualsAndHashCode().generateEqualsAndHashCodeForType(typeNode, annotationNode); - new HandleToString().generateToStringForType(typeNode, annotationNode); - new HandleConstructor().generateRequiredArgsConstructor( + handleGetter.generateGetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true); + handleSetter.generateSetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true); + handleEqualsAndHashCode.generateEqualsAndHashCodeForType(typeNode, annotationNode); + handleToString.generateToStringForType(typeNode, annotationNode); + handleConstructor.generateRequiredArgsConstructor( typeNode, AccessLevel.PUBLIC, ann.staticConstructor(), SkipIfConstructorExists.YES, Collections.<Annotation>emptyList(), annotationNode); } diff --git a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java index ceef3d3c..75339f7c 100644 --- a/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java +++ b/src/core/lombok/eclipse/handlers/HandleEqualsAndHashCode.java @@ -118,7 +118,10 @@ public class HandleEqualsAndHashCode extends EclipseAnnotationHandler<EqualsAndH return; } - generateMethods(typeNode, errorNode, null, null, null, false, FieldAccess.GETTER, new ArrayList<Annotation>()); + Boolean doNotUseGettersConfiguration = typeNode.getAst().readConfiguration(ConfigurationKeys.EQUALS_AND_HASH_CODE_DO_NOT_USE_GETTERS); + FieldAccess access = doNotUseGettersConfiguration == null || !doNotUseGettersConfiguration ? FieldAccess.GETTER : FieldAccess.PREFER_FIELD; + + generateMethods(typeNode, errorNode, null, null, null, false, access, new ArrayList<Annotation>()); } @Override public void handle(AnnotationValues<EqualsAndHashCode> annotation, Annotation ast, EclipseNode annotationNode) { @@ -296,7 +299,7 @@ public class HandleEqualsAndHashCode extends EclipseAnnotationHandler<EqualsAndH /* final int PRIME = X; */ { /* Without fields, PRIME isn't used, and that would trigger a 'local variable not used' warning. */ - if (!isEmpty || callSuper) { + if (!isEmpty) { LocalDeclaration primeDecl = new LocalDeclaration(PRIME, pS, pE); setGeneratedBy(primeDecl, source); primeDecl.modifiers |= Modifier.FINAL; @@ -308,26 +311,30 @@ public class HandleEqualsAndHashCode extends EclipseAnnotationHandler<EqualsAndH } } - /* int result = 1; */ { - LocalDeclaration resultDecl = new LocalDeclaration(RESULT, pS, pE); + /*int result = ... */{ + LocalDeclaration resultDecl = new LocalDeclaration(RESULT, pS, pE); setGeneratedBy(resultDecl, source); - resultDecl.initialization = makeIntLiteral("1".toCharArray(), source); + final Expression init; + if (callSuper) { + /* ... super.hashCode(); */ + MessageSend callToSuper = new MessageSend(); + setGeneratedBy(callToSuper, source); + callToSuper.sourceStart = pS; callToSuper.sourceEnd = pE; + callToSuper.receiver = new SuperReference(pS, pE); + setGeneratedBy(callToSuper.receiver, source); + callToSuper.selector = "hashCode".toCharArray(); + init = callToSuper; + } else { + /* ... 1; */ + init = makeIntLiteral("1".toCharArray(), source); + } + resultDecl.initialization = init; resultDecl.type = TypeReference.baseTypeReference(TypeIds.T_int, 0); resultDecl.type.sourceStart = pS; resultDecl.type.sourceEnd = pE; setGeneratedBy(resultDecl.type, source); statements.add(resultDecl); } - if (callSuper) { - MessageSend callToSuper = new MessageSend(); - setGeneratedBy(callToSuper, source); - callToSuper.sourceStart = pS; callToSuper.sourceEnd = pE; - callToSuper.receiver = new SuperReference(pS, pE); - setGeneratedBy(callToSuper.receiver, source); - callToSuper.selector = "hashCode".toCharArray(); - statements.add(createResultCalculation(source, callToSuper)); - } - for (EclipseNode field : fields) { TypeReference fType = getFieldType(field, fieldAccess); char[] dollarFieldName = ("$" + field.getName()).toCharArray(); @@ -468,47 +475,62 @@ public class HandleEqualsAndHashCode extends EclipseAnnotationHandler<EqualsAndH public TypeReference createTypeReference(EclipseNode type, long p, ASTNode source, boolean addWildcards) { int pS = source.sourceStart; int pE = source.sourceEnd; List<String> list = new ArrayList<String>(); + List<Integer> genericsCount = addWildcards ? new ArrayList<Integer>() : null; + list.add(type.getName()); + if (addWildcards) genericsCount.add(arraySizeOf(((TypeDeclaration) type.get()).typeParameters)); + boolean staticContext = (((TypeDeclaration) type.get()).modifiers & Modifier.STATIC) != 0; EclipseNode tNode = type.up(); + while (tNode != null && tNode.getKind() == Kind.TYPE) { list.add(tNode.getName()); + if (addWildcards) genericsCount.add(staticContext ? 0 : arraySizeOf(((TypeDeclaration) tNode.get()).typeParameters)); + if (!staticContext) staticContext = (((TypeDeclaration) tNode.get()).modifiers & Modifier.STATIC) != 0; tNode = tNode.up(); } Collections.reverse(list); - - TypeDeclaration typeDecl = (TypeDeclaration) type.get(); - int typeParamCount = typeDecl.typeParameters == null ? 0 : typeDecl.typeParameters.length; - if (typeParamCount == 0) addWildcards = false; - TypeReference[] typeArgs = null; - if (addWildcards) { - typeArgs = new TypeReference[typeParamCount]; - for (int i = 0; i < typeParamCount; i++) { - typeArgs[i] = new Wildcard(Wildcard.UNBOUND); - typeArgs[i].sourceStart = pS; typeArgs[i].sourceEnd = pE; - setGeneratedBy(typeArgs[i], source); - } - } + if (addWildcards) Collections.reverse(genericsCount); if (list.size() == 1) { - if (addWildcards) { - return new ParameterizedSingleTypeReference(list.get(0).toCharArray(), typeArgs, 0, p); - } else { + if (!addWildcards || genericsCount.get(0) == 0) { return new SingleTypeReference(list.get(0).toCharArray(), p); + } else { + return new ParameterizedSingleTypeReference(list.get(0).toCharArray(), wildcardify(pS, pE, source, genericsCount.get(0)), 0, p); } } + + if (addWildcards) { + addWildcards = false; + for (int i : genericsCount) if (i > 0) addWildcards = true; + } + long[] ps = new long[list.size()]; char[][] tokens = new char[list.size()][]; for (int i = 0; i < list.size(); i++) { ps[i] = p; tokens[i] = list.get(i).toCharArray(); } - if (addWildcards) { - TypeReference[][] typeArgs2 = new TypeReference[tokens.length][]; - typeArgs2[typeArgs2.length - 1] = typeArgs; - return new ParameterizedQualifiedTypeReference(tokens, typeArgs2, 0, ps); - } else { - return new QualifiedTypeReference(tokens, ps); + + if (!addWildcards) return new QualifiedTypeReference(tokens, ps); + TypeReference[][] typeArgs2 = new TypeReference[tokens.length][]; + for (int i = 0; i < tokens.length; i++) typeArgs2[i] = wildcardify(pS, pE, source, genericsCount.get(i)); + return new ParameterizedQualifiedTypeReference(tokens, typeArgs2, 0, ps); + } + + private TypeReference[] wildcardify(int pS, int pE, ASTNode source, int count) { + if (count == 0) return null; + TypeReference[] typeArgs = new TypeReference[count]; + for (int i = 0; i < count; i++) { + typeArgs[i] = new Wildcard(Wildcard.UNBOUND); + typeArgs[i].sourceStart = pS; typeArgs[i].sourceEnd = pE; + setGeneratedBy(typeArgs[i], source); } + + return typeArgs; + } + + private int arraySizeOf(Object[] arr) { + return arr == null ? 0 : arr.length; } public MethodDeclaration createEquals(EclipseNode type, Collection<EclipseNode> fields, boolean callSuper, ASTNode source, FieldAccess fieldAccess, boolean needsCanEqual, List<Annotation> onParam) { @@ -676,7 +698,7 @@ public class HandleEqualsAndHashCode extends EclipseAnnotationHandler<EqualsAndH } else /* objects */ { /* final java.lang.Object this$fieldName = this.fieldName; */ /* final java.lang.Object other$fieldName = other.fieldName; */ - /* if (this$fieldName == null ? other$fieldName != null : !this$fieldName.equals(other$fieldName)) return false;; */ + /* if (this$fieldName == null ? other$fieldName != null : !this$fieldName.equals(other$fieldName)) return false; */ char[] thisDollarFieldName = ("this$" + field.getName()).toCharArray(); char[] otherDollarFieldName = ("other$" + field.getName()).toCharArray(); diff --git a/src/core/lombok/eclipse/handlers/HandleGetter.java b/src/core/lombok/eclipse/handlers/HandleGetter.java index c11303f3..f417aca5 100644 --- a/src/core/lombok/eclipse/handlers/HandleGetter.java +++ b/src/core/lombok/eclipse/handlers/HandleGetter.java @@ -105,7 +105,7 @@ public class HandleGetter extends EclipseAnnotationHandler<Getter> { return true; } - public boolean fieldQualifiesForGetterGeneration(EclipseNode field) { + public static boolean fieldQualifiesForGetterGeneration(EclipseNode field) { if (field.getKind() != Kind.FIELD) return false; FieldDeclaration fieldDecl = (FieldDeclaration) field.get(); return filterField(fieldDecl); diff --git a/src/core/lombok/eclipse/handlers/HandleSetter.java b/src/core/lombok/eclipse/handlers/HandleSetter.java index 7e7ea121..6a9a5123 100644 --- a/src/core/lombok/eclipse/handlers/HandleSetter.java +++ b/src/core/lombok/eclipse/handlers/HandleSetter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2014 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -52,6 +52,7 @@ import org.eclipse.jdt.internal.compiler.ast.ReturnStatement; import org.eclipse.jdt.internal.compiler.ast.SingleNameReference; import org.eclipse.jdt.internal.compiler.ast.Statement; import org.eclipse.jdt.internal.compiler.ast.ThisReference; +import org.eclipse.jdt.internal.compiler.ast.TrueLiteral; import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.eclipse.jdt.internal.compiler.ast.TypeReference; import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; @@ -192,11 +193,11 @@ public class HandleSetter extends EclipseAnnotationHandler<Setter> { } } - MethodDeclaration method = createSetter((TypeDeclaration) fieldNode.up().get(), fieldNode, setterName, shouldReturnThis, modifier, sourceNode, onMethod, onParam); + MethodDeclaration method = createSetter((TypeDeclaration) fieldNode.up().get(), false, fieldNode, setterName, null, shouldReturnThis, modifier, sourceNode, onMethod, onParam); injectMethod(fieldNode.up(), method); } - static MethodDeclaration createSetter(TypeDeclaration parent, EclipseNode fieldNode, String name, boolean shouldReturnThis, int modifier, EclipseNode sourceNode, List<Annotation> onMethod, List<Annotation> onParam) { + static MethodDeclaration createSetter(TypeDeclaration parent, boolean deprecate, EclipseNode fieldNode, String name, char[] booleanFieldToSet, boolean shouldReturnThis, int modifier, EclipseNode sourceNode, List<Annotation> onMethod, List<Annotation> onParam) { FieldDeclaration field = (FieldDeclaration) fieldNode.get(); ASTNode source = sourceNode.get(); int pS = source.sourceStart, pE = source.sourceEnd; @@ -213,7 +214,7 @@ public class HandleSetter extends EclipseAnnotationHandler<Setter> { shouldReturnThis = false; } Annotation[] deprecated = null; - if (isFieldDeprecated(fieldNode)) { + if (isFieldDeprecated(fieldNode) || deprecate) { deprecated = new Annotation[] { generateDeprecatedAnnotation(source) }; } method.annotations = copyAnnotations(source, onMethod.toArray(new Annotation[0]), deprecated); @@ -243,6 +244,10 @@ public class HandleSetter extends EclipseAnnotationHandler<Setter> { statements.add(assignment); } + if (booleanFieldToSet != null) { + statements.add(new Assignment(new SingleNameReference(booleanFieldToSet, p), new TrueLiteral(pS, pE), pE)); + } + if (shouldReturnThis) { ThisReference thisRef = new ThisReference(pS, pE); ReturnStatement returnThis = new ReturnStatement(thisRef, pS, pE); diff --git a/src/core/lombok/eclipse/handlers/HandleToString.java b/src/core/lombok/eclipse/handlers/HandleToString.java index a4ed254a..d8f4c569 100644 --- a/src/core/lombok/eclipse/handlers/HandleToString.java +++ b/src/core/lombok/eclipse/handlers/HandleToString.java @@ -94,7 +94,11 @@ public class HandleToString extends EclipseAnnotationHandler<ToString> { Boolean configuration = typeNode.getAst().readConfiguration(ConfigurationKeys.TO_STRING_INCLUDE_FIELD_NAMES); includeFieldNames = configuration != null ? configuration : ((Boolean)ToString.class.getMethod("includeFieldNames").getDefaultValue()).booleanValue(); } catch (Exception ignore) {} - generateToString(typeNode, errorNode, null, null, includeFieldNames, null, false, FieldAccess.GETTER); + + Boolean doNotUseGettersConfiguration = typeNode.getAst().readConfiguration(ConfigurationKeys.TO_STRING_DO_NOT_USE_GETTERS); + FieldAccess access = doNotUseGettersConfiguration == null || !doNotUseGettersConfiguration ? FieldAccess.GETTER : FieldAccess.PREFER_FIELD; + + generateToString(typeNode, errorNode, null, null, includeFieldNames, null, false, access); } public void handle(AnnotationValues<ToString> annotation, Annotation ast, EclipseNode annotationNode) { diff --git a/src/core/lombok/eclipse/handlers/HandleVal.java b/src/core/lombok/eclipse/handlers/HandleVal.java index d8901067..3742ac00 100644 --- a/src/core/lombok/eclipse/handlers/HandleVal.java +++ b/src/core/lombok/eclipse/handlers/HandleVal.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2016 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 @@ -25,13 +25,14 @@ import static lombok.core.handlers.HandlerUtil.handleFlagUsage; import static lombok.eclipse.handlers.EclipseHandlerUtil.typeMatches; import lombok.ConfigurationKeys; import lombok.val; +import lombok.var; import lombok.core.HandlerPriority; import lombok.eclipse.DeferUntilPostDiet; import lombok.eclipse.EclipseASTAdapter; import lombok.eclipse.EclipseASTVisitor; import lombok.eclipse.EclipseNode; -import lombok.experimental.var; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.ast.ArrayInitializer; import org.eclipse.jdt.internal.compiler.ast.ForStatement; import org.eclipse.jdt.internal.compiler.ast.ForeachStatement; @@ -74,11 +75,18 @@ public class HandleVal extends EclipseASTAdapter { return; } - if (isVal && localNode.directUp().get() instanceof ForStatement) { + ASTNode parentRaw = localNode.directUp().get(); + + if (isVal && parentRaw instanceof ForStatement) { localNode.addError("'val' is not allowed in old-style for loops"); return; } + if (parentRaw instanceof ForStatement && ((ForStatement) parentRaw).initializations != null && ((ForStatement) parentRaw).initializations.length > 1) { + localNode.addError("'var' is not allowed in old-style for loops if there is more than 1 initializer"); + return; + } + if (local.initialization != null && local.initialization.getClass().getName().equals("org.eclipse.jdt.internal.compiler.ast.LambdaExpression")) { localNode.addError("'" + annotation + "' is not allowed with lambda expressions."); return; diff --git a/src/core/lombok/eclipse/handlers/HandleValue.java b/src/core/lombok/eclipse/handlers/HandleValue.java index 79c11771..a61ca6c3 100644 --- a/src/core/lombok/eclipse/handlers/HandleValue.java +++ b/src/core/lombok/eclipse/handlers/HandleValue.java @@ -47,6 +47,12 @@ import org.mangosdk.spi.ProviderFor; @ProviderFor(EclipseAnnotationHandler.class) @HandlerPriority(-512) //-2^9; to ensure @EqualsAndHashCode and such pick up on this handler making the class final and messing with the fields' access levels, run earlier. public class HandleValue extends EclipseAnnotationHandler<Value> { + private HandleFieldDefaults handleFieldDefaults = new HandleFieldDefaults(); + private HandleGetter handleGetter = new HandleGetter(); + private HandleEqualsAndHashCode handleEqualsAndHashCode = new HandleEqualsAndHashCode(); + private HandleToString handleToString = new HandleToString(); + private HandleConstructor handleConstructor = new HandleConstructor(); + public void handle(AnnotationValues<Value> annotation, Annotation ast, EclipseNode annotationNode) { handleFlagUsage(annotationNode, ConfigurationKeys.VALUE_FLAG_USAGE, "@Value"); @@ -72,7 +78,7 @@ public class HandleValue extends EclipseAnnotationHandler<Value> { } } - new HandleFieldDefaults().generateFieldDefaultsForType(typeNode, annotationNode, AccessLevel.PRIVATE, true, true); + handleFieldDefaults.generateFieldDefaultsForType(typeNode, annotationNode, AccessLevel.PRIVATE, true, true); //Careful: Generate the public static constructor (if there is one) LAST, so that any attempt to //'find callers' on the annotation node will find callers of the constructor, which is by far the @@ -80,10 +86,10 @@ public class HandleValue extends EclipseAnnotationHandler<Value> { //for whatever reason, though you can find callers of that one by focusing on the class name itself //and hitting 'find callers'. - new HandleGetter().generateGetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true); - new HandleEqualsAndHashCode().generateEqualsAndHashCodeForType(typeNode, annotationNode); - new HandleToString().generateToStringForType(typeNode, annotationNode); - new HandleConstructor().generateAllArgsConstructor(typeNode, AccessLevel.PUBLIC, ann.staticConstructor(), SkipIfConstructorExists.YES, + handleGetter.generateGetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true); + handleEqualsAndHashCode.generateEqualsAndHashCodeForType(typeNode, annotationNode); + handleToString.generateToStringForType(typeNode, annotationNode); + handleConstructor.generateAllArgsConstructor(typeNode, AccessLevel.PUBLIC, ann.staticConstructor(), SkipIfConstructorExists.YES, Collections.<Annotation>emptyList(), annotationNode); } } diff --git a/src/core/lombok/eclipse/handlers/SetGeneratedByVisitor.java b/src/core/lombok/eclipse/handlers/SetGeneratedByVisitor.java index b42761f4..89964914 100644 --- a/src/core/lombok/eclipse/handlers/SetGeneratedByVisitor.java +++ b/src/core/lombok/eclipse/handlers/SetGeneratedByVisitor.java @@ -369,11 +369,6 @@ public final class SetGeneratedByVisitor extends ASTVisitor { return super.visit(node, scope); } - @Override public boolean visit(ArrayInitializer node, ClassScope scope) { - fixPositions(setGeneratedBy(node, source)); - return super.visit(node, scope); - } - @Override public boolean visit(ArrayQualifiedTypeReference node, BlockScope scope) { fixPositions(setGeneratedBy(node, source)); return super.visit(node, scope); diff --git a/src/core/lombok/eclipse/handlers/singulars/EclipseGuavaSingularizer.java b/src/core/lombok/eclipse/handlers/singulars/EclipseGuavaSingularizer.java index d9f4cb73..eb2c9b35 100644 --- a/src/core/lombok/eclipse/handlers/singulars/EclipseGuavaSingularizer.java +++ b/src/core/lombok/eclipse/handlers/singulars/EclipseGuavaSingularizer.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 The Project Lombok Authors. + * Copyright (C) 2015-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 @@ -35,6 +35,7 @@ import lombok.eclipse.EclipseNode; import lombok.eclipse.handlers.EclipseSingularsRecipes.EclipseSingularizer; import lombok.eclipse.handlers.EclipseSingularsRecipes.SingularData; +import org.eclipse.jdt.internal.compiler.ast.Annotation; import org.eclipse.jdt.internal.compiler.ast.Argument; import org.eclipse.jdt.internal.compiler.ast.Assignment; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; @@ -96,21 +97,21 @@ abstract class EclipseGuavaSingularizer extends EclipseSingularizer { return Collections.singletonList(injectFieldAndMarkGenerated(builderType, buildField)); } - @Override public void generateMethods(SingularData data, EclipseNode builderType, boolean fluent, boolean chain) { + @Override public void generateMethods(SingularData data, boolean deprecate, EclipseNode builderType, boolean fluent, boolean chain) { TypeReference returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0); Statement returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null; - generateSingularMethod(returnType, returnStatement, data, builderType, fluent); + generateSingularMethod(deprecate, returnType, returnStatement, data, builderType, fluent); returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0); returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null; - generatePluralMethod(returnType, returnStatement, data, builderType, fluent); + generatePluralMethod(deprecate, returnType, returnStatement, data, builderType, fluent); returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0); returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null; - generateClearMethod(returnType, returnStatement, data, builderType); + generateClearMethod(deprecate, returnType, returnStatement, data, builderType); } - void generateClearMethod(TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType) { + void generateClearMethod(boolean deprecate, TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType) { MethodDeclaration md = new MethodDeclaration(((CompilationUnitDeclaration) builderType.top().get()).compilationResult); md.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; md.modifiers = ClassFileConstants.AccPublic; @@ -121,10 +122,12 @@ abstract class EclipseGuavaSingularizer extends EclipseSingularizer { md.selector = HandlerUtil.buildAccessorName("clear", new String(data.getPluralName())).toCharArray(); md.statements = returnStatement != null ? new Statement[] {a, returnStatement} : new Statement[] {a}; md.returnType = returnType; + md.annotations = deprecate ? new Annotation[] { generateDeprecatedAnnotation(data.getSource()) } : null; + injectMethod(builderType, md); } - void generateSingularMethod(TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType, boolean fluent) { + void generateSingularMethod(boolean deprecate, TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType, boolean fluent) { LombokImmutableList<String> suffixes = getArgumentSuffixes(); char[][] names = new char[suffixes.size()][]; for (int i = 0; i < suffixes.size(); i++) { @@ -159,12 +162,13 @@ abstract class EclipseGuavaSingularizer extends EclipseSingularizer { } md.returnType = returnType; md.selector = fluent ? data.getSingularName() : HandlerUtil.buildAccessorName(getAddMethodName(), new String(data.getSingularName())).toCharArray(); + md.annotations = deprecate ? new Annotation[] { generateDeprecatedAnnotation(data.getSource()) } : null; data.setGeneratedByRecursive(md); injectMethod(builderType, md); } - void generatePluralMethod(TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType, boolean fluent) { + void generatePluralMethod(boolean deprecate, TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType, boolean fluent) { MethodDeclaration md = new MethodDeclaration(((CompilationUnitDeclaration) builderType.top().get()).compilationResult); md.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; md.modifiers = ClassFileConstants.AccPublic; @@ -190,6 +194,7 @@ abstract class EclipseGuavaSingularizer extends EclipseSingularizer { md.arguments = new Argument[] {param}; md.returnType = returnType; md.selector = fluent ? data.getPluralName() : HandlerUtil.buildAccessorName(getAddMethodName() + "All", new String(data.getPluralName())).toCharArray(); + md.annotations = deprecate ? new Annotation[] { generateDeprecatedAnnotation(data.getSource()) } : null; data.setGeneratedByRecursive(md); injectMethod(builderType, md); diff --git a/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilListSetSingularizer.java b/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilListSetSingularizer.java index 2d8083d3..cfa48eaf 100644 --- a/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilListSetSingularizer.java +++ b/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilListSetSingularizer.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 The Project Lombok Authors. + * Copyright (C) 2015-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 @@ -32,6 +32,7 @@ import lombok.core.handlers.HandlerUtil; import lombok.eclipse.EclipseNode; import lombok.eclipse.handlers.EclipseSingularsRecipes.SingularData; +import org.eclipse.jdt.internal.compiler.ast.Annotation; import org.eclipse.jdt.internal.compiler.ast.Argument; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; import org.eclipse.jdt.internal.compiler.ast.EqualExpression; @@ -87,26 +88,26 @@ abstract class EclipseJavaUtilListSetSingularizer extends EclipseJavaUtilSingula return Collections.singletonList(injectFieldAndMarkGenerated(builderType, buildField)); } - @Override public void generateMethods(SingularData data, EclipseNode builderType, boolean fluent, boolean chain) { + @Override public void generateMethods(SingularData data, boolean deprecate, EclipseNode builderType, boolean fluent, boolean chain) { if (useGuavaInstead(builderType)) { - guavaListSetSingularizer.generateMethods(data, builderType, fluent, chain); + guavaListSetSingularizer.generateMethods(data, deprecate, builderType, fluent, chain); return; } TypeReference returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0); Statement returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null; - generateSingularMethod(returnType, returnStatement, data, builderType, fluent); + generateSingularMethod(deprecate, returnType, returnStatement, data, builderType, fluent); returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0); returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null; - generatePluralMethod(returnType, returnStatement, data, builderType, fluent); + generatePluralMethod(deprecate, returnType, returnStatement, data, builderType, fluent); returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0); returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null; - generateClearMethod(returnType, returnStatement, data, builderType); + generateClearMethod(deprecate, returnType, returnStatement, data, builderType); } - private void generateClearMethod(TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType) { + private void generateClearMethod(boolean deprecate, TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType) { MethodDeclaration md = new MethodDeclaration(((CompilationUnitDeclaration) builderType.top().get()).compilationResult); md.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; md.modifiers = ClassFileConstants.AccPublic; @@ -122,10 +123,11 @@ abstract class EclipseJavaUtilListSetSingularizer extends EclipseJavaUtilSingula Statement clearStatement = new IfStatement(new EqualExpression(thisDotField, new NullLiteral(0, 0), OperatorIds.NOT_EQUAL), clearMsg, 0, 0); md.statements = returnStatement != null ? new Statement[] {clearStatement, returnStatement} : new Statement[] {clearStatement}; md.returnType = returnType; + md.annotations = deprecate ? new Annotation[] { generateDeprecatedAnnotation(data.getSource()) } : null; injectMethod(builderType, md); } - void generateSingularMethod(TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType, boolean fluent) { + void generateSingularMethod(boolean deprecate, TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType, boolean fluent) { MethodDeclaration md = new MethodDeclaration(((CompilationUnitDeclaration) builderType.top().get()).compilationResult); md.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; md.modifiers = ClassFileConstants.AccPublic; @@ -148,12 +150,13 @@ abstract class EclipseJavaUtilListSetSingularizer extends EclipseJavaUtilSingula md.arguments = new Argument[] {param}; md.returnType = returnType; md.selector = fluent ? data.getSingularName() : HandlerUtil.buildAccessorName("add", new String(data.getSingularName())).toCharArray(); + md.annotations = deprecate ? new Annotation[] { generateDeprecatedAnnotation(data.getSource()) } : null; data.setGeneratedByRecursive(md); injectMethod(builderType, md); } - void generatePluralMethod(TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType, boolean fluent) { + void generatePluralMethod(boolean deprecate, TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType, boolean fluent) { MethodDeclaration md = new MethodDeclaration(((CompilationUnitDeclaration) builderType.top().get()).compilationResult); md.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; md.modifiers = ClassFileConstants.AccPublic; @@ -178,6 +181,7 @@ abstract class EclipseJavaUtilListSetSingularizer extends EclipseJavaUtilSingula md.arguments = new Argument[] {param}; md.returnType = returnType; md.selector = fluent ? data.getPluralName() : HandlerUtil.buildAccessorName("addAll", new String(data.getPluralName())).toCharArray(); + md.annotations = deprecate ? new Annotation[] { generateDeprecatedAnnotation(data.getSource()) } : null; data.setGeneratedByRecursive(md); injectMethod(builderType, md); diff --git a/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilMapSingularizer.java b/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilMapSingularizer.java index 3d7b05ed..ee0e6409 100644 --- a/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilMapSingularizer.java +++ b/src/core/lombok/eclipse/handlers/singulars/EclipseJavaUtilMapSingularizer.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 The Project Lombok Authors. + * Copyright (C) 2015-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 @@ -29,6 +29,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; +import org.eclipse.jdt.internal.compiler.ast.Annotation; import org.eclipse.jdt.internal.compiler.ast.Argument; import org.eclipse.jdt.internal.compiler.ast.Block; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; @@ -132,26 +133,26 @@ public class EclipseJavaUtilMapSingularizer extends EclipseJavaUtilSingularizer return Arrays.asList(keyFieldNode, valueFieldNode); } - @Override public void generateMethods(SingularData data, EclipseNode builderType, boolean fluent, boolean chain) { + @Override public void generateMethods(SingularData data, boolean deprecate, EclipseNode builderType, boolean fluent, boolean chain) { if (useGuavaInstead(builderType)) { - guavaMapSingularizer.generateMethods(data, builderType, fluent, chain); + guavaMapSingularizer.generateMethods(data, deprecate, builderType, fluent, chain); return; } TypeReference returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0); Statement returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null; - generateSingularMethod(returnType, returnStatement, data, builderType, fluent); + generateSingularMethod(deprecate, returnType, returnStatement, data, builderType, fluent); returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0); returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null; - generatePluralMethod(returnType, returnStatement, data, builderType, fluent); + generatePluralMethod(deprecate, returnType, returnStatement, data, builderType, fluent); returnType = chain ? cloneSelfType(builderType) : TypeReference.baseTypeReference(TypeIds.T_void, 0); returnStatement = chain ? new ReturnStatement(new ThisReference(0, 0), 0, 0) : null; - generateClearMethod(returnType, returnStatement, data, builderType); + generateClearMethod(deprecate, returnType, returnStatement, data, builderType); } - private void generateClearMethod(TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType) { + private void generateClearMethod(boolean deprecate, TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType) { MethodDeclaration md = new MethodDeclaration(((CompilationUnitDeclaration) builderType.top().get()).compilationResult); md.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; md.modifiers = ClassFileConstants.AccPublic; @@ -178,10 +179,12 @@ public class EclipseJavaUtilMapSingularizer extends EclipseJavaUtilSingularizer Statement clearStatement = new IfStatement(new EqualExpression(thisDotField, new NullLiteral(0, 0), OperatorIds.NOT_EQUAL), clearMsgs, 0, 0); md.statements = returnStatement != null ? new Statement[] {clearStatement, returnStatement} : new Statement[] {clearStatement}; md.returnType = returnType; + md.annotations = deprecate ? new Annotation[] { generateDeprecatedAnnotation(data.getSource()) } : null; + injectMethod(builderType, md); } - private void generateSingularMethod(TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType, boolean fluent) { + private void generateSingularMethod(boolean deprecate, TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType, boolean fluent) { MethodDeclaration md = new MethodDeclaration(((CompilationUnitDeclaration) builderType.top().get()).compilationResult); md.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; md.modifiers = ClassFileConstants.AccPublic; @@ -225,12 +228,13 @@ public class EclipseJavaUtilMapSingularizer extends EclipseJavaUtilSingularizer md.arguments = new Argument[] {keyParam, valueParam}; md.returnType = returnType; md.selector = fluent ? data.getSingularName() : HandlerUtil.buildAccessorName("put", new String(data.getSingularName())).toCharArray(); + md.annotations = deprecate ? new Annotation[] { generateDeprecatedAnnotation(data.getSource()) } : null; data.setGeneratedByRecursive(md); injectMethod(builderType, md); } - private void generatePluralMethod(TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType, boolean fluent) { + private void generatePluralMethod(boolean deprecate, TypeReference returnType, Statement returnStatement, SingularData data, EclipseNode builderType, boolean fluent) { MethodDeclaration md = new MethodDeclaration(((CompilationUnitDeclaration) builderType.top().get()).compilationResult); md.bits |= ECLIPSE_DO_NOT_TOUCH_FLAG; md.modifiers = ClassFileConstants.AccPublic; @@ -288,6 +292,7 @@ public class EclipseJavaUtilMapSingularizer extends EclipseJavaUtilSingularizer md.arguments = new Argument[] {param}; md.returnType = returnType; md.selector = fluent ? data.getPluralName() : HandlerUtil.buildAccessorName("putAll", new String(data.getPluralName())).toCharArray(); + md.annotations = deprecate ? new Annotation[] { generateDeprecatedAnnotation(data.getSource()) } : null; data.setGeneratedByRecursive(md); injectMethod(builderType, md); diff --git a/src/core/lombok/experimental/Accessors.java b/src/core/lombok/experimental/Accessors.java index 7d9fdc5c..dc9ae4b0 100644 --- a/src/core/lombok/experimental/Accessors.java +++ b/src/core/lombok/experimental/Accessors.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 The Project Lombok Authors. + * 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 @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** * A container for settings for the generation of getters and setters. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/experimental/Accessors.html">the project lombok features page for @Accessors</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/experimental/Accessors">the project lombok features page for @Accessors</a>. * <p> * Using this annotation does nothing by itself; an annotation that makes lombok generate getters and setters, * such as {@link lombok.Setter} or {@link lombok.Data} is also required. @@ -38,15 +38,19 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) public @interface Accessors { /** - * If true, accessors will be named after the field and not include a <code>get</code> or <code>set</code> - * prefix. If true and <code>chain</code> is omitted, <code>chain</code> defaults to <code>true</code>. + * If true, accessors will be named after the field and not include a {@code get} or {@code set} + * prefix. If true and {@code chain} is omitted, {@code chain} defaults to {@code true}. * <strong>default: false</strong> + * + * @return Whether or not to make fluent methods (named {@code fieldName()}, not for example {@code setFieldName}). */ boolean fluent() default false; /** - * If true, setters return <code>this</code> instead of <code>void</code>. - * <strong>default: false</strong>, unless <code>fluent=true</code>, then <strong>default: true</code> + * If true, setters return {@code this} instead of {@code void}. + * <strong>default: false</strong>, unless {@code fluent=true}, then <strong>default: true</strong> + * + * @return Whether or not setters should return themselves (chaining) or {@code void} (no chaining). */ boolean chain() default false; @@ -55,6 +59,8 @@ public @interface Accessors { * Note that a prefix only counts if the next character is NOT a lowercase character or the last * letter of the prefix is not a letter (for instance an underscore). If multiple fields * all turn into the same name when the prefix is stripped, an error will be generated. + * + * @return If you are in the habit of prefixing your fields (for example, you name them {@code fFieldName}, specify such prefixes here). */ String[] prefix() default {}; } diff --git a/src/core/lombok/experimental/Builder.java b/src/core/lombok/experimental/Builder.java deleted file mode 100644 index 4d5e0f67..00000000 --- a/src/core/lombok/experimental/Builder.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (C) 2013-2014 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 static java.lang.annotation.ElementType.*; -import static java.lang.annotation.RetentionPolicy.*; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * The builder annotation creates a so-called 'builder' aspect to the class that is annotated or the class - * that contains a member which is annotated with {@code @Builder}. - * <p> - * 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. - * <p> - * The effect of {@code @Builder} is that an inner class is generated named <code><strong>T</strong>Builder</code>, - * with a private constructor. Instances of <code><strong>T</strong>Builder</code> are made with the - * method named {@code builder()} which is also generated for you in the class itself (not in the builder class). - * <p> - * The <code><strong>T</strong>Builder</code> 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 <code>build()</code> 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. - * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/experimental/Builder.html">the project lombok features page for @Builder</a>. - * <p> - * <p> - * Before: - * - * <pre> - * @Builder - * class Example { - * private int foo; - * private final String bar; - * } - * </pre> - * - * After: - * - * <pre> - * 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); - * } - * } - * } - * </pre> - * - * @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 { - /** Name of the method that creates a new builder instance. Default: {@code builder}. */ - String builderMethodName() default "builder"; - - /** 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}. - */ - 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}. - * <p> - * <strong>Default: true</strong> - */ - 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. - * <p> - * <strong>Default: true</strong> - */ - boolean chain() default true; -} diff --git a/src/core/lombok/experimental/Delegate.java b/src/core/lombok/experimental/Delegate.java index d94389b0..cc844526 100644 --- a/src/core/lombok/experimental/Delegate.java +++ b/src/core/lombok/experimental/Delegate.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2014 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 @@ -40,7 +40,7 @@ import java.lang.annotation.Target; * that exist in {@link Object}, the {@code canEqual(Object)} method, and any methods that appear in types * that are listed in the {@code excludes} property. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/experimental/Delegate.html">the project lombok features page for @Delegate</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/experimental/Delegate">the project lombok features page for @Delegate</a>. */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.SOURCE) @@ -52,6 +52,8 @@ public @interface Delegate { * type listed here is used only to determine which delegate methods to generate. * * NB: All methods in {@code Object}, as well as {@code canEqual(Object other)} will never be delegated. + * + * @return For each method (not already in {@code java.lang.Object}) in these types, generate a delegate method. */ Class<?>[] types() default {}; @@ -59,6 +61,8 @@ public @interface Delegate { * Each method in any of the types listed here (include supertypes) will <em>not</em> be delegated. * * NB: All methods in {@code Object}, as well as {@code canEqual(Object other)} will never be delegated. + * + * @return For each method (not already in {@code java.lang.Object}) in these types, skip generating a delegate method (overrides {@code types()}). */ Class<?>[] excludes() default {}; } diff --git a/src/core/lombok/experimental/ExtensionMethod.java b/src/core/lombok/experimental/ExtensionMethod.java index 3e64cf78..af38f6ed 100644 --- a/src/core/lombok/experimental/ExtensionMethod.java +++ b/src/core/lombok/experimental/ExtensionMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 The Project Lombok Authors. + * 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 @@ -31,8 +31,8 @@ import java.lang.annotation.*; * otherwise modifying the original type. Extension methods are a special kind of static method, but they are called as * if they were instance methods on the extended type. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/experimental/ExtensionMethod.html">the project lombok features page for @ExtensionMethod</a>. - * <p> + * Complete documentation is found at <a href="https://projectlombok.org/features/experimental/ExtensionMethod">the project lombok features page for @ExtensionMethod</a>. + * <br> * <p> * Before: * @@ -60,12 +60,14 @@ import java.lang.annotation.*; @Target(TYPE) @Retention(SOURCE) public @interface ExtensionMethod { - /** All types whose static methods will be exposed as extension methods. */ + /** @return All types whose static methods will be exposed as extension methods. */ Class<?>[] value(); /** * If {@code true}, an applicable extension method is used (if found) even if the method call already was compilable (this is the default). * If {@code false}, an extension method is only used if the method call is not also defined by the type itself. + * + * @return Whether or not to override already existing methods with the extension. */ boolean suppressBaseMethods() default true; } diff --git a/src/core/lombok/experimental/FieldDefaults.java b/src/core/lombok/experimental/FieldDefaults.java index 384abda5..5c387bb6 100644 --- a/src/core/lombok/experimental/FieldDefaults.java +++ b/src/core/lombok/experimental/FieldDefaults.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 The Project Lombok Authors. + * 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 @@ -31,7 +31,7 @@ import lombok.AccessLevel; /** * Adds modifiers to each field in the type with this annotation. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/experimental/FieldDefaults.html">the project lombok features page for @FieldDefaults</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/experimental/FieldDefaults">the project lombok features page for @FieldDefaults</a>. * <p> * If {@code makeFinal} is {@code true}, then each (instance) field that is not annotated with {@code @NonFinal} will have the {@code final} modifier added. * <p> diff --git a/src/core/lombok/experimental/Value.java b/src/core/lombok/experimental/Value.java deleted file mode 100644 index 46ec7a05..00000000 --- a/src/core/lombok/experimental/Value.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2012-2013 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. - * <p> - * Equivalent to {@code @Getter @FieldDefaults(makeFinal=true, level=AccessLevel.PRIVATE) @RequiredArgsConstructor @ToString @EqualsAndHashCode}. - * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/experimental/Value.html">the project lombok features page for @Value</a>. - * - * @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: - * - * <pre> - * public @Data(staticConstructor = "of") class Point { final int x, y; } - * </pre> - * - * Default: No static constructor, instead the normal constructor is public. - */ - String staticConstructor() default ""; -} diff --git a/src/core/lombok/experimental/Wither.java b/src/core/lombok/experimental/Wither.java index 3fb767d1..3df546d0 100644 --- a/src/core/lombok/experimental/Wither.java +++ b/src/core/lombok/experimental/Wither.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 The Project Lombok Authors. + * 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 @@ -31,7 +31,7 @@ import lombok.AccessLevel; /** * Put on any field to make lombok build a 'wither' - a withX method which produces a clone of this object (except for 1 field which gets a new value). * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/experimental/Wither.html">the project lombok features page for @Wither</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/experimental/Wither">the project lombok features page for @Wither</a>. * <p> * Even though it is not listed, this annotation also has the {@code onParam} and {@code onMethod} parameter. See the full documentation for more details. * <p> @@ -56,26 +56,32 @@ import lombok.AccessLevel; public @interface Wither { /** * If you want your wither to be non-public, you can specify an alternate access level here. + * + * @return The method will be generated with this access modifier. */ AccessLevel value() default AccessLevel.PUBLIC; /** * Any annotations listed here are put on the generated method. - * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br /> - * up to JDK7:<br /> - * {@code @Wither(onMethod=@__({@AnnotationsGoHere}))}<br /> - * from JDK8:<br /> + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br> + * up to JDK7:<br> + * {@code @Wither(onMethod=@__({@AnnotationsGoHere}))}<br> + * from JDK8:<br> * {@code @Wither(onMethod_={@AnnotationsGohere})} // note the underscore after {@code onMethod}. + * + * @return List of annotations to apply to the generated method. */ AnyAnnotation[] onMethod() default {}; /** * Any annotations listed here are put on the generated method's parameter. - * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br /> - * up to JDK7:<br /> - * {@code @Wither(onParam=@__({@AnnotationsGoHere}))}<br /> - * from JDK8:<br /> + * The syntax for this feature depends on JDK version (nothing we can do about that; it's to work around javac bugs).<br> + * up to JDK7:<br> + * {@code @Wither(onParam=@__({@AnnotationsGoHere}))}<br> + * from JDK8:<br> * {@code @Wither(onParam_={@AnnotationsGohere})} // note the underscore after {@code onParam}. + * + * @return List of annotations to apply to the generated parameter in the method. */ AnyAnnotation[] onParam() default {}; diff --git a/src/core/lombok/experimental/package-info.java b/src/core/lombok/experimental/package-info.java index d85e2969..22b23a52 100644 --- a/src/core/lombok/experimental/package-info.java +++ b/src/core/lombok/experimental/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2014 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -28,6 +28,6 @@ * to the official feature documentation. * * @see lombok - * @see <a href="https://projectlombok.org/features/experimental/index.html">Lombok features (experimental)</a> + * @see <a href="https://projectlombok.org/features/experimental/all">Lombok features (experimental)</a> */ package lombok.experimental; 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/extern/apachecommons/CommonsLog.java b/src/core/lombok/extern/apachecommons/CommonsLog.java index 777f4b35..04d5ef93 100644 --- a/src/core/lombok/extern/apachecommons/CommonsLog.java +++ b/src/core/lombok/extern/apachecommons/CommonsLog.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 @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** * Causes lombok to generate a logger field. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Log.html">the project lombok features page for lombok log annotations</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Log">the project lombok features page for lombok log annotations</a>. * <p> * Example: * <pre> @@ -46,10 +46,10 @@ import java.lang.annotation.Target; * } * </pre> * - * This annotation is valid for classes and enumerations.<br /> + * This annotation is valid for classes and enumerations.<br> * - * @see org.apache.commons.logging.Log org.apache.commons.logging.Log - * @see org.apache.commons.logging.LogFactory#getLog(java.lang.Class) org.apache.commons.logging.LogFactory.getLog(Class target) + * @see <a href="https://commons.apache.org/proper/commons-logging/apidocs/org/apache/commons/logging/Log.html">org.apache.commons.logging.Log</a> + * @see <a href="https://commons.apache.org/proper/commons-logging/apidocs/org/apache/commons/logging/LogFactory.html#getLog(java.lang.Class)">org.apache.commons.logging.LogFactory#getLog(java.lang.Class)</a> * @see lombok.extern.java.Log @Log * @see lombok.extern.log4j.Log4j @Log4j * @see lombok.extern.log4j.Log4j2 @Log4j2 @@ -60,8 +60,6 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface CommonsLog { - /** - * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed. - */ + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ String topic() default ""; } diff --git a/src/core/lombok/extern/java/Log.java b/src/core/lombok/extern/java/Log.java index d5515283..553b7c4a 100644 --- a/src/core/lombok/extern/java/Log.java +++ b/src/core/lombok/extern/java/Log.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 @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** * Causes lombok to generate a logger field. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Log.html">the project lombok features page for lombok log annotations</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Log">the project lombok features page for lombok log annotations</a>. * <p> * Example: * <pre> @@ -46,9 +46,9 @@ import java.lang.annotation.Target; * } * </pre> * - * This annotation is valid for classes and enumerations.<br /> - * @see java.util.logging.Logger java.util.logging.Logger - * @see java.util.logging.Logger#getLogger(java.lang.String) java.util.logging.Logger.getLogger(String name) + * This annotation is valid for classes and enumerations.<br> + * @see <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html">java.util.logging.Logger</a> + * @see <a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/Logger.html#getLogger-java.lang.String-">java.util.logging.Logger#getLogger(java.lang.String)</a> * @see lombok.extern.apachecommons.CommonsLog @CommonsLog * @see lombok.extern.log4j.Log4j @Log4j * @see lombok.extern.log4j.Log4j2 @Log4j2 @@ -59,8 +59,6 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface Log { - /** - * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed. - */ + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ String topic() default ""; } diff --git a/src/core/lombok/extern/jbosslog/JBossLog.java b/src/core/lombok/extern/jbosslog/JBossLog.java index 2735290c..ea520aea 100644 --- a/src/core/lombok/extern/jbosslog/JBossLog.java +++ b/src/core/lombok/extern/jbosslog/JBossLog.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 The Project Lombok Authors. + * Copyright (C) 2016-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 @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** * Causes lombok to generate a logger field. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Log.html">the project lombok features page for lombok log annotations</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Log">the project lombok features page for lombok log annotations</a>. * <p> * Example: * <pre> @@ -46,9 +46,9 @@ import java.lang.annotation.Target; * } * </pre> * - * This annotation is valid for classes and enumerations.<br /> - * @see org.jboss.logging.Logger org.jboss.logging.Logger - * @see org.jboss.logging.Logger#getLogger(java.lang.Class) org.jboss.logging.Logger.getLogger(Class target) + * This annotation is valid for classes and enumerations.<br> + * @see <a href="https://docs.jboss.org/jbosslogging/latest/org/jboss/logging/Logger.html">org.jboss.logging.Logger</a> + * @see <a href="https://docs.jboss.org/jbosslogging/latest/org/jboss/logging/Logger.html#getLogger(java.lang.Class)">org.jboss.logging.Logger#getLogger(java.lang.Class)</a> * @see lombok.extern.apachecommons.CommonsLog @CommonsLog * @see lombok.extern.java.Log @Log * @see lombok.extern.log4j.Log4j @Log4j @@ -59,9 +59,6 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface JBossLog { - - /** - * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed. - */ + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ String topic() default ""; } diff --git a/src/core/lombok/extern/log4j/Log4j.java b/src/core/lombok/extern/log4j/Log4j.java index 6c6ef1da..ee719407 100644 --- a/src/core/lombok/extern/log4j/Log4j.java +++ b/src/core/lombok/extern/log4j/Log4j.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 @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** * Causes lombok to generate a logger field. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Log.html">the project lombok features page for lombok log annotations</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Log">the project lombok features page for lombok log annotations</a>. * <p> * Example: * <pre> @@ -46,10 +46,10 @@ import java.lang.annotation.Target; * } * </pre> * - * This annotation is valid for classes and enumerations.<br /> + * This annotation is valid for classes and enumerations.<br> * - * @see org.apache.log4j.Logger org.apache.log4j.Logger - * @see org.apache.log4j.Logger#getLogger(java.lang.Class) org.apache.log4j.Logger.getLogger(Class target) + * @see <a href="https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Logger.html">org.apache.log4j.Logger</a> + * @see <a href="https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Logger.html#getLogger(java.lang.Class)">org.apache.log4j.Logger#getLogger(java.lang.Class)</a> * @see lombok.extern.log4j.Log4j2 @Log4j2 * @see lombok.extern.apachecommons.CommonsLog @CommonsLog * @see lombok.extern.java.Log @Log @@ -60,8 +60,6 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface Log4j { - /** - * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed. - */ + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ String topic() default ""; } diff --git a/src/core/lombok/extern/log4j/Log4j2.java b/src/core/lombok/extern/log4j/Log4j2.java index a1b2e0e7..4a5b166c 100644 --- a/src/core/lombok/extern/log4j/Log4j2.java +++ b/src/core/lombok/extern/log4j/Log4j2.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 The Project Lombok Authors. + * Copyright (C) 2013-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 @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** * Causes lombok to generate a logger field. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Log.html">the project lombok features page for lombok log annotations</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Log">the project lombok features page for lombok log annotations</a>. * <p> * Example: * <pre> @@ -46,10 +46,10 @@ import java.lang.annotation.Target; * } * </pre> * - * This annotation is valid for classes and enumerations.<br /> + * This annotation is valid for classes and enumerations.<br> * - * @see org.apache.logging.log4j.Logger org.apache.logging.log4j.Logger - * @see org.apache.logging.log4j.LogManager#getLogger(java.lang.Class) org.apache.logging.log4j.LogManager.getLogger(Class target) + * @see <a href="https://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/Logger.html">org.apache.logging.log4j.Logger</a> + * @see <a href="https://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/LogManager.html#getLogger-java.lang.Class-">org.apache.logging.log4j.LogManager#getLogger(java.lang.Class)</a> * @see lombok.extern.log4j.Log4j @Log4j * @see lombok.extern.apachecommons.CommonsLog @CommonsLog * @see lombok.extern.java.Log @Log @@ -60,8 +60,6 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface Log4j2 { - /** - * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed. - */ + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ String topic() default ""; } diff --git a/src/core/lombok/extern/slf4j/Slf4j.java b/src/core/lombok/extern/slf4j/Slf4j.java index efa6105f..24586d43 100644 --- a/src/core/lombok/extern/slf4j/Slf4j.java +++ b/src/core/lombok/extern/slf4j/Slf4j.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 @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** * Causes lombok to generate a logger field. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Log.html">the project lombok features page for lombok log annotations</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Log">the project lombok features page for lombok log annotations</a>. * <p> * Example: * <pre> @@ -46,9 +46,9 @@ import java.lang.annotation.Target; * } * </pre> * - * This annotation is valid for classes and enumerations.<br /> - * @see org.slf4j.Logger org.slf4j.Logger - * @see org.slf4j.LoggerFactory#getLogger(java.lang.Class) org.slf4j.LoggerFactory.getLogger(Class target) + * This annotation is valid for classes and enumerations.<br> + * @see <a href="https://www.slf4j.org/api/org/slf4j/Logger.html">org.slf4j.Logger</a> + * @see <a href="https://www.slf4j.org/api/org/slf4j/LoggerFactory.html#getLogger(java.lang.Class)">org.slf4j.LoggerFactory#getLogger(java.lang.Class)</a> * @see lombok.extern.apachecommons.CommonsLog @CommonsLog * @see lombok.extern.java.Log @Log * @see lombok.extern.log4j.Log4j @Log4j @@ -59,9 +59,7 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface Slf4j { - /** - * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed. - */ + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ String topic() default ""; } diff --git a/src/core/lombok/extern/slf4j/XSlf4j.java b/src/core/lombok/extern/slf4j/XSlf4j.java index ce23ab9e..85a0fdd8 100644 --- a/src/core/lombok/extern/slf4j/XSlf4j.java +++ b/src/core/lombok/extern/slf4j/XSlf4j.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 The Project Lombok Authors. + * 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 @@ -29,7 +29,7 @@ import java.lang.annotation.Target; /** * Causes lombok to generate a logger field. * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/Log.html">the project lombok features page for lombok log annotations</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/Log">the project lombok features page for lombok log annotations</a>. * <p> * Example: * <pre> @@ -46,9 +46,9 @@ import java.lang.annotation.Target; * } * </pre> * - * This annotation is valid for classes and enumerations.<br /> - * @see org.slf4j.ext.XLogger org.slf4j.ext.XLogger - * @see org.slf4j.ext.XLoggerFactory#getLogger(java.lang.Class) org.slf4j.ext.XLoggerFactory.getXLogger(Class target) + * This annotation is valid for classes and enumerations.<br> + * @see <a href="https://www.slf4j.org/api/org/slf4j/ext/XLogger.html">org.slf4j.ext.XLogger</a> + * @see <a href="https://www.slf4j.org/api/org/slf4j/ext/XLoggerFactory.html#getXLogger(java.lang.Class)">org.slf4j.ext.XLoggerFactory#getLogger(java.lang.Class)</a> * @see lombok.extern.apachecommons.CommonsLog @CommonsLog * @see lombok.extern.java.Log @Log * @see lombok.extern.log4j.Log4j @Log4j @@ -59,8 +59,6 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.SOURCE) @Target(ElementType.TYPE) public @interface XSlf4j { - /** - * Sets the category of the constructed Logger. By default, it will use the type where the annotation is placed. - */ + /** @return The category of the constructed Logger. By default, it will use the type where the annotation is placed. */ String topic() default ""; } diff --git a/src/core/lombok/javac/CapturingDiagnosticListener.java b/src/core/lombok/javac/CapturingDiagnosticListener.java index a0ac6adc..0e64ed8d 100644 --- a/src/core/lombok/javac/CapturingDiagnosticListener.java +++ b/src/core/lombok/javac/CapturingDiagnosticListener.java @@ -52,6 +52,10 @@ public class CapturingDiagnosticListener implements DiagnosticListener<JavaFileO "^" + Pattern.quote(file.getAbsolutePath()) + "\\s*:\\s*\\d+\\s*:\\s*(?:warning:\\s*)?(.*)$", Pattern.DOTALL).matcher(msg); if (m.matches()) msg = m.group(1); + if (msg.equals("deprecated item is not annotated with @Deprecated")) { + // This is new in JDK9; prior to that you don't see this. We shall ignore these. + return; + } messages.add(new CompilerMessage(d.getLineNumber(), d.getStartPosition(), d.getKind() == Kind.ERROR, msg)); } diff --git a/src/core/lombok/javac/CompilerMessageSuppressor.java b/src/core/lombok/javac/CompilerMessageSuppressor.java index a17e0c62..391ec64a 100644 --- a/src/core/lombok/javac/CompilerMessageSuppressor.java +++ b/src/core/lombok/javac/CompilerMessageSuppressor.java @@ -26,6 +26,7 @@ import java.io.OutputStream; import java.io.PrintWriter; import java.lang.reflect.Field; import java.util.LinkedList; +import java.util.Map; import java.util.Queue; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -43,38 +44,40 @@ import com.sun.tools.javac.util.Log; * then they will be generated AGAIN, this time with proper names and line numbers, at the end. Therefore, we want to suppress the logger. */ public final class CompilerMessageSuppressor { + private final Log log; - private static final Field errWriterField, warnWriterField, noticeWriterField, dumpOnErrorField, promptOnErrorField, diagnosticListenerField; + private static final WriterField errWriterField, warnWriterField, noticeWriterField; + private static final Field dumpOnErrorField, promptOnErrorField, diagnosticListenerField; private static final Field deferDiagnosticsField, deferredDiagnosticsField, diagnosticHandlerField; private static final ConcurrentMap<Class<?>, Field> handlerDeferredFields = new ConcurrentHashMap<Class<?>, Field>(); private static final Field NULL_FIELD; - private PrintWriter errWriter, warnWriter, noticeWriter; private Boolean dumpOnError, promptOnError; private DiagnosticListener<?> contextDiagnosticListener, logDiagnosticListener; private final Context context; - // If this is true, the fields changed. Better to print weird error messages than to fail outright. - private static final boolean dontBother; - private static final ThreadLocal<Queue<?>> queueCache = new ThreadLocal<Queue<?>>(); + enum Writers { + ERROR("errWriter", "ERROR"), + WARNING("warnWriter", "WARNING"), + NOTICE("noticeWriter", "NOTICE"); + + final String fieldName; + final String keyName; + + Writers(String fieldName, String keyName) { + this.fieldName = fieldName; + this.keyName = keyName; + } + } + static { - errWriterField = getDeclaredField(Log.class, "errWriter"); - warnWriterField = getDeclaredField(Log.class, "warnWriter"); - noticeWriterField = getDeclaredField(Log.class, "noticeWriter"); + errWriterField = createWriterField(Writers.ERROR); + warnWriterField = createWriterField(Writers.WARNING); + noticeWriterField = createWriterField(Writers.NOTICE); dumpOnErrorField = getDeclaredField(Log.class, "dumpOnError"); promptOnErrorField = getDeclaredField(Log.class, "promptOnError"); diagnosticListenerField = getDeclaredField(Log.class, "diagListener"); - - dontBother = - errWriterField == null || - warnWriterField == null || - noticeWriterField == null || - dumpOnErrorField == null || - promptOnErrorField == null || - diagnosticListenerField == null; - - deferDiagnosticsField = getDeclaredField(Log.class, "deferDiagnostics"); deferredDiagnosticsField = getDeclaredField(Log.class, "deferredDiagnostics"); @@ -100,17 +103,13 @@ public final class CompilerMessageSuppressor { this.context = context; } - public boolean disableLoggers() { + public void disableLoggers() { contextDiagnosticListener = context.get(DiagnosticListener.class); context.put(DiagnosticListener.class, (DiagnosticListener<?>) null); - if (dontBother) return false; - boolean dontBotherInstance = false; - - PrintWriter dummyWriter = new PrintWriter(new OutputStream() { - @Override public void write(int b) throws IOException { - // Do nothing on purpose - } - }); + + errWriterField.pauze(log); + warnWriterField.pauze(log); + noticeWriterField.pauze(log); if (deferDiagnosticsField != null) try { if (Boolean.TRUE.equals(deferDiagnosticsField.get(log))) { @@ -130,50 +129,23 @@ public final class CompilerMessageSuppressor { } } catch (Exception e) {} - if (!dontBotherInstance) try { - errWriter = (PrintWriter) errWriterField.get(log); - errWriterField.set(log, dummyWriter); - } catch (Exception e) { - dontBotherInstance = true; - } - - if (!dontBotherInstance) try { - warnWriter = (PrintWriter) warnWriterField.get(log); - warnWriterField.set(log, dummyWriter); - } catch (Exception e) { - dontBotherInstance = true; - } - - if (!dontBotherInstance) try { - noticeWriter = (PrintWriter) noticeWriterField.get(log); - noticeWriterField.set(log, dummyWriter); - } catch (Exception e) { - dontBotherInstance = true; - } - - if (!dontBotherInstance) try { + if (dumpOnErrorField != null) try { dumpOnError = (Boolean) dumpOnErrorField.get(log); dumpOnErrorField.set(log, false); } catch (Exception e) { - dontBotherInstance = true; } - if (!dontBotherInstance) try { + if (promptOnErrorField != null) try { promptOnError = (Boolean) promptOnErrorField.get(log); promptOnErrorField.set(log, false); } catch (Exception e) { - dontBotherInstance = true; } - if (!dontBotherInstance) try { + if (diagnosticListenerField != null) try { logDiagnosticListener = (DiagnosticListener<?>) diagnosticListenerField.get(log); diagnosticListenerField.set(log, null); } catch (Exception e) { - dontBotherInstance = true; } - - if (dontBotherInstance) enableLoggers(); - return !dontBotherInstance; } private static Field getDeferredField(Object handler) { @@ -193,20 +165,9 @@ public final class CompilerMessageSuppressor { contextDiagnosticListener = null; } - if (errWriter != null) try { - errWriterField.set(log, errWriter); - errWriter = null; - } catch (Exception e) {} - - if (warnWriter != null) try { - warnWriterField.set(log, warnWriter); - warnWriter = null; - } catch (Exception e) {} - - if (noticeWriter != null) try { - noticeWriterField.set(log, noticeWriter); - noticeWriter = null; - } catch (Exception e) {} + errWriterField.resume(log); + warnWriterField.resume(log); + noticeWriterField.resume(log); if (dumpOnError != null) try { dumpOnErrorField.set(log, dumpOnError); @@ -283,4 +244,107 @@ public final class CompilerMessageSuppressor { // javac will contain rather a lot of messages, but this is a lot better than just crashing during compilation! } } + + private static WriterField createWriterField(Writers w) { + // jdk9 + try { + Field writers = getDeclaredField(Log.class, "writer"); + if (writers != null) { + Class<?> kindsClass = Class.forName("com.sun.tools.javac.util.Log$WriterKind"); + for (Object enumConstant : kindsClass.getEnumConstants()) { + if (enumConstant.toString().equals(w.keyName)) { + return new Java9WriterField(writers, enumConstant); + } + } + return WriterField.NONE; + } + } catch (Exception e) { + } + + // jdk8 + Field writerField = getDeclaredField(Log.class, w.fieldName); + if (writerField != null) return new Java8WriterField(writerField); + + // other jdk + return WriterField.NONE; + } + + interface WriterField { + final PrintWriter NO_WRITER = new PrintWriter(new OutputStream() { + @Override public void write(int b) throws IOException { + // Do nothing on purpose + } + }); + + final WriterField NONE = new WriterField() { + @Override public void pauze(Log log) { + // do nothing + } + @Override public void resume(Log log) { + // no nothing + } + }; + + void pauze(Log log); + void resume(Log log); + } + + static class Java8WriterField implements WriterField { + private final Field field; + private PrintWriter writer; + + public Java8WriterField(Field field) { + this.field = field; + } + + @Override public void pauze(Log log) { + try { + writer = (PrintWriter) field.get(log); + field.set(log, NO_WRITER); + } catch (Exception e) { + } + } + + @Override public void resume(Log log) { + if (writer != null) { + try { + field.set(log, writer); + } catch (Exception e) { + } + } + writer = null; + } + } + + + static class Java9WriterField implements WriterField { + private final Field field; + private final Object key; + private PrintWriter writer; + + public Java9WriterField(Field field, Object key) { + this.field = field; + this.key = key; + } + + @Override public void pauze(Log log) { + try { + @SuppressWarnings("unchecked") Map<Object,PrintWriter> map = (Map<Object,PrintWriter>)field.get(log); + writer = map.get(key); + map.put(key, NO_WRITER); + } catch (Exception e) { + } + } + + @Override public void resume(Log log) { + if (writer != null) { + try { + @SuppressWarnings("unchecked") Map<Object,PrintWriter> map = (Map<Object,PrintWriter>)field.get(log); + map.put(key, writer); + } catch (Exception e) { + } + } + writer = null; + } + } }
\ No newline at end of file diff --git a/src/core/lombok/javac/Javac8BasedLombokOptions.java b/src/core/lombok/javac/Javac8BasedLombokOptions.java index 3fdea890..9a662490 100644 --- a/src/core/lombok/javac/Javac8BasedLombokOptions.java +++ b/src/core/lombok/javac/Javac8BasedLombokOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 The Project Lombok Authors. + * Copyright (C) 2013-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 @@ -28,7 +28,7 @@ import com.sun.tools.javac.util.Options; public class Javac8BasedLombokOptions extends LombokOptions { public static Javac8BasedLombokOptions replaceWithDelombokOptions(Context context) { Options options = Options.instance(context); - context.put(optionsKey, (Options)null); + context.put(optionsKey, (Options) null); Javac8BasedLombokOptions result = new Javac8BasedLombokOptions(context); result.putAll(options); return result; diff --git a/src/core/lombok/javac/Javac9BasedLombokOptions.java b/src/core/lombok/javac/Javac9BasedLombokOptions.java new file mode 100644 index 00000000..e786346d --- /dev/null +++ b/src/core/lombok/javac/Javac9BasedLombokOptions.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 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.javac; + +import com.sun.tools.javac.main.Option; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.Options; + +public class Javac9BasedLombokOptions extends LombokOptions { + public static Javac9BasedLombokOptions replaceWithDelombokOptions(Context context) { + Options options = Options.instance(context); + context.put(optionsKey, (Options) null); + Javac9BasedLombokOptions result = new Javac9BasedLombokOptions(context); + result.putAll(options); + return result; + } + + private Javac9BasedLombokOptions(Context context) { + super(context); + } + + @Override public void putJavacOption(String optionName, String value) { + if (optionName.equals("CLASSPATH")) optionName = "CLASS_PATH"; + if (optionName.equals("SOURCEPATH")) optionName = "SOURCE_PATH"; + if (optionName.equals("BOOTCLASSPATH")) optionName = "BOOT_CLASS_PATH"; + String optionText = Option.valueOf(optionName).primaryName; + put(optionText, value); + } +} diff --git a/src/core/lombok/javac/JavacAST.java b/src/core/lombok/javac/JavacAST.java index c99ae5c9..45679fd3 100644 --- a/src/core/lombok/javac/JavacAST.java +++ b/src/core/lombok/javac/JavacAST.java @@ -48,8 +48,6 @@ import com.sun.tools.javac.tree.JCTree.JCCatch; import com.sun.tools.javac.tree.JCTree.JCClassDecl; import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; import com.sun.tools.javac.tree.JCTree.JCExpression; -import com.sun.tools.javac.tree.JCTree.JCFieldAccess; -import com.sun.tools.javac.tree.JCTree.JCIdent; import com.sun.tools.javac.tree.JCTree.JCMethodDecl; import com.sun.tools.javac.tree.JCTree.JCStatement; import com.sun.tools.javac.tree.JCTree.JCTry; @@ -65,12 +63,12 @@ import com.sun.tools.javac.util.Name; * something javac's own AST system does not offer. */ public class JavacAST extends AST<JavacAST, JavacNode, JCTree> { - private final Messager messager; private final JavacElements elements; private final JavacTreeMaker treeMaker; private final Symtab symtab; private final JavacTypes javacTypes; private final Log log; + private final ErrorLog errorLogger; private final Context context; /** @@ -84,8 +82,8 @@ public class JavacAST extends AST<JavacAST, JavacNode, JCTree> { super(sourceName(top), PackageName.getPackageName(top), new JavacImportList(top), statementTypes()); setTop(buildCompilationUnit(top)); this.context = context; - this.messager = messager; this.log = Log.instance(context); + this.errorLogger = ErrorLog.create(messager, log); this.elements = JavacElements.instance(context); this.treeMaker = new JavacTreeMaker(TreeMaker.instance(context)); this.symtab = Symtab.instance(context); @@ -106,27 +104,6 @@ public class JavacAST extends AST<JavacAST, JavacNode, JCTree> { return cu.sourcefile == null ? null : cu.sourcefile.toString(); } - // jdk9 support, types have changed, names stay the same - static class PackageName { - private static final Method packageNameMethod; - - static { - Method m = null; - try { - m = JCCompilationUnit.class.getDeclaredMethod("getPackageName"); - } catch (Exception e) {} - packageNameMethod = m; - } - - static String getPackageName(JCCompilationUnit cu) { - try { - Object pkg = packageNameMethod.invoke(cu); - return (pkg instanceof JCFieldAccess || pkg instanceof JCIdent) ? pkg.toString() : null; - } catch (Exception e) {} - return null; - } - } - public Context getContext() { return context; } @@ -148,6 +125,8 @@ public class JavacAST extends AST<JavacAST, JavacNode, JCTree> { String nm = Source.instance(context).name(); int underscoreIdx = nm.indexOf('_'); if (underscoreIdx > -1) return Integer.parseInt(nm.substring(underscoreIdx + 1)); + // assume java9+ + return Integer.parseInt(nm); } catch (Exception ignore) {} return 6; } @@ -422,22 +401,21 @@ public class JavacAST extends AST<JavacAST, JavacNode, JCTree> { try { switch (kind) { case ERROR: - increaseErrorCount(messager); - boolean prev = log.multipleErrors; - log.multipleErrors = true; - try { - log.error(pos, "proc.messager", message); - } finally { - log.multipleErrors = prev; - } + errorLogger.error(pos, message); + break; + case MANDATORY_WARNING: + errorLogger.mandatoryWarning(pos, message); break; - default: case WARNING: - log.warning(pos, "proc.messager", message); + errorLogger.warning(pos, message); + break; + default: + case NOTE: + errorLogger.note(pos, message); break; } } finally { - if (oldSource != null) log.useSource(oldSource); + if (newSource != null) log.useSource(oldSource); } } @@ -475,16 +453,118 @@ public class JavacAST extends AST<JavacAST, JavacNode, JCTree> { return oldL; } - private void increaseErrorCount(Messager m) { - try { - Field f = m.getClass().getDeclaredField("errorCount"); - f.setAccessible(true); - if (f.getType() == int.class) { - int val = ((Number)f.get(m)).intValue(); - f.set(m, val +1); + abstract static class ErrorLog { + final Log log; + private final Messager messager; + private final Field errorCount; + private final Field warningCount; + + private ErrorLog(Log log, Messager messager, Field errorCount, Field warningCount) { + this.log = log; + this.messager = messager; + this.errorCount = errorCount; + this.warningCount = warningCount; + } + + final void error(DiagnosticPosition pos, String message) { + increment(errorCount); + error1(pos, message); + } + + final void warning(DiagnosticPosition pos, String message) { + increment(warningCount); + log.warning(pos, "proc.messager", message); + } + + final void mandatoryWarning(DiagnosticPosition pos, String message) { + increment(warningCount); + log.mandatoryWarning(pos, "proc.messager", message); + } + + final void note(DiagnosticPosition pos, String message) { + log.note(pos, "proc.messager", message); + } + + abstract void error1(DiagnosticPosition pos, String message); + + private void increment(Field field) { + if (field == null) return; + try { + int val = ((Number)field.get(messager)).intValue(); + field.set(messager, val +1); + } catch (Throwable t) { + //Very unfortunate, but in most cases it still works fine, so we'll silently swallow it. + } + } + + static ErrorLog create(Messager messager, Log log) { + Field errorCount = null; + try { + Field f = messager.getClass().getDeclaredField("errorCount"); + f.setAccessible(true); + errorCount = f; + } catch (Throwable t) {} + boolean hasMultipleErrors = false; + for (Field field : log.getClass().getFields()) { + if (field.getName().equals("multipleErrors")) { + hasMultipleErrors = true; + break; + } + } + if (hasMultipleErrors) return new JdkBefore9(log, messager, errorCount); + + Field warningCount = null; + try { + Field f = messager.getClass().getDeclaredField("warningCount"); + f.setAccessible(true); + warningCount = f; + } catch (Throwable t) {} + + + Method logMethod = null; + Object multiple = null; + try { + Class<?> df = Class.forName("com.sun.tools.javac.util.JCDiagnostic$DiagnosticFlag"); + for (Object constant : df.getEnumConstants()) { + if (constant.toString().equals("MULTIPLE")) multiple = constant; + } + logMethod = log.getClass().getMethod("error", new Class<?>[] {df, DiagnosticPosition.class, String.class, Object[].class}); + } catch (Throwable t) {} + + return new Jdk9Plus(log, messager, errorCount, warningCount, logMethod, multiple); + } + } + + static class JdkBefore9 extends ErrorLog { + private JdkBefore9(Log log, Messager messager, Field errorCount) { + super(log, messager, errorCount, null); + } + + @Override void error1(DiagnosticPosition pos, String message) { + boolean prev = log.multipleErrors; + log.multipleErrors = true; + try { + log.error(pos, "proc.messager", message); + } finally { + log.multipleErrors = prev; } - } catch (Throwable t) { - //Very unfortunate, but in most cases it still works fine, so we'll silently swallow it. + } + } + + static class Jdk9Plus extends ErrorLog { + private final Object multiple; + private final Method logMethod; + + private Jdk9Plus(Log log, Messager messager, Field errorCount, Field warningCount, Method logMethod, Object multiple) { + super(log, messager, errorCount, warningCount); + this.logMethod = logMethod; + this.multiple = multiple; + } + + @Override void error1(DiagnosticPosition pos, String message) { + try { + logMethod.invoke(log, multiple, pos, "proc.messager", new Object[] { message }); + } catch (Throwable t) {} } } } diff --git a/src/core/lombok/javac/JavacImportList.java b/src/core/lombok/javac/JavacImportList.java index 0f789f45..468d8c7b 100644 --- a/src/core/lombok/javac/JavacImportList.java +++ b/src/core/lombok/javac/JavacImportList.java @@ -26,7 +26,6 @@ import java.util.Collection; import lombok.core.ImportList; import lombok.core.LombokInternalAliasing; -import lombok.javac.JavacAST.PackageName; import com.sun.tools.javac.tree.JCTree; import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; diff --git a/src/core/lombok/javac/JavacResolution.java b/src/core/lombok/javac/JavacResolution.java index 67dbaac6..8cc239e1 100644 --- a/src/core/lombok/javac/JavacResolution.java +++ b/src/core/lombok/javac/JavacResolution.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2015 The Project Lombok Authors. + * Copyright (C) 2011-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 @@ -31,6 +31,7 @@ import java.util.ArrayDeque; import java.util.Map; import javax.lang.model.type.TypeKind; +import javax.tools.JavaFileObject; import lombok.Lombok; import lombok.core.debug.AssertionLogger; @@ -59,6 +60,7 @@ import com.sun.tools.javac.tree.JCTree.JCVariableDecl; import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.List; import com.sun.tools.javac.util.ListBuffer; +import com.sun.tools.javac.util.Log; public class JavacResolution { private final Attr attr; @@ -142,9 +144,14 @@ public class JavacResolution { TreeMirrorMaker mirrorMaker = new TreeMirrorMaker(node.getTreeMaker(), node.getContext()); JCTree copy = mirrorMaker.copy(finder.copyAt()); - - memberEnterAndAttribute(copy, finder.get(), node.getContext()); - return mirrorMaker.getOriginalToCopyMap(); + Log log = Log.instance(node.getContext()); + JavaFileObject oldFileObject = log.useSource(((JCCompilationUnit) node.top().get()).getSourceFile()); + try { + memberEnterAndAttribute(copy, finder.get(), node.getContext()); + return mirrorMaker.getOriginalToCopyMap(); + } finally { + log.useSource(oldFileObject); + } } finally { messageSuppressor.enableLoggers(); } @@ -222,8 +229,13 @@ public class JavacResolution { } private void attrib(JCTree tree, Env<AttrContext> env) { + if (env.enclClass.type == null) try { + env.enclClass.type = Type.noType; + } catch (Throwable ignore) { + // This addresses issue #1553 which involves JDK9; if it doesn't exist, we probably don't need to set it. + } if (tree instanceof JCBlock) attr.attribStat(tree, env); - else if (tree instanceof JCMethodDecl) attr.attribStat(((JCMethodDecl)tree).body, env); + else if (tree instanceof JCMethodDecl) attr.attribStat(((JCMethodDecl) tree).body, env); else if (tree instanceof JCVariableDecl) attr.attribStat(tree, env); else throw new IllegalStateException("Called with something that isn't a block, method decl, or variable decl"); } @@ -261,6 +273,7 @@ public class JavacResolution { } public static Type ifTypeIsIterableToComponent(Type type, JavacAST ast) { + if (type == null) return null; Types types = Types.instance(ast.getContext()); Symtab syms = Symtab.instance(ast.getContext()); Type boundType = ReflectiveAccess.Types_upperBound(types, type); diff --git a/src/core/lombok/javac/apt/InterceptingJavaFileManager.java b/src/core/lombok/javac/apt/InterceptingJavaFileManager.java index 303bdc2f..9b58d111 100644 --- a/src/core/lombok/javac/apt/InterceptingJavaFileManager.java +++ b/src/core/lombok/javac/apt/InterceptingJavaFileManager.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 @@ -42,14 +42,14 @@ final class InterceptingJavaFileManager extends ForwardingJavaFileManager<JavaFi } @Override public JavaFileObject getJavaFileForOutput(Location location, String className, final Kind kind, FileObject sibling) throws IOException { - if (className.startsWith("lombok.dummy.ForceNewRound")) { + if (className.contains("lombok.dummy.ForceNewRound")) { final String name = className.replace(".", "/") + kind.extension; return LombokFileObjects.createEmpty(compiler, name, kind); } + JavaFileObject fileObject = fileManager.getJavaFileForOutput(location, className, kind, sibling); - if (kind != Kind.CLASS) { - return fileObject; - } + if (kind != Kind.CLASS) return fileObject; + return LombokFileObjects.createIntercepting(compiler, fileObject, className, diagnostics); } }
\ No newline at end of file diff --git a/src/core/lombok/javac/apt/LombokFileObjects.java b/src/core/lombok/javac/apt/LombokFileObjects.java index 7e818cab..aba10540 100644 --- a/src/core/lombok/javac/apt/LombokFileObjects.java +++ b/src/core/lombok/javac/apt/LombokFileObjects.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2017 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 @@ -22,19 +22,26 @@ package lombok.javac.apt; +import java.io.IOException; import java.lang.reflect.Method; import java.net.URI; +import java.nio.file.Path; import java.nio.file.Paths; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; +import javax.tools.FileObject; import javax.tools.JavaFileManager; import javax.tools.JavaFileObject; import javax.tools.JavaFileObject.Kind; -import com.sun.tools.javac.file.BaseFileManager; - import lombok.core.DiagnosticsReceiver; +import com.sun.tools.javac.file.BaseFileManager; + //Can't use SimpleJavaFileObject so we copy/paste most of its content here, because javac doesn't follow the interface, //and casts to its own BaseFileObject type. D'oh! final class LombokFileObjects { @@ -94,6 +101,15 @@ final class LombokFileObjects { private LombokFileObjects() {} + private static final List<String> KNOWN_JAVA9_FILE_MANAGERS = Arrays.asList( + "com.google.errorprone.MaskedClassLoader$MaskedFileManager", + "com.google.devtools.build.buildjar.javac.BlazeJavacMain$ClassloaderMaskingFileManager", + "com.google.devtools.build.java.turbine.javac.JavacTurbineCompiler$ClassloaderMaskingFileManager", + "org.netbeans.modules.java.source.parsing.ProxyFileManager", + "com.sun.tools.javac.api.ClientCodeWrapper$WrappedStandardJavaFileManager", + "com.sun.tools.javac.main.DelegatingJavaFileManager$DelegatingSJFM" // IntelliJ + JDK10 + ); + static Compiler getCompiler(JavaFileManager jfm) { String jfmClassName = jfm != null ? jfm.getClass().getName() : "null"; if (jfmClassName.equals("com.sun.tools.javac.util.DefaultFileManager")) return Compiler.JAVAC6; @@ -105,18 +121,36 @@ final class LombokFileObjects { return new Java9Compiler(jfm); } } - catch (Exception e) {} + catch (Throwable e) {} return Compiler.JAVAC7; } + if (KNOWN_JAVA9_FILE_MANAGERS.contains(jfmClassName)) { + try { + return new Java9Compiler(jfm); + } + catch (Throwable e) {} + } + try { + if (Class.forName("com.sun.tools.javac.file.PathFileObject") == null) throw new NullPointerException(); + return new Java9Compiler(jfm); + } catch (Throwable e) {} try { if (Class.forName("com.sun.tools.javac.file.BaseFileObject") == null) throw new NullPointerException(); return Compiler.JAVAC7; - } catch (Exception e) {} + } catch (Throwable e) {} try { if (Class.forName("com.sun.tools.javac.util.BaseFileObject") == null) throw new NullPointerException(); return Compiler.JAVAC6; - } catch (Exception e) {} - return null; + } catch (Throwable e) {} + + StringBuilder sb = new StringBuilder(jfmClassName); + if (jfm != null) { + sb.append(" extends ").append(jfm.getClass().getSuperclass().getName()); + for (Class<?> cls : jfm.getClass().getInterfaces()) { + sb.append(" implements ").append(cls.getName()); + } + } + throw new IllegalArgumentException(sb.toString()); } static JavaFileObject createEmpty(Compiler compiler, String name, Kind kind) { @@ -131,19 +165,108 @@ final class LombokFileObjects { private final BaseFileManager fileManager; public Java9Compiler(JavaFileManager jfm) { - fileManager = (BaseFileManager) jfm; + fileManager = asBaseFileManager(jfm); } @Override public JavaFileObject wrap(LombokFileObject fileObject) { + return new Javac9BaseFileObjectWrapper(fileManager, toPath(fileObject), fileObject); + } + + @Override public Method getDecoderMethod() { + return null; + } + + private static Path toPath(LombokFileObject fileObject) { URI uri = fileObject.toUri(); if (uri.getScheme() == null) { - uri = URI.create("file://" + uri); + uri = URI.create("file:///" + uri); + } + try { + return Paths.get(uri); + } catch (IllegalArgumentException e) { + throw new IllegalArgumentException("Problems in URI '" + uri + "' (" + fileObject.toUri() + ")", e); } - return new Javac9BaseFileObjectWrapper(fileManager, Paths.get(uri), fileObject); } - @Override public Method getDecoderMethod() { - throw new UnsupportedOperationException(); + private static BaseFileManager asBaseFileManager(JavaFileManager jfm) { + if (jfm instanceof BaseFileManager) { + return (BaseFileManager) jfm; + } + return new FileManagerWrapper(jfm); + } + + static class FileManagerWrapper extends BaseFileManager { + JavaFileManager manager; + + public FileManagerWrapper(JavaFileManager manager) { + super(null); + this.manager = manager; + } + + @Override + public int isSupportedOption(String option) { + return manager.isSupportedOption(option); + } + + @Override + public ClassLoader getClassLoader(Location location) { + return manager.getClassLoader(location); + } + + @Override + public Iterable<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds, boolean recurse) throws IOException { + return manager.list(location, packageName, kinds, recurse); + } + + @Override + public String inferBinaryName(Location location, JavaFileObject file) { + return manager.inferBinaryName(location, file); + } + + @Override + public boolean isSameFile(FileObject a, FileObject b) { + return manager.isSameFile(a, b); + } + + @Override + public boolean handleOption(String current, Iterator<String> remaining) { + return manager.handleOption(current, remaining); + } + + @Override + public boolean hasLocation(Location location) { + return manager.hasLocation(location); + } + + @Override + public JavaFileObject getJavaFileForInput(Location location, String className, Kind kind) throws IOException { + return manager.getJavaFileForInput(location, className, kind); + } + + @Override + public JavaFileObject getJavaFileForOutput(Location location, String className, Kind kind, FileObject sibling) throws IOException { + return manager.getJavaFileForOutput(location, className, kind, sibling); + } + + @Override + public FileObject getFileForInput(Location location, String packageName, String relativeName) throws IOException { + return manager.getFileForInput(location, packageName, relativeName); + } + + @Override + public FileObject getFileForOutput(Location location, String packageName, String relativeName, FileObject sibling) throws IOException { + return manager.getFileForOutput(location, packageName, relativeName, sibling); + } + + @Override + public void flush() throws IOException { + manager.flush(); + } + + @Override + public void close() throws IOException { + manager.close(); + } } } } diff --git a/src/core/lombok/javac/apt/LombokProcessor.java b/src/core/lombok/javac/apt/LombokProcessor.java index b962a955..9c0a2dfa 100644 --- a/src/core/lombok/javac/apt/LombokProcessor.java +++ b/src/core/lombok/javac/apt/LombokProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2017 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 @@ -54,6 +54,8 @@ import lombok.javac.JavacTransformer; import com.sun.source.util.TreePath; import com.sun.source.util.Trees; +import com.sun.tools.javac.jvm.ClassWriter; +import com.sun.tools.javac.main.JavaCompiler; import com.sun.tools.javac.processing.JavacFiler; import com.sun.tools.javac.processing.JavacProcessingEnvironment; import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; @@ -156,7 +158,6 @@ public class LombokProcessor extends AbstractProcessor { @SuppressWarnings("unchecked") Map<Object,Object> ht = (Map<Object,Object>) htField.get(context); final JavaFileManager originalFiler = (JavaFileManager) ht.get(key); - if (!(originalFiler instanceof InterceptingJavaFileManager)) { final Messager messager = processingEnv.getMessager(); DiagnosticsReceiver receiver = new MessagerDiagnosticsReceiver(messager); @@ -166,11 +167,37 @@ public class LombokProcessor extends AbstractProcessor { Field filerFileManagerField = JavacFiler.class.getDeclaredField("fileManager"); filerFileManagerField.setAccessible(true); filerFileManagerField.set(processingEnv.getFiler(), newFiler); + + replaceFileManagerJdk9(context, newFiler); } } catch (Exception e) { throw Lombok.sneakyThrow(e); } } + + private void replaceFileManagerJdk9(Context context, JavaFileManager newFiler) { + try { + JavaCompiler compiler = (JavaCompiler) JavaCompiler.class.getDeclaredMethod("instance", Context.class).invoke(null, context); + try { + Field fileManagerField = JavaCompiler.class.getDeclaredField("fileManager"); + fileManagerField.setAccessible(true); + fileManagerField.set(compiler, newFiler); + } + catch (Exception e) {} + + try { + Field writerField = JavaCompiler.class.getDeclaredField("writer"); + writerField.setAccessible(true); + ClassWriter writer = (ClassWriter) writerField.get(compiler); + Field fileManagerField = ClassWriter.class.getDeclaredField("fileManager"); + fileManagerField.setAccessible(true); + fileManagerField.set(writer, newFiler); + } + catch (Exception e) {} + } + catch (Exception e) { + } + } private void forceMultipleRoundsInNetBeansEditor() { try { @@ -274,7 +301,10 @@ public class LombokProcessor extends AbstractProcessor { // Step 1: Take all CUs which aren't already in the map. Give them the first priority level. + String randomModuleName = null; + for (Element element : roundEnv.getRootElements()) { + if (randomModuleName == null) randomModuleName = getModuleNameFor(element); JCCompilationUnit unit = toUnit(element); if (unit == null) continue; if (roots.containsKey(unit)) continue; @@ -317,20 +347,22 @@ public class LombokProcessor extends AbstractProcessor { if (newLevels.isEmpty()) return false; newLevels.retainAll(priorityLevelsRequiringResolutionReset); - if (!newLevels.isEmpty()){ + if (!newLevels.isEmpty()) { // Force a new round to reset resolution. The next round will cause this method (process) to be called again. - forceNewRound((JavacFiler) processingEnv.getFiler()); + forceNewRound(randomModuleName, (JavacFiler) processingEnv.getFiler()); return false; } - // None of the new levels need resolution, so just keep going. + // None of the new levels need resolution, so just keep going. } } private int dummyCount = 0; - private void forceNewRound(JavacFiler filer) { + private void forceNewRound(String randomModuleName, JavacFiler filer) { if (!filer.newFiles()) { try { - JavaFileObject dummy = filer.createSourceFile("lombok.dummy.ForceNewRound" + (dummyCount++)); + String name = "lombok.dummy.ForceNewRound" + (dummyCount++); + if (randomModuleName != null) name = randomModuleName + "/" + name; + JavaFileObject dummy = filer.createSourceFile(name); Writer w = dummy.openWriter(); w.close(); } catch (Exception e) { @@ -341,6 +373,19 @@ public class LombokProcessor extends AbstractProcessor { } } + private String getModuleNameFor(Element element) { + while (element != null) { + if (element.getKind().name().equals("MODULE")) { + String n = element.getSimpleName().toString().trim(); + return n.isEmpty() ? null : n; + } + Element n = element.getEnclosingElement(); + if (n == element) return null; + element = n; + } + return null; + } + private JCCompilationUnit toUnit(Element element) { TreePath path = trees == null ? null : trees.getPath(element); if (path == null) return null; diff --git a/src/core/lombok/javac/handlers/HandleBuilder.java b/src/core/lombok/javac/handlers/HandleBuilder.java index 9860fb07..4c575d91 100644 --- a/src/core/lombok/javac/handlers/HandleBuilder.java +++ b/src/core/lombok/javac/handlers/HandleBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2015 The Project Lombok Authors. + * Copyright (C) 2013-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,7 +21,6 @@ */ package lombok.javac.handlers; -import java.lang.annotation.Annotation; import java.util.ArrayList; import javax.lang.model.element.Modifier; @@ -76,6 +75,8 @@ import static lombok.javac.JavacTreeMaker.TypeTag.*; @ProviderFor(JavacAnnotationHandler.class) @HandlerPriority(-1024) //-2^10; to ensure we've picked up @FieldDefault's changes (-2048) but @Value hasn't removed itself yet (-512), so that we can error on presence of it on the builder classes. public class HandleBuilder extends JavacAnnotationHandler<Builder> { + private HandleConstructor handleConstructor = new HandleConstructor(); + private static final boolean toBoolean(Object expr, boolean defaultValue) { if (expr == null) return defaultValue; if (expr instanceof JCLiteral) return ((Integer) ((JCLiteral) expr).value) != 0; @@ -87,9 +88,12 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { JCExpression type; Name rawName; Name name; + Name nameOfDefaultProvider; + Name nameOfSetFlag; SingularData singularData; ObtainVia obtainVia; JavacNode obtainViaNode; + JavacNode originalFieldNode; java.util.List<JavacNode> createdFields = new ArrayList<JavacNode>(); } @@ -107,18 +111,14 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { String toBuilderMethodName = "toBuilder"; boolean inherit = builderInstance.inherit(); - boolean extendable = inherit || builderInstance.extendable(); // inherit implies extendable - String superclassBuilderClassName = builderInstance.superclassBuilderClassName(); - + boolean extensible = inherit || builderInstance.extensible(); // inherit implies extendable + boolean toBuilder = builderInstance.toBuilder(); java.util.List<Name> typeArgsForToBuilder = null; if (builderMethodName == null) builderMethodName = "builder"; if (buildMethodName == null) buildMethodName = "build"; if (builderClassName == null) builderClassName = ""; - if (superclassBuilderClassName == null) { - superclassBuilderClassName = ""; - } if (!checkName("builderMethodName", builderMethodName, annotationNode)) return; if (!checkName("buildMethodName", buildMethodName, annotationNode)) return; @@ -126,9 +126,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { if (!checkName("builderClassName", builderClassName, annotationNode)) return; } - @SuppressWarnings("deprecation") - Class<? extends Annotation> oldExperimentalBuilder = lombok.experimental.Builder.class; - deleteAnnotationIfNeccessary(annotationNode, Builder.class, oldExperimentalBuilder); + deleteAnnotationIfNeccessary(annotationNode, Builder.class, "lombok.experimental.Builder"); JavacNode parent = annotationNode.up(); @@ -143,43 +141,61 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { boolean addCleaning = false; boolean isStatic = true; + JCClassDecl td = null; + if (parent.get() instanceof JCClassDecl) { tdParent = parent; - JCClassDecl td = (JCClassDecl) tdParent.get(); + td = (JCClassDecl) tdParent.get(); ListBuffer<JavacNode> allFields = new ListBuffer<JavacNode>(); - @SuppressWarnings("deprecation") - boolean valuePresent = (hasAnnotation(lombok.Value.class, parent) || hasAnnotation(lombok.experimental.Value.class, parent)); - for (JavacNode fieldNode : HandleConstructor.findAllFields(tdParent)) { + boolean valuePresent = (hasAnnotation(lombok.Value.class, parent) || hasAnnotation("lombok.experimental.Value", parent)); + for (JavacNode fieldNode : HandleConstructor.findAllFields(tdParent, true)) { JCVariableDecl fd = (JCVariableDecl) fieldNode.get(); - // final fields with an initializer cannot be written to, so they can't be 'builderized'. Unfortunately presence of @Value makes - // non-final fields final, but @Value's handler hasn't done this yet, so we have to do this math ourselves. - // Value will only skip making a field final if it has an explicit @NonFinal annotation, so we check for that. - if (fd.init != null && valuePresent && !hasAnnotation(NonFinal.class, fieldNode)) continue; + JavacNode isDefault = findAnnotation(Builder.Default.class, fieldNode, true); + boolean isFinal = (fd.mods.flags & Flags.FINAL) != 0 || (valuePresent && !hasAnnotation(NonFinal.class, fieldNode)); BuilderFieldData bfd = new BuilderFieldData(); bfd.fieldNode = fieldNode; bfd.rawName = fd.name; bfd.name = removePrefixFromField(fieldNode); bfd.type = fd.vartype; bfd.singularData = getSingularData(fieldNode); + bfd.originalFieldNode = fieldNode; + + if (bfd.singularData != null && isDefault != null) { + isDefault.addError("@Builder.Default and @Singular cannot be mixed."); + isDefault = null; + } + + if (fd.init == null && isDefault != null) { + isDefault.addWarning("@Builder.Default requires an initializing expression (' = something;')."); + isDefault = null; + } + + if (fd.init != null && isDefault == null) { + if (isFinal) continue; + fieldNode.addWarning("@Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. If it is not supposed to be settable during building, make the field final."); + } + + if (isDefault != null) { + bfd.nameOfDefaultProvider = parent.toName("$default$" + bfd.name); + bfd.nameOfSetFlag = parent.toName(bfd.name + "$set"); + JCMethodDecl md = generateDefaultProvider(bfd.nameOfDefaultProvider, fieldNode, td.typarams); + recursiveSetGeneratedBy(md, ast, annotationNode.getContext()); + if (md != null) injectMethod(tdParent, md); + } addObtainVia(bfd, fieldNode); builderFields.add(bfd); allFields.append(fieldNode); } - if (builderClassName.isEmpty()) { - builderClassName = td.name.toString() + "Builder"; - } + if (builderClassName.isEmpty()) builderClassName = td.name.toString() + "Builder"; JCTree extendsClause = Javac.getExtendsClause(td); - if (superclassBuilderClassName.isEmpty() && extendsClause != null) { - superclassBuilderClassName = extendsClause + "Builder"; - } - if (extendable) { + if (extensible) { boolean callBuilderBasedSuperConstructor = extendsClause != null; generateBuilderBasedConstructor(tdParent, builderFields, annotationNode, builderClassName, callBuilderBasedSuperConstructor); } else { - new HandleConstructor().generateConstructor(tdParent, AccessLevel.PROTECTED, List.<JCAnnotation>nil(), allFields.toList(), false, null, SkipIfConstructorExists.I_AM_BUILDER, annotationNode); + handleConstructor.generateConstructor(tdParent, AccessLevel.PROTECTED, List.<JCAnnotation>nil(), allFields.toList(), false, null, SkipIfConstructorExists.I_AM_BUILDER, annotationNode); } returnType = namePlusTypeParamsToTypeReference(tdParent.getTreeMaker(), td.name, td.typarams); @@ -191,7 +207,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { annotationNode.addError("@Builder(inherit=true) is only supported for type builders."); return; } - if (extendable) { + if (extensible) { annotationNode.addError("@Builder(extendable=true) is only supported for type builders."); return; } @@ -202,7 +218,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { } tdParent = parent.up(); - JCClassDecl td = (JCClassDecl) tdParent.get(); + td = (JCClassDecl) tdParent.get(); returnType = namePlusTypeParamsToTypeReference(tdParent.getTreeMaker(), td.name, td.typarams); typeParams = td.typarams; thrownExceptions = jmd.thrown; @@ -213,12 +229,12 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { annotationNode.addError("@Builder(inherit=true) is only supported for type builders."); return; } - if (extendable) { + if (extensible) { annotationNode.addError("@Builder(extendable=true) is only supported for type builders."); return; } tdParent = parent.up(); - JCClassDecl td = (JCClassDecl) tdParent.get(); + td = (JCClassDecl) tdParent.get(); JCMethodDecl jmd = (JCMethodDecl) fillParametersFrom.get(); isStatic = (jmd.mods.flags & Flags.STATIC) != 0; JCExpression fullReturnType = jmd.restype; @@ -227,7 +243,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { thrownExceptions = jmd.thrown; nameOfBuilderMethod = jmd.name; if (returnType instanceof JCTypeApply) { - returnType = ((JCTypeApply) returnType).clazz; + returnType = cloneType(tdParent.getTreeMaker(), returnType, ast, annotationNode.getContext()); } if (builderClassName.isEmpty()) { if (returnType instanceof JCFieldAccess) { @@ -247,7 +263,16 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { if (Character.isLowerCase(builderClassName.charAt(0))) { builderClassName = Character.toTitleCase(builderClassName.charAt(0)) + builderClassName.substring(1); } - } else { + } else if (returnType instanceof JCTypeApply) { + JCExpression clazz = ((JCTypeApply) returnType).clazz; + if (clazz instanceof JCFieldAccess) { + builderClassName = ((JCFieldAccess) clazz).name + "Builder"; + } else if (clazz instanceof JCIdent) { + builderClassName = ((JCIdent) clazz).name + "Builder"; + } + } + + if (builderClassName.isEmpty()) { // This shouldn't happen. System.err.println("Lombok bug ID#20140614-1651: javac HandleBuilder: return type to name conversion failed: " + returnType.getClass()); builderClassName = td.name.toString() + "Builder"; @@ -268,11 +293,14 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { tpOnRet = ((JCTypeApply) fullReturnType).arguments; } - if (returnType instanceof JCIdent) { - simpleName = ((JCIdent) returnType).name; + JCExpression namingType = returnType; + if (returnType instanceof JCTypeApply) namingType = ((JCTypeApply) returnType).clazz; + + if (namingType instanceof JCIdent) { + simpleName = ((JCIdent) namingType).name; pkg = null; - } else if (returnType instanceof JCFieldAccess) { - JCFieldAccess jcfa = (JCFieldAccess) returnType; + } else if (namingType instanceof JCFieldAccess) { + JCFieldAccess jcfa = (JCFieldAccess) namingType; simpleName = jcfa.name; pkg = unpack(jcfa.selected); if (pkg.startsWith("ERR:")) { @@ -281,7 +309,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { return; } } else { - annotationNode.addError("Expected a (parameterized) type here instead of a " + returnType.getClass().getName()); + annotationNode.addError("Expected a (parameterized) type here instead of a " + namingType.getClass().getName()); return; } @@ -330,6 +358,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { bfd.rawName = raw.name; bfd.type = raw.vartype; bfd.singularData = getSingularData(param); + bfd.originalFieldNode = param; addObtainVia(bfd, param); builderFields.add(bfd); } @@ -337,7 +366,18 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { JavacNode builderType = findInnerClass(tdParent, builderClassName); if (builderType == null) { - builderType = makeBuilderClass(isStatic, annotationNode, tdParent, builderClassName, typeParams, ast, inherit ? superclassBuilderClassName : null); + String superclassBuilderClassName = null; + if (inherit) { + JCTree extendsClause = Javac.getExtendsClause(td); + if (extendsClause == null) { + annotationNode.addError("@Builder(inherit = true) requires that your class has an 'extends' clause."); + return; + } + + superclassBuilderClassName = builderInstance.superclassBuilderClassName(); + if (superclassBuilderClassName == null || superclassBuilderClassName.isEmpty()) superclassBuilderClassName = extendsClause + "Builder"; + } + builderType = makeBuilderClass(isStatic, annotationNode, tdParent, builderClassName, typeParams, ast, superclassBuilderClassName); } else { JCClassDecl builderTypeDeclaration = (JCClassDecl) builderType.get(); if (isStatic && !builderTypeDeclaration.getModifiers().getFlags().contains(Modifier.STATIC)) { @@ -397,8 +437,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { } if (methodExists(buildMethodName, builderType, -1) == MemberExistsResult.NOT_EXISTS) { - boolean useBuilderBasedConstructor = parent.get() instanceof JCClassDecl && extendable; - JCMethodDecl md = generateBuildMethod(isStatic, buildMethodName, nameOfBuilderMethod, returnType, builderFields, builderType, thrownExceptions, ast, addCleaning, useBuilderBasedConstructor); + JCMethodDecl md = generateBuildMethod(tdParent, isStatic, buildMethodName, nameOfBuilderMethod, returnType, builderFields, builderType, thrownExceptions, ast, addCleaning, extensible); if (md != null) injectMethod(builderType, md); } @@ -528,17 +567,10 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { * {@code builderClassAsParameter != null}. */ private void generateBuilderBasedConstructor(JavacNode typeNode, java.util.List<BuilderFieldData> builderFields, JavacNode source, String builderClassnameAsParameter, boolean callBuilderBasedSuperConstructor) { - if (builderClassnameAsParameter == null || builderClassnameAsParameter.isEmpty()) { - source.addError("A builder-based constructor requires a non-empty 'builderClassnameAsParameter' value."); - } - JavacTreeMaker maker = typeNode.getTreeMaker(); - AccessLevel level = AccessLevel.PROTECTED; boolean isEnum = (((JCClassDecl) typeNode.get()).mods.flags & Flags.ENUM) != 0; - if (isEnum) { - level = AccessLevel.PRIVATE; - } + AccessLevel level = isEnum ? AccessLevel.PRIVATE : AccessLevel.PROTECTED; ListBuffer<JCStatement> nullChecks = new ListBuffer<JCStatement>(); ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>(); @@ -583,11 +615,11 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { List.<JCExpression>of(maker.Ident(builderVariableName))); statements.prepend(maker.Exec(callToSuperConstructor)); } - + JCMethodDecl constr = recursiveSetGeneratedBy(maker.MethodDef(mods, typeNode.toName("<init>"), null, List.<JCTypeParameter>nil(), params.toList(), List.<JCExpression>nil(), maker.Block(0L, nullChecks.appendList(statements).toList()), null), source.get(), typeNode.getContext()); - + injectMethod(typeNode, constr, null, Javac.createVoidType(typeNode.getSymbolTable(), CTC_VOID)); } @@ -601,7 +633,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { } } - statements.append(maker.Exec(maker.Assign(maker.Select(maker.Ident(type.toName("this")), type.toName("$lombokUnclean")), maker.Literal(CTC_BOOLEAN, false)))); + statements.append(maker.Exec(maker.Assign(maker.Select(maker.Ident(type.toName("this")), type.toName("$lombokUnclean")), maker.Literal(CTC_BOOLEAN, 0)))); JCBlock body = maker.Block(0, statements.toList()); return maker.MethodDef(maker.Modifiers(Flags.PUBLIC), type.toName("$lombokClean"), maker.Type(Javac.createVoidType(type.getSymbolTable(), CTC_VOID)), List.<JCTypeParameter>nil(), List.<JCVariableDecl>nil(), List.<JCExpression>nil(), body, null); /* @@ -624,13 +656,13 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { * that takes the builder instance as parameter (instead of a * constructor with all relevant fields as parameters) */ - private JCMethodDecl generateBuildMethod(boolean isStatic, String buildName, Name builderName, JCExpression returnType, java.util.List<BuilderFieldData> builderFields, JavacNode type, List<JCExpression> thrownExceptions, JCTree source, boolean addCleaning, boolean useBuilderBasedConstructor) { + private JCMethodDecl generateBuildMethod(JavacNode tdParent, boolean isStatic, String buildName, Name builderName, JCExpression returnType, java.util.List<BuilderFieldData> builderFields, JavacNode type, List<JCExpression> thrownExceptions, JCTree source, boolean addCleaning, boolean useBuilderBasedConstructor) { JavacTreeMaker maker = type.getTreeMaker(); JCExpression call; ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>(); ListBuffer<JCExpression> args = new ListBuffer<JCExpression>(); - + // Extendable builders assign their values in the constructor, not in this build() method. if (!useBuilderBasedConstructor) { if (addCleaning) { @@ -645,13 +677,17 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { bfd.singularData.getSingularizer().appendBuildCode(bfd.singularData, type, source, statements, bfd.name, "this"); } } - + for (BuilderFieldData bfd : builderFields) { + if (bfd.nameOfSetFlag != null) { + statements.append(maker.VarDef(maker.Modifiers(0L), bfd.name, cloneType(maker, bfd.type, source, tdParent.getContext()), maker.Select(maker.Ident(type.toName("this")), bfd.name))); + statements.append(maker.If(maker.Unary(CTC_NOT, maker.Ident(bfd.nameOfSetFlag)), maker.Exec(maker.Assign(maker.Ident(bfd.name),maker.Apply(typeParameterNames(maker, ((JCClassDecl) tdParent.get()).typarams), maker.Select(maker.Ident(((JCClassDecl) tdParent.get()).name), bfd.nameOfDefaultProvider), List.<JCExpression>nil()))), null)); + } args.append(maker.Ident(bfd.name)); } if (addCleaning) { - statements.append(maker.Exec(maker.Assign(maker.Select(maker.Ident(type.toName("this")), type.toName("$lombokUnclean")), maker.Literal(CTC_BOOLEAN, true)))); + statements.append(maker.Exec(maker.Assign(maker.Select(maker.Ident(type.toName("this")), type.toName("$lombokUnclean")), maker.Literal(CTC_BOOLEAN, 1)))); } } @@ -666,14 +702,12 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { } statements.append(maker.Return(call)); } else { - ListBuffer<JCExpression> typeParams = new ListBuffer<JCExpression>(); for (JCTypeParameter tp : ((JCClassDecl) type.get()).typarams) { typeParams.append(maker.Ident(tp.name)); } JCExpression callee = maker.Ident(((JCClassDecl) type.up().get()).name); - if (!isStatic) - callee = maker.Select(callee, type.up().toName("this")); + if (!isStatic) callee = maker.Select(callee, type.up().toName("this")); JCExpression fn = maker.Select(callee, builderName); call = maker.Apply(typeParams.toList(), fn, args.toList()); if (returnType instanceof JCPrimitiveTypeTree && CTC_VOID.equals(typeTag(returnType))) { @@ -688,6 +722,18 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { return maker.MethodDef(maker.Modifiers(Flags.PUBLIC), type.toName(buildName), returnType, List.<JCTypeParameter>nil(), List.<JCVariableDecl>nil(), thrownExceptions, body, null); } + public JCMethodDecl generateDefaultProvider(Name methodName, JavacNode fieldNode, List<JCTypeParameter> params) { + JavacTreeMaker maker = fieldNode.getTreeMaker(); + JCVariableDecl field = (JCVariableDecl) fieldNode.get(); + + JCStatement statement = maker.Return(field.init); + field.init = null; + + JCBlock body = maker.Block(0, List.<JCStatement>of(statement)); + int modifiers = Flags.PRIVATE | Flags.STATIC; + return maker.MethodDef(maker.Modifiers(modifiers), methodName, cloneType(maker, field.vartype, field, fieldNode.getContext()), copyTypeParams(fieldNode, params), List.<JCVariableDecl>nil(), List.<JCExpression>nil(), body, null); + } + public JCMethodDecl generateBuilderMethod(boolean isStatic, String builderMethodName, String builderClassName, JavacNode source, JavacNode type, List<JCTypeParameter> typeParams) { JavacTreeMaker maker = type.getTreeMaker(); @@ -712,36 +758,43 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { if (child.getKind() == Kind.FIELD) existing.add(child); } - top: for (int i = len - 1; i >= 0; i--) { BuilderFieldData bfd = builderFields.get(i); if (bfd.singularData != null && bfd.singularData.getSingularizer() != null) { bfd.createdFields.addAll(bfd.singularData.getSingularizer().generateFields(bfd.singularData, builderType, source)); } else { + JavacNode field = null, setFlag = null; for (JavacNode exists : existing) { Name n = ((JCVariableDecl) exists.get()).name; - if (n.equals(bfd.name)) { - bfd.createdFields.add(exists); - continue top; - } + if (n.equals(bfd.name)) field = exists; + if (n.equals(bfd.nameOfSetFlag)) setFlag = exists; } JavacTreeMaker maker = builderType.getTreeMaker(); - JCModifiers mods = maker.Modifiers(Flags.PRIVATE); - JCVariableDecl newField = maker.VarDef(mods, bfd.name, cloneType(maker, bfd.type, source, builderType.getContext()), null); - bfd.createdFields.add(injectFieldAndMarkGenerated(builderType, newField)); + if (field == null) { + JCModifiers mods = maker.Modifiers(Flags.PRIVATE); + JCVariableDecl newField = maker.VarDef(mods, bfd.name, cloneType(maker, bfd.type, source, builderType.getContext()), null); + field = injectFieldAndMarkGenerated(builderType, newField); + } + if (setFlag == null && bfd.nameOfSetFlag != null) { + JCModifiers mods = maker.Modifiers(Flags.PRIVATE); + JCVariableDecl newField = maker.VarDef(mods, bfd.nameOfSetFlag, maker.TypeIdent(CTC_BOOLEAN), null); + injectFieldAndMarkGenerated(builderType, newField); + } + bfd.createdFields.add(field); } } } public void makeSetterMethodsForBuilder(JavacNode builderType, BuilderFieldData fieldNode, JavacNode source, boolean fluent, boolean chain) { + boolean deprecate = isFieldDeprecated(fieldNode.originalFieldNode); if (fieldNode.singularData == null || fieldNode.singularData.getSingularizer() == null) { - makeSimpleSetterMethodForBuilder(builderType, fieldNode.createdFields.get(0), source, fluent, chain); + makeSimpleSetterMethodForBuilder(builderType, deprecate, fieldNode.createdFields.get(0), fieldNode.nameOfSetFlag, source, fluent, chain); } else { - fieldNode.singularData.getSingularizer().generateMethods(fieldNode.singularData, builderType, source.get(), fluent, chain); + fieldNode.singularData.getSingularizer().generateMethods(fieldNode.singularData, deprecate, builderType, source.get(), fluent, chain); } } - private void makeSimpleSetterMethodForBuilder(JavacNode builderType, JavacNode fieldNode, JavacNode source, boolean fluent, boolean chain) { + private void makeSimpleSetterMethodForBuilder(JavacNode builderType, boolean deprecate, JavacNode fieldNode, Name nameOfSetFlag, JavacNode source, boolean fluent, boolean chain) { Name fieldName = ((JCVariableDecl) fieldNode.get()).name; for (JavacNode child : builderType.down()) { @@ -754,7 +807,9 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { String setterName = fluent ? fieldNode.getName() : HandlerUtil.buildAccessorName("set", fieldNode.getName()); JavacTreeMaker maker = fieldNode.getTreeMaker(); - JCMethodDecl newMethod = HandleSetter.createSetter(Flags.PUBLIC, fieldNode, maker, setterName, chain, source, List.<JCAnnotation>nil(), List.<JCAnnotation>nil()); + + JCMethodDecl newMethod = HandleSetter.createSetter(Flags.PUBLIC, deprecate, fieldNode, maker, setterName, nameOfSetFlag, chain, source, List.<JCAnnotation>nil(), List.<JCAnnotation>nil()); + injectMethod(builderType, newMethod); } @@ -772,10 +827,7 @@ public class HandleBuilder extends JavacAnnotationHandler<Builder> { int modifiers = Flags.PUBLIC; if (isStatic) modifiers |= Flags.STATIC; JCModifiers mods = maker.Modifiers(modifiers); - JCExpression extending = null; - if (parentBuilderClassName != null) { - extending = maker.Ident(tdParent.toName(parentBuilderClassName)); - } + JCExpression extending = parentBuilderClassName == null ? null : maker.Ident(tdParent.toName(parentBuilderClassName)); JCClassDecl builder = maker.ClassDef(mods, tdParent.toName(builderClassName), copyTypeParams(source, typeParams), extending, List.<JCExpression>nil(), List.<JCTree>nil()); return injectType(tdParent, builder); } diff --git a/src/core/lombok/javac/handlers/HandleBuilderDefault.java b/src/core/lombok/javac/handlers/HandleBuilderDefault.java new file mode 100644 index 00000000..4c4ba0e8 --- /dev/null +++ b/src/core/lombok/javac/handlers/HandleBuilderDefault.java @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2017-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. + */ +package lombok.javac.handlers; + +import static lombok.javac.handlers.JavacHandlerUtil.*; + +import org.mangosdk.spi.ProviderFor; + +import com.sun.tools.javac.tree.JCTree.JCAnnotation; + +import lombok.Builder; +import lombok.core.AST.Kind; +import lombok.core.AnnotationValues; +import lombok.core.HandlerPriority; +import lombok.javac.JavacAnnotationHandler; +import lombok.javac.JavacNode; + +@ProviderFor(JavacAnnotationHandler.class) +@HandlerPriority(-1025) //HandleBuilder's level, minus one. +public class HandleBuilderDefault extends JavacAnnotationHandler<Builder.Default> { + @Override public void handle(AnnotationValues<Builder.Default> annotation, JCAnnotation ast, JavacNode annotationNode) { + JavacNode annotatedField = annotationNode.up(); + if (annotatedField.getKind() != Kind.FIELD) return; + JavacNode classWithAnnotatedField = annotatedField.up(); + if (!hasAnnotation(Builder.class, classWithAnnotatedField) && !hasAnnotation("lombok.experimental.Builder", classWithAnnotatedField)) { + annotationNode.addWarning("@Builder.Default requires @Builder on the class for it to mean anything."); + deleteAnnotationIfNeccessary(annotationNode, Builder.Default.class); + } + } +} diff --git a/src/core/lombok/javac/handlers/HandleConstructor.java b/src/core/lombok/javac/handlers/HandleConstructor.java index 4e90b639..dca25ee7 100644 --- a/src/core/lombok/javac/handlers/HandleConstructor.java +++ b/src/core/lombok/javac/handlers/HandleConstructor.java @@ -64,6 +64,8 @@ import com.sun.tools.javac.util.Name; public class HandleConstructor { @ProviderFor(JavacAnnotationHandler.class) public static class HandleNoArgsConstructor extends JavacAnnotationHandler<NoArgsConstructor> { + private HandleConstructor handleConstructor = new HandleConstructor(); + @Override public void handle(AnnotationValues<NoArgsConstructor> annotation, JCAnnotation ast, JavacNode annotationNode) { handleFlagUsage(annotationNode, ConfigurationKeys.NO_ARGS_CONSTRUCTOR_FLAG_USAGE, "@NoArgsConstructor", ConfigurationKeys.ANY_CONSTRUCTOR_FLAG_USAGE, "any @xArgsConstructor"); @@ -78,12 +80,14 @@ public class HandleConstructor { String staticName = ann.staticName(); boolean force = ann.force(); List<JavacNode> fields = force ? findFinalFields(typeNode) : List.<JavacNode>nil(); - new HandleConstructor().generateConstructor(typeNode, level, onConstructor, fields, force, staticName, SkipIfConstructorExists.NO, annotationNode); + handleConstructor.generateConstructor(typeNode, level, onConstructor, fields, force, staticName, SkipIfConstructorExists.NO, annotationNode); } } @ProviderFor(JavacAnnotationHandler.class) public static class HandleRequiredArgsConstructor extends JavacAnnotationHandler<RequiredArgsConstructor> { + private HandleConstructor handleConstructor = new HandleConstructor(); + @Override public void handle(AnnotationValues<RequiredArgsConstructor> annotation, JCAnnotation ast, JavacNode annotationNode) { handleFlagUsage(annotationNode, ConfigurationKeys.REQUIRED_ARGS_CONSTRUCTOR_FLAG_USAGE, "@RequiredArgsConstructor", ConfigurationKeys.ANY_CONSTRUCTOR_FLAG_USAGE, "any @xArgsConstructor"); @@ -100,7 +104,7 @@ public class HandleConstructor { annotationNode.addError("This deprecated feature is no longer supported. Remove it; you can create a lombok.config file with 'lombok.anyConstructor.suppressConstructorProperties = true'."); } - new HandleConstructor().generateConstructor(typeNode, level, onConstructor, findRequiredFields(typeNode), false, staticName, SkipIfConstructorExists.NO, annotationNode); + handleConstructor.generateConstructor(typeNode, level, onConstructor, findRequiredFields(typeNode), false, staticName, SkipIfConstructorExists.NO, annotationNode); } } @@ -131,6 +135,8 @@ public class HandleConstructor { @ProviderFor(JavacAnnotationHandler.class) public static class HandleAllArgsConstructor extends JavacAnnotationHandler<AllArgsConstructor> { + private HandleConstructor handleConstructor = new HandleConstructor(); + @Override public void handle(AnnotationValues<AllArgsConstructor> annotation, JCAnnotation ast, JavacNode annotationNode) { handleFlagUsage(annotationNode, ConfigurationKeys.ALL_ARGS_CONSTRUCTOR_FLAG_USAGE, "@AllArgsConstructor", ConfigurationKeys.ANY_CONSTRUCTOR_FLAG_USAGE, "any @xArgsConstructor"); @@ -146,11 +152,15 @@ public class HandleConstructor { if (annotation.isExplicit("suppressConstructorProperties")) { annotationNode.addError("This deprecated feature is no longer supported. Remove it; you can create a lombok.config file with 'lombok.anyConstructor.suppressConstructorProperties = true'."); } - new HandleConstructor().generateConstructor(typeNode, level, onConstructor, findAllFields(typeNode), false, staticName, SkipIfConstructorExists.NO, annotationNode); + handleConstructor.generateConstructor(typeNode, level, onConstructor, findAllFields(typeNode), false, staticName, SkipIfConstructorExists.NO, annotationNode); } } public static List<JavacNode> findAllFields(JavacNode typeNode) { + return findAllFields(typeNode, false); + } + + public static List<JavacNode> findAllFields(JavacNode typeNode, boolean evenFinalInitialized) { ListBuffer<JavacNode> fields = new ListBuffer<JavacNode>(); for (JavacNode child : typeNode.down()) { if (child.getKind() != Kind.FIELD) continue; @@ -162,7 +172,7 @@ public class HandleConstructor { if ((fieldFlags & Flags.STATIC) != 0) continue; //Skip initialized final fields boolean isFinal = (fieldFlags & Flags.FINAL) != 0; - if (!isFinal || fieldDecl.init == null) fields.append(child); + if (evenFinalInitialized || !isFinal || fieldDecl.init == null) fields.append(child); } return fields.toList(); } @@ -256,18 +266,20 @@ public class HandleConstructor { mods.annotations = mods.annotations.append(annotation); } - public static JCMethodDecl createConstructor(AccessLevel level, List<JCAnnotation> onConstructor, JavacNode typeNode, List<JavacNode> fields, boolean allToDefault, JavacNode source) { + @SuppressWarnings("deprecation") public static JCMethodDecl createConstructor(AccessLevel level, List<JCAnnotation> onConstructor, JavacNode typeNode, List<JavacNode> fields, boolean allToDefault, JavacNode source) { JavacTreeMaker maker = typeNode.getTreeMaker(); boolean isEnum = (((JCClassDecl) typeNode.get()).mods.flags & Flags.ENUM) != 0; if (isEnum) level = AccessLevel.PRIVATE; - boolean suppressConstructorProperties; + boolean addConstructorProperties; if (fields.isEmpty()) { - suppressConstructorProperties = false; + addConstructorProperties = false; } else { - suppressConstructorProperties = Boolean.TRUE.equals(typeNode.getAst().readConfiguration(ConfigurationKeys.ANY_CONSTRUCTOR_SUPPRESS_CONSTRUCTOR_PROPERTIES)); + Boolean v = typeNode.getAst().readConfiguration(ConfigurationKeys.ANY_CONSTRUCTOR_ADD_CONSTRUCTOR_PROPERTIES); + addConstructorProperties = v != null ? v.booleanValue() : + Boolean.FALSE.equals(typeNode.getAst().readConfiguration(ConfigurationKeys.ANY_CONSTRUCTOR_SUPPRESS_CONSTRUCTOR_PROPERTIES)); } ListBuffer<JCStatement> nullChecks = new ListBuffer<JCStatement>(); @@ -285,7 +297,7 @@ public class HandleConstructor { JCVariableDecl param = maker.VarDef(maker.Modifiers(flags, nonNulls.appendList(nullables)), fieldName, field.vartype, null); params.append(param); if (!nonNulls.isEmpty()) { - JCStatement nullCheck = generateNullCheck(maker, fieldNode, source); + JCStatement nullCheck = generateNullCheck(maker, fieldNode, param, source); if (nullCheck != null) nullChecks.append(nullCheck); } } @@ -295,7 +307,7 @@ public class HandleConstructor { } JCModifiers mods = maker.Modifiers(toJavacModifier(level), List.<JCAnnotation>nil()); - if (!allToDefault && !suppressConstructorProperties && level != AccessLevel.PRIVATE && level != AccessLevel.PACKAGE && !isLocalType(typeNode) && LombokOptionsFactory.getDelombokOptions(typeNode.getContext()).getFormatPreferences().generateConstructorProperties()) { + if (!allToDefault && addConstructorProperties && !isLocalType(typeNode) && LombokOptionsFactory.getDelombokOptions(typeNode.getContext()).getFormatPreferences().generateConstructorProperties()) { addConstructorProperties(mods, typeNode, fields); } if (onConstructor != null) mods.annotations = mods.annotations.appendList(copyAnnotations(onConstructor)); diff --git a/src/core/lombok/javac/handlers/HandleData.java b/src/core/lombok/javac/handlers/HandleData.java index 9ecf8754..15f1fd83 100644 --- a/src/core/lombok/javac/handlers/HandleData.java +++ b/src/core/lombok/javac/handlers/HandleData.java @@ -40,6 +40,12 @@ import com.sun.tools.javac.tree.JCTree.JCAnnotation; */ @ProviderFor(JavacAnnotationHandler.class) public class HandleData extends JavacAnnotationHandler<Data> { + private HandleConstructor handleConstructor = new HandleConstructor(); + private HandleGetter handleGetter = new HandleGetter(); + private HandleSetter handleSetter = new HandleSetter(); + private HandleEqualsAndHashCode handleEqualsAndHashCode = new HandleEqualsAndHashCode(); + private HandleToString handleToString = new HandleToString(); + @Override public void handle(AnnotationValues<Data> annotation, JCAnnotation ast, JavacNode annotationNode) { handleFlagUsage(annotationNode, ConfigurationKeys.DATA_FLAG_USAGE, "@Data"); @@ -54,11 +60,10 @@ public class HandleData extends JavacAnnotationHandler<Data> { String staticConstructorName = annotation.getInstance().staticConstructor(); - // TODO move this to the end OR move it to the top in eclipse. - new HandleConstructor().generateRequiredArgsConstructor(typeNode, AccessLevel.PUBLIC, staticConstructorName, SkipIfConstructorExists.YES, annotationNode); - new HandleGetter().generateGetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true); - new HandleSetter().generateSetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true); - new HandleEqualsAndHashCode().generateEqualsAndHashCodeForType(typeNode, annotationNode); - new HandleToString().generateToStringForType(typeNode, annotationNode); + handleConstructor.generateRequiredArgsConstructor(typeNode, AccessLevel.PUBLIC, staticConstructorName, SkipIfConstructorExists.YES, annotationNode); + handleGetter.generateGetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true); + handleSetter.generateSetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true); + handleEqualsAndHashCode.generateEqualsAndHashCodeForType(typeNode, annotationNode); + handleToString.generateToStringForType(typeNode, annotationNode); } } diff --git a/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java b/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java index 6df56ed6..d8bfd154 100644 --- a/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java +++ b/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java @@ -121,7 +121,10 @@ public class HandleEqualsAndHashCode extends JavacAnnotationHandler<EqualsAndHas return; } - generateMethods(typeNode, source, null, null, null, false, FieldAccess.GETTER, List.<JCAnnotation>nil()); + Boolean doNotUseGettersConfiguration = typeNode.getAst().readConfiguration(ConfigurationKeys.EQUALS_AND_HASH_CODE_DO_NOT_USE_GETTERS); + FieldAccess access = doNotUseGettersConfiguration == null || !doNotUseGettersConfiguration ? FieldAccess.GETTER : FieldAccess.PREFER_FIELD; + + generateMethods(typeNode, source, null, null, null, false, access, List.<JCAnnotation>nil()); } public void generateMethods(JavacNode typeNode, JavacNode source, List<String> excludes, List<String> includes, @@ -255,20 +258,23 @@ public class HandleEqualsAndHashCode extends JavacAnnotationHandler<EqualsAndHas long finalFlag = JavacHandlerUtil.addFinalIfNeeded(0L, typeNode.getContext()); /* final int PRIME = X; */ { - if (!fields.isEmpty() || callSuper) { + if (!fields.isEmpty()) { statements.append(maker.VarDef(maker.Modifiers(finalFlag), primeName, maker.TypeIdent(CTC_INT), maker.Literal(HandlerUtil.primeForHashcode()))); } } - /* int result = 1; */ { - statements.append(maker.VarDef(maker.Modifiers(0), resultName, maker.TypeIdent(CTC_INT), maker.Literal(1))); - } - - if (callSuper) { - JCMethodInvocation callToSuper = maker.Apply(List.<JCExpression>nil(), - maker.Select(maker.Ident(typeNode.toName("super")), typeNode.toName("hashCode")), - List.<JCExpression>nil()); - statements.append(createResultCalculation(typeNode, callToSuper)); + /* int result = ... */ { + final JCExpression init; + if (callSuper) { + /* ... super.hashCode(); */ + init = maker.Apply(List.<JCExpression>nil(), + maker.Select(maker.Ident(typeNode.toName("super")), typeNode.toName("hashCode")), + List.<JCExpression>nil()); + } else { + /* ... 1; */ + init = maker.Literal(1); + } + statements.append(maker.VarDef(maker.Modifiers(0), resultName, maker.TypeIdent(CTC_INT), init)); } Name dollar = typeNode.toName("$"); @@ -365,31 +371,44 @@ public class HandleEqualsAndHashCode extends JavacAnnotationHandler<EqualsAndHas public JCExpression createTypeReference(JavacNode type, boolean addWildcards) { java.util.List<String> list = new ArrayList<String>(); + java.util.List<Integer> genericsCount = addWildcards ? new ArrayList<Integer>() : null; + list.add(type.getName()); + if (addWildcards) genericsCount.add(((JCClassDecl) type.get()).typarams.size()); + boolean staticContext = (((JCClassDecl) type.get()).getModifiers().flags & Flags.STATIC) != 0; JavacNode tNode = type.up(); + while (tNode != null && tNode.getKind() == Kind.TYPE) { list.add(tNode.getName()); + if (addWildcards) genericsCount.add(staticContext ? 0 : ((JCClassDecl) tNode.get()).typarams.size()); + if (!staticContext) staticContext = (((JCClassDecl) tNode.get()).getModifiers().flags & Flags.STATIC) != 0; tNode = tNode.up(); } Collections.reverse(list); - JCClassDecl typeDecl = (JCClassDecl) type.get(); + if (addWildcards) Collections.reverse(genericsCount); JavacTreeMaker maker = type.getTreeMaker(); JCExpression chain = maker.Ident(type.toName(list.get(0))); + if (addWildcards) chain = wildcardify(maker, chain, genericsCount.get(0)); for (int i = 1; i < list.size(); i++) { chain = maker.Select(chain, type.toName(list.get(i))); + if (addWildcards) chain = wildcardify(maker, chain, genericsCount.get(i)); } - if (!addWildcards || typeDecl.typarams.length() == 0) return chain; + return chain; + } + + private JCExpression wildcardify(JavacTreeMaker maker, JCExpression expr, int count) { + if (count == 0) return expr; ListBuffer<JCExpression> wildcards = new ListBuffer<JCExpression>(); - for (int i = 0 ; i < typeDecl.typarams.length() ; i++) { + for (int i = 0 ; i < count ; i++) { wildcards.append(maker.Wildcard(maker.TypeBoundKind(BoundKind.UNBOUND), null)); } - return maker.TypeApply(chain, wildcards.toList()); + return maker.TypeApply(expr, wildcards.toList()); } public JCMethodDecl createEquals(JavacNode typeNode, List<JavacNode> fields, boolean callSuper, FieldAccess fieldAccess, boolean needsCanEqual, JCTree source, List<JCAnnotation> onParam) { diff --git a/src/core/lombok/javac/handlers/HandleGetter.java b/src/core/lombok/javac/handlers/HandleGetter.java index 5a2e1993..0540465d 100644 --- a/src/core/lombok/javac/handlers/HandleGetter.java +++ b/src/core/lombok/javac/handlers/HandleGetter.java @@ -95,7 +95,7 @@ public class HandleGetter extends JavacAnnotationHandler<Getter> { } } - public boolean fieldQualifiesForGetterGeneration(JavacNode field) { + public static boolean fieldQualifiesForGetterGeneration(JavacNode field) { if (field.getKind() != Kind.FIELD) return false; JCVariableDecl fieldDecl = (JCVariableDecl) field.get(); //Skip fields that start with $ diff --git a/src/core/lombok/javac/handlers/HandleSetter.java b/src/core/lombok/javac/handlers/HandleSetter.java index e766127a..1453aa27 100644 --- a/src/core/lombok/javac/handlers/HandleSetter.java +++ b/src/core/lombok/javac/handlers/HandleSetter.java @@ -206,10 +206,10 @@ public class HandleSetter extends JavacAnnotationHandler<Setter> { public static JCMethodDecl createSetter(long access, JavacNode field, JavacTreeMaker treeMaker, JavacNode source, List<JCAnnotation> onMethod, List<JCAnnotation> onParam) { String setterName = toSetterName(field); boolean returnThis = shouldReturnThis(field); - return createSetter(access, field, treeMaker, setterName, returnThis, source, onMethod, onParam); + return createSetter(access, false, field, treeMaker, setterName, null, returnThis, source, onMethod, onParam); } - public static JCMethodDecl createSetter(long access, JavacNode field, JavacTreeMaker treeMaker, String setterName, boolean shouldReturnThis, JavacNode source, List<JCAnnotation> onMethod, List<JCAnnotation> onParam) { + public static JCMethodDecl createSetter(long access, boolean deprecate, JavacNode field, JavacTreeMaker treeMaker, String setterName, Name booleanFieldToSet, boolean shouldReturnThis, JavacNode source, List<JCAnnotation> onMethod, List<JCAnnotation> onParam) { if (setterName == null) return null; JCVariableDecl fieldDecl = (JCVariableDecl) field.get(); @@ -235,6 +235,11 @@ public class HandleSetter extends JavacAnnotationHandler<Setter> { statements.append(treeMaker.Exec(assign)); } + if (booleanFieldToSet != null) { + JCAssign setBool = treeMaker.Assign(treeMaker.Ident(booleanFieldToSet), treeMaker.Literal(CTC_BOOLEAN, 1)); + statements.append(treeMaker.Exec(setBool)); + } + JCExpression methodType = null; if (shouldReturnThis) { methodType = cloneSelfType(field); @@ -258,7 +263,7 @@ public class HandleSetter extends JavacAnnotationHandler<Setter> { JCExpression annotationMethodDefaultValue = null; List<JCAnnotation> annsOnMethod = copyAnnotations(onMethod); - if (isFieldDeprecated(field)) { + if (isFieldDeprecated(field) || deprecate) { annsOnMethod = annsOnMethod.prepend(treeMaker.Annotation(genJavaLangTypeRef(field, "Deprecated"), List.<JCExpression>nil())); } diff --git a/src/core/lombok/javac/handlers/HandleToString.java b/src/core/lombok/javac/handlers/HandleToString.java index 743e7b26..897d5f2c 100644 --- a/src/core/lombok/javac/handlers/HandleToString.java +++ b/src/core/lombok/javac/handlers/HandleToString.java @@ -117,7 +117,11 @@ public class HandleToString extends JavacAnnotationHandler<ToString> { Boolean configuration = typeNode.getAst().readConfiguration(ConfigurationKeys.TO_STRING_INCLUDE_FIELD_NAMES); includeFieldNames = configuration != null ? configuration : ((Boolean)ToString.class.getMethod("includeFieldNames").getDefaultValue()).booleanValue(); } catch (Exception ignore) {} - generateToString(typeNode, errorNode, null, null, includeFieldNames, null, false, FieldAccess.GETTER); + + Boolean doNotUseGettersConfiguration = typeNode.getAst().readConfiguration(ConfigurationKeys.TO_STRING_DO_NOT_USE_GETTERS); + FieldAccess access = doNotUseGettersConfiguration == null || !doNotUseGettersConfiguration ? FieldAccess.GETTER : FieldAccess.PREFER_FIELD; + + generateToString(typeNode, errorNode, null, null, includeFieldNames, null, false, access); } public void generateToString(JavacNode typeNode, JavacNode source, List<String> excludes, List<String> includes, diff --git a/src/core/lombok/javac/handlers/HandleVal.java b/src/core/lombok/javac/handlers/HandleVal.java index 2976eabe..14130bc4 100644 --- a/src/core/lombok/javac/handlers/HandleVal.java +++ b/src/core/lombok/javac/handlers/HandleVal.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2016 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 @@ -26,7 +26,7 @@ import static lombok.javac.handlers.JavacHandlerUtil.*; import lombok.ConfigurationKeys; import lombok.val; import lombok.core.HandlerPriority; -import lombok.experimental.var; +import lombok.var; import lombok.javac.JavacASTAdapter; import lombok.javac.JavacASTVisitor; import lombok.javac.JavacNode; @@ -54,29 +54,34 @@ import com.sun.tools.javac.util.List; public class HandleVal extends JavacASTAdapter { private static boolean eq(String typeTreeToString, String key) { - return (typeTreeToString.equals(key) || typeTreeToString.equals("lombok." + key)); + return typeTreeToString.equals(key) || typeTreeToString.equals("lombok." + key) || typeTreeToString.equals("lombok.experimental." + key); } - @Override + @SuppressWarnings("deprecation") @Override public void visitLocal(JavacNode localNode, JCVariableDecl local) { JCTree typeTree = local.vartype; if (typeTree == null) return; String typeTreeToString = typeTree.toString(); - + if (!(eq(typeTreeToString, "val") || eq(typeTreeToString, "var"))) return; boolean isVal = typeMatches(val.class, localNode, typeTree); boolean isVar = typeMatches(var.class, localNode, typeTree); if (!(isVal || isVar)) return; - + if (isVal) handleFlagUsage(localNode, ConfigurationKeys.VAL_FLAG_USAGE, "val"); if (isVar) handleFlagUsage(localNode, ConfigurationKeys.VAR_FLAG_USAGE, "var"); - + JCTree parentRaw = localNode.directUp().get(); if (isVal && parentRaw instanceof JCForLoop) { localNode.addError("'val' is not allowed in old-style for loops"); return; } - + + if (parentRaw instanceof JCForLoop && ((JCForLoop) parentRaw).getInitializer().size() > 1) { + localNode.addError("'var' is not allowed in old-style for loops if there is more than 1 initializer"); + return; + } + JCExpression rhsOfEnhancedForLoop = null; if (local.init == null) { if (parentRaw instanceof JCEnhancedForLoop) { @@ -84,26 +89,26 @@ public class HandleVal extends JavacASTAdapter { if (efl.var == local) rhsOfEnhancedForLoop = efl.expr; } } - + final String annotation = typeTreeToString; if (rhsOfEnhancedForLoop == null && local.init == null) { localNode.addError("'" + annotation + "' on a local variable requires an initializer expression"); return; - } - + if (local.init instanceof JCNewArray && ((JCNewArray)local.init).elemtype == null) { localNode.addError("'" + annotation + "' is not compatible with array initializer expressions. Use the full form (new int[] { ... } instead of just { ... })"); return; } - + if (localNode.shouldDeleteLombokAnnotations()) { JavacHandlerUtil.deleteImportFromCompilationUnit(localNode, val.class.getName()); + JavacHandlerUtil.deleteImportFromCompilationUnit(localNode, lombok.experimental.var.class.getName()); JavacHandlerUtil.deleteImportFromCompilationUnit(localNode, var.class.getName()); } - + if (isVal) local.mods.flags |= Flags.FINAL; - + if (!localNode.shouldDeleteLombokAnnotations()) { JCAnnotation valAnnotation = recursiveSetGeneratedBy(localNode.getTreeMaker().Annotation(local.vartype, List.<JCExpression>nil()), typeTree, localNode.getContext()); local.mods.annotations = local.mods.annotations == null ? List.of(valAnnotation) : local.mods.annotations.append(valAnnotation); @@ -126,7 +131,7 @@ public class HandleVal extends JavacASTAdapter { try { type = ((JCExpression) resolver.resolveMethodMember(localNode).get(local.init)).type; } catch (RuntimeException e) { - System.err.println("Exception while resolving: " + localNode); + System.err.println("Exception while resolving: " + localNode + "(" + localNode.getFileName() + ")"); throw e; } } else { @@ -137,7 +142,7 @@ public class HandleVal extends JavacASTAdapter { local.type = Symtab.instance(localNode.getContext()).unknownType; type = ((JCExpression) resolver.resolveMethodMember(localNode).get(local.init)).type; } catch (RuntimeException e) { - System.err.println("Exception while resolving: " + localNode); + System.err.println("Exception while resolving: " + localNode + "(" + localNode.getFileName() + ")"); throw e; } } diff --git a/src/core/lombok/javac/handlers/HandleValue.java b/src/core/lombok/javac/handlers/HandleValue.java index 90f6a98d..d1af4168 100644 --- a/src/core/lombok/javac/handlers/HandleValue.java +++ b/src/core/lombok/javac/handlers/HandleValue.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2014 The Project Lombok Authors. + * Copyright (C) 2012-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 @@ -24,8 +24,6 @@ package lombok.javac.handlers; import static lombok.core.handlers.HandlerUtil.*; import static lombok.javac.handlers.JavacHandlerUtil.*; -import java.lang.annotation.Annotation; - import lombok.AccessLevel; import lombok.ConfigurationKeys; import lombok.core.AnnotationValues; @@ -49,13 +47,16 @@ import com.sun.tools.javac.tree.JCTree.JCModifiers; @ProviderFor(JavacAnnotationHandler.class) @HandlerPriority(-512) //-2^9; to ensure @EqualsAndHashCode and such pick up on this handler making the class final and messing with the fields' access levels, run earlier. public class HandleValue extends JavacAnnotationHandler<Value> { + private HandleFieldDefaults handleFieldDefaults = new HandleFieldDefaults(); + private HandleConstructor handleConstructor = new HandleConstructor(); + private HandleGetter handleGetter = new HandleGetter(); + private HandleEqualsAndHashCode handleEqualsAndHashCode = new HandleEqualsAndHashCode(); + private HandleToString handleToString = new HandleToString(); + @Override public void handle(AnnotationValues<Value> annotation, JCAnnotation ast, JavacNode annotationNode) { - @SuppressWarnings("deprecation") - Class<? extends Annotation> oldExperimentalValue = lombok.experimental.Value.class; - handleFlagUsage(annotationNode, ConfigurationKeys.VALUE_FLAG_USAGE, "@Value"); - deleteAnnotationIfNeccessary(annotationNode, Value.class, oldExperimentalValue); + deleteAnnotationIfNeccessary(annotationNode, Value.class, "lombok.experimental.Value"); JavacNode typeNode = annotationNode.up(); boolean notAClass = !isClass(typeNode); @@ -73,12 +74,10 @@ public class HandleValue extends JavacAnnotationHandler<Value> { typeNode.rebuild(); } } - new HandleFieldDefaults().generateFieldDefaultsForType(typeNode, annotationNode, AccessLevel.PRIVATE, true, true); - - // TODO move this to the end OR move it to the top in eclipse. - new HandleConstructor().generateAllArgsConstructor(typeNode, AccessLevel.PUBLIC, staticConstructorName, SkipIfConstructorExists.YES, annotationNode); - new HandleGetter().generateGetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true); - new HandleEqualsAndHashCode().generateEqualsAndHashCodeForType(typeNode, annotationNode); - new HandleToString().generateToStringForType(typeNode, annotationNode); + handleFieldDefaults.generateFieldDefaultsForType(typeNode, annotationNode, AccessLevel.PRIVATE, true, true); + handleConstructor.generateAllArgsConstructor(typeNode, AccessLevel.PUBLIC, staticConstructorName, SkipIfConstructorExists.YES, annotationNode); + handleGetter.generateGetterForType(typeNode, annotationNode, AccessLevel.PUBLIC, true); + handleEqualsAndHashCode.generateEqualsAndHashCodeForType(typeNode, annotationNode); + handleToString.generateToStringForType(typeNode, annotationNode); } } diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java index 56e666f7..65d09a9a 100644 --- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java +++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2017 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 @@ -162,6 +162,10 @@ public class JavacHandlerUtil { return node; } + public static boolean hasAnnotation(String type, JavacNode node) { + return hasAnnotation(type, node, false); + } + public static boolean hasAnnotation(Class<? extends Annotation> type, JavacNode node) { return hasAnnotation(type, node, false); } @@ -191,6 +195,48 @@ public class JavacHandlerUtil { } } + private static boolean hasAnnotation(String type, JavacNode node, boolean delete) { + if (node == null) return false; + if (type == null) return false; + switch (node.getKind()) { + case ARGUMENT: + case FIELD: + case LOCAL: + case TYPE: + case METHOD: + for (JavacNode child : node.down()) { + if (annotationTypeMatches(type, child)) { + if (delete) deleteAnnotationIfNeccessary(child, type); + return true; + } + } + // intentional fallthrough + default: + return false; + } + } + + static JavacNode findAnnotation(Class<? extends Annotation> type, JavacNode node, boolean delete) { + if (node == null) return null; + if (type == null) return null; + switch (node.getKind()) { + case ARGUMENT: + case FIELD: + case LOCAL: + case TYPE: + case METHOD: + for (JavacNode child : node.down()) { + if (annotationTypeMatches(type, child)) { + if (delete) deleteAnnotationIfNeccessary(child, type); + return child; + } + } + // intentional fallthrough + default: + return null; + } + } + /** * Checks if the Annotation AST Node provided is likely to be an instance of the provided annotation type. * @@ -203,6 +249,17 @@ public class JavacHandlerUtil { } /** + * Checks if the Annotation AST Node provided is likely to be an instance of the provided annotation type. + * + * @param type An actual annotation type, such as {@code lombok.Getter.class}. + * @param node A Lombok AST node representing an annotation in source code. + */ + public static boolean annotationTypeMatches(String type, JavacNode node) { + if (node.getKind() != Kind.ANNOTATION) return false; + return typeMatches(type, node, ((JCAnnotation)node.get()).annotationType); + } + + /** * Checks if the given TypeReference node is likely to be a reference to the provided class. * * @param type An actual type. This method checks if {@code typeNode} is likely to be a reference to this type. @@ -210,10 +267,21 @@ public class JavacHandlerUtil { * @param typeNode A type reference to check. */ public static boolean typeMatches(Class<?> type, JavacNode node, JCTree typeNode) { + return typeMatches(type.getName(), node, typeNode); + } + + /** + * Checks if the given TypeReference node is likely to be a reference to the provided class. + * + * @param type An actual type. This method checks if {@code typeNode} is likely to be a reference to this type. + * @param node A Lombok AST node. Any node in the appropriate compilation unit will do (used to get access to import statements). + * @param typeNode A type reference to check. + */ + public static boolean typeMatches(String type, JavacNode node, JCTree typeNode) { String typeName = typeNode.toString(); TypeResolver resolver = new TypeResolver(node.getImportList()); - return resolver.typeMatches(node, type.getName(), typeName); + return resolver.typeMatches(node, type, typeName); } /** @@ -222,6 +290,7 @@ public class JavacHandlerUtil { * @return {@code true} if a field is marked deprecated, either by {@code @Deprecated} or in javadoc, otherwise {@code false} */ public static boolean isFieldDeprecated(JavacNode field) { + if (!(field.get() instanceof JCVariableDecl)) return false; JCVariableDecl fieldNode = (JCVariableDecl) field.get(); if ((fieldNode.mods.flags & Flags.DEPRECATED) != 0) { return true; @@ -324,8 +393,7 @@ public class JavacHandlerUtil { * then removes any import statement that imports this exact annotation (not star imports). * Only does this if the DeleteLombokAnnotations class is in the context. */ - @SuppressWarnings("unchecked") - public static void deleteAnnotationIfNeccessary(JavacNode annotation, Class<? extends Annotation> annotationType) { + public static void deleteAnnotationIfNeccessary(JavacNode annotation, String annotationType) { deleteAnnotationIfNeccessary0(annotation, annotationType); } @@ -334,12 +402,29 @@ public class JavacHandlerUtil { * then removes any import statement that imports this exact annotation (not star imports). * Only does this if the DeleteLombokAnnotations class is in the context. */ - @SuppressWarnings("unchecked") + public static void deleteAnnotationIfNeccessary(JavacNode annotation, Class<? extends Annotation> annotationType) { + deleteAnnotationIfNeccessary0(annotation, annotationType.getName()); + } + + /** + * Removes the annotation from javac's AST (it remains in lombok's AST), + * then removes any import statement that imports this exact annotation (not star imports). + * Only does this if the DeleteLombokAnnotations class is in the context. + */ public static void deleteAnnotationIfNeccessary(JavacNode annotation, Class<? extends Annotation> annotationType1, Class<? extends Annotation> annotationType2) { - deleteAnnotationIfNeccessary0(annotation, annotationType1, annotationType2); + deleteAnnotationIfNeccessary0(annotation, annotationType1.getName(), annotationType2.getName()); } - private static void deleteAnnotationIfNeccessary0(JavacNode annotation, Class<? extends Annotation>... annotationTypes) { + /** + * Removes the annotation from javac's AST (it remains in lombok's AST), + * then removes any import statement that imports this exact annotation (not star imports). + * Only does this if the DeleteLombokAnnotations class is in the context. + */ + public static void deleteAnnotationIfNeccessary(JavacNode annotation, Class<? extends Annotation> annotationType1, String annotationType2) { + deleteAnnotationIfNeccessary0(annotation, annotationType1.getName(), annotationType2); + } + + private static void deleteAnnotationIfNeccessary0(JavacNode annotation, String... annotationTypes) { if (inNetbeansEditor(annotation)) return; if (!annotation.shouldDeleteLombokAnnotations()) return; JavacNode parentNode = annotation.directUp(); @@ -368,8 +453,8 @@ public class JavacHandlerUtil { } parentNode.getAst().setChanged(); - for (Class<?> annotationType : annotationTypes) { - deleteImportFromCompilationUnit(annotation, annotationType.getName()); + for (String annotationType : annotationTypes) { + deleteImportFromCompilationUnit(annotation, annotationType); } } @@ -733,7 +818,7 @@ public class JavacHandlerUtil { // Check if the class has a @Getter annotation. - if (!hasGetterAnnotation && new HandleGetter().fieldQualifiesForGetterGeneration(field)) { + if (!hasGetterAnnotation && HandleGetter.fieldQualifiesForGetterGeneration(field)) { //Check if the class has @Getter or @Data annotation. JavacNode containingType = field.up(); @@ -1189,16 +1274,25 @@ public class JavacHandlerUtil { } /** - * Generates a new statement that checks if the given variable is null, and if so, throws a specified exception with the + * Generates a new statement that checks if the given variable is null, and if so, throws a configured exception with the * variable name as message. - * - * @param exName The name of the exception to throw; normally {@code java.lang.NullPointerException}. */ public static JCStatement generateNullCheck(JavacTreeMaker maker, JavacNode variable, JavacNode source) { + return generateNullCheck(maker, variable, (JCVariableDecl)variable.get(), source); + } + + /** + * Generates a new statement that checks if the given variable is null, and if so, throws a configured exception with the + * variable name as message. + * + * This is a special case method reserved for use when the provided declaration differs from the + * variable's declaration, i.e. in a constructor or setter where the local parameter is named the same but with the prefix + * stripped as a result of @Accessors.prefix. + */ + public static JCStatement generateNullCheck(JavacTreeMaker maker, JavacNode variable, JCVariableDecl varDecl, JavacNode source) { NullCheckExceptionType exceptionType = source.getAst().readConfiguration(ConfigurationKeys.NON_NULL_EXCEPTION_TYPE); if (exceptionType == null) exceptionType = NullCheckExceptionType.NULL_POINTER_EXCEPTION; - JCVariableDecl varDecl = (JCVariableDecl) variable.get(); if (isPrimitive(varDecl.vartype)) return null; Name fieldName = varDecl.name; JCExpression exType = genTypeRef(variable, exceptionType.getExceptionType()); @@ -1357,25 +1451,27 @@ public class JavacHandlerUtil { } public static JCExpression namePlusTypeParamsToTypeReference(JavacTreeMaker maker, Name typeName, List<JCTypeParameter> params) { + if (params.isEmpty()) { + return maker.Ident(typeName); + } + return maker.TypeApply(maker.Ident(typeName), typeParameterNames(maker, params)); + } + + public static List<JCExpression> typeParameterNames(JavacTreeMaker maker, List<JCTypeParameter> params) { ListBuffer<JCExpression> typeArgs = new ListBuffer<JCExpression>(); - - if (!params.isEmpty()) { - for (JCTypeParameter param : params) { - typeArgs.append(maker.Ident(param.name)); - } - - return maker.TypeApply(maker.Ident(typeName), typeArgs.toList()); + for (JCTypeParameter param : params) { + typeArgs.append(maker.Ident(param.name)); } - - return maker.Ident(typeName); + return typeArgs.toList(); } public static void sanityCheckForMethodGeneratingAnnotationsOnBuilderClass(JavacNode typeNode, JavacNode errorNode) { List<String> disallowed = List.nil(); for (JavacNode child : typeNode.down()) { - for (Class<? extends java.lang.annotation.Annotation> annType : INVALID_ON_BUILDERS) { + for (String annType : INVALID_ON_BUILDERS) { if (annotationTypeMatches(annType, child)) { - disallowed = disallowed.append(annType.getSimpleName()); + int lastIndex = annType.lastIndexOf('.'); + disallowed = disallowed.append(lastIndex == -1 ? annType : annType.substring(lastIndex + 1)); } } } diff --git a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java index 33501349..4279ec63 100644 --- a/src/core/lombok/javac/handlers/JavacSingularsRecipes.java +++ b/src/core/lombok/javac/handlers/JavacSingularsRecipes.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 The Project Lombok Authors. + * Copyright (C) 2015-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 @@ -38,9 +38,12 @@ import lombok.javac.JavacTreeMaker; import com.sun.source.tree.Tree.Kind; import com.sun.tools.javac.code.BoundKind; +import com.sun.tools.javac.code.Flags; import com.sun.tools.javac.tree.JCTree; +import com.sun.tools.javac.tree.JCTree.JCAnnotation; import com.sun.tools.javac.tree.JCTree.JCExpression; import com.sun.tools.javac.tree.JCTree.JCMethodDecl; +import com.sun.tools.javac.tree.JCTree.JCModifiers; import com.sun.tools.javac.tree.JCTree.JCStatement; import com.sun.tools.javac.tree.JCTree.JCVariableDecl; import com.sun.tools.javac.tree.JCTree.JCWildcard; @@ -141,6 +144,11 @@ public class JavacSingularsRecipes { public static abstract class JavacSingularizer { public abstract LombokImmutableList<String> getSupportedTypes(); + protected JCModifiers makeMods(JavacTreeMaker maker, JavacNode node, boolean deprecate) { + if (deprecate) return maker.Modifiers(Flags.PUBLIC, List.<JCAnnotation>of(maker.Annotation(genJavaLangTypeRef(node, "Deprecated"), List.<JCExpression>nil()))); + return maker.Modifiers(Flags.PUBLIC); + } + /** Checks if any of the to-be-generated nodes (fields, methods) already exist. If so, errors on these (singulars don't support manually writing some of it, and returns true). */ public boolean checkForAlreadyExistingNodesAndGenerateError(JavacNode builderType, SingularData data) { for (JavacNode child : builderType.down()) { @@ -186,7 +194,7 @@ public class JavacSingularsRecipes { } public abstract java.util.List<JavacNode> generateFields(SingularData data, JavacNode builderType, JCTree source); - public abstract void generateMethods(SingularData data, JavacNode builderType, JCTree source, boolean fluent, boolean chain); + public abstract void generateMethods(SingularData data, boolean deprecate, JavacNode builderType, JCTree source, boolean fluent, boolean chain); public abstract void appendBuildCode(SingularData data, JavacNode builderType, JCTree source, ListBuffer<JCStatement> statements, Name targetVariableName, String builderVariable); public boolean requiresCleaning() { diff --git a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java index fb3d2c55..1798d52c 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacGuavaSingularizer.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 The Project Lombok Authors. + * Copyright (C) 2015-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 @@ -70,24 +70,24 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer { return Collections.singletonList(injectFieldAndMarkGenerated(builderType, buildField)); } - @Override public void generateMethods(SingularData data, JavacNode builderType, JCTree source, boolean fluent, boolean chain) { + @Override public void generateMethods(SingularData data, boolean deprecate, JavacNode builderType, JCTree source, boolean fluent, boolean chain) { JavacTreeMaker maker = builderType.getTreeMaker(); Symtab symbolTable = builderType.getSymbolTable(); JCExpression returnType = chain ? cloneSelfType(builderType) : maker.Type(createVoidType(symbolTable, CTC_VOID)); JCStatement returnStatement = chain ? maker.Return(maker.Ident(builderType.toName("this"))) : null; - generateSingularMethod(maker, returnType, returnStatement, data, builderType, source, fluent); + generateSingularMethod(deprecate, maker, returnType, returnStatement, data, builderType, source, fluent); returnType = chain ? cloneSelfType(builderType) : maker.Type(createVoidType(symbolTable, CTC_VOID)); returnStatement = chain ? maker.Return(maker.Ident(builderType.toName("this"))) : null; - generatePluralMethod(maker, returnType, returnStatement, data, builderType, source, fluent); + generatePluralMethod(deprecate, maker, returnType, returnStatement, data, builderType, source, fluent); returnType = chain ? cloneSelfType(builderType) : maker.Type(createVoidType(symbolTable, CTC_VOID)); returnStatement = chain ? maker.Return(maker.Ident(builderType.toName("this"))) : null; - generateClearMethod(maker, returnType, returnStatement, data, builderType, source); + generateClearMethod(deprecate, maker, returnType, returnStatement, data, builderType, source); } - private void generateClearMethod(JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source) { - JCModifiers mods = maker.Modifiers(Flags.PUBLIC); + private void generateClearMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source) { + JCModifiers mods = makeMods(maker, builderType, deprecate); List<JCTypeParameter> typeParams = List.nil(); List<JCExpression> thrown = List.nil(); List<JCVariableDecl> params = List.nil(); @@ -102,7 +102,7 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer { injectMethod(builderType, method); } - void generateSingularMethod(JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { + void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { List<JCTypeParameter> typeParams = List.nil(); List<JCExpression> thrown = List.nil(); @@ -114,7 +114,7 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer { names[i] = s.isEmpty() ? n : builderType.toName(s); } - JCModifiers mods = maker.Modifiers(Flags.PUBLIC); + JCModifiers mods = makeMods(maker, builderType, deprecate); ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>(); statements.append(createConstructBuilderVarIfNeeded(maker, data, builderType, source)); JCExpression thisDotFieldDotAdd = chainDots(builderType, "this", data.getPluralName().toString(), getAddMethodName()); @@ -141,11 +141,10 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer { injectMethod(builderType, method); } - protected void generatePluralMethod(JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { + protected void generatePluralMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { List<JCTypeParameter> typeParams = List.nil(); List<JCExpression> thrown = List.nil(); - - JCModifiers mods = maker.Modifiers(Flags.PUBLIC); + JCModifiers mods = makeMods(maker, builderType, deprecate); ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>(); statements.append(createConstructBuilderVarIfNeeded(maker, data, builderType, source)); JCExpression thisDotFieldDotAddAll = chainDots(builderType, "this", data.getPluralName().toString(), getAddMethodName() + "All"); diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java index 7beb29cb..196ce45d 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilListSetSingularizer.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 The Project Lombok Authors. + * Copyright (C) 2015-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 @@ -76,9 +76,9 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize return Collections.singletonList(injectFieldAndMarkGenerated(builderType, buildField)); } - @Override public void generateMethods(SingularData data, JavacNode builderType, JCTree source, boolean fluent, boolean chain) { + @Override public void generateMethods(SingularData data, boolean deprecate, JavacNode builderType, JCTree source, boolean fluent, boolean chain) { if (useGuavaInstead(builderType)) { - guavaListSetSingularizer.generateMethods(data, builderType, source, fluent, chain); + guavaListSetSingularizer.generateMethods(data, deprecate, builderType, source, fluent, chain); return; } @@ -88,19 +88,19 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize JCExpression returnType = chain ? cloneSelfType(builderType) : maker.Type(createVoidType(symbolTable, CTC_VOID)); JCStatement returnStatement = chain ? maker.Return(maker.Ident(thisName)) : null; - generateSingularMethod(maker, returnType, returnStatement, data, builderType, source, fluent); + generateSingularMethod(deprecate, maker, returnType, returnStatement, data, builderType, source, fluent); returnType = chain ? cloneSelfType(builderType) : maker.Type(createVoidType(symbolTable, CTC_VOID)); returnStatement = chain ? maker.Return(maker.Ident(thisName)) : null; - generatePluralMethod(maker, returnType, returnStatement, data, builderType, source, fluent); + generatePluralMethod(deprecate, maker, returnType, returnStatement, data, builderType, source, fluent); returnType = chain ? cloneSelfType(builderType) : maker.Type(createVoidType(symbolTable, CTC_VOID)); returnStatement = chain ? maker.Return(maker.Ident(thisName)) : null; - generateClearMethod(maker, returnType, returnStatement, data, builderType, source); + generateClearMethod(deprecate, maker, returnType, returnStatement, data, builderType, source); } - private void generateClearMethod(JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source) { - JCModifiers mods = maker.Modifiers(Flags.PUBLIC); + private void generateClearMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source) { + JCModifiers mods = makeMods(maker, builderType, deprecate); List<JCTypeParameter> typeParams = List.nil(); List<JCExpression> thrown = List.nil(); List<JCVariableDecl> params = List.nil(); @@ -119,11 +119,10 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize injectMethod(builderType, method); } - void generateSingularMethod(JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { + void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { List<JCTypeParameter> typeParams = List.nil(); List<JCExpression> thrown = List.nil(); - - JCModifiers mods = maker.Modifiers(Flags.PUBLIC); + JCModifiers mods = makeMods(maker, builderType, deprecate); ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>(); statements.append(createConstructBuilderVarIfNeeded(maker, data, builderType, false, source)); JCExpression thisDotFieldDotAdd = chainDots(builderType, "this", data.getPluralName().toString(), "add"); @@ -140,11 +139,10 @@ abstract class JavacJavaUtilListSetSingularizer extends JavacJavaUtilSingularize injectMethod(builderType, method); } - void generatePluralMethod(JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { + void generatePluralMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { List<JCTypeParameter> typeParams = List.nil(); List<JCExpression> thrown = List.nil(); - - JCModifiers mods = maker.Modifiers(Flags.PUBLIC); + JCModifiers mods = makeMods(maker, builderType, deprecate); ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>(); statements.append(createConstructBuilderVarIfNeeded(maker, data, builderType, false, source)); JCExpression thisDotFieldDotAdd = chainDots(builderType, "this", data.getPluralName().toString(), "addAll"); diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java index 774b1200..fbcf776e 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilMapSingularizer.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 The Project Lombok Authors. + * Copyright (C) 2015-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 @@ -101,9 +101,9 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { return Arrays.asList(keyFieldNode, valueFieldNode); } - @Override public void generateMethods(SingularData data, JavacNode builderType, JCTree source, boolean fluent, boolean chain) { + @Override public void generateMethods(SingularData data, boolean deprecate, JavacNode builderType, JCTree source, boolean fluent, boolean chain) { if (useGuavaInstead(builderType)) { - guavaMapSingularizer.generateMethods(data, builderType, source, fluent, chain); + guavaMapSingularizer.generateMethods(data, deprecate, builderType, source, fluent, chain); return; } @@ -112,19 +112,20 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { JCExpression returnType = chain ? cloneSelfType(builderType) : maker.Type(createVoidType(symbolTable, CTC_VOID)); JCStatement returnStatement = chain ? maker.Return(maker.Ident(builderType.toName("this"))) : null; - generateSingularMethod(maker, returnType, returnStatement, data, builderType, source, fluent); + generateSingularMethod(deprecate, maker, returnType, returnStatement, data, builderType, source, fluent); returnType = chain ? cloneSelfType(builderType) : maker.Type(createVoidType(symbolTable, CTC_VOID)); returnStatement = chain ? maker.Return(maker.Ident(builderType.toName("this"))) : null; - generatePluralMethod(maker, returnType, returnStatement, data, builderType, source, fluent); + generatePluralMethod(deprecate, maker, returnType, returnStatement, data, builderType, source, fluent); returnType = chain ? cloneSelfType(builderType) : maker.Type(createVoidType(symbolTable, CTC_VOID)); returnStatement = chain ? maker.Return(maker.Ident(builderType.toName("this"))) : null; - generateClearMethod(maker, returnType, returnStatement, data, builderType, source); + generateClearMethod(deprecate, maker, returnType, returnStatement, data, builderType, source); } - private void generateClearMethod(JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source) { - JCModifiers mods = maker.Modifiers(Flags.PUBLIC); + private void generateClearMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source) { + JCModifiers mods = makeMods(maker, builderType, deprecate); + List<JCTypeParameter> typeParams = List.nil(); List<JCExpression> thrown = List.nil(); List<JCVariableDecl> params = List.nil(); @@ -146,10 +147,11 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { injectMethod(builderType, method); } - private void generateSingularMethod(JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { + private void generateSingularMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { List<JCTypeParameter> typeParams = List.nil(); List<JCExpression> thrown = List.nil(); - JCModifiers mods = maker.Modifiers(Flags.PUBLIC); + JCModifiers mods = makeMods(maker, builderType, deprecate); + ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>(); statements.append(createConstructBuilderVarIfNeeded(maker, data, builderType, true, source)); Name keyName = builderType.toName(data.getSingularName().toString() + "Key"); @@ -178,10 +180,10 @@ public class JavacJavaUtilMapSingularizer extends JavacJavaUtilSingularizer { injectMethod(builderType, method); } - private void generatePluralMethod(JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { + private void generatePluralMethod(boolean deprecate, JavacTreeMaker maker, JCExpression returnType, JCStatement returnStatement, SingularData data, JavacNode builderType, JCTree source, boolean fluent) { List<JCTypeParameter> typeParams = List.nil(); List<JCExpression> jceBlank = List.nil(); - JCModifiers mods = maker.Modifiers(Flags.PUBLIC); + JCModifiers mods = makeMods(maker, builderType, deprecate); ListBuffer<JCStatement> statements = new ListBuffer<JCStatement>(); statements.append(createConstructBuilderVarIfNeeded(maker, data, builderType, true, source)); long paramFlags = JavacHandlerUtil.addFinalIfNeeded(Flags.PARAMETER, builderType.getContext()); diff --git a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java index 12922d3d..df521fd8 100644 --- a/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java +++ b/src/core/lombok/javac/handlers/singulars/JavacJavaUtilSingularizer.java @@ -165,6 +165,9 @@ abstract class JavacJavaUtilSingularizer extends JavacSingularizer { JCExpression pluralnameDotPut = maker.Select(maker.Ident(data.getPluralName()), builderType.toName("put")); JCExpression arg1 = maker.Apply(jceBlank, chainDots(builderType, builderVariable, data.getPluralName() + "$key", "get"), List.<JCExpression>of(maker.Ident(ivar))); JCExpression arg2 = maker.Apply(jceBlank, chainDots(builderType, builderVariable, data.getPluralName() + "$value", "get"), List.<JCExpression>of(maker.Ident(ivar))); + // [jdk9] We add an unneccessary (V) cast here. Not doing so gives an error in javac (build 9-ea+156-jigsaw-nightly-h6072-20170212): + // error: method put in interface Map<K#2,V#2> cannot be applied to given types; + arg2 = maker.TypeCast(createTypeArgs(2, false, builderType, data.getTypeArgs(), source).get(1), arg2); JCStatement putStatement = maker.Exec(maker.Apply(jceBlank, pluralnameDotPut, List.of(arg1, arg2))); JCStatement forInit = maker.VarDef(maker.Modifiers(0), ivar, maker.TypeIdent(CTC_INT), maker.Literal(CTC_INT, 0)); JCExpression checkExpr = maker.Binary(CTC_LESS_THAN, maker.Ident(ivar), getSize(maker, builderType, keyVarName, nullGuard, true, builderVariable)); diff --git a/src/core/lombok/package-info.java b/src/core/lombok/package-info.java index 5e34c914..1c01dd0d 100644 --- a/src/core/lombok/package-info.java +++ b/src/core/lombok/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2014 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -29,6 +29,6 @@ * <li>{@code lombok.experimental} – This package contains lombok features that are new or likely to change before committing to long-term support. * </ul> * - * @see <a href="https://projectlombok.org/features/index.html">Lombok features</a> + * @see <a href="https://projectlombok.org/features/all">Lombok features</a> */ package lombok; diff --git a/src/core/lombok/val.java b/src/core/lombok/val.java index a398fd34..a69d514c 100644 --- a/src/core/lombok/val.java +++ b/src/core/lombok/val.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 @@ -28,7 +28,7 @@ package lombok; * <p> * Note that this is an annotation type because {@code val x = 10;} will be desugared to {@code @val final int x = 10;} * <p> - * Complete documentation is found at <a href="https://projectlombok.org/features/val.html">the project lombok features page for @val</a>. + * Complete documentation is found at <a href="https://projectlombok.org/features/val">the project lombok features page for @val</a>. */ public @interface val { } diff --git a/src/core/lombok/var.java b/src/core/lombok/var.java new file mode 100644 index 00000000..63a70213 --- /dev/null +++ b/src/core/lombok/var.java @@ -0,0 +1,35 @@ +/* + * 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 + * 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; + +/** + * Use {@code var} as the type of any local variable declaration (even in a {@code for} statement), and the type will be inferred from the initializing expression + * (any further assignments to the variable are not involved in this type inference). + * <p> + * For example: {@code var x = 10.0;} will infer {@code double}, and {@code var y = new ArrayList<String>();} will infer {@code ArrayList<String>}. + * <p> + * Note that this is an annotation type because {@code var x = 10;} will be desugared to {@code @var int x = 10;} + * <p> + * Complete documentation is found at <a href="https://projectlombok.org/features/var">the project lombok features page for @var</a>. + */ +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/Delombok.java b/src/delombok/lombok/delombok/Delombok.java index ead4aa60..0d887cb9 100644 --- a/src/delombok/lombok/delombok/Delombok.java +++ b/src/delombok/lombok/delombok/Delombok.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2015 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -30,12 +30,14 @@ import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintStream; import java.io.Writer; +import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URI; import java.nio.charset.Charset; import java.nio.charset.UnsupportedCharsetException; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.IdentityHashMap; @@ -43,15 +45,23 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.ListIterator; import java.util.Map; +import java.util.Set; +import java.util.regex.Pattern; import javax.tools.DiagnosticListener; +import javax.tools.JavaFileManager; import javax.tools.JavaFileObject; import lombok.Lombok; import lombok.javac.CommentCatcher; +import lombok.javac.Javac; import lombok.javac.LombokOptions; +import lombok.javac.apt.LombokProcessor; +import com.sun.tools.javac.code.Symtab; import com.sun.tools.javac.comp.Todo; +import com.sun.tools.javac.file.BaseFileManager; +import com.sun.tools.javac.main.Arguments; import com.sun.tools.javac.main.JavaCompiler; import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; import com.sun.tools.javac.util.Context; @@ -466,26 +476,83 @@ public class Delombok { return out; } + private static final Field MODULE_FIELD = getModuleField(); + private static Field getModuleField() { + try { + return JCCompilationUnit.class.getField("modle"); + } catch (NoSuchFieldException e) { + return null; + } catch (SecurityException e) { + return null; + } + } + public boolean delombok() throws IOException { LombokOptions options = LombokOptionsFactory.getDelombokOptions(context); options.deleteLombokAnnotations(); options.putJavacOption("ENCODING", charset.name()); - if (classpath != null) options.putJavacOption("CLASSPATH", classpath); + if (classpath != null) options.putJavacOption("CLASSPATH", unpackClasspath(classpath)); if (sourcepath != null) options.putJavacOption("SOURCEPATH", sourcepath); - if (bootclasspath != null) options.putJavacOption("BOOTCLASSPATH", bootclasspath); + if (bootclasspath != null) options.putJavacOption("BOOTCLASSPATH", unpackClasspath(bootclasspath)); options.setFormatPreferences(new FormatPreferences(formatPrefs)); options.put("compilePolicy", "check"); + if (Javac.getJavaCompilerVersion() >= 9) { + Arguments args = Arguments.instance(context); + List<String> argsList = new ArrayList<String>(); + if (classpath != null) { + argsList.add("--class-path"); + argsList.add(options.get("--class-path")); + } + if (sourcepath != null) { + argsList.add("--source-path"); + argsList.add(options.get("--source-path")); + } + if (bootclasspath != null) { + argsList.add("--boot-class-path"); + argsList.add(options.get("--boot-class-path")); + } + if (charset != null) { + argsList.add("-encoding"); + argsList.add(charset.name()); + } + String[] argv = argsList.toArray(new String[0]); + args.init("javac", argv); + } + CommentCatcher catcher = CommentCatcher.create(context); JavaCompiler compiler = catcher.getCompiler(); List<JCCompilationUnit> roots = new ArrayList<JCCompilationUnit>(); Map<JCCompilationUnit, File> baseMap = new IdentityHashMap<JCCompilationUnit, File>(); - compiler.initProcessAnnotations(Collections.singleton(new lombok.javac.apt.LombokProcessor())); + Set<LombokProcessor> processors = Collections.singleton(new lombok.javac.apt.LombokProcessor()); + + if (Javac.getJavaCompilerVersion() >= 9) { + JavaFileManager jfm_ = context.get(JavaFileManager.class); + if (jfm_ instanceof BaseFileManager) { + Arguments args = Arguments.instance(context); + ((BaseFileManager) jfm_).setContext(context); // reinit with options + ((BaseFileManager) jfm_).handleOptions(args.getDeferredFileManagerOptions()); + } + } + + if (Javac.getJavaCompilerVersion() < 9) { + compiler.initProcessAnnotations(processors); + } else { + compiler.initProcessAnnotations(processors, Collections.<JavaFileObject>emptySet(), Collections.<String>emptySet()); + } + + Object unnamedModule = null; + if (Javac.getJavaCompilerVersion() >= 9) unnamedModule = Symtab.instance(context).unnamedModule; for (File fileToParse : filesToParse) { - @SuppressWarnings("deprecation") JCCompilationUnit unit = compiler.parse(fileToParse.getAbsolutePath()); + JCCompilationUnit unit = compiler.parse(fileToParse.getAbsolutePath()); + if (Javac.getJavaCompilerVersion() >= 9) try { + MODULE_FIELD.set(unit, unnamedModule); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } baseMap.put(unit, fileToBase.get(fileToParse)); roots.add(unit); } @@ -498,9 +565,19 @@ public class Delombok { catcher.setComments(unit, new DocCommentIntegrator().integrate(catcher.getComments(unit), unit)); } + if (Javac.getJavaCompilerVersion() >= 9) { + compiler.initModules(com.sun.tools.javac.util.List.from(roots.toArray(new JCCompilationUnit[0]))); + } com.sun.tools.javac.util.List<JCCompilationUnit> trees = compiler.enterTrees(toJavacList(roots)); - JavaCompiler delegate = compiler.processAnnotations(trees); + JavaCompiler delegate; + if (Javac.getJavaCompilerVersion() < 9) { + delegate = compiler.processAnnotations(trees, com.sun.tools.javac.util.List.<String>nil()); + } else { + delegate = compiler; + Collection<String> c = com.sun.tools.javac.util.List.nil(); + compiler.processAnnotations(trees, c); + } Object care = callAttributeMethodOnJavaCompiler(delegate, delegate.todo); @@ -529,6 +606,29 @@ public class Delombok { return true; } + private String unpackClasspath(String cp) { + String[] parts = cp.split(Pattern.quote(File.pathSeparator)); + StringBuilder out = new StringBuilder(); + for (String p : parts) { + if (!p.endsWith("*")) { + if (out.length() > 0) out.append(File.pathSeparator); + out.append(p); + continue; + } + File f = new File(p.substring(0, p.length() - 2)); + File[] files = f.listFiles(); + if (files == null) continue; + for (File file : files) { + if (file.isFile()) { + if (out.length() > 0) out.append(File.pathSeparator); + out.append(p, 0, p.length() - 1); + out.append(file.getName()); + } + } + } + return out.toString(); + } + private static Method attributeMethod; /** Method is needed because the call signature has changed between javac6 and javac7; no matter what we compile against, using delombok in the other means VerifyErrors. */ private static Object callAttributeMethodOnJavaCompiler(JavaCompiler compiler, Todo arg) { diff --git a/src/delombok/lombok/delombok/DocCommentIntegrator.java b/src/delombok/lombok/delombok/DocCommentIntegrator.java index c66ff0ec..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 @@ -29,6 +29,7 @@ import java.util.regex.Pattern; import lombok.javac.CommentInfo; import lombok.javac.Javac; +import lombok.javac.PackageName; import lombok.javac.handlers.JavacHandlerUtil; import com.sun.tools.javac.parser.Tokens.Comment; @@ -73,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); @@ -120,7 +121,8 @@ public class DocCommentIntegrator { } private JCTree findJavadocableNodeOnOrAfter(JCCompilationUnit unit, int endPos) { - if (unit.pid != null && endPos <= unit.pid.pos) return null; + JCTree pid = PackageName.getPackageNode(unit); + if (pid != null && endPos <= pid.pos) return null; Iterator<JCTree> it = unit.defs.iterator(); while (it.hasNext()) { diff --git a/src/delombok/lombok/delombok/LombokOptionsFactory.java b/src/delombok/lombok/delombok/LombokOptionsFactory.java index 47921931..62dc953a 100644 --- a/src/delombok/lombok/delombok/LombokOptionsFactory.java +++ b/src/delombok/lombok/delombok/LombokOptionsFactory.java @@ -24,6 +24,7 @@ package lombok.delombok; import lombok.javac.Javac; import lombok.javac.Javac6BasedLombokOptions; import lombok.javac.Javac8BasedLombokOptions; +import lombok.javac.Javac9BasedLombokOptions; import lombok.javac.LombokOptions; import com.sun.tools.javac.util.Context; @@ -41,9 +42,15 @@ public class LombokOptionsFactory { @Override LombokOptions createAndRegisterOptions(Context context) { return Javac8BasedLombokOptions.replaceWithDelombokOptions(context); } + }, + + JDK9 { + @Override LombokOptions createAndRegisterOptions(Context context) { + return Javac9BasedLombokOptions.replaceWithDelombokOptions(context); + } }; - abstract LombokOptions createAndRegisterOptions(Context context); + abstract LombokOptions createAndRegisterOptions(Context context); } public static LombokOptions getDelombokOptions(Context context) { @@ -53,8 +60,10 @@ public class LombokOptionsFactory { LombokOptions options; if (Javac.getJavaCompilerVersion() < 8) { options = LombokOptionCompilerVersion.JDK7_AND_LOWER.createAndRegisterOptions(context); - } else { + } else if (Javac.getJavaCompilerVersion() == 8) { options = LombokOptionCompilerVersion.JDK8.createAndRegisterOptions(context); + } else { + options = LombokOptionCompilerVersion.JDK9.createAndRegisterOptions(context); } return options; } diff --git a/src/delombok/lombok/delombok/PrettyPrinter.java b/src/delombok/lombok/delombok/PrettyPrinter.java index b5064a33..4261a558 100644 --- a/src/delombok/lombok/delombok/PrettyPrinter.java +++ b/src/delombok/lombok/delombok/PrettyPrinter.java @@ -92,6 +92,7 @@ import com.sun.tools.javac.util.Name; import com.sun.tools.javac.util.Position; import lombok.javac.CommentInfo; +import lombok.javac.PackageName; import lombok.javac.CommentInfo.EndConnection; import lombok.javac.CommentInfo.StartConnection; import lombok.javac.JavacTreeMaker.TreeTag; @@ -457,11 +458,12 @@ public class PrettyPrinter extends JCTree.Visitor { @Override public void visitTopLevel(JCCompilationUnit tree) { printDocComment(tree); - if (tree.pid != null) { + JCTree n = PackageName.getPackageNode(tree); + if (n != null) { consumeComments(tree); aPrint("package "); - print(tree.pid); - println(";", tree.pid); + print(n); + println(";", n); } boolean first = true; @@ -811,6 +813,11 @@ public class PrettyPrinter extends JCTree.Visitor { print(tree.encl); print("."); } + boolean moveFirstParameter = tree.args.nonEmpty() && tree.args.head instanceof JCUnary && tree.args.head.toString().startsWith("<*nullchk*>"); + if (moveFirstParameter) { + print(((JCUnary) tree.args.head).arg); + print("."); + } print("new "); if (!tree.typeargs.isEmpty()) { @@ -820,7 +827,11 @@ public class PrettyPrinter extends JCTree.Visitor { } print(tree.clazz); print("("); - print(tree.args, ", "); + if (moveFirstParameter) { + print(tree.args.tail, ", "); + } else { + print(tree.args, ", "); + } print(")"); if (tree.def != null) { Name previousTypeName = currentTypeName; @@ -1431,22 +1442,19 @@ public class PrettyPrinter extends JCTree.Visitor { if ("JCTypeUnion".equals(simpleName)) { List<JCExpression> types = readObject(tree, "alternatives", List.<JCExpression>nil()); print(types, " | "); - return; } else if ("JCTypeIntersection".equals(simpleName)) { print(readObject(tree, "bounds", List.<JCExpression>nil()), " & "); - return; } else if ("JCMemberReference".equals(simpleName)) { printMemberReference0(tree); - return; } else if ("JCLambda".equals(simpleName)) { printLambda0(tree); - return; } else if ("JCAnnotatedType".equals(simpleName)) { printAnnotatedType0(tree); - return; + } else if ("JCPackageDecl".equals(simpleName)) { + // Starting with JDK9, this is inside the import list, but we've already printed it. Just ignore it. + } else { + throw new AssertionError("Unhandled tree type: " + tree.getClass() + ": " + tree); } - - throw new AssertionError("Unhandled tree type: " + tree.getClass() + ": " + tree); } private void printMemberReference0(JCTree tree) { diff --git a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java index 135b5c77..33d7a496 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java +++ b/src/eclipseAgent/lombok/eclipse/agent/EclipsePatcher.java @@ -23,6 +23,7 @@ package lombok.eclipse.agent; import static lombok.patcher.scripts.ScriptBuilder.*; +import java.io.File; import java.lang.instrument.Instrumentation; import java.net.URLClassLoader; import java.security.ProtectionDomain; @@ -86,7 +87,7 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable { } }); - final boolean forceBaseResourceNames = !"".equals(System.getProperty("shadow.override.lombok", "")); + final boolean forceBaseResourceNames = shouldForceBaseResourceNames(); sm.setTransplantMapper(new TransplantMapper() { public String mapResourceName(int classFileFormatVersion, String resourceName) { if (classFileFormatVersion < 50 || forceBaseResourceNames) return resourceName; @@ -125,6 +126,15 @@ public class EclipsePatcher implements AgentLauncher.AgentLaunchable { if (reloadExistingClasses) sm.reloadClasses(instrumentation); } + private static boolean shouldForceBaseResourceNames() { + String shadowOverride = System.getProperty("shadow.override.lombok", ""); + if (shadowOverride == null || shadowOverride.length() == 0) return false; + for (String part : shadowOverride.split("\\s*" + (File.pathSeparatorChar == ';' ? ";" : ":") + "\\s*")) { + if (part.equalsIgnoreCase("lombok.jar")) return false; + } + return true; + } + private static void patchRenameField(ScriptManager sm) { /* RefactoringSearchEngine.search will not return results when renaming field and Data Annotation is present. Return a fake Element to make checks pass */ sm.addScript(ScriptBuilder.wrapMethodCall() 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/installer/lombok/installer/InstallerGUI.java b/src/installer/lombok/installer/InstallerGUI.java index b96fec9c..231e2d3c 100644 --- a/src/installer/lombok/installer/InstallerGUI.java +++ b/src/installer/lombok/installer/InstallerGUI.java @@ -171,6 +171,7 @@ public class InstallerGUI { container.add(buttonBar, constraints); container.setPreferredSize(new Dimension(INSTALLER_WINDOW_WIDTH, 415)); + container.setMinimumSize(new Dimension(INSTALLER_WINDOW_WIDTH, 415)); return container; } @@ -195,6 +196,7 @@ public class InstallerGUI { JLabel title; container.add(title = new JLabel(SUCCESS_TITLE), constraints); title.setPreferredSize(new Dimension(INSTALLER_WINDOW_WIDTH - 82, 20)); + title.setMinimumSize(new Dimension(INSTALLER_WINDOW_WIDTH - 82, 20)); constraints.gridy = 1; constraints.insets = new Insets(8, 0, 0, 16); @@ -296,6 +298,7 @@ public class InstallerGUI { container.add(buttonBar, constraints); container.setPreferredSize(new Dimension(INSTALLER_WINDOW_WIDTH, 415)); + container.setMinimumSize(new Dimension(INSTALLER_WINDOW_WIDTH, 415)); return container; } @@ -319,6 +322,7 @@ public class InstallerGUI { constraints.gridy = 2; container.add(example, constraints); container.setPreferredSize(new Dimension(INSTALLER_WINDOW_WIDTH, 105)); + container.setMinimumSize(new Dimension(INSTALLER_WINDOW_WIDTH, 105)); return container; } @@ -507,6 +511,7 @@ public class InstallerGUI { container.add(uninstallPlaceholder, constraints); container.setPreferredSize(new Dimension(INSTALLER_WINDOW_WIDTH, 296)); + container.setMinimumSize(new Dimension(INSTALLER_WINDOW_WIDTH, 296)); return container; } diff --git a/src/installer/lombok/installer/eclipse/EclipseProductLocation.java b/src/installer/lombok/installer/eclipse/EclipseProductLocation.java index 886e3e85..aa97a3e5 100644 --- a/src/installer/lombok/installer/eclipse/EclipseProductLocation.java +++ b/src/installer/lombok/installer/eclipse/EclipseProductLocation.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2016 The Project Lombok Authors. + * Copyright (C) 2009-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 @@ -256,11 +256,11 @@ public final class EclipseProductLocation extends IdeLocation { */ @Override public String install() throws InstallException { - // For whatever reason, relative paths in your eclipse.ini file don't work on linux, but only for -javaagent. - // If someone knows how to fix this, please do so, as this current hack solution (putting the absolute path - // to the jar files in your eclipse.ini) means you can't move your eclipse around on linux without lombok - // breaking it. NB: rerunning lombok.jar installer and hitting 'update' will fix it if you do that. - boolean fullPathRequired = OsUtils.getOS() == OsUtils.OS.UNIX || System.getProperty("lombok.installer.fullpath") != null; + // On Linux, for whatever reason, relative paths in your eclipse.ini file don't work, but only for -javaagent. + // On Windows, since the Oomph, the generated shortcut starts in the wrong directory. + // So the default is to use absolute paths, breaking lombok when you move the eclipse directory. + // Or not break when you copy your directory, but break later when you remove the original one. + boolean fullPathRequired = !"false".equals(System.getProperty("lombok.installer.fullpath", "true")); boolean installSucceeded = false; StringBuilder newContents = new StringBuilder(); diff --git a/src/installer/lombok/installer/eclipse/STS4LocationProvider.java b/src/installer/lombok/installer/eclipse/STS4LocationProvider.java new file mode 100644 index 00000000..47a07bdd --- /dev/null +++ b/src/installer/lombok/installer/eclipse/STS4LocationProvider.java @@ -0,0 +1,44 @@ +/* + * 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. + */ +package lombok.installer.eclipse; + +import java.util.Arrays; +import java.util.Collections; + +import lombok.installer.IdeLocationProvider; + +import org.mangosdk.spi.ProviderFor; + +@ProviderFor(IdeLocationProvider.class) +public class STS4LocationProvider extends EclipseProductLocationProvider { + + private static final EclipseProductDescriptor STS4 = new StandardProductDescriptor("Spring Tools Suite 4", + "SpringToolSuite4", + "sts", + STS4LocationProvider.class.getResource("STS.png"), + Collections.unmodifiableList(Arrays.asList("springsource", "spring-tool-suite")) + ); + + public STS4LocationProvider() { + super(STS4); + } +} 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. + * <p> + * 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. + * <p> + * 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/stubs/com/sun/tools/javac/code/Symbol.java b/src/stubs/com/sun/tools/javac/code/Symbol.java new file mode 100644 index 00000000..4aef63ad --- /dev/null +++ b/src/stubs/com/sun/tools/javac/code/Symbol.java @@ -0,0 +1,84 @@ +/* + * These are stub versions of various bits of javac-internal API (for various different versions of javac). Lombok is compiled against these. + */ +package com.sun.tools.javac.code; + +import java.lang.annotation.Annotation; +import java.util.Set; + +import javax.lang.model.element.AnnotationValue; +import javax.lang.model.element.Element; +import javax.lang.model.element.ElementKind; +import javax.lang.model.element.ElementVisitor; +import javax.lang.model.element.ExecutableElement; +import javax.lang.model.element.Modifier; +import javax.lang.model.element.NestingKind; +import javax.lang.model.element.TypeElement; +import javax.lang.model.element.TypeParameterElement; +import javax.lang.model.element.VariableElement; +import javax.lang.model.type.TypeMirror; + +import com.sun.tools.javac.util.Name; + +public abstract class Symbol implements Element { + public Type type; + public Name name; + + public long flags() { return 0; } + public boolean isStatic() { return false; } + public boolean isConstructor() { return false; } + public boolean isLocal() { return false; } + public Name flatName() { return null; } + public Name getQualifiedName() { return null; } + public <A extends Annotation> A[] getAnnotationsByType(Class<A> annoType) { return null; } + @Override public java.util.List<Attribute.Compound> getAnnotationMirrors() { return null; } + @Override public TypeMirror asType() { return null; } + public <A extends java.lang.annotation.Annotation> A getAnnotation(Class<A> annoType) { return null; } + @Override public Name getSimpleName() { return null; } + @Override public java.util.List<Symbol> getEnclosedElements() { return null; } + @Override public Element getEnclosingElement() { return null; } + + public static abstract class TypeSymbol extends Symbol {} + + public static class MethodSymbol extends Symbol implements ExecutableElement { + public MethodSymbol(long flags, Name name, Type type, Symbol owner) {} + @Override public ElementKind getKind() { return null; } + @Override public Set<Modifier> getModifiers() { return null; } + @Override public <R, P> R accept(ElementVisitor<R, P> v, P p) { return null; } + @Override public java.util.List<? extends TypeParameterElement> getTypeParameters() { return null; } + @Override public TypeMirror getReturnType() { return null; } + @Override public java.util.List<? extends VariableElement> getParameters() { return null; } + @Override public boolean isVarArgs() { return false; } + @Override public java.util.List<? extends TypeMirror> getThrownTypes() { return null; } + @Override public AnnotationValue getDefaultValue() { return null; } + public TypeMirror getReceiverType() { return null; } + public boolean isDefault() { return false; } + public com.sun.tools.javac.util.List<VarSymbol> params() { return null; } + } + + public static class VarSymbol extends Symbol implements VariableElement { + public Type type; + @Override public ElementKind getKind() { return null; } + @Override public Set<Modifier> getModifiers() { return null; } + @Override public <R, P> R accept(ElementVisitor<R, P> v, P p) { return null; } + @Override public Object getConstantValue() { return null; } + } + + public static class ClassSymbol extends TypeSymbol implements TypeElement { + @Override public Name getQualifiedName() { return null; } + @Override public java.util.List<? extends TypeMirror> getInterfaces() { return null; } + @Override public TypeMirror getSuperclass() { return null; } + @Override public ElementKind getKind() { return null; } + @Override public Set<Modifier> getModifiers() { return null; } + @Override public NestingKind getNestingKind() { return null; } + @Override public <R, P> R accept(ElementVisitor<R, P> v, P p) { return null; } + @Override public java.util.List<? extends TypeParameterElement> getTypeParameters() { return null; } + } + + // JDK9 + public static class ModuleSymbol extends TypeSymbol { + @Override public ElementKind getKind() { return null; } + @Override public Set<Modifier> getModifiers() { return null; } + @Override public <R, P> R accept(ElementVisitor<R, P> v, P p) { return null; } + } +} diff --git a/src/stubs/com/sun/tools/javac/code/Symtab.java b/src/stubs/com/sun/tools/javac/code/Symtab.java new file mode 100644 index 00000000..2b524e4c --- /dev/null +++ b/src/stubs/com/sun/tools/javac/code/Symtab.java @@ -0,0 +1,20 @@ +/* + * These are stub versions of various bits of javac-internal API (for various different versions of javac). Lombok is compiled against these. + */ +package com.sun.tools.javac.code; + +import com.sun.tools.javac.code.Symbol.ClassSymbol; +import com.sun.tools.javac.code.Symbol.ModuleSymbol; +import com.sun.tools.javac.util.Context; + +public class Symtab { + // Shared by JDK6-9 + public ClassSymbol methodClass; + public Type iterableType; + public Type objectType; + public static Symtab instance(Context context) {return null;} + public Type unknownType; + + // JDK 9 + public ModuleSymbol unnamedModule; +} diff --git a/src/stubs/com/sun/tools/javac/file/BaseFileManager.java b/src/stubs/com/sun/tools/javac/file/BaseFileManager.java index 7a2293d5..a56a2430 100644 --- a/src/stubs/com/sun/tools/javac/file/BaseFileManager.java +++ b/src/stubs/com/sun/tools/javac/file/BaseFileManager.java @@ -5,4 +5,14 @@ package com.sun.tools.javac.file; import javax.tools.JavaFileManager; -public abstract class BaseFileManager implements JavaFileManager{} +import com.sun.tools.javac.main.Option; +import com.sun.tools.javac.util.Context; + +import java.nio.charset.Charset; +import java.util.Map; + +public abstract class BaseFileManager implements JavaFileManager { + protected BaseFileManager(Charset charset) {} + public void setContext(Context context) {} + public boolean handleOptions(Map<Option, String> deferredFileManagerOptions) { return false; } +} diff --git a/src/stubs/com/sun/tools/javac/main/Arguments.java b/src/stubs/com/sun/tools/javac/main/Arguments.java new file mode 100644 index 00000000..ea866b6e --- /dev/null +++ b/src/stubs/com/sun/tools/javac/main/Arguments.java @@ -0,0 +1,13 @@ +package com.sun.tools.javac.main; + +import java.util.Map; + +import com.sun.tools.javac.util.Context; + +public class Arguments { + public static final Context.Key<Arguments> argsKey = new Context.Key<Arguments>(); + public static Arguments instance(Context context) { return null; } + public void init(String ownName, String... argv) {} + public Map<Option, String> getDeferredFileManagerOptions() { return null; } + public boolean validate() { return false; } +} diff --git a/src/stubs/com/sun/tools/javac/main/JavaCompiler.java b/src/stubs/com/sun/tools/javac/main/JavaCompiler.java new file mode 100644 index 00000000..d0e7b38f --- /dev/null +++ b/src/stubs/com/sun/tools/javac/main/JavaCompiler.java @@ -0,0 +1,37 @@ +/* + * These are stub versions of various bits of javac-internal API (for various different versions of javac). Lombok is compiled against these. + */ +package com.sun.tools.javac.main; + +import java.io.IOException; +import java.util.Collection; +import javax.annotation.processing.Processor; +import javax.tools.JavaFileObject; + +import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.List; +import com.sun.tools.javac.comp.Todo; + +public class JavaCompiler { + // Shared by JDK6-9 + public boolean keepComments; + public boolean genEndPos; + public Todo todo; + + public JavaCompiler(Context context) {} + public int errorCount() { return 0; } + public static String version() { return "<stub>"; } + public JCCompilationUnit parse(String fileName) throws IOException { return null; } + public List<JCCompilationUnit> enterTrees(List<JCCompilationUnit> roots) {return null;} + + //JDK up to 8 + public void initProcessAnnotations(Iterable<? extends Processor> processors) throws IOException {} + public JavaCompiler processAnnotations(List<JCCompilationUnit> roots, List<String> classnames) {return this;} + + // JDK 9 + public void initProcessAnnotations(Iterable<? extends Processor> processors, Collection<? extends JavaFileObject> initialFiles, Collection<String> initialClassNames) {} + public void processAnnotations(List<JCCompilationUnit> roots, Collection<String> classnames) {} + public void close() {} + public List<JCCompilationUnit> initModules(List<JCCompilationUnit> roots) { return null; } +} diff --git a/src/stubs/com/sun/tools/javac/main/Option.java b/src/stubs/com/sun/tools/javac/main/Option.java index f3229c78..ae955772 100644 --- a/src/stubs/com/sun/tools/javac/main/Option.java +++ b/src/stubs/com/sun/tools/javac/main/Option.java @@ -7,4 +7,5 @@ package com.sun.tools.javac.main; public enum Option { ; public String text; + public String primaryName; } diff --git a/src/stubs/com/sun/tools/javac/parser/JavacParser.java b/src/stubs/com/sun/tools/javac/parser/JavacParser.java index da42f37a..4f1f3380 100644 --- a/src/stubs/com/sun/tools/javac/parser/JavacParser.java +++ b/src/stubs/com/sun/tools/javac/parser/JavacParser.java @@ -1,3 +1,6 @@ +/* + * These are stub versions of various bits of javac-internal API (for various different versions of javac). Lombok is compiled against these. + */ package com.sun.tools.javac.parser; import com.sun.tools.javac.tree.JCTree; @@ -6,6 +9,9 @@ public class JavacParser { protected JavacParser(ParserFactory fac, Lexer S, boolean keepDocComments, boolean keepLineMap, boolean keepEndPositions) { } + protected JavacParser(ParserFactory fac, Lexer S, boolean keepDocComments, boolean keepLineMap, boolean keepEndPositions, boolean parseModuleInfo) { + } + public JCTree.JCCompilationUnit parseCompilationUnit() { return null; } diff --git a/src/stubs/com/sun/tools/javac/util/Options.java b/src/stubs/com/sun/tools/javac/util/Options.java new file mode 100644 index 00000000..e7ba8960 --- /dev/null +++ b/src/stubs/com/sun/tools/javac/util/Options.java @@ -0,0 +1,20 @@ +package com.sun.tools.javac.util; + +import java.util.Set; + +import com.sun.tools.javac.main.Option; +import com.sun.tools.javac.main.OptionName; +import com.sun.tools.javac.main.JavacOption; + +public class Options { + public Options(Context context) {} + public static final Context.Key<Options> optionsKey = new Context.Key<Options>(); + public static Options instance(Context context) { return null; } + public String get(String key) { return null; } + public String get(Option opt) { return null; } + public String get(OptionName name) { return null; } + public String get(JavacOption.Option opt) { return null; } + public void putAll(Options o) {} + public void put(String key, String value) {} + public Set<String> keySet() { return null; } +} diff --git a/src/stubsstubs/com/sun/tools/javac/code/Attribute.java b/src/stubsstubs/com/sun/tools/javac/code/Attribute.java new file mode 100644 index 00000000..29bd54a9 --- /dev/null +++ b/src/stubsstubs/com/sun/tools/javac/code/Attribute.java @@ -0,0 +1,15 @@ +package com.sun.tools.javac.code; + +import java.util.Map; + +import javax.lang.model.element.AnnotationMirror; +import javax.lang.model.element.AnnotationValue; +import javax.lang.model.element.ExecutableElement; +import javax.lang.model.type.DeclaredType; + +public abstract class Attribute { + public static class Compound extends Attribute implements AnnotationMirror { + public DeclaredType getAnnotationType() { return null; } + public Map<? extends ExecutableElement, ? extends AnnotationValue> getElementValues() { return null; } + } +}
\ No newline at end of file diff --git a/src/stubsstubs/com/sun/tools/javac/code/Type.java b/src/stubsstubs/com/sun/tools/javac/code/Type.java new file mode 100644 index 00000000..c130ae9c --- /dev/null +++ b/src/stubsstubs/com/sun/tools/javac/code/Type.java @@ -0,0 +1,3 @@ +package com.sun.tools.javac.code; + +public class Type {}
\ No newline at end of file diff --git a/src/stubsstubs/com/sun/tools/javac/comp/Todo.java b/src/stubsstubs/com/sun/tools/javac/comp/Todo.java new file mode 100644 index 00000000..006a7fd3 --- /dev/null +++ b/src/stubsstubs/com/sun/tools/javac/comp/Todo.java @@ -0,0 +1,3 @@ +package com.sun.tools.javac.comp; + +public class Todo {}
\ No newline at end of file diff --git a/src/stubsstubs/com/sun/tools/javac/main/JavacOption.java b/src/stubsstubs/com/sun/tools/javac/main/JavacOption.java new file mode 100644 index 00000000..8e74d3d3 --- /dev/null +++ b/src/stubsstubs/com/sun/tools/javac/main/JavacOption.java @@ -0,0 +1,5 @@ +package com.sun.tools.javac.main; + +public class JavacOption { + public static class Option {} +}
\ No newline at end of file diff --git a/src/stubsstubs/com/sun/tools/javac/main/Option.java b/src/stubsstubs/com/sun/tools/javac/main/Option.java new file mode 100644 index 00000000..45988e4c --- /dev/null +++ b/src/stubsstubs/com/sun/tools/javac/main/Option.java @@ -0,0 +1,3 @@ +package com.sun.tools.javac.main; + +public class Option {}
\ No newline at end of file diff --git a/src/stubsstubs/com/sun/tools/javac/main/OptionName.java b/src/stubsstubs/com/sun/tools/javac/main/OptionName.java new file mode 100644 index 00000000..b1866633 --- /dev/null +++ b/src/stubsstubs/com/sun/tools/javac/main/OptionName.java @@ -0,0 +1,3 @@ +package com.sun.tools.javac.main; + +public class OptionName {}
\ No newline at end of file diff --git a/src/stubsstubs/com/sun/tools/javac/util/Context.java b/src/stubsstubs/com/sun/tools/javac/util/Context.java new file mode 100644 index 00000000..a090714e --- /dev/null +++ b/src/stubsstubs/com/sun/tools/javac/util/Context.java @@ -0,0 +1,5 @@ +package com.sun.tools.javac.util; + +public class Context { + public static class Key<T> {} +}
\ No newline at end of file diff --git a/src/stubsstubs/com/sun/tools/javac/util/List.java b/src/stubsstubs/com/sun/tools/javac/util/List.java new file mode 100644 index 00000000..16418a2b --- /dev/null +++ b/src/stubsstubs/com/sun/tools/javac/util/List.java @@ -0,0 +1,3 @@ +package com.sun.tools.javac.util; + +public class List<T> {}
\ No newline at end of file diff --git a/src/stubsstubs/com/sun/tools/javac/util/Name.java b/src/stubsstubs/com/sun/tools/javac/util/Name.java new file mode 100644 index 00000000..c0e81926 --- /dev/null +++ b/src/stubsstubs/com/sun/tools/javac/util/Name.java @@ -0,0 +1,8 @@ +package com.sun.tools.javac.util; + +public class Name implements javax.lang.model.element.Name { + public boolean contentEquals(CharSequence cs) { return false; } + public int length() { return 0; } + public char charAt(int idx) { return '\0'; } + public CharSequence subSequence(int a, int b) { return null; } +}
\ No newline at end of file diff --git a/src/utils/lombok/javac/CommentCatcher.java b/src/utils/lombok/javac/CommentCatcher.java index c32da68b..afbd7b52 100644 --- a/src/utils/lombok/javac/CommentCatcher.java +++ b/src/utils/lombok/javac/CommentCatcher.java @@ -95,8 +95,10 @@ public class CommentCatcher { parserFactory = Class.forName("lombok.javac.java6.CommentCollectingParserFactory"); } else if (javaCompilerVersion == 7) { parserFactory = Class.forName("lombok.javac.java7.CommentCollectingParserFactory"); - } else { + } else if (javaCompilerVersion == 8) { parserFactory = Class.forName("lombok.javac.java8.CommentCollectingParserFactory"); + } else { + parserFactory = Class.forName("lombok.javac.java9.CommentCollectingParserFactory"); } parserFactory.getMethod("setInCompiler", JavaCompiler.class, Context.class).invoke(null, compiler, context); } catch (InvocationTargetException e) { 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/src/utils/lombok/javac/JavacTreeMaker.java b/src/utils/lombok/javac/JavacTreeMaker.java index 12baf5af..5f4fb09c 100644 --- a/src/utils/lombok/javac/JavacTreeMaker.java +++ b/src/utils/lombok/javac/JavacTreeMaker.java @@ -226,6 +226,7 @@ public class JavacTreeMaker { } public static TypeTag typeTag(Type t) { + if (t == null) return Javac.CTC_VOID; try { return new TypeTag(getFieldCached(FIELD_CACHE, t, "tag")); } catch (NoSuchFieldException e) { diff --git a/src/utils/lombok/javac/PackageName.java b/src/utils/lombok/javac/PackageName.java new file mode 100644 index 00000000..e4dd6b20 --- /dev/null +++ b/src/utils/lombok/javac/PackageName.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 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.javac; + +import java.lang.reflect.Method; + +import com.sun.tools.javac.tree.JCTree; +import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; +import com.sun.tools.javac.tree.JCTree.JCFieldAccess; +import com.sun.tools.javac.tree.JCTree.JCIdent; + +// Supports JDK6-9 +public class PackageName { + private static final Method packageNameMethod = getPackageNameMethod(); + + private static Method getPackageNameMethod() { + try { + return JCCompilationUnit.class.getDeclaredMethod("getPackageName"); + } catch (Exception e) { + return null; + } + } + + public static String getPackageName(JCCompilationUnit cu) { + JCTree t = getPackageNode(cu); + return t != null ? t.toString() : null; + } + + public static JCTree getPackageNode(JCCompilationUnit cu) { + if (packageNameMethod != null) try { + Object pkg = packageNameMethod.invoke(cu); + return (pkg instanceof JCFieldAccess || pkg instanceof JCIdent) ? (JCTree) pkg : null; + } catch (Exception e) {} + return cu.pid instanceof JCFieldAccess || cu.pid instanceof JCIdent ? cu.pid : null; + } +} diff --git a/src/utils/lombok/javac/TreeMirrorMaker.java b/src/utils/lombok/javac/TreeMirrorMaker.java index 918a3242..8cd8cffe 100644 --- a/src/utils/lombok/javac/TreeMirrorMaker.java +++ b/src/utils/lombok/javac/TreeMirrorMaker.java @@ -90,12 +90,13 @@ public class TreeMirrorMaker extends TreeCopier<Void> { return Collections.unmodifiableMap(originalToCopy); } - // Monitor issue 205 and issue 694 when making changes here. + // Monitor the following issues when making changes here. + // - https://github.com/rzwitserloot/lombok/issues/278 + // - https://github.com/rzwitserloot/lombok/issues/729 @Override public JCTree visitVariable(VariableTree node, Void p) { JCVariableDecl original = node instanceof JCVariableDecl ? (JCVariableDecl) node : null; JCVariableDecl copy = (JCVariableDecl) super.visitVariable(node, p); if (original == null) return copy; - copy.sym = original.sym; if (copy.sym != null) copy.type = original.type; if (copy.type != null) { @@ -114,7 +115,7 @@ public class TreeMirrorMaker extends TreeCopier<Void> { return copy; } - // Fix for NPE in HandleVal. See http://code.google.com/p/projectlombok/issues/detail?id=299 + // Fix for NPE in HandleVal. See https://github.com/rzwitserloot/lombok/issues/372 // This and visitVariable is rather hacky but we're working around evident bugs or at least inconsistencies in javac. @Override public JCTree visitLabeledStatement(LabeledStatementTree node, Void p) { return node.getStatement().accept(this, p); diff --git a/src/utils/lombok/javac/java8/CommentCollectingParserFactory.java b/src/utils/lombok/javac/java8/CommentCollectingParserFactory.java index 45f865ad..2fdaddfe 100644 --- a/src/utils/lombok/javac/java8/CommentCollectingParserFactory.java +++ b/src/utils/lombok/javac/java8/CommentCollectingParserFactory.java @@ -52,6 +52,16 @@ public class CommentCollectingParserFactory extends ParserFactory { //Either way this will work out. } + public JavacParser newParser(CharSequence input, boolean keepDocComments, boolean keepEndPos, boolean keepLineMap, boolean parseModuleInfo) { + ScannerFactory scannerFactory = ScannerFactory.instance(context); + Lexer lexer = scannerFactory.newScanner(input, true); + Object x = new CommentCollectingParser(this, lexer, true, keepLineMap, keepEndPos); + return (JavacParser) x; + // CCP is based on a stub which extends nothing, but at runtime the stub is replaced with either + //javac6's EndPosParser which extends Parser, or javac8's JavacParser which implements Parser. + //Either way this will work out. + } + public static void setInCompiler(JavaCompiler compiler, Context context) { context.put(CommentCollectingParserFactory.key(), (ParserFactory) null); Field field; diff --git a/src/utils/lombok/javac/java9/CommentCollectingParser.java b/src/utils/lombok/javac/java9/CommentCollectingParser.java new file mode 100644 index 00000000..307be405 --- /dev/null +++ b/src/utils/lombok/javac/java9/CommentCollectingParser.java @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2013-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.javac.java9; + +import static lombok.javac.CommentCatcher.JCCompilationUnit_comments; + +import java.util.List; + +import lombok.javac.CommentInfo; +import lombok.javac.java8.CommentCollectingScanner; + +import com.sun.tools.javac.parser.JavacParser; +import com.sun.tools.javac.parser.Lexer; +import com.sun.tools.javac.parser.ParserFactory; +import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; + +class CommentCollectingParser extends JavacParser { + private final Lexer lexer; + + protected CommentCollectingParser(ParserFactory fac, Lexer S, + boolean keepDocComments, boolean keepLineMap, boolean keepEndPositions, boolean parseModuleInfo) { + super(fac, S, keepDocComments, keepLineMap, keepEndPositions, parseModuleInfo); + lexer = S; + } + + public JCCompilationUnit parseCompilationUnit() { + JCCompilationUnit result = super.parseCompilationUnit(); + if (lexer instanceof CommentCollectingScanner) { + List<CommentInfo> comments = ((CommentCollectingScanner)lexer).getComments(); + JCCompilationUnit_comments.set(result, comments); + } + return result; + } +}
\ No newline at end of file diff --git a/src/utils/lombok/javac/java9/CommentCollectingParserFactory.java b/src/utils/lombok/javac/java9/CommentCollectingParserFactory.java new file mode 100644 index 00000000..5af4a419 --- /dev/null +++ b/src/utils/lombok/javac/java9/CommentCollectingParserFactory.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2013-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.javac.java9; + +import java.lang.reflect.Field; + +import com.sun.tools.javac.main.JavaCompiler; +import com.sun.tools.javac.parser.JavacParser; +import com.sun.tools.javac.parser.Lexer; +import com.sun.tools.javac.parser.ParserFactory; +import com.sun.tools.javac.parser.ScannerFactory; +import com.sun.tools.javac.util.Context; + +public class CommentCollectingParserFactory extends ParserFactory { + private final Context context; + + static Context.Key<ParserFactory> key() { + return parserFactoryKey; + } + + protected CommentCollectingParserFactory(Context context) { + super(context); + this.context = context; + } + + public JavacParser newParser(CharSequence input, boolean keepDocComments, boolean keepEndPos, boolean keepLineMap) { + return newParser(input, keepDocComments, keepEndPos, keepLineMap, false); + } + + public JavacParser newParser(CharSequence input, boolean keepDocComments, boolean keepEndPos, boolean keepLineMap, boolean parseModuleInfo) { + ScannerFactory scannerFactory = ScannerFactory.instance(context); + Lexer lexer = scannerFactory.newScanner(input, true); + Object x = new CommentCollectingParser(this, lexer, true, keepLineMap, keepEndPos, parseModuleInfo); + return (JavacParser) x; + // CCP is based on a stub which extends nothing, but at runtime the stub is replaced with either + //javac6's EndPosParser which extends Parser, or javac-9's JavacParser which implements Parser. + //Either way this will work out. + } + + public static void setInCompiler(JavaCompiler compiler, Context context) { + context.put(CommentCollectingParserFactory.key(), (ParserFactory) null); + Field field; + try { + field = JavaCompiler.class.getDeclaredField("parserFactory"); + field.setAccessible(true); + field.set(compiler, new CommentCollectingParserFactory(context)); + } catch (Exception e) { + throw new IllegalStateException("Could not set comment sensitive parser in the compiler", e); + } + } +}
\ No newline at end of file diff --git a/src/website/log4j.properties b/src/website/log4j.properties new file mode 100644 index 00000000..9cafcc3b --- /dev/null +++ b/src/website/log4j.properties @@ -0,0 +1,6 @@ +log4j.rootLogger=INFO, stdout + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.Target=System.out +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n diff --git a/src/website/lombok/website/CompileChangelog.java b/src/website/lombok/website/CompileChangelog.java new file mode 100644 index 00000000..8912434e --- /dev/null +++ b/src/website/lombok/website/CompileChangelog.java @@ -0,0 +1,147 @@ +package lombok.website; + +import java.io.BufferedReader; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.StringReader; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.petebevin.markdown.MarkdownProcessor; + +public class CompileChangelog { + public static void main(String[] args) { + String fileIn = args[0]; + String fileOut = args[1]; + boolean edge = args.length > 3 && "-edge".equals(args[2]); + boolean latest = args.length > 3 && "-latest".equals(args[2]); + String version = args.length > 3 ? args[3] : null; + + try { + FileInputStream in = new FileInputStream(fileIn); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + byte[] b = new byte[65536]; + while (true) { + int r = in.read(b); + if ( r == -1 ) break; + out.write(b, 0, r); + } + in.close(); + String markdown = new String(out.toByteArray(), "UTF-8"); + + String result; + if (edge) { + result = buildEdge(sectionByVersion(markdown, version)); + } else if (latest) { + result = buildLatest(sectionByVersion(markdown, version)); + } else { + result = markdownToHtml(sectionStartingAt(markdown, version)); + } + + FileOutputStream file = new FileOutputStream(fileOut); + file.write(result.getBytes("UTF-8")); + file.close(); + System.exit(0); + } catch (Throwable e) { + e.printStackTrace(); + System.exit(1); + } + } + + public static String getHtmlForEdge(File root, String edgeVersion) throws IOException { + File f = new File(root, "doc/changelog.markdown"); + String raw = readFile(f); + return buildEdge(sectionByVersion(raw, edgeVersion)); + } + + public static String getHtmlForLatest(File root, String latestVersion) throws IOException { + File f = new File(root, "doc/changelog.markdown"); + String raw = readFile(f); + return buildLatest(sectionByVersion(raw, latestVersion)); + } + + public static String getHtml(File root) throws IOException { + File f = new File(root, "doc/changelog.markdown"); + String raw = readFile(f); + return markdownToHtml(raw); + } + + public static String getHtmlStartingAtSection(File root, String version) throws IOException { + File f = new File(root, "doc/changelog.markdown"); + String raw = readFile(f); + return markdownToHtml(sectionStartingAt(raw, version)); + } + + private static String readFile(File f) throws IOException { + byte[] b = new byte[65536]; + FileInputStream in = new FileInputStream(f); + try { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + while (true) { + int r = in.read(b); + if ( r == -1 ) break; + out.write(b, 0, r); + } + in.close(); + return new String(out.toByteArray(), "UTF-8"); + } finally { + in.close(); + } + } + + private static String markdownToHtml(String markdown) { + return new MarkdownProcessor().markdown(markdown); + } + + private static String buildEdge(String section) { + String latest = section != null ? section : "* No changelog records for this edge release."; + return markdownToHtml(latest); + } + + private static String buildLatest(String section) { + String latest = section != null ? section : "* No changelog records for this release."; + String noIssueLinks = latest.replaceAll("\\[[^]]*[Ii]ssue[^]]*\\]\\([^)]*\\)", ""); + String noLinks = noIssueLinks.replaceAll("\\[([^]]*)\\]\\([^)]*\\)", "$1"); + return markdownToHtml(noLinks); + } + + private static String sectionStartingAt(String markdown, String version) { + if (version.toUpperCase().endsWith("-HEAD") || version.toUpperCase().endsWith("-EDGE")) { + version = version.substring(0, version.length() - 5); + } + + Pattern p = Pattern.compile("^.*###\\s*v(.*)$"); + BufferedReader br = new BufferedReader(new StringReader(markdown)); + StringBuilder out = new StringBuilder(); + int state = 0; + try { + for (String line = br.readLine(); line != null; line = br.readLine()) { + if (state < 2) { + Matcher m = p.matcher(line); + if (m.matches()) state = m.group(1).startsWith(version) ? 2 : 1; + } + if (state != 1) { + out.append(line); + out.append("\n"); + } + } + return out.toString(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private static String sectionByVersion(String markdown, String version) { + if (version.toUpperCase().endsWith("-HEAD") || version.toUpperCase().endsWith("-EDGE")) { + version = version.substring(0, version.length() - 5); + } + + Pattern p = Pattern.compile("(?is-m)^.*###\\s*v" + version + ".*?\n(.*?)(?:###\\s*v.*)?$"); + Matcher m = p.matcher(markdown); + return m.matches() ? m.group(1) : null; + } +}
\ No newline at end of file diff --git a/src/website/lombok/website/FetchCurrentVersion.java b/src/website/lombok/website/FetchCurrentVersion.java new file mode 100644 index 00000000..6c1ca639 --- /dev/null +++ b/src/website/lombok/website/FetchCurrentVersion.java @@ -0,0 +1,33 @@ +package lombok.website; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class FetchCurrentVersion { + private FetchCurrentVersion() {} + + private static final Pattern VERSION_PATTERN = Pattern.compile("^.*<\\s*span\\s+id\\s*=\\s*[\"'](currentVersion|currentVersionFull)[\"'](?:\\s+style\\s*=\\s*[\"']display\\s*:\\s*none;?[\"'])?\\s*>\\s*([^\t<]+)\\s*<\\s*/\\s*span\\s*>.*$"); + + public static void main(String[] args) throws IOException { + System.out.print(fetchVersionFromSite(args.length == 0 || args[0].equals("full"))); + } + + public static String fetchVersionFromSite(boolean fetchFull) throws IOException { + InputStream in = new URL("https://projectlombok.org/download").openStream(); + try { + BufferedReader br = new BufferedReader(new InputStreamReader(in, "UTF-8")); + for (String line = br.readLine(); line != null; line = br.readLine()) { + Matcher m = VERSION_PATTERN.matcher(line); + if (m.matches() && m.group(1).equals("currentVersionFull") == fetchFull) return m.group(2); + } + throw new IOException("Expected a span with id 'currentVersion'"); + } finally { + in.close(); + } + } +} diff --git a/src/website/lombok/website/WebsiteMaker.java b/src/website/lombok/website/WebsiteMaker.java new file mode 100644 index 00000000..88556b97 --- /dev/null +++ b/src/website/lombok/website/WebsiteMaker.java @@ -0,0 +1,403 @@ +package lombok.website; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.lang.reflect.Method; +import java.net.URL; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.TimeZone; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import de.java2html.Java2Html; +import freemarker.cache.FileTemplateLoader; +import freemarker.cache.TemplateLoader; +import freemarker.core.HTMLOutputFormat; +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateExceptionHandler; + +public class WebsiteMaker { + private final String version, fullVersion; + private final File baseDir, outputDir; + + public WebsiteMaker(String version, String fullVersion, File baseDir, File outputDir) { + this.version = version; + this.fullVersion = fullVersion; + this.baseDir = baseDir; + this.outputDir = outputDir; + } + + private static final class VersionFinder { + public static String getVersion() { + return getVersion0("getVersion"); + } + + public static String getFullVersion() { + return getVersion0("getFullVersion"); + } + + private static String getVersion0(String mName) { + try { + Class<?> c = Class.forName("lombok.core.Version"); + Method m = c.getMethod(mName); + return (String) m.invoke(null); + } catch (ClassNotFoundException e) { + System.err.println("You need to specify the version string, and the full version string, as first 2 arguments."); + System.exit(1); + return null; + } catch (Exception e) { + if (e instanceof RuntimeException) throw (RuntimeException) e; + throw new RuntimeException(e); + } + } + } + + private static void buildAll(String version, String fullVersion, String argIn, String argOut) throws Exception { + File in, out; + if (argIn == null) { + in = new File("."); + if (new File(in, "build.xml").isFile() && new File(in, "website").isDirectory()) in = new File(in, "website"); + } else { + in = new File(argIn); + } + + if (argOut == null) { + if (new File("./build.xml").isFile() && new File("./website").isDirectory() && new File("./build").isDirectory()) { + out = new File("./build/website"); + } else { + out = new File(in, "output"); + } + } else { + out = new File(argOut); + } + WebsiteMaker maker = new WebsiteMaker(version, fullVersion, in, out); + maker.buildWebsite(); + } + + private static void buildChangelog(String version, String fullVersion, String argIn, String argOut) throws Exception { + File in, out; + if (argIn == null) { + in = new File("."); + if (new File(in, "build.xml").isFile() && new File(in, "website").isDirectory()) in = new File(in, "website"); + } else { + in = new File(argIn); + } + + if (argOut == null) { + if (new File("./build.xml").isFile() && new File("./website").isDirectory() && new File("./build").isDirectory()) { + out = new File("./build/website/changelog.html"); + } else { + out = new File(in, "output/changelog.html"); + } + } else { + out = new File(argOut); + } + WebsiteMaker maker = new WebsiteMaker(version, fullVersion, in, out.getParentFile()); + maker.buildChangelog(out); + } + + private static void buildDownloadEdge(String version, String fullVersion, String argIn, String argOut) throws Exception { + File in, out; + if (argIn == null) { + in = new File("."); + if (new File(in, "build.xml").isFile() && new File(in, "website").isDirectory()) in = new File(in, "website"); + } else { + in = new File(argIn); + } + + if (argOut == null) { + if (new File("./build.xml").isFile() && new File("./website").isDirectory() && new File("./build").isDirectory()) { + out = new File("./build/website-edge/download-edge.html"); + } else { + out = new File(in, "output/download-edge.html"); + } + } else { + out = new File(argOut); + } + WebsiteMaker maker = new WebsiteMaker(version, fullVersion, in, out.getParentFile()); + maker.buildDownloadEdge(out); + } + + private static void buildChangelogLatest(String version, String fullVersion, String argIn, String argOut) throws Exception { + File in, out; + if (argIn == null) { + in = new File("."); + if (new File(in, "build.xml").isFile() && new File(in, "website").isDirectory()) in = new File(in, "website"); + } else { + in = new File(argIn); + } + + if (argOut == null) { + if (new File("./build.xml").isFile() && new File("./website").isDirectory() && new File("./build").isDirectory()) { + out = new File("./build/latestchanges.html"); + } else { + out = new File(in, "output/latestchanges.html"); + } + } else { + out = new File(argOut); + } + WebsiteMaker maker = new WebsiteMaker(version, fullVersion, in, out.getParentFile()); + maker.buildChangelogLatest(out); + } + + public static void main(String[] args) throws Exception { + String version, fullVersion; + + if (args.length < 2) { + version = VersionFinder.getVersion(); + fullVersion = VersionFinder.getFullVersion(); + } else { + version = args[0]; + fullVersion = args[1]; + } + + if (args.length < 3 || args[2].equalsIgnoreCase("all")) { + buildAll(version, fullVersion, args.length < 4 ? null : args[3], args.length < 5 ? null : args[4]); + } else if (args[2].equalsIgnoreCase("changelog")) { + buildChangelog(version, fullVersion, args.length < 4 ? null : args[3], args.length < 5 ? null : args[4]); + } else if (args[2].equalsIgnoreCase("download-edge")) { + buildDownloadEdge(version, fullVersion, args.length < 4 ? null : args[3], args.length < 5 ? null : args[4]); + } else if (args[2].equalsIgnoreCase("changelog-latest")) { + buildChangelogLatest(version, fullVersion, args.length < 4 ? null : args[3], args.length < 5 ? null : args[4]); + } else { + throw new IllegalArgumentException("3rd argument must be one of 'all', 'changelog', 'download-edge', 'changelog-latest'"); + } + } + + private Configuration makeFreemarkerConfig() throws IOException { + Configuration freemarkerConfig = new Configuration(Configuration.VERSION_2_3_25); + freemarkerConfig.setEncoding(Locale.ENGLISH, "UTF-8"); + freemarkerConfig.setOutputEncoding("UTF-8"); + freemarkerConfig.setOutputFormat(HTMLOutputFormat.INSTANCE); + freemarkerConfig.setTemplateLoader(createLoader()); + freemarkerConfig.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); + return freemarkerConfig; + } + + public void buildChangelog(File out) throws Exception { + Configuration freemarkerConfig = makeFreemarkerConfig(); + outputDir.mkdirs(); + convertChangelog(freemarkerConfig, out); + } + + public void buildChangelogLatest(File out) throws Exception { + outputDir.mkdirs(); + String htmlForLatest = CompileChangelog.getHtmlForLatest(baseDir.getParentFile(), version); + FileOutputStream fos = new FileOutputStream(out); + try { + BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fos, "UTF-8")); + bw.write(htmlForLatest); + bw.close(); + } finally { + fos.close(); + } + } + + public void buildDownloadEdge(File out) throws Exception { + Configuration freemarkerConfig = makeFreemarkerConfig(); + + outputDir.mkdirs(); + convertDownloadEdge(freemarkerConfig, out); + } + + public void buildHtAccess(File out) throws Exception { + Configuration freemarkerConfig = new Configuration(Configuration.VERSION_2_3_25); + freemarkerConfig.setEncoding(Locale.ENGLISH, "UTF-8"); + freemarkerConfig.setOutputEncoding("UTF-8"); + freemarkerConfig.setOutputFormat(HTMLOutputFormat.INSTANCE); + freemarkerConfig.setTemplateLoader(createLoader("extra")); + freemarkerConfig.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER); + + outputDir.mkdirs(); + convertHtAccess(freemarkerConfig, out); + } + + public void buildWebsite() throws Exception { + Configuration freemarkerConfig = makeFreemarkerConfig(); + + outputDir.mkdirs(); + convertTemplates(freemarkerConfig); + buildHtAccess(new File(outputDir, ".htaccess")); + } + + private TemplateLoader createLoader() throws IOException { + return createLoader("templates"); + } + + private TemplateLoader createLoader(String base) throws IOException { + return new FileTemplateLoader(new File(baseDir, base)); + } + + private void convertHtAccess(Configuration freemarker, File outFile) throws Exception { + Map<String, Object> dataModel = new HashMap<String, Object>(); + dataModel.put("setupPages", listHtmlNames(new File(outputDir, "setup"))); + dataModel.put("featurePages", listHtmlNames(new File(outputDir, "features"))); + dataModel.put("experimentalPages", listHtmlNames(new File(outputDir, "features/experimental"))); + Template template = freemarker.getTemplate("htaccess"); + FileOutputStream fileOut = new FileOutputStream(outFile); + try { + Writer wr = new BufferedWriter(new OutputStreamWriter(fileOut, "UTF-8")); + template.process(dataModel, wr); + wr.close(); + } finally { + fileOut.close(); + } + } + + private List<String> listHtmlNames(File dir) { + List<String> out = new ArrayList<String>(); + for (String s : dir.list()) { + if (s.endsWith(".html") && !s.equals("index.html")) out.add(s.substring(0, s.length() - 5)); + } + return out; + } + + private void convertChangelog(Configuration freemarker, File outFile) throws Exception { + Map<String, Object> dataModel = createBasicDataModel(); + + Template template = freemarker.getTemplate("changelog.html"); + FileOutputStream fileOut = new FileOutputStream(outFile); + try { + Writer wr = new BufferedWriter(new OutputStreamWriter(fileOut, "UTF-8")); + template.process(dataModel, wr); + wr.close(); + } finally { + fileOut.close(); + } + } + + private void convertDownloadEdge(Configuration freemarker, File outFile) throws Exception { + Map<String, Object> dataModel = createBasicDataModel(); + + Template template = freemarker.getTemplate("_download-edge.html"); + FileOutputStream fileOut = new FileOutputStream(outFile); + try { + Writer wr = new BufferedWriter(new OutputStreamWriter(fileOut, "UTF-8")); + template.process(dataModel, wr); + wr.close(); + } finally { + fileOut.close(); + } + } + + private void convertTemplates(Configuration freemarker) throws Exception { + File basePagesLoc = new File(baseDir, "templates"); + Map<String, Object> dataModel = createBasicDataModel(); + dataModel.putAll(createExtendedDataModel()); + convertTemplates_(freemarker, "", basePagesLoc, outputDir, 0, dataModel); + } + + private void convertTemplates_(Configuration freemarker, String prefix, File from, File to, int depth, Map<String, Object> dataModel) throws Exception { + if (depth > 50) throw new IllegalArgumentException("50 levels is too deep: " + from); + + for (File f : from.listFiles()) { + if (f.isDirectory()) convertTemplates_(freemarker, prefix + f.getName() + "/", f, new File(to, f.getName()), depth + 1, dataModel); + if (!f.isFile() || !f.getName().endsWith(".html") || f.getName().startsWith("_")) continue; + to.mkdirs(); + Template template = freemarker.getTemplate(prefix + f.getName()); + FileOutputStream fileOut = new FileOutputStream(new File(to, f.getName())); + try { + Writer wr = new BufferedWriter(new OutputStreamWriter(fileOut, "UTF-8")); + template.process(dataModel, wr); + wr.close(); + } finally { + fileOut.close(); + } + } + } + + private Map<String, Object> createBasicDataModel() throws IOException { + Map<String, Object> data = new HashMap<String, Object>(); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss 'UTC'"); + sdf.setTimeZone(TimeZone.getTimeZone("UTC")); + String currentTime = sdf.format(new Date()); + + data.put("version", version); + data.put("fullVersion", fullVersion); + data.put("timestampString", currentTime); + data.put("year", "" + new GregorianCalendar().get(Calendar.YEAR)); + data.put("changelog", CompileChangelog.getHtmlStartingAtSection(baseDir.getParentFile(), version)); + data.put("changelogEdge", CompileChangelog.getHtmlForEdge(baseDir.getParentFile(), version)); + + return data; + } + + private static final Pattern LOMBOK_LINK = Pattern.compile("^.*<a(?: (?:id|class|rel|rev|download|target|type)(?:=\"[^\"]*\")?)* href=\"(downloads/[^\"]+)\"(?: (?:id|class|rel|rev|download|target|type)(?:=\"[^\"]*\")?)*>([^<]+)</a>.*$"); + private Map<String, Object> createExtendedDataModel() throws IOException { + Map<String, Object> data = new HashMap<String, Object>(); + + data.put("usages", new HtmlMaker(new File(baseDir, "usageExamples"))); + InputStream in = new URL("https://projectlombok.org/all-versions.html").openStream(); + ArrayList<List<String>> links = new ArrayList<List<String>>(); + try { + BufferedReader br = new BufferedReader(new InputStreamReader(in, "UTF-8")); + for (String line = br.readLine(); line != null; line = br.readLine()) { + Matcher m = LOMBOK_LINK.matcher(line); + if (m.matches()) links.add(Arrays.asList(m.group(1), m.group(2))); + } + } finally { + in.close(); + } + + data.put("linksToVersions", links); + + return data; + } + + public static class HtmlMaker { + private final File usagesDir; + + HtmlMaker(File usagesDir) { + this.usagesDir = usagesDir; + } + + public String pre(String name) throws IOException { + return convert(new File(usagesDir, name + "Example_pre.jpage")); + } + + public String post(String name) throws IOException { + return convert(new File(usagesDir, name + "Example_post.jpage")); + } + + public String convert(File file) throws IOException { + String rawJava = readFully(file); + return Java2Html.convertToHtml(rawJava); + } + } + + public static String readFully(File file) throws IOException { + FileInputStream fis = new FileInputStream(file); + try { + InputStreamReader isr = new InputStreamReader(fis, "UTF-8"); + StringBuilder out = new StringBuilder(); + char[] b = new char[65536]; + while (true) { + int r = isr.read(b); + if (r == -1) break; + out.append(b, 0, r); + } + return out.toString(); + } finally { + fis.close(); + } + } +} diff --git a/ssh.knownHosts b/ssh.knownHosts new file mode 100644 index 00000000..873e852f --- /dev/null +++ b/ssh.knownHosts @@ -0,0 +1,2 @@ +projectlombok.org:22:ECDSA:X.509:MIIBMzCB7AYHKoZIzj0CATCB4AIBATAsBgcqhkjOPQEBAiEA/////wAAAAEAAAAAAAAAAAAAAAD///////////////8wRAQg/////wAAAAEAAAAAAAAAAAAAAAD///////////////wEIFrGNdiqOpPns+u9VXaYhrxlHQawzFOw9jvOPD4n0mBLBEEEaxfR8uEsQkf4vOblY6RA8ncDfYEt6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54WK84zV2sxXs7LtkBoN79R9QIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBA0IABKwMbAFQuRwz9+PnuBOlc1OqPAYVhg0VBTGQ1G5V6JVfb0CU5GH4NEFp+jEAoGCZNrghB0XLB3d3egfF06ihDgE= + diff --git a/test/core/src/lombok/RunTestsViaEcj.java b/test/core/src/lombok/RunTestsViaEcj.java index 3f2698bb..6ed1e950 100644 --- a/test/core/src/lombok/RunTestsViaEcj.java +++ b/test/core/src/lombok/RunTestsViaEcj.java @@ -24,7 +24,6 @@ package lombok; import java.io.File; import java.io.StringWriter; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; @@ -131,14 +130,14 @@ public class RunTestsViaEcj extends AbstractRunTests { private FileSystem createFileSystem(File file) { List<String> classpath = new ArrayList<String>(); - classpath.addAll(Arrays.asList(System.getProperty("sun.boot.class.path").split(File.pathSeparator))); for (Iterator<String> i = classpath.iterator(); i.hasNext();) { if (FileSystem.getClasspath(i.next(), "UTF-8", null) == null) { i.remove(); } } - classpath.add("bin"); + if (new File("bin").exists()) classpath.add("bin"); classpath.add("dist/lombok.jar"); + classpath.add("lib/oracleJDK8Environment/rt.jar"); classpath.add("lib/test/commons-logging-commons-logging.jar"); classpath.add("lib/test/org.slf4j-slf4j-api.jar"); classpath.add("lib/test/org.slf4j-slf4j-ext.jar"); diff --git a/test/core/src/lombok/core/TestSingulars.java b/test/core/src/lombok/core/TestSingulars.java index 1134af08..4560615d 100644 --- a/test/core/src/lombok/core/TestSingulars.java +++ b/test/core/src/lombok/core/TestSingulars.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 The Project Lombok Authors. + * Copyright (C) 2015-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 @@ -22,31 +22,35 @@ package lombok.core; import static lombok.core.handlers.Singulars.autoSingularize; -import static org.junit.Assert.assertEquals; +import static org.junit.Assert.*; import org.junit.Test; public class TestSingulars { @Test public void testSingulars() { - assertEquals(null, autoSingularize("axes")); + assertNull("axes", autoSingularize("axes")); assertEquals("adjective", autoSingularize("adjectives")); assertEquals("bus", autoSingularize("buses")); assertEquals("octopus", autoSingularize("octopodes")); - assertEquals(null, autoSingularize("octopi")); + assertNull("octopi", autoSingularize("octopi")); assertEquals("elf", autoSingularize("elves")); assertEquals("jack", autoSingularize("jacks")); assertEquals("colloquy", autoSingularize("colloquies")); - assertEquals(null, autoSingularize("series")); + assertNull("series", autoSingularize("series")); assertEquals("man", autoSingularize("men")); - assertEquals(null, autoSingularize("highwaymen")); + assertNull("highwaymen", autoSingularize("highwaymen")); assertEquals("caveMan", autoSingularize("caveMen")); - assertEquals(null, autoSingularize("jackss")); - assertEquals(null, autoSingularize("virus")); + assertNull("jackss", autoSingularize("jackss")); + assertNull("virus", autoSingularize("virus")); assertEquals("quiz", autoSingularize("quizzes")); assertEquals("database", autoSingularize("databases")); assertEquals("dataBase", autoSingularize("dataBases")); assertEquals("Query", autoSingularize("Queries")); assertEquals("Movie", autoSingularize("Movies")); + assertEquals("cafe", autoSingularize("cafes")); + assertNull("caves", autoSingularize("caves")); + assertEquals("leaf", autoSingularize("leaves")); + assertEquals("autosave", autoSingularize("autosaves")); } } diff --git a/test/transform/resource/after-delombok/Accessors.java b/test/transform/resource/after-delombok/Accessors.java index 426b3863..2773a17b 100644 --- a/test/transform/resource/after-delombok/Accessors.java +++ b/test/transform/resource/after-delombok/Accessors.java @@ -1,12 +1,10 @@ class AccessorsFluent { private String fieldName = ""; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String fieldName() { return this.fieldName; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public AccessorsFluent fieldName(final String fieldName) { this.fieldName = fieldName; return this; @@ -16,17 +14,14 @@ class AccessorsFluentOnClass { private String fieldName = ""; private String otherFieldWithOverride = ""; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String fieldName() { return this.fieldName; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getOtherFieldWithOverride() { return this.otherFieldWithOverride; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public AccessorsFluentOnClass fieldName(final String fieldName) { this.fieldName = fieldName; return this; @@ -35,7 +30,6 @@ class AccessorsFluentOnClass { class AccessorsChain { private boolean isRunning; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public AccessorsChain setRunning(final boolean isRunning) { this.isRunning = isRunning; return this; @@ -45,7 +39,6 @@ class AccessorsPrefix { private String fieldName; private String fActualField; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setActualField(final String fActualField) { this.fActualField = fActualField; } @@ -54,12 +47,10 @@ class AccessorsPrefix2 { private String fieldName; private String fActualField; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setFieldName(final String fieldName) { this.fieldName = fieldName; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setActualField(final String fActualField) { this.fActualField = fActualField; } @@ -71,13 +62,11 @@ class AccessorsPrefix3 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "AccessorsPrefix3(fName=" + this.getName() + ")"; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof AccessorsPrefix3)) return false; @@ -89,13 +78,11 @@ class AccessorsPrefix3 { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof AccessorsPrefix3; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -107,7 +94,6 @@ class AccessorsPrefix3 { class AccessorsFluentGenerics<T extends Number> { private String name; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public AccessorsFluentGenerics<T> name(final String name) { this.name = name; return this; @@ -116,7 +102,6 @@ class AccessorsFluentGenerics<T extends Number> { class AccessorsFluentNoChaining { private String name; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void name(final String name) { this.name = name; } @@ -124,7 +109,6 @@ class AccessorsFluentNoChaining { class AccessorsFluentStatic<T extends Number> { private static String name; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static void name(final String name) { AccessorsFluentStatic.name = name; } diff --git a/test/transform/resource/after-delombok/AccessorsConfiguration.java b/test/transform/resource/after-delombok/AccessorsConfiguration.java index 0094c55c..f6604970 100644 --- a/test/transform/resource/after-delombok/AccessorsConfiguration.java +++ b/test/transform/resource/after-delombok/AccessorsConfiguration.java @@ -1,12 +1,10 @@ class AccessorsConfiguration { private String m_FieldName = ""; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String fieldName() { return this.m_FieldName; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void fieldName(final String m_FieldName) { this.m_FieldName = m_FieldName; } @@ -14,7 +12,6 @@ class AccessorsConfiguration { class AccessorsConfiguration2 { private String m_FieldName = ""; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setM_FieldName(final String m_FieldName) { this.m_FieldName = m_FieldName; } @@ -22,7 +19,6 @@ class AccessorsConfiguration2 { class AccessorsConfiguration3 { private String fFieldName = ""; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public AccessorsConfiguration3 setFieldName(final String fFieldName) { this.fFieldName = fFieldName; return this; diff --git a/test/transform/resource/after-delombok/BuilderChainAndFluent.java b/test/transform/resource/after-delombok/BuilderChainAndFluent.java deleted file mode 100644 index 2475a998..00000000 --- a/test/transform/resource/after-delombok/BuilderChainAndFluent.java +++ /dev/null @@ -1,40 +0,0 @@ -class BuilderChainAndFluent { - private final int yes; - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - BuilderChainAndFluent(final int yes) { - this.yes = yes; - } - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - public static class BuilderChainAndFluentBuilder { - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - private int yes; - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - BuilderChainAndFluentBuilder() { - } - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - public void setYes(final int yes) { - this.yes = yes; - } - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - public BuilderChainAndFluent build() { - return new BuilderChainAndFluent(yes); - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - public java.lang.String toString() { - return "BuilderChainAndFluent.BuilderChainAndFluentBuilder(yes=" + this.yes + ")"; - } - } - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - public static BuilderChainAndFluentBuilder builder() { - return new BuilderChainAndFluentBuilder(); - } -} diff --git a/test/transform/resource/after-delombok/BuilderComplex.java b/test/transform/resource/after-delombok/BuilderComplex.java index 937628f9..a89d7114 100644 --- a/test/transform/resource/after-delombok/BuilderComplex.java +++ b/test/transform/resource/after-delombok/BuilderComplex.java @@ -3,62 +3,49 @@ class BuilderComplex { private static <T extends Number> void testVoidWithGenerics(T number, int arg2, String arg3, BuilderComplex selfRef) { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class VoidBuilder<T extends Number> { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private T number; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private int arg2; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private String arg3; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private BuilderComplex selfRef; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") VoidBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public VoidBuilder<T> number(final T number) { this.number = number; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public VoidBuilder<T> arg2(final int arg2) { this.arg2 = arg2; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public VoidBuilder<T> arg3(final String arg3) { this.arg3 = arg3; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public VoidBuilder<T> selfRef(final BuilderComplex selfRef) { this.selfRef = selfRef; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void execute() { BuilderComplex.<T>testVoidWithGenerics(number, arg2, arg3, selfRef); } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderComplex.VoidBuilder(number=" + this.number + ", arg2=" + this.arg2 + ", arg3=" + this.arg3 + ", selfRef=" + this.selfRef + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static <T extends Number> VoidBuilder<T> builder() { return new VoidBuilder<T>(); } diff --git a/test/transform/resource/after-delombok/BuilderDefaults.java b/test/transform/resource/after-delombok/BuilderDefaults.java new file mode 100644 index 00000000..b916b725 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderDefaults.java @@ -0,0 +1,111 @@ +public final class BuilderDefaults { + private final int x; + private final String name; + private final long z; + @java.lang.SuppressWarnings("all") + private static int $default$x() { + return 10; + } + @java.lang.SuppressWarnings("all") + private static long $default$z() { + return System.currentTimeMillis(); + } + @java.lang.SuppressWarnings("all") + BuilderDefaults(final int x, final String name, final long z) { + this.x = x; + this.name = name; + this.z = z; + } + @java.lang.SuppressWarnings("all") + public static class BuilderDefaultsBuilder { + @java.lang.SuppressWarnings("all") + private boolean x$set; + @java.lang.SuppressWarnings("all") + private int x; + @java.lang.SuppressWarnings("all") + private String name; + @java.lang.SuppressWarnings("all") + private boolean z$set; + @java.lang.SuppressWarnings("all") + private long z; + @java.lang.SuppressWarnings("all") + BuilderDefaultsBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsBuilder x(final int x) { + this.x = x; + x$set = true; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsBuilder name(final String name) { + this.name = name; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsBuilder z(final long z) { + this.z = z; + z$set = true; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaults build() { + int x = this.x; + if (!x$set) x = BuilderDefaults.$default$x(); + long z = this.z; + if (!z$set) z = BuilderDefaults.$default$z(); + return new BuilderDefaults(x, name, z); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderDefaults.BuilderDefaultsBuilder(x=" + this.x + ", name=" + this.name + ", z=" + this.z + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderDefaultsBuilder builder() { + return new BuilderDefaultsBuilder(); + } + @java.lang.SuppressWarnings("all") + public int getX() { + return this.x; + } + @java.lang.SuppressWarnings("all") + public String getName() { + return this.name; + } + @java.lang.SuppressWarnings("all") + public long getZ() { + return this.z; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof BuilderDefaults)) return false; + final BuilderDefaults other = (BuilderDefaults) o; + if (this.getX() != other.getX()) return false; + final java.lang.Object this$name = this.getName(); + final java.lang.Object other$name = other.getName(); + if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false; + if (this.getZ() != other.getZ()) return false; + return true; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int PRIME = 59; + int result = 1; + result = result * PRIME + this.getX(); + final java.lang.Object $name = this.getName(); + result = result * PRIME + ($name == null ? 43 : $name.hashCode()); + final long $z = this.getZ(); + result = result * PRIME + (int) ($z >>> 32 ^ $z); + return result; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderDefaults(x=" + this.getX() + ", name=" + this.getName() + ", z=" + this.getZ() + ")"; + } +} diff --git a/test/transform/resource/after-delombok/BuilderDefaultsGenerics.java b/test/transform/resource/after-delombok/BuilderDefaultsGenerics.java new file mode 100644 index 00000000..b88a61be --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderDefaultsGenerics.java @@ -0,0 +1,79 @@ +import java.util.*; +public class BuilderDefaultsGenerics<N extends Number, T, R extends List<T>> { + private java.util.concurrent.Callable<N> callable; + private T tee; + private R arrr; + @java.lang.SuppressWarnings("all") + private static <N extends Number, T, R extends List<T>> java.util.concurrent.Callable<N> $default$callable() { + return null; + } + @java.lang.SuppressWarnings("all") + private static <N extends Number, T, R extends List<T>> T $default$tee() { + return null; + } + @java.lang.SuppressWarnings("all") + private static <N extends Number, T, R extends List<T>> R $default$arrr() { + return null; + } + @java.lang.SuppressWarnings("all") + BuilderDefaultsGenerics(final java.util.concurrent.Callable<N> callable, final T tee, final R arrr) { + this.callable = callable; + this.tee = tee; + this.arrr = arrr; + } + @java.lang.SuppressWarnings("all") + public static class BuilderDefaultsGenericsBuilder<N extends Number, T, R extends List<T>> { + @java.lang.SuppressWarnings("all") + private boolean callable$set; + @java.lang.SuppressWarnings("all") + private java.util.concurrent.Callable<N> callable; + @java.lang.SuppressWarnings("all") + private boolean tee$set; + @java.lang.SuppressWarnings("all") + private T tee; + @java.lang.SuppressWarnings("all") + private boolean arrr$set; + @java.lang.SuppressWarnings("all") + private R arrr; + @java.lang.SuppressWarnings("all") + BuilderDefaultsGenericsBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsGenericsBuilder<N, T, R> callable(final java.util.concurrent.Callable<N> callable) { + this.callable = callable; + callable$set = true; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsGenericsBuilder<N, T, R> tee(final T tee) { + this.tee = tee; + tee$set = true; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsGenericsBuilder<N, T, R> arrr(final R arrr) { + this.arrr = arrr; + arrr$set = true; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsGenerics<N, T, R> build() { + java.util.concurrent.Callable<N> callable = this.callable; + if (!callable$set) callable = BuilderDefaultsGenerics.<N, T, R>$default$callable(); + T tee = this.tee; + if (!tee$set) tee = BuilderDefaultsGenerics.<N, T, R>$default$tee(); + R arrr = this.arrr; + if (!arrr$set) arrr = BuilderDefaultsGenerics.<N, T, R>$default$arrr(); + return new BuilderDefaultsGenerics<N, T, R>(callable, tee, arrr); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderDefaultsGenerics.BuilderDefaultsGenericsBuilder(callable=" + this.callable + ", tee=" + this.tee + ", arrr=" + this.arrr + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static <N extends Number, T, R extends List<T>> BuilderDefaultsGenericsBuilder<N, T, R> builder() { + return new BuilderDefaultsGenericsBuilder<N, T, R>(); + } +} diff --git a/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java b/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java new file mode 100644 index 00000000..7e645dc1 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java @@ -0,0 +1,99 @@ +public class BuilderDefaultsWarnings { + long x = System.currentTimeMillis(); + final int y = 5; + int z; + java.util.List<String> items; + @java.lang.SuppressWarnings("all") + BuilderDefaultsWarnings(final long x, final int z, final java.util.List<String> items) { + this.x = x; + this.z = z; + this.items = items; + } + @java.lang.SuppressWarnings("all") + public static class BuilderDefaultsWarningsBuilder { + @java.lang.SuppressWarnings("all") + private long x; + @java.lang.SuppressWarnings("all") + private int z; + @java.lang.SuppressWarnings("all") + private java.util.ArrayList<String> items; + @java.lang.SuppressWarnings("all") + BuilderDefaultsWarningsBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsWarningsBuilder x(final long x) { + this.x = x; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsWarningsBuilder z(final int z) { + this.z = z; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsWarningsBuilder item(final String item) { + if (this.items == null) this.items = new java.util.ArrayList<String>(); + this.items.add(item); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsWarningsBuilder items(final java.util.Collection<? extends String> items) { + if (this.items == null) this.items = new java.util.ArrayList<String>(); + this.items.addAll(items); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsWarningsBuilder clearItems() { + if (this.items != null) this.items.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsWarnings build() { + java.util.List<String> items; + switch (this.items == null ? 0 : this.items.size()) { + case 0: + items = java.util.Collections.emptyList(); + break; + case 1: + items = java.util.Collections.singletonList(this.items.get(0)); + break; + default: + items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.items)); + } + return new BuilderDefaultsWarnings(x, z, items); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderDefaultsWarnings.BuilderDefaultsWarningsBuilder(x=" + this.x + ", z=" + this.z + ", items=" + this.items + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderDefaultsWarningsBuilder builder() { + return new BuilderDefaultsWarningsBuilder(); + } +} +class NoBuilderButHasDefaults { + private final long z = 5; + public NoBuilderButHasDefaults() { + } + @java.lang.SuppressWarnings("all") + public static class NoBuilderButHasDefaultsBuilder { + @java.lang.SuppressWarnings("all") + NoBuilderButHasDefaultsBuilder() { + } + @java.lang.SuppressWarnings("all") + public NoBuilderButHasDefaults build() { + return new NoBuilderButHasDefaults(); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "NoBuilderButHasDefaults.NoBuilderButHasDefaultsBuilder()"; + } + } + @java.lang.SuppressWarnings("all") + public static NoBuilderButHasDefaultsBuilder builder() { + return new NoBuilderButHasDefaultsBuilder(); + } +} diff --git a/test/transform/resource/after-delombok/BuilderGenericMethod.java b/test/transform/resource/after-delombok/BuilderGenericMethod.java new file mode 100644 index 00000000..f70ae871 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderGenericMethod.java @@ -0,0 +1,40 @@ +import java.util.List; +import java.util.*; +class BuilderGenericMethod<T> { + public <N extends Number> Map<N, T> foo(int a, long b) { + return null; + } + @java.lang.SuppressWarnings("all") + public class MapBuilder<N extends Number> { + @java.lang.SuppressWarnings("all") + private int a; + @java.lang.SuppressWarnings("all") + private long b; + @java.lang.SuppressWarnings("all") + MapBuilder() { + } + @java.lang.SuppressWarnings("all") + public MapBuilder<N> a(final int a) { + this.a = a; + return this; + } + @java.lang.SuppressWarnings("all") + public MapBuilder<N> b(final long b) { + this.b = b; + return this; + } + @java.lang.SuppressWarnings("all") + public Map<N, T> build() { + return BuilderGenericMethod.this.<N>foo(a, b); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderGenericMethod.MapBuilder(a=" + this.a + ", b=" + this.b + ")"; + } + } + @java.lang.SuppressWarnings("all") + public <N extends Number> MapBuilder<N> builder() { + return new MapBuilder<N>(); + } +} diff --git a/test/transform/resource/after-delombok/BuilderInstanceMethod.java b/test/transform/resource/after-delombok/BuilderInstanceMethod.java index 61e237d0..12b76a8f 100644 --- a/test/transform/resource/after-delombok/BuilderInstanceMethod.java +++ b/test/transform/resource/after-delombok/BuilderInstanceMethod.java @@ -4,62 +4,49 @@ class BuilderInstanceMethod<T> { return "" + show + yes + also + $andMe; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public class StringBuilder { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private int show; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private int yes; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private List<T> also; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private int $andMe; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") StringBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public StringBuilder show(final int show) { this.show = show; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public StringBuilder yes(final int yes) { this.yes = yes; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public StringBuilder also(final List<T> also) { this.also = also; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public StringBuilder $andMe(final int $andMe) { this.$andMe = $andMe; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String build() { return BuilderInstanceMethod.this.create(show, yes, also, $andMe); } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderInstanceMethod.StringBuilder(show=" + this.show + ", yes=" + this.yes + ", also=" + this.also + ", $andMe=" + this.$andMe + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public StringBuilder builder() { return new StringBuilder(); } diff --git a/test/transform/resource/after-delombok/BuilderSimple.java b/test/transform/resource/after-delombok/BuilderSimple.java index a12ad047..e3821c9a 100644 --- a/test/transform/resource/after-delombok/BuilderSimple.java +++ b/test/transform/resource/after-delombok/BuilderSimple.java @@ -5,50 +5,40 @@ class BuilderSimple<T> { private List<T> also; private int $butNotMe; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSimple(final int yes, final List<T> also) { this.yes = yes; this.also = also; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class BuilderSimpleBuilder<T> { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private int yes; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private List<T> also; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSimpleBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSimpleBuilder<T> yes(final int yes) { this.yes = yes; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSimpleBuilder<T> also(final List<T> also) { this.also = also; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSimple<T> build() { return new BuilderSimple<T>(yes, also); } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderSimple.BuilderSimpleBuilder(yes=" + this.yes + ", also=" + this.also + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static <T> BuilderSimpleBuilder<T> builder() { return new BuilderSimpleBuilder<T>(); } diff --git a/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java b/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java index 08becf6b..cf90e883 100644 --- a/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java +++ b/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java @@ -11,7 +11,6 @@ class BuilderSingularGuavaListsSets<T> { private ImmutableSortedSet<String> passes; private ImmutableTable<? extends Number, ? extends Number, String> users; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSets(final ImmutableList<T> cards, final ImmutableCollection<? extends Number> frogs, final ImmutableSet rawSet, final ImmutableSortedSet<String> passes, final ImmutableTable<? extends Number, ? extends Number, String> users) { this.cards = cards; this.frogs = frogs; @@ -20,129 +19,106 @@ class BuilderSingularGuavaListsSets<T> { this.users = users; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class BuilderSingularGuavaListsSetsBuilder<T> { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private com.google.common.collect.ImmutableList.Builder<T> cards; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private com.google.common.collect.ImmutableList.Builder<Number> frogs; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private com.google.common.collect.ImmutableSet.Builder<java.lang.Object> rawSet; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private com.google.common.collect.ImmutableSortedSet.Builder<String> passes; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private com.google.common.collect.ImmutableTable.Builder<Number, Number, String> users; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> card(final T card) { if (this.cards == null) this.cards = com.google.common.collect.ImmutableList.builder(); this.cards.add(card); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> cards(final java.lang.Iterable<? extends T> cards) { if (this.cards == null) this.cards = com.google.common.collect.ImmutableList.builder(); this.cards.addAll(cards); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> clearCards() { this.cards = null; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> frog(final Number frog) { if (this.frogs == null) this.frogs = com.google.common.collect.ImmutableList.builder(); this.frogs.add(frog); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> frogs(final java.lang.Iterable<? extends Number> frogs) { if (this.frogs == null) this.frogs = com.google.common.collect.ImmutableList.builder(); this.frogs.addAll(frogs); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> clearFrogs() { this.frogs = null; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> rawSet(final java.lang.Object rawSet) { if (this.rawSet == null) this.rawSet = com.google.common.collect.ImmutableSet.builder(); this.rawSet.add(rawSet); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> rawSet(final java.lang.Iterable<?> rawSet) { if (this.rawSet == null) this.rawSet = com.google.common.collect.ImmutableSet.builder(); this.rawSet.addAll(rawSet); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> clearRawSet() { this.rawSet = null; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> pass(final String pass) { if (this.passes == null) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); this.passes.add(pass); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> passes(final java.lang.Iterable<? extends String> passes) { if (this.passes == null) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); this.passes.addAll(passes); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> clearPasses() { this.passes = null; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> user(final Number rowKey, final Number columnKey, final String value) { if (this.users == null) this.users = com.google.common.collect.ImmutableTable.builder(); this.users.put(rowKey, columnKey, value); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> users(final com.google.common.collect.Table<? extends Number, ? extends Number, ? extends String> users) { if (this.users == null) this.users = com.google.common.collect.ImmutableTable.builder(); this.users.putAll(users); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> clearUsers() { this.users = null; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSets<T> build() { com.google.common.collect.ImmutableList<T> cards = this.cards == null ? com.google.common.collect.ImmutableList.<T>of() : this.cards.build(); com.google.common.collect.ImmutableCollection<Number> frogs = this.frogs == null ? com.google.common.collect.ImmutableList.<Number>of() : this.frogs.build(); @@ -153,13 +129,11 @@ class BuilderSingularGuavaListsSets<T> { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder(cards=" + this.cards + ", frogs=" + this.frogs + ", rawSet=" + this.rawSet + ", passes=" + this.passes + ", users=" + this.users + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static <T> BuilderSingularGuavaListsSetsBuilder<T> builder() { return new BuilderSingularGuavaListsSetsBuilder<T>(); } diff --git a/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java b/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java index d6c38790..e29c7e94 100644 --- a/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java +++ b/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java @@ -7,90 +7,74 @@ class BuilderSingularGuavaMaps<K, V> { @SuppressWarnings("all") private ImmutableBiMap rawMap; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularGuavaMaps(final ImmutableMap<K, V> battleaxes, final ImmutableSortedMap<Integer, ? extends V> vertices, final ImmutableBiMap rawMap) { this.battleaxes = battleaxes; this.vertices = vertices; this.rawMap = rawMap; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class BuilderSingularGuavaMapsBuilder<K, V> { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private com.google.common.collect.ImmutableMap.Builder<K, V> battleaxes; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private com.google.common.collect.ImmutableSortedMap.Builder<Integer, V> vertices; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private com.google.common.collect.ImmutableBiMap.Builder<java.lang.Object, java.lang.Object> rawMap; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaMapsBuilder<K, V> battleaxe(final K key, final V value) { if (this.battleaxes == null) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); this.battleaxes.put(key, value); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaMapsBuilder<K, V> battleaxes(final java.util.Map<? extends K, ? extends V> battleaxes) { if (this.battleaxes == null) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); this.battleaxes.putAll(battleaxes); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaMapsBuilder<K, V> clearBattleaxes() { this.battleaxes = null; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaMapsBuilder<K, V> vertex(final Integer key, final V value) { if (this.vertices == null) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.vertices.put(key, value); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaMapsBuilder<K, V> vertices(final java.util.Map<? extends Integer, ? extends V> vertices) { if (this.vertices == null) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.vertices.putAll(vertices); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaMapsBuilder<K, V> clearVertices() { this.vertices = null; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaMapsBuilder<K, V> rawMap(final java.lang.Object key, final java.lang.Object value) { if (this.rawMap == null) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); this.rawMap.put(key, value); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaMapsBuilder<K, V> rawMap(final java.util.Map<?, ?> rawMap) { if (this.rawMap == null) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); this.rawMap.putAll(rawMap); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaMapsBuilder<K, V> clearRawMap() { this.rawMap = null; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularGuavaMaps<K, V> build() { com.google.common.collect.ImmutableMap<K, V> battleaxes = this.battleaxes == null ? com.google.common.collect.ImmutableMap.<K, V>of() : this.battleaxes.build(); com.google.common.collect.ImmutableSortedMap<Integer, V> vertices = this.vertices == null ? com.google.common.collect.ImmutableSortedMap.<Integer, V>of() : this.vertices.build(); @@ -99,13 +83,11 @@ class BuilderSingularGuavaMaps<K, V> { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderSingularGuavaMaps.BuilderSingularGuavaMapsBuilder(battleaxes=" + this.battleaxes + ", vertices=" + this.vertices + ", rawMap=" + this.rawMap + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static <K, V> BuilderSingularGuavaMapsBuilder<K, V> builder() { return new BuilderSingularGuavaMapsBuilder<K, V>(); } diff --git a/test/transform/resource/after-delombok/BuilderSingularLists.java b/test/transform/resource/after-delombok/BuilderSingularLists.java index 9b409404..a0be0c12 100644 --- a/test/transform/resource/after-delombok/BuilderSingularLists.java +++ b/test/transform/resource/after-delombok/BuilderSingularLists.java @@ -6,90 +6,74 @@ class BuilderSingularLists<T> { @SuppressWarnings("all") private List rawList; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularLists(final List<T> children, final Collection<? extends Number> scarves, final List rawList) { this.children = children; this.scarves = scarves; this.rawList = rawList; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class BuilderSingularListsBuilder<T> { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private java.util.ArrayList<T> children; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private java.util.ArrayList<Number> scarves; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private java.util.ArrayList<java.lang.Object> rawList; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularListsBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularListsBuilder<T> child(final T child) { if (this.children == null) this.children = new java.util.ArrayList<T>(); this.children.add(child); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularListsBuilder<T> children(final java.util.Collection<? extends T> children) { if (this.children == null) this.children = new java.util.ArrayList<T>(); this.children.addAll(children); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularListsBuilder<T> clearChildren() { if (this.children != null) this.children.clear(); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularListsBuilder<T> scarf(final Number scarf) { if (this.scarves == null) this.scarves = new java.util.ArrayList<Number>(); this.scarves.add(scarf); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularListsBuilder<T> scarves(final java.util.Collection<? extends Number> scarves) { if (this.scarves == null) this.scarves = new java.util.ArrayList<Number>(); this.scarves.addAll(scarves); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularListsBuilder<T> clearScarves() { if (this.scarves != null) this.scarves.clear(); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularListsBuilder<T> rawList(final java.lang.Object rawList) { if (this.rawList == null) this.rawList = new java.util.ArrayList<java.lang.Object>(); this.rawList.add(rawList); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularListsBuilder<T> rawList(final java.util.Collection<?> rawList) { if (this.rawList == null) this.rawList = new java.util.ArrayList<java.lang.Object>(); this.rawList.addAll(rawList); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularListsBuilder<T> clearRawList() { if (this.rawList != null) this.rawList.clear(); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularLists<T> build() { java.util.List<T> children; switch (this.children == null ? 0 : this.children.size()) { @@ -128,13 +112,11 @@ class BuilderSingularLists<T> { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderSingularLists.BuilderSingularListsBuilder(children=" + this.children + ", scarves=" + this.scarves + ", rawList=" + this.rawList + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static <T> BuilderSingularListsBuilder<T> builder() { return new BuilderSingularListsBuilder<T>(); } diff --git a/test/transform/resource/after-delombok/BuilderSingularMaps.java b/test/transform/resource/after-delombok/BuilderSingularMaps.java index 257a2ec2..6520568b 100644 --- a/test/transform/resource/after-delombok/BuilderSingularMaps.java +++ b/test/transform/resource/after-delombok/BuilderSingularMaps.java @@ -166,11 +166,11 @@ class BuilderSingularMaps<K, V> { break; default: women = new java.util.LinkedHashMap<K, V>(this.women$key.size() < 1073741824 ? 1 + this.women$key.size() + (this.women$key.size() - 3) / 3 : Integer.MAX_VALUE); - for (int $i = 0; $i < this.women$key.size(); $i++) women.put(this.women$key.get($i), this.women$value.get($i)); + for (int $i = 0; $i < this.women$key.size(); $i++) women.put(this.women$key.get($i), (V) this.women$value.get($i)); women = java.util.Collections.unmodifiableMap(women); } java.util.SortedMap<K, Number> men = new java.util.TreeMap<K, Number>(); - if (this.men$key != null) for (int $i = 0; $i < (this.men$key == null ? 0 : this.men$key.size()); $i++) men.put(this.men$key.get($i), this.men$value.get($i)); + if (this.men$key != null) for (int $i = 0; $i < (this.men$key == null ? 0 : this.men$key.size()); $i++) men.put(this.men$key.get($i), (Number) this.men$value.get($i)); men = java.util.Collections.unmodifiableSortedMap(men); java.util.Map<Object, Object> rawMap; switch (this.rawMap$key == null ? 0 : this.rawMap$key.size()) { @@ -182,7 +182,7 @@ class BuilderSingularMaps<K, V> { break; default: rawMap = new java.util.LinkedHashMap<Object, Object>(this.rawMap$key.size() < 1073741824 ? 1 + this.rawMap$key.size() + (this.rawMap$key.size() - 3) / 3 : Integer.MAX_VALUE); - for (int $i = 0; $i < this.rawMap$key.size(); $i++) rawMap.put(this.rawMap$key.get($i), this.rawMap$value.get($i)); + for (int $i = 0; $i < this.rawMap$key.size(); $i++) rawMap.put(this.rawMap$key.get($i), (Object) this.rawMap$value.get($i)); rawMap = java.util.Collections.unmodifiableMap(rawMap); } java.util.Map<String, V> stringMap; @@ -195,7 +195,7 @@ class BuilderSingularMaps<K, V> { break; default: stringMap = new java.util.LinkedHashMap<String, V>(this.stringMap$key.size() < 1073741824 ? 1 + this.stringMap$key.size() + (this.stringMap$key.size() - 3) / 3 : Integer.MAX_VALUE); - for (int $i = 0; $i < this.stringMap$key.size(); $i++) stringMap.put(this.stringMap$key.get($i), this.stringMap$value.get($i)); + for (int $i = 0; $i < this.stringMap$key.size(); $i++) stringMap.put(this.stringMap$key.get($i), (V) this.stringMap$value.get($i)); stringMap = java.util.Collections.unmodifiableMap(stringMap); } return new BuilderSingularMaps<K, V>(women, men, rawMap, stringMap); diff --git a/test/transform/resource/after-delombok/BuilderSingularNoAuto.java b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java index 71ec0c7a..189408da 100644 --- a/test/transform/resource/after-delombok/BuilderSingularNoAuto.java +++ b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java @@ -4,90 +4,74 @@ class BuilderSingularNoAuto { private List<String> widgets; private List<String> items; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularNoAuto(final List<String> things, final List<String> widgets, final List<String> items) { this.things = things; this.widgets = widgets; this.items = items; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class BuilderSingularNoAutoBuilder { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private java.util.ArrayList<String> things; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private java.util.ArrayList<String> widgets; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private java.util.ArrayList<String> items; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularNoAutoBuilder things(final String things) { if (this.things == null) this.things = new java.util.ArrayList<String>(); this.things.add(things); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularNoAutoBuilder things(final java.util.Collection<? extends String> things) { if (this.things == null) this.things = new java.util.ArrayList<String>(); this.things.addAll(things); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularNoAutoBuilder clearThings() { if (this.things != null) this.things.clear(); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularNoAutoBuilder widget(final String widget) { if (this.widgets == null) this.widgets = new java.util.ArrayList<String>(); this.widgets.add(widget); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularNoAutoBuilder widgets(final java.util.Collection<? extends String> widgets) { if (this.widgets == null) this.widgets = new java.util.ArrayList<String>(); this.widgets.addAll(widgets); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularNoAutoBuilder clearWidgets() { if (this.widgets != null) this.widgets.clear(); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularNoAutoBuilder items(final String items) { if (this.items == null) this.items = new java.util.ArrayList<String>(); this.items.add(items); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularNoAutoBuilder items(final java.util.Collection<? extends String> items) { if (this.items == null) this.items = new java.util.ArrayList<String>(); this.items.addAll(items); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularNoAutoBuilder clearItems() { if (this.items != null) this.items.clear(); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularNoAuto build() { java.util.List<String> things; switch (this.things == null ? 0 : this.things.size()) { @@ -126,13 +110,11 @@ class BuilderSingularNoAuto { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderSingularNoAuto.BuilderSingularNoAutoBuilder(things=" + this.things + ", widgets=" + this.widgets + ", items=" + this.items + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static BuilderSingularNoAutoBuilder builder() { return new BuilderSingularNoAutoBuilder(); } diff --git a/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java b/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java index ff194b47..938f3bbc 100644 --- a/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java +++ b/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java @@ -6,90 +6,74 @@ class BuilderSingularRedirectToGuava { private NavigableMap<Integer, Number> things; private Collection<Class<?>> doohickeys; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuava(final Set<String> dangerMice, final NavigableMap<Integer, Number> things, final Collection<Class<?>> doohickeys) { this.dangerMice = dangerMice; this.things = things; this.doohickeys = doohickeys; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class BuilderSingularRedirectToGuavaBuilder { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private com.google.common.collect.ImmutableSet.Builder<String> dangerMice; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private com.google.common.collect.ImmutableSortedMap.Builder<Integer, Number> things; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private com.google.common.collect.ImmutableList.Builder<Class<?>> doohickeys; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuavaBuilder dangerMouse(final String dangerMouse) { if (this.dangerMice == null) this.dangerMice = com.google.common.collect.ImmutableSet.builder(); this.dangerMice.add(dangerMouse); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuavaBuilder dangerMice(final java.lang.Iterable<? extends String> dangerMice) { if (this.dangerMice == null) this.dangerMice = com.google.common.collect.ImmutableSet.builder(); this.dangerMice.addAll(dangerMice); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuavaBuilder clearDangerMice() { this.dangerMice = null; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuavaBuilder thing(final Integer key, final Number value) { if (this.things == null) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.things.put(key, value); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuavaBuilder things(final java.util.Map<? extends Integer, ? extends Number> things) { if (this.things == null) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.things.putAll(things); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuavaBuilder clearThings() { this.things = null; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuavaBuilder doohickey(final Class<?> doohickey) { if (this.doohickeys == null) this.doohickeys = com.google.common.collect.ImmutableList.builder(); this.doohickeys.add(doohickey); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuavaBuilder doohickeys(final java.lang.Iterable<? extends Class<?>> doohickeys) { if (this.doohickeys == null) this.doohickeys = com.google.common.collect.ImmutableList.builder(); this.doohickeys.addAll(doohickeys); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuavaBuilder clearDoohickeys() { this.doohickeys = null; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuava build() { java.util.Set<String> dangerMice = this.dangerMice == null ? com.google.common.collect.ImmutableSet.<String>of() : this.dangerMice.build(); java.util.NavigableMap<Integer, Number> things = this.things == null ? com.google.common.collect.ImmutableSortedMap.<Integer, Number>of() : this.things.build(); @@ -98,13 +82,11 @@ class BuilderSingularRedirectToGuava { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderSingularRedirectToGuava.BuilderSingularRedirectToGuavaBuilder(dangerMice=" + this.dangerMice + ", things=" + this.things + ", doohickeys=" + this.doohickeys + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static BuilderSingularRedirectToGuavaBuilder builder() { return new BuilderSingularRedirectToGuavaBuilder(); } diff --git a/test/transform/resource/after-delombok/BuilderSingularSets.java b/test/transform/resource/after-delombok/BuilderSingularSets.java index 2461d2fd..2d75b294 100644 --- a/test/transform/resource/after-delombok/BuilderSingularSets.java +++ b/test/transform/resource/after-delombok/BuilderSingularSets.java @@ -7,7 +7,6 @@ class BuilderSingularSets<T> { private Set rawSet; private Set<String> stringSet; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularSets(final Set<T> dangerMice, final SortedSet<? extends Number> octopodes, final Set rawSet, final Set<String> stringSet) { this.dangerMice = dangerMice; this.octopodes = octopodes; @@ -15,106 +14,87 @@ class BuilderSingularSets<T> { this.stringSet = stringSet; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class BuilderSingularSetsBuilder<T> { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private java.util.ArrayList<T> dangerMice; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private java.util.ArrayList<Number> octopodes; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private java.util.ArrayList<java.lang.Object> rawSet; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private java.util.ArrayList<String> stringSet; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> dangerMouse(final T dangerMouse) { if (this.dangerMice == null) this.dangerMice = new java.util.ArrayList<T>(); this.dangerMice.add(dangerMouse); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> dangerMice(final java.util.Collection<? extends T> dangerMice) { if (this.dangerMice == null) this.dangerMice = new java.util.ArrayList<T>(); this.dangerMice.addAll(dangerMice); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> clearDangerMice() { if (this.dangerMice != null) this.dangerMice.clear(); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> octopus(final Number octopus) { if (this.octopodes == null) this.octopodes = new java.util.ArrayList<Number>(); this.octopodes.add(octopus); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> octopodes(final java.util.Collection<? extends Number> octopodes) { if (this.octopodes == null) this.octopodes = new java.util.ArrayList<Number>(); this.octopodes.addAll(octopodes); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> clearOctopodes() { if (this.octopodes != null) this.octopodes.clear(); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> rawSet(final java.lang.Object rawSet) { if (this.rawSet == null) this.rawSet = new java.util.ArrayList<java.lang.Object>(); this.rawSet.add(rawSet); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> rawSet(final java.util.Collection<?> rawSet) { if (this.rawSet == null) this.rawSet = new java.util.ArrayList<java.lang.Object>(); this.rawSet.addAll(rawSet); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> clearRawSet() { if (this.rawSet != null) this.rawSet.clear(); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> stringSet(final String stringSet) { if (this.stringSet == null) this.stringSet = new java.util.ArrayList<String>(); this.stringSet.add(stringSet); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> stringSet(final java.util.Collection<? extends String> stringSet) { if (this.stringSet == null) this.stringSet = new java.util.ArrayList<String>(); this.stringSet.addAll(stringSet); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> clearStringSet() { if (this.stringSet != null) this.stringSet.clear(); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularSets<T> build() { java.util.Set<T> dangerMice; switch (this.dangerMice == null ? 0 : this.dangerMice.size()) { @@ -162,13 +142,11 @@ class BuilderSingularSets<T> { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderSingularSets.BuilderSingularSetsBuilder(dangerMice=" + this.dangerMice + ", octopodes=" + this.octopodes + ", rawSet=" + this.rawSet + ", stringSet=" + this.stringSet + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static <T> BuilderSingularSetsBuilder<T> builder() { return new BuilderSingularSetsBuilder<T>(); } diff --git a/test/transform/resource/after-delombok/BuilderSingularWithPrefixes.java b/test/transform/resource/after-delombok/BuilderSingularWithPrefixes.java index a6bd2f88..e103d6dd 100644 --- a/test/transform/resource/after-delombok/BuilderSingularWithPrefixes.java +++ b/test/transform/resource/after-delombok/BuilderSingularWithPrefixes.java @@ -1,42 +1,34 @@ class BuilderSingularWithPrefixes { private java.util.List<String> _elems; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularWithPrefixes(final java.util.List<String> elems) { this._elems = elems; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class BuilderSingularWithPrefixesBuilder { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private java.util.ArrayList<String> elems; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderSingularWithPrefixesBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularWithPrefixesBuilder elem(final String elem) { if (this.elems == null) this.elems = new java.util.ArrayList<String>(); this.elems.add(elem); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularWithPrefixesBuilder elems(final java.util.Collection<? extends String> elems) { if (this.elems == null) this.elems = new java.util.ArrayList<String>(); this.elems.addAll(elems); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularWithPrefixesBuilder clearElems() { if (this.elems != null) this.elems.clear(); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderSingularWithPrefixes build() { java.util.List<String> elems; switch (this.elems == null ? 0 : this.elems.size()) { @@ -53,13 +45,11 @@ class BuilderSingularWithPrefixes { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderSingularWithPrefixes.BuilderSingularWithPrefixesBuilder(elems=" + this.elems + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static BuilderSingularWithPrefixesBuilder builder() { return new BuilderSingularWithPrefixesBuilder(); } diff --git a/test/transform/resource/after-delombok/BuilderValueData.java b/test/transform/resource/after-delombok/BuilderValueData.java index d08c6149..e1c107da 100644 --- a/test/transform/resource/after-delombok/BuilderValueData.java +++ b/test/transform/resource/after-delombok/BuilderValueData.java @@ -2,41 +2,33 @@ import java.util.List; final class BuilderAndValue { private final int zero = 0; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderAndValue() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class BuilderAndValueBuilder { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderAndValueBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderAndValue build() { return new BuilderAndValue(); } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderAndValue.BuilderAndValueBuilder()"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static BuilderAndValueBuilder builder() { return new BuilderAndValueBuilder(); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getZero() { return this.zero; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof BuilderAndValue)) return false; @@ -46,7 +38,6 @@ final class BuilderAndValue { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -55,7 +46,6 @@ final class BuilderAndValue { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderAndValue(zero=" + this.getZero() + ")"; } @@ -64,41 +54,33 @@ final class BuilderAndValue { class BuilderAndData { private final int zero = 0; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderAndData() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class BuilderAndDataBuilder { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderAndDataBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderAndData build() { return new BuilderAndData(); } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderAndData.BuilderAndDataBuilder()"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static BuilderAndDataBuilder builder() { return new BuilderAndDataBuilder(); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getZero() { return this.zero; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof BuilderAndData)) return false; @@ -108,13 +90,11 @@ class BuilderAndData { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof BuilderAndData; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -123,7 +103,6 @@ class BuilderAndData { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderAndData(zero=" + this.getZero() + ")"; } diff --git a/test/transform/resource/after-delombok/BuilderWithAccessors.java b/test/transform/resource/after-delombok/BuilderWithAccessors.java index db3cc3d8..e6a6da79 100644 --- a/test/transform/resource/after-delombok/BuilderWithAccessors.java +++ b/test/transform/resource/after-delombok/BuilderWithAccessors.java @@ -4,7 +4,6 @@ class BuilderWithAccessors { private int _foo; private int __bar; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderWithAccessors(final int plower, final int upper, final int foo, final int _bar) { this.plower = plower; this.pUpper = upper; @@ -12,62 +11,49 @@ class BuilderWithAccessors { this.__bar = _bar; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class BuilderWithAccessorsBuilder { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private int plower; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private int upper; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private int foo; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private int _bar; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderWithAccessorsBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithAccessorsBuilder plower(final int plower) { this.plower = plower; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithAccessorsBuilder upper(final int upper) { this.upper = upper; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithAccessorsBuilder foo(final int foo) { this.foo = foo; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithAccessorsBuilder _bar(final int _bar) { this._bar = _bar; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithAccessors build() { return new BuilderWithAccessors(plower, upper, foo, _bar); } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderWithAccessors.BuilderWithAccessorsBuilder(plower=" + this.plower + ", upper=" + this.upper + ", foo=" + this.foo + ", _bar=" + this._bar + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static BuilderWithAccessorsBuilder builder() { return new BuilderWithAccessorsBuilder(); } diff --git a/test/transform/resource/after-delombok/BuilderWithDeprecated.java b/test/transform/resource/after-delombok/BuilderWithDeprecated.java new file mode 100644 index 00000000..cd887529 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderWithDeprecated.java @@ -0,0 +1,111 @@ +import com.google.common.collect.ImmutableList; +public class BuilderWithDeprecated { + /** + * @deprecated + */ + String dep1; + @Deprecated + int dep2; + @Deprecated + java.util.List<String> strings; + @Deprecated + ImmutableList<Integer> numbers; + @java.lang.SuppressWarnings("all") + BuilderWithDeprecated(final String dep1, final int dep2, final java.util.List<String> strings, final ImmutableList<Integer> numbers) { + this.dep1 = dep1; + this.dep2 = dep2; + this.strings = strings; + this.numbers = numbers; + } + @java.lang.SuppressWarnings("all") + public static class BuilderWithDeprecatedBuilder { + @java.lang.SuppressWarnings("all") + private String dep1; + @java.lang.SuppressWarnings("all") + private int dep2; + @java.lang.SuppressWarnings("all") + private java.util.ArrayList<String> strings; + @java.lang.SuppressWarnings("all") + private com.google.common.collect.ImmutableList.Builder<Integer> numbers; + @java.lang.SuppressWarnings("all") + BuilderWithDeprecatedBuilder() { + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecatedBuilder dep1(final String dep1) { + this.dep1 = dep1; + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecatedBuilder dep2(final int dep2) { + this.dep2 = dep2; + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecatedBuilder string(final String string) { + if (this.strings == null) this.strings = new java.util.ArrayList<String>(); + this.strings.add(string); + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecatedBuilder strings(final java.util.Collection<? extends String> strings) { + if (this.strings == null) this.strings = new java.util.ArrayList<String>(); + this.strings.addAll(strings); + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecatedBuilder clearStrings() { + if (this.strings != null) this.strings.clear(); + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecatedBuilder number(final Integer number) { + if (this.numbers == null) this.numbers = com.google.common.collect.ImmutableList.builder(); + this.numbers.add(number); + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecatedBuilder numbers(final java.lang.Iterable<? extends Integer> numbers) { + if (this.numbers == null) this.numbers = com.google.common.collect.ImmutableList.builder(); + this.numbers.addAll(numbers); + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecatedBuilder clearNumbers() { + this.numbers = null; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecated build() { + java.util.List<String> strings; + switch (this.strings == null ? 0 : this.strings.size()) { + case 0: + strings = java.util.Collections.emptyList(); + break; + case 1: + strings = java.util.Collections.singletonList(this.strings.get(0)); + break; + default: + strings = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.strings)); + } + com.google.common.collect.ImmutableList<Integer> numbers = this.numbers == null ? com.google.common.collect.ImmutableList.<Integer>of() : this.numbers.build(); + return new BuilderWithDeprecated(dep1, dep2, strings, numbers); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderWithDeprecated.BuilderWithDeprecatedBuilder(dep1=" + this.dep1 + ", dep2=" + this.dep2 + ", strings=" + this.strings + ", numbers=" + this.numbers + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderWithDeprecatedBuilder builder() { + return new BuilderWithDeprecatedBuilder(); + } +} diff --git a/test/transform/resource/after-delombok/BuilderWithExistingBuilderClass.java b/test/transform/resource/after-delombok/BuilderWithExistingBuilderClass.java index 03692529..0a5edacd 100644 --- a/test/transform/resource/after-delombok/BuilderWithExistingBuilderClass.java +++ b/test/transform/resource/after-delombok/BuilderWithExistingBuilderClass.java @@ -4,44 +4,36 @@ class BuilderWithExistingBuilderClass<T, K extends Number> { } public static class BuilderWithExistingBuilderClassBuilder<Z extends Number> { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private boolean arg2; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private String arg3; private Z arg1; public void arg2(boolean arg) { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderWithExistingBuilderClassBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithExistingBuilderClassBuilder<Z> arg1(final Z arg1) { this.arg1 = arg1; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithExistingBuilderClassBuilder<Z> arg3(final String arg3) { this.arg3 = arg3; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - public BuilderWithExistingBuilderClass build() { + public BuilderWithExistingBuilderClass<String, Z> build() { return BuilderWithExistingBuilderClass.<Z>staticMethod(arg1, arg2, arg3); } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderWithExistingBuilderClass.BuilderWithExistingBuilderClassBuilder(arg1=" + this.arg1 + ", arg2=" + this.arg2 + ", arg3=" + this.arg3 + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static <Z extends Number> BuilderWithExistingBuilderClassBuilder<Z> builder() { return new BuilderWithExistingBuilderClassBuilder<Z>(); } diff --git a/test/transform/resource/after-delombok/BuilderWithRecursiveGenerics.java b/test/transform/resource/after-delombok/BuilderWithRecursiveGenerics.java index edc1e3c6..7fb300e4 100644 --- a/test/transform/resource/after-delombok/BuilderWithRecursiveGenerics.java +++ b/test/transform/resource/after-delombok/BuilderWithRecursiveGenerics.java @@ -6,66 +6,53 @@ public class BuilderWithRecursiveGenerics { private final Foo foo; private final Bar bar; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") Test(final Foo foo, final Bar bar) { this.foo = foo; this.bar = bar; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class TestBuilder<Foo, Bar extends Set<Foo>, Quz extends Inter<Bar, Quz>> { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private Foo foo; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private Bar bar; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") TestBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public TestBuilder<Foo, Bar, Quz> foo(final Foo foo) { this.foo = foo; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public TestBuilder<Foo, Bar, Quz> bar(final Bar bar) { this.bar = bar; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Test<Foo, Bar, Quz> build() { return new Test<Foo, Bar, Quz>(foo, bar); } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderWithRecursiveGenerics.Test.TestBuilder(foo=" + this.foo + ", bar=" + this.bar + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static <Foo, Bar extends Set<Foo>, Quz extends Inter<Bar, Quz>> TestBuilder<Foo, Bar, Quz> builder() { return new TestBuilder<Foo, Bar, Quz>(); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Foo getFoo() { return this.foo; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Bar getBar() { return this.bar; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof BuilderWithRecursiveGenerics.Test)) return false; @@ -80,7 +67,6 @@ public class BuilderWithRecursiveGenerics { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -92,7 +78,6 @@ public class BuilderWithRecursiveGenerics { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderWithRecursiveGenerics.Test(foo=" + this.getFoo() + ", bar=" + this.getBar() + ")"; } diff --git a/test/transform/resource/after-delombok/BuilderWithToBuilder.java b/test/transform/resource/after-delombok/BuilderWithToBuilder.java index 7dfb046a..46387f0f 100644 --- a/test/transform/resource/after-delombok/BuilderWithToBuilder.java +++ b/test/transform/resource/after-delombok/BuilderWithToBuilder.java @@ -8,7 +8,6 @@ class BuilderWithToBuilder<T> { return x.foo; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderWithToBuilder(final String one, final String two, final T foo, final List<T> bars) { this.mOne = one; this.mTwo = two; @@ -16,64 +15,51 @@ class BuilderWithToBuilder<T> { this.bars = bars; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class BuilderWithToBuilderBuilder<T> { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private String one; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private String two; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private T foo; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private java.util.ArrayList<T> bars; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderWithToBuilderBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithToBuilderBuilder<T> one(final String one) { this.one = one; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithToBuilderBuilder<T> two(final String two) { this.two = two; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithToBuilderBuilder<T> foo(final T foo) { this.foo = foo; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithToBuilderBuilder<T> bar(final T bar) { if (this.bars == null) this.bars = new java.util.ArrayList<T>(); this.bars.add(bar); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithToBuilderBuilder<T> bars(final java.util.Collection<? extends T> bars) { if (this.bars == null) this.bars = new java.util.ArrayList<T>(); this.bars.addAll(bars); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithToBuilderBuilder<T> clearBars() { if (this.bars != null) this.bars.clear(); return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithToBuilder<T> build() { java.util.List<T> bars; switch (this.bars == null ? 0 : this.bars.size()) { @@ -90,18 +76,15 @@ class BuilderWithToBuilder<T> { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderWithToBuilder.BuilderWithToBuilderBuilder(one=" + this.one + ", two=" + this.two + ", foo=" + this.foo + ", bars=" + this.bars + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static <T> BuilderWithToBuilderBuilder<T> builder() { return new BuilderWithToBuilderBuilder<T>(); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithToBuilderBuilder<T> toBuilder() { return new BuilderWithToBuilderBuilder<T>().one(this.mOne).two(this.mTwo).foo(BuilderWithToBuilder.rrr(this)).bars(this.bars); } @@ -115,49 +98,39 @@ class ConstructorWithToBuilder<T> { public ConstructorWithToBuilder(String mOne, T bar) { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class ConstructorWithToBuilderBuilder<T> { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private String mOne; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private T bar; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") ConstructorWithToBuilderBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public ConstructorWithToBuilderBuilder<T> mOne(final String mOne) { this.mOne = mOne; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public ConstructorWithToBuilderBuilder<T> bar(final T bar) { this.bar = bar; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public ConstructorWithToBuilder<T> build() { return new ConstructorWithToBuilder<T>(mOne, bar); } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ConstructorWithToBuilder.ConstructorWithToBuilderBuilder(mOne=" + this.mOne + ", bar=" + this.bar + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static <T> ConstructorWithToBuilderBuilder<T> builder() { return new ConstructorWithToBuilderBuilder<T>(); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public ConstructorWithToBuilderBuilder<T> toBuilder() { return new ConstructorWithToBuilderBuilder<T>().mOne(this.mOne).bar(this.foo); } @@ -173,49 +146,39 @@ class StaticWithToBuilder<T, K> { return new StaticWithToBuilder<Z, String>(); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static class StaticWithToBuilderBuilder<Z> { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private String mOne; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private Z bar; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") StaticWithToBuilderBuilder() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public StaticWithToBuilderBuilder<Z> mOne(final String mOne) { this.mOne = mOne; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public StaticWithToBuilderBuilder<Z> bar(final Z bar) { this.bar = bar; return this; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - public StaticWithToBuilder build() { + public StaticWithToBuilder<Z, String> build() { return StaticWithToBuilder.<Z>test(mOne, bar); } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "StaticWithToBuilder.StaticWithToBuilderBuilder(mOne=" + this.mOne + ", bar=" + this.bar + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static <Z> StaticWithToBuilderBuilder<Z> builder() { return new StaticWithToBuilderBuilder<Z>(); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public StaticWithToBuilderBuilder<T> toBuilder() { return new StaticWithToBuilderBuilder<T>().mOne(this.mOne).bar(this.foo); } diff --git a/test/transform/resource/after-delombok/BuilderWithTolerate.java b/test/transform/resource/after-delombok/BuilderWithTolerate.java index 5eff9120..6ec7c091 100644 --- a/test/transform/resource/after-delombok/BuilderWithTolerate.java +++ b/test/transform/resource/after-delombok/BuilderWithTolerate.java @@ -1,58 +1,39 @@ - import lombok.experimental.Tolerate; - public class BuilderWithTolerate { private final int value; - public static void main(String[] args) { BuilderWithTolerate.builder().value("42").build(); } - - public static class BuilderWithTolerateBuilder { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private int value; - @Tolerate public BuilderWithTolerateBuilder value(String s) { return this.value(Integer.parseInt(s)); } - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderWithTolerateBuilder() { } - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithTolerateBuilder value(final int value) { this.value = value; return this; } - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public BuilderWithTolerate build() { return new BuilderWithTolerate(value); } - @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "BuilderWithTolerate.BuilderWithTolerateBuilder(value=" + this.value + ")"; } } - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") BuilderWithTolerate(final int value) { this.value = value; } - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static BuilderWithTolerateBuilder builder() { return new BuilderWithTolerateBuilder(); } diff --git a/test/transform/resource/after-delombok/ClassNamedAfterGetter.java b/test/transform/resource/after-delombok/ClassNamedAfterGetter.java index 793ec097..769aaf7c 100644 --- a/test/transform/resource/after-delombok/ClassNamedAfterGetter.java +++ b/test/transform/resource/after-delombok/ClassNamedAfterGetter.java @@ -1,7 +1,6 @@ class GetFoo { private int foo; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getFoo() { return this.foo; } diff --git a/test/transform/resource/after-delombok/CommentsInterspersed.java b/test/transform/resource/after-delombok/CommentsInterspersed.java index a1da2c3d..833f2ce0 100644 --- a/test/transform/resource/after-delombok/CommentsInterspersed.java +++ b/test/transform/resource/after-delombok/CommentsInterspersed.java @@ -12,7 +12,6 @@ public class CommentsInterspersed { javascript; }-*/ @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getTest() { return this.test; } diff --git a/test/transform/resource/after-delombok/ConflictingStaticConstructorNames.java b/test/transform/resource/after-delombok/ConflictingStaticConstructorNames.java index 22a66c95..30aefaa0 100644 --- a/test/transform/resource/after-delombok/ConflictingStaticConstructorNames.java +++ b/test/transform/resource/after-delombok/ConflictingStaticConstructorNames.java @@ -1,7 +1,6 @@ class ConflictingStaticConstructorNames { @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ConflictingStaticConstructorNames)) return false; @@ -10,25 +9,21 @@ class ConflictingStaticConstructorNames { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof ConflictingStaticConstructorNames; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { int result = 1; return result; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ConflictingStaticConstructorNames()"; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public ConflictingStaticConstructorNames() { } } diff --git a/test/transform/resource/after-delombok/Constructors.java b/test/transform/resource/after-delombok/Constructors.java index c138a00c..b2e51c40 100644 --- a/test/transform/resource/after-delombok/Constructors.java +++ b/test/transform/resource/after-delombok/Constructors.java @@ -1,9 +1,7 @@ class RequiredArgsConstructor1 { final int x; String name; - @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public RequiredArgsConstructor1(final int x) { this.x = x; } @@ -11,9 +9,7 @@ class RequiredArgsConstructor1 { class RequiredArgsConstructorAccess { final int x; String name; - @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected RequiredArgsConstructorAccess(final int x) { this.x = x; } @@ -22,12 +18,10 @@ class RequiredArgsConstructorStaticName { final int x; String name; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private RequiredArgsConstructorStaticName(final int x) { this.x = x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static RequiredArgsConstructorStaticName staticname(final int x) { return new RequiredArgsConstructorStaticName(x); } @@ -35,10 +29,8 @@ class RequiredArgsConstructorStaticName { class RequiredArgsConstructorWithAnnotations { final int x; String name; - @java.beans.ConstructorProperties({"x"}) @Deprecated @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public RequiredArgsConstructorWithAnnotations(final int x) { this.x = x; } @@ -46,9 +38,7 @@ class RequiredArgsConstructorWithAnnotations { class AllArgsConstructor1 { final int x; String name; - @java.beans.ConstructorProperties({"x", "name"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public AllArgsConstructor1(final int x, final String name) { this.x = x; this.name = name; @@ -58,7 +48,6 @@ class NoArgsConstructor1 { int x; String name; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public NoArgsConstructor1() { } } @@ -66,12 +55,10 @@ class RequiredArgsConstructorStaticNameGenerics<T extends Number> { final T x; String name; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private RequiredArgsConstructorStaticNameGenerics(final T x) { this.x = x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static <T extends Number> RequiredArgsConstructorStaticNameGenerics<T> of(final T x) { return new RequiredArgsConstructorStaticNameGenerics<T>(x); } @@ -80,12 +67,10 @@ class RequiredArgsConstructorStaticNameGenerics2<T extends Number> { final Class<T> x; String name; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private RequiredArgsConstructorStaticNameGenerics2(final Class<T> x) { this.x = x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static <T extends Number> RequiredArgsConstructorStaticNameGenerics2<T> of(final Class<T> x) { return new RequiredArgsConstructorStaticNameGenerics2<T>(x); } @@ -93,7 +78,6 @@ class RequiredArgsConstructorStaticNameGenerics2<T extends Number> { class AllArgsConstructorPackageAccess { final String x; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") AllArgsConstructorPackageAccess(final String x) { this.x = x; } @@ -107,7 +91,6 @@ class NoArgsConstructor2 { final String s; byte z; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public NoArgsConstructor2() { this.x = 0; this.y = 0.0; diff --git a/test/transform/resource/after-delombok/ConstructorsConfiguration.java b/test/transform/resource/after-delombok/ConstructorsConfiguration.java index 40189911..47b0cc16 100644 --- a/test/transform/resource/after-delombok/ConstructorsConfiguration.java +++ b/test/transform/resource/after-delombok/ConstructorsConfiguration.java @@ -1,7 +1,6 @@ class ConstructorsConfiguration { int x; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public ConstructorsConfiguration(final int x) { this.x = x; } diff --git a/test/transform/resource/after-delombok/ConstructorsWithAccessors.java b/test/transform/resource/after-delombok/ConstructorsWithAccessors.java index 43c0ea66..dd4ce12f 100644 --- a/test/transform/resource/after-delombok/ConstructorsWithAccessors.java +++ b/test/transform/resource/after-delombok/ConstructorsWithAccessors.java @@ -4,9 +4,7 @@ class ConstructorsWithAccessors { int _huh; int __huh2; - @java.beans.ConstructorProperties({"plower", "upper", "huh", "_huh2"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public ConstructorsWithAccessors(final int plower, final int upper, final int huh, final int _huh2) { this.plower = plower; this.pUpper = upper; @@ -14,3 +12,34 @@ class ConstructorsWithAccessors { this.__huh2 = _huh2; } } + +class ConstructorsWithAccessorsNonNull { + @lombok.NonNull + Integer plower; + @lombok.NonNull + Integer pUpper; + @lombok.NonNull + Integer _huh; + @lombok.NonNull + final Integer __huh2; + + @java.lang.SuppressWarnings("all") + public ConstructorsWithAccessorsNonNull(@lombok.NonNull final Integer plower, @lombok.NonNull final Integer upper, @lombok.NonNull final Integer huh, @lombok.NonNull final Integer _huh2) { + if (plower == null) { + throw new java.lang.NullPointerException("plower"); + } + if (upper == null) { + throw new java.lang.NullPointerException("upper"); + } + if (huh == null) { + throw new java.lang.NullPointerException("huh"); + } + if (_huh2 == null) { + throw new java.lang.NullPointerException("_huh2"); + } + this.plower = plower; + this.pUpper = upper; + this._huh = huh; + this.__huh2 = _huh2; + } +} diff --git a/test/transform/resource/after-delombok/DataConfiguration.java b/test/transform/resource/after-delombok/DataConfiguration.java index aadb35b6..b71e1c81 100644 --- a/test/transform/resource/after-delombok/DataConfiguration.java +++ b/test/transform/resource/after-delombok/DataConfiguration.java @@ -1,44 +1,38 @@ class DataConfiguration { final int x; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public DataConfiguration(final int x) { this.x = x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof DataConfiguration)) return false; final DataConfiguration other = (DataConfiguration) o; if (!other.canEqual((java.lang.Object) this)) return false; - if (this.getX() != other.getX()) return false; + if (this.x != other.x) return false; return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof DataConfiguration; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; - result = result * PRIME + this.getX(); + result = result * PRIME + this.x; return result; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { - return "DataConfiguration(x=" + this.getX() + ")"; + return "DataConfiguration(x=" + this.x + ")"; } } diff --git a/test/transform/resource/after-delombok/DataExtended.java b/test/transform/resource/after-delombok/DataExtended.java index 04f0da0b..bcbf2293 100644 --- a/test/transform/resource/after-delombok/DataExtended.java +++ b/test/transform/resource/after-delombok/DataExtended.java @@ -1,22 +1,18 @@ class DataExtended { int x; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public DataExtended() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setX(final int x) { this.x = x; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof DataExtended)) return false; @@ -26,13 +22,11 @@ class DataExtended { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof DataExtended; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -41,7 +35,6 @@ class DataExtended { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "DataExtended(x=" + this.x + ")"; } diff --git a/test/transform/resource/after-delombok/DataIgnore.java b/test/transform/resource/after-delombok/DataIgnore.java index dca235d3..309d8150 100644 --- a/test/transform/resource/after-delombok/DataIgnore.java +++ b/test/transform/resource/after-delombok/DataIgnore.java @@ -1,20 +1,16 @@ class DataIgnore { final int x; String $name; - @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public DataIgnore(final int x) { this.x = x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof DataIgnore)) return false; @@ -24,13 +20,11 @@ class DataIgnore { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof DataIgnore; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -39,7 +33,6 @@ class DataIgnore { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "DataIgnore(x=" + this.getX() + ")"; } diff --git a/test/transform/resource/after-delombok/DataOnEnum.java b/test/transform/resource/after-delombok/DataOnEnum.java index 5316c022..2486646b 100644 --- a/test/transform/resource/after-delombok/DataOnEnum.java +++ b/test/transform/resource/after-delombok/DataOnEnum.java @@ -2,18 +2,15 @@ public enum DataOnEnum { A("hello"); private final String someField; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getSomeField() { return this.someField; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "DataOnEnum(someField=" + this.getSomeField() + ")"; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private DataOnEnum(final String someField) { this.someField = someField; } diff --git a/test/transform/resource/after-delombok/DataOnLocalClass.java b/test/transform/resource/after-delombok/DataOnLocalClass.java index 9fe16070..84817897 100644 --- a/test/transform/resource/after-delombok/DataOnLocalClass.java +++ b/test/transform/resource/after-delombok/DataOnLocalClass.java @@ -4,28 +4,23 @@ class DataOnLocalClass1 { final int x; String name; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Local(final int x) { this.x = x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getName() { return this.name; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setName(final String name) { this.name = name; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Local)) return false; @@ -38,13 +33,11 @@ class DataOnLocalClass1 { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof Local; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -55,7 +48,6 @@ class DataOnLocalClass1 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "Local(x=" + this.getX() + ", name=" + this.getName() + ")"; } @@ -70,7 +62,6 @@ class DataOnLocalClass2 { @lombok.NonNull String name; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public InnerLocal(@lombok.NonNull final String name) { if (name == null) { throw new java.lang.NullPointerException("name"); @@ -79,12 +70,10 @@ class DataOnLocalClass2 { } @lombok.NonNull @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getName() { return this.name; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setName(@lombok.NonNull final String name) { if (name == null) { throw new java.lang.NullPointerException("name"); @@ -93,7 +82,6 @@ class DataOnLocalClass2 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Local.InnerLocal)) return false; @@ -105,13 +93,11 @@ class DataOnLocalClass2 { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof Local.InnerLocal; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -121,24 +107,20 @@ class DataOnLocalClass2 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "Local.InnerLocal(name=" + this.getName() + ")"; } } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Local(final int x) { this.x = x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Local)) return false; @@ -148,13 +130,11 @@ class DataOnLocalClass2 { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof Local; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -163,7 +143,6 @@ class DataOnLocalClass2 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "Local(x=" + this.getX() + ")"; } diff --git a/test/transform/resource/after-delombok/DataPlain.java b/test/transform/resource/after-delombok/DataPlain.java index 6d109653..d54baef1 100644 --- a/test/transform/resource/after-delombok/DataPlain.java +++ b/test/transform/resource/after-delombok/DataPlain.java @@ -1,30 +1,24 @@ class Data1 { final int x; String name; - @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Data1(final int x) { this.x = x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getName() { return this.name; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setName(final String name) { this.name = name; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Data1)) return false; @@ -37,13 +31,11 @@ class Data1 { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof Data1; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -54,7 +46,6 @@ class Data1 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "Data1(x=" + this.getX() + ", name=" + this.getName() + ")"; } @@ -62,30 +53,24 @@ class Data1 { class Data2 { final int x; String name; - @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Data2(final int x) { this.x = x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getName() { return this.name; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setName(final String name) { this.name = name; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Data2)) return false; @@ -98,13 +83,11 @@ class Data2 { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof Data2; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -115,7 +98,6 @@ class Data2 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "Data2(x=" + this.getX() + ", name=" + this.getName() + ")"; } @@ -123,30 +105,24 @@ class Data2 { final class Data3 { final int x; String name; - @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Data3(final int x) { this.x = x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getName() { return this.name; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setName(final String name) { this.name = name; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Data3)) return false; @@ -159,7 +135,6 @@ final class Data3 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -170,7 +145,6 @@ final class Data3 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "Data3(x=" + this.getX() + ", name=" + this.getName() + ")"; } @@ -180,24 +154,20 @@ final class Data4 extends java.util.Timer { Data4() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setX(final int x) { this.x = x; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "Data4(x=" + this.getX() + ")"; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Data4)) return false; @@ -208,29 +178,24 @@ final class Data4 extends java.util.Timer { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof Data4; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; - int result = 1; - result = result * PRIME + super.hashCode(); + int result = super.hashCode(); result = result * PRIME + this.getX(); return result; } } class Data5 { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Data5() { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Data5)) return false; @@ -239,32 +204,27 @@ class Data5 { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof Data5; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { int result = 1; return result; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "Data5()"; } } final class Data6 { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Data6() { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Data6)) return false; @@ -272,14 +232,12 @@ final class Data6 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { int result = 1; return result; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "Data6()"; } diff --git a/test/transform/resource/after-delombok/DataWithGetter.java b/test/transform/resource/after-delombok/DataWithGetter.java index 85e698df..b4107bb3 100644 --- a/test/transform/resource/after-delombok/DataWithGetter.java +++ b/test/transform/resource/after-delombok/DataWithGetter.java @@ -2,25 +2,20 @@ class DataWithGetter { private int x; private int y; private final String z; - @java.beans.ConstructorProperties({"z"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public DataWithGetter(final String z) { this.z = z; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setX(final int x) { this.x = x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setY(final int y) { this.y = y; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof DataWithGetter)) return false; @@ -34,13 +29,11 @@ class DataWithGetter { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof DataWithGetter; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -52,22 +45,18 @@ class DataWithGetter { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "DataWithGetter(x=" + this.getX() + ", y=" + this.getY() + ", z=" + this.getZ() + ")"; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getY() { return this.y; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getZ() { return this.z; } diff --git a/test/transform/resource/after-delombok/DataWithGetterNone.java b/test/transform/resource/after-delombok/DataWithGetterNone.java index 8be06247..4467e407 100644 --- a/test/transform/resource/after-delombok/DataWithGetterNone.java +++ b/test/transform/resource/after-delombok/DataWithGetterNone.java @@ -2,25 +2,20 @@ class DataWithGetterNone { private int x; private int y; private final String z; - @java.beans.ConstructorProperties({"z"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public DataWithGetterNone(final String z) { this.z = z; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setX(final int x) { this.x = x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setY(final int y) { this.y = y; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof DataWithGetterNone)) return false; @@ -34,13 +29,11 @@ class DataWithGetterNone { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof DataWithGetterNone; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -52,7 +45,6 @@ class DataWithGetterNone { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "DataWithGetterNone(x=" + this.x + ", y=" + this.y + ", z=" + this.z + ")"; } diff --git a/test/transform/resource/after-delombok/DelegateOnGetter.java b/test/transform/resource/after-delombok/DelegateOnGetter.java index 8cb72788..f41259df 100644 --- a/test/transform/resource/after-delombok/DelegateOnGetter.java +++ b/test/transform/resource/after-delombok/DelegateOnGetter.java @@ -5,7 +5,6 @@ class DelegateOnGetter { int getInt(); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Bar getBar() { java.lang.Object value = this.bar.get(); if (value == null) { @@ -27,12 +26,10 @@ class DelegateOnGetter { return (Bar) (value == this.bar ? null : value); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setList(final java.util.ArrayList<java.lang.String> list) { this.getBar().setList(list); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getInt() { return this.getBar().getInt(); } diff --git a/test/transform/resource/after-delombok/DelegateOnGetterNone.java b/test/transform/resource/after-delombok/DelegateOnGetterNone.java index 49215748..1f6eb5be 100644 --- a/test/transform/resource/after-delombok/DelegateOnGetterNone.java +++ b/test/transform/resource/after-delombok/DelegateOnGetterNone.java @@ -5,12 +5,10 @@ class DelegateOnGetterNone { int getInt(); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setList(final java.util.ArrayList<java.lang.String> list) { this.bar.setList(list); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getInt() { return this.bar.getInt(); } diff --git a/test/transform/resource/after-delombok/DelegateOnMethods.java b/test/transform/resource/after-delombok/DelegateOnMethods.java index 8028b48a..eb94c6d2 100644 --- a/test/transform/resource/after-delombok/DelegateOnMethods.java +++ b/test/transform/resource/after-delombok/DelegateOnMethods.java @@ -7,7 +7,6 @@ abstract class DelegateOnMethods { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void bar(final java.util.ArrayList<java.lang.String> list) { this.getBar().bar(list); diff --git a/test/transform/resource/after-delombok/DelegateTypesAndExcludes.java b/test/transform/resource/after-delombok/DelegateTypesAndExcludes.java index bc19b276..921669c7 100644 --- a/test/transform/resource/after-delombok/DelegateTypesAndExcludes.java +++ b/test/transform/resource/after-delombok/DelegateTypesAndExcludes.java @@ -25,7 +25,6 @@ class DelegatePlain { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void bar(final java.util.ArrayList<java.lang.String> list) { this.bar.bar(list); @@ -33,7 +32,6 @@ class DelegatePlain { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void foo() { this.foo.foo(); diff --git a/test/transform/resource/after-delombok/DelegateWithDeprecated.java b/test/transform/resource/after-delombok/DelegateWithDeprecated.java index 0bc89859..f487dc87 100644 --- a/test/transform/resource/after-delombok/DelegateWithDeprecated.java +++ b/test/transform/resource/after-delombok/DelegateWithDeprecated.java @@ -11,18 +11,15 @@ class DelegateWithDeprecated { } @java.lang.Deprecated @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void deprecatedAnnotation() { this.bar.deprecatedAnnotation(); } @java.lang.Deprecated @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void deprecatedComment() { this.bar.deprecatedComment(); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void notDeprecated() { this.bar.notDeprecated(); } diff --git a/test/transform/resource/after-delombok/DelegateWithVarargs.java b/test/transform/resource/after-delombok/DelegateWithVarargs.java index 1d240524..dadbb4ee 100644 --- a/test/transform/resource/after-delombok/DelegateWithVarargs.java +++ b/test/transform/resource/after-delombok/DelegateWithVarargs.java @@ -7,22 +7,18 @@ class DelegateWithVarargs { void arrayVarargs(int[]... arrayVarargs); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void justOneParameter(final int... varargs) { this.bar.justOneParameter(varargs); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void multipleParameters(final java.lang.String first, final int... varargs) { this.bar.multipleParameters(first, varargs); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void array(final int[] array) { this.bar.array(array); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void arrayVarargs(final int[]... arrayVarargs) { this.bar.arrayVarargs(arrayVarargs); } diff --git a/test/transform/resource/after-delombok/EncodingUsAscii.java b/test/transform/resource/after-delombok/EncodingUsAscii.java index 965d70b5..ec352056 100644 --- a/test/transform/resource/after-delombok/EncodingUsAscii.java +++ b/test/transform/resource/after-delombok/EncodingUsAscii.java @@ -3,7 +3,6 @@ class EncodingUsAscii { String foo\u0e51\u0e51 = "\016\t\b "; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "EncodingUsAscii(foo\u0e51\u0e51=" + this.foo\u0e51\u0e51 + ")"; } diff --git a/test/transform/resource/after-delombok/EncodingUtf8.java b/test/transform/resource/after-delombok/EncodingUtf8.java index 4cc5c89d..1c7751b5 100644 --- a/test/transform/resource/after-delombok/EncodingUtf8.java +++ b/test/transform/resource/after-delombok/EncodingUtf8.java @@ -2,7 +2,6 @@ class EncodingUtf8 { String foo๑๑ = "\016\t\b "; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "EncodingUtf8(foo๑๑=" + this.foo๑๑ + ")"; } diff --git a/test/transform/resource/after-delombok/EqualsAndHashCode.java b/test/transform/resource/after-delombok/EqualsAndHashCode.java index 67e07d7f..eed77b39 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCode.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCode.java @@ -6,7 +6,6 @@ class EqualsAndHashCode { String b; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCode)) return false; @@ -24,13 +23,11 @@ class EqualsAndHashCode { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof EqualsAndHashCode; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -52,7 +49,6 @@ final class EqualsAndHashCode2 { boolean b; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCode2)) return false; @@ -66,7 +62,6 @@ final class EqualsAndHashCode2 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -83,7 +78,6 @@ final class EqualsAndHashCode2 { final class EqualsAndHashCode3 extends EqualsAndHashCode { @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCode3)) return false; @@ -92,13 +86,11 @@ final class EqualsAndHashCode3 extends EqualsAndHashCode { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof EqualsAndHashCode3; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { int result = 1; return result; @@ -107,7 +99,6 @@ final class EqualsAndHashCode3 extends EqualsAndHashCode { class EqualsAndHashCode4 extends EqualsAndHashCode { @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCode4)) return false; @@ -117,17 +108,13 @@ class EqualsAndHashCode4 extends EqualsAndHashCode { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof EqualsAndHashCode4; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + super.hashCode(); + int result = super.hashCode(); return result; } } diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeConfigKeys1.java b/test/transform/resource/after-delombok/EqualsAndHashCodeConfigKeys1.java index 449a1b2e..82a5a42d 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeConfigKeys1.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeConfigKeys1.java @@ -1,7 +1,6 @@ class EqualsAndHashCodeConfigKeys1Parent { @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeConfigKeys1Parent)) return false; @@ -10,13 +9,11 @@ class EqualsAndHashCodeConfigKeys1Parent { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof EqualsAndHashCodeConfigKeys1Parent; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { int result = 1; return result; @@ -26,7 +23,6 @@ class EqualsAndHashCodeConfigKeys1 extends EqualsAndHashCodeConfigKeys1Parent { int x; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeConfigKeys1)) return false; @@ -36,13 +32,11 @@ class EqualsAndHashCodeConfigKeys1 extends EqualsAndHashCodeConfigKeys1Parent { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof EqualsAndHashCodeConfigKeys1; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeConfigKeys2.java b/test/transform/resource/after-delombok/EqualsAndHashCodeConfigKeys2.java index 43c271fa..c46c7f1c 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeConfigKeys2.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeConfigKeys2.java @@ -1,7 +1,27 @@ +class EqualsAndHashCodeConfigKeys2Object extends Object { + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof EqualsAndHashCodeConfigKeys2Object)) return false; + final EqualsAndHashCodeConfigKeys2Object other = (EqualsAndHashCodeConfigKeys2Object) o; + if (!other.canEqual((java.lang.Object) this)) return false; + return true; + } + @java.lang.SuppressWarnings("all") + protected boolean canEqual(final java.lang.Object other) { + return other instanceof EqualsAndHashCodeConfigKeys2Object; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + int result = 1; + return result; + } +} class EqualsAndHashCodeConfigKeys2Parent { @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeConfigKeys2Parent)) return false; @@ -10,13 +30,11 @@ class EqualsAndHashCodeConfigKeys2Parent { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof EqualsAndHashCodeConfigKeys2Parent; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { int result = 1; return result; @@ -26,7 +44,6 @@ class EqualsAndHashCodeConfigKeys2 extends EqualsAndHashCodeConfigKeys2Parent { int x; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeConfigKeys2)) return false; @@ -37,17 +54,14 @@ class EqualsAndHashCodeConfigKeys2 extends EqualsAndHashCodeConfigKeys2Parent { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof EqualsAndHashCodeConfigKeys2; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; - int result = 1; - result = result * PRIME + super.hashCode(); + int result = super.hashCode(); result = result * PRIME + this.x; return result; } diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeNestedShadow.java b/test/transform/resource/after-delombok/EqualsAndHashCodeNestedShadow.java index ac687d84..0b479c2d 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeNestedShadow.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeNestedShadow.java @@ -5,7 +5,6 @@ interface EqualsAndHashCodeNestedShadow { public static class Foo extends Bar implements EqualsAndHashCodeNestedShadow.Foo { @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeNestedShadow.Bar.Foo)) return false; @@ -14,13 +13,11 @@ interface EqualsAndHashCodeNestedShadow { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof EqualsAndHashCodeNestedShadow.Bar.Foo; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { int result = 1; return result; @@ -31,7 +28,6 @@ interface EqualsAndHashCodeNestedShadow { public static class Foo<T> extends Bar implements EqualsAndHashCodeNestedShadow.Foo { @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeNestedShadow.Baz.Foo)) return false; @@ -40,13 +36,11 @@ interface EqualsAndHashCodeNestedShadow { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof EqualsAndHashCodeNestedShadow.Baz.Foo; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { int result = 1; return result; diff --git a/test/transform/resource/after-delombok/EqualsAndHashcodeOfExclude.java b/test/transform/resource/after-delombok/EqualsAndHashCodeOfAndExclude.java index 8b9888e9..895da4db 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashcodeOfExclude.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeOfAndExclude.java @@ -3,7 +3,6 @@ final class EqualsAndHashCodeOf { int y; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeOf)) return false; @@ -13,7 +12,6 @@ final class EqualsAndHashCodeOf { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -26,7 +24,6 @@ final class EqualsAndHashCodeExclude { int y; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeExclude)) return false; @@ -36,7 +33,6 @@ final class EqualsAndHashCodeExclude { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java index d9e4a913..dcad0263 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeWithExistingMethods.java @@ -17,7 +17,6 @@ final class EqualsAndHashCodeWithExistingMethods3 extends EqualsAndHashCodeWithE } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeWithExistingMethods3)) return false; @@ -29,11 +28,9 @@ final class EqualsAndHashCodeWithExistingMethods3 extends EqualsAndHashCodeWithE } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; - int result = 1; - result = result * PRIME + super.hashCode(); + int result = super.hashCode(); result = result * PRIME + this.x; return result; } 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<A> { + class Inner<B> { + 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/EqualsAndHashCodeWithOnParam.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithOnParam.java index 3bf4b661..91c62b0f 100644 --- a/test/transform/resource/after-delombok/EqualsAndHashCodeWithOnParam.java +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeWithOnParam.java @@ -9,7 +9,6 @@ class EqualsAndHashCodeWithOnParam { String b; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(@Nullable final java.lang.Object o) { if (o == this) return true; if (!(o instanceof EqualsAndHashCodeWithOnParam)) return false; @@ -27,13 +26,11 @@ class EqualsAndHashCodeWithOnParam { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(@Nullable final java.lang.Object other) { return other instanceof EqualsAndHashCodeWithOnParam; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; diff --git a/test/transform/resource/after-delombok/FieldDefaultsViaConfigAndRequiredArgsConstructor.java b/test/transform/resource/after-delombok/FieldDefaultsViaConfigAndRequiredArgsConstructor.java index f92f0890..959bb1e0 100644 --- a/test/transform/resource/after-delombok/FieldDefaultsViaConfigAndRequiredArgsConstructor.java +++ b/test/transform/resource/after-delombok/FieldDefaultsViaConfigAndRequiredArgsConstructor.java @@ -1,8 +1,6 @@ class FieldDefaultsViaConfigAndRequiredArgsConstructor { final int x; - @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public FieldDefaultsViaConfigAndRequiredArgsConstructor(final int x) { this.x = x; } diff --git a/test/transform/resource/after-delombok/GenerateSuppressFBWarnings.java b/test/transform/resource/after-delombok/GenerateSuppressFBWarnings.java index 02c91700..e78ee55c 100644 --- a/test/transform/resource/after-delombok/GenerateSuppressFBWarnings.java +++ b/test/transform/resource/after-delombok/GenerateSuppressFBWarnings.java @@ -3,7 +3,6 @@ class GenerateSuppressFBWarnings { int y; @java.lang.SuppressWarnings("all") @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code") - @javax.annotation.Generated("lombok") public int getY() { return this.y; } diff --git a/test/transform/resource/after-delombok/GeneratedJavaxOnLombokOn.java b/test/transform/resource/after-delombok/GeneratedJavaxOnLombokOn.java index 90fe0e3a..2ca96e7c 100644 --- a/test/transform/resource/after-delombok/GeneratedJavaxOnLombokOn.java +++ b/test/transform/resource/after-delombok/GeneratedJavaxOnLombokOn.java @@ -1,3 +1,4 @@ +//version :8 class GeneratedJavaxOnLombokOn { int x; @java.lang.SuppressWarnings("all") diff --git a/test/transform/resource/after-delombok/GeneratedOffJavaxOn.java b/test/transform/resource/after-delombok/GeneratedOffJavaxOn.java index 05c2be09..4b10c708 100644 --- a/test/transform/resource/after-delombok/GeneratedOffJavaxOn.java +++ b/test/transform/resource/after-delombok/GeneratedOffJavaxOn.java @@ -1,3 +1,4 @@ +//version :8 class GeneratedOffJavaxOn { int x; @java.lang.SuppressWarnings("all") diff --git a/test/transform/resource/after-delombok/GetterAccessLevel.java b/test/transform/resource/after-delombok/GetterAccessLevel.java index 31f8a59f..2574340a 100644 --- a/test/transform/resource/after-delombok/GetterAccessLevel.java +++ b/test/transform/resource/after-delombok/GetterAccessLevel.java @@ -11,47 +11,38 @@ class GetterAccessLevel { String publicString; String value; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private boolean isPrivate() { return this.isPrivate; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") boolean isPackage() { return this.isPackage; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean isProtected() { return this.isProtected; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean isPublic() { return this.isPublic; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private String getPrivateString() { return this.privateString; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") String getPackageString() { return this.packageString; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected String getProtectedString() { return this.protectedString; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getPublicString() { return this.publicString; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getValue() { return this.value; } diff --git a/test/transform/resource/after-delombok/GetterAlreadyExists.java b/test/transform/resource/after-delombok/GetterAlreadyExists.java index ba2bb5e1..d7f32ff1 100644 --- a/test/transform/resource/after-delombok/GetterAlreadyExists.java +++ b/test/transform/resource/after-delombok/GetterAlreadyExists.java @@ -4,7 +4,6 @@ class Getter1 { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean isFoo() { return this.foo; } @@ -27,7 +26,6 @@ class Getter4 { return null; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getFoo() { return this.foo; } @@ -38,7 +36,6 @@ class Getter5 { return null; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getFoo() { return this.foo; } @@ -55,7 +52,6 @@ class Getter7 { return false; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getFoo() { return this.foo; } @@ -66,7 +62,6 @@ class Getter8 { return false; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getFoo() { return this.foo; } @@ -83,7 +78,6 @@ class Getter10 { return false; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean isFoo() { return this.foo; } @@ -106,7 +100,6 @@ class Getter13 { return false; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getFoo() { return this.foo; } @@ -117,7 +110,6 @@ class Getter14 { return false; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getFoo() { return this.foo; } @@ -134,7 +126,6 @@ class Getter16 { return ""; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getFoo() { return this.foo; } @@ -145,7 +136,6 @@ class Getter17 { return ""; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getFoo() { return this.foo; } diff --git a/test/transform/resource/after-delombok/GetterBoolean.java b/test/transform/resource/after-delombok/GetterBoolean.java index d6347abd..6ac91512 100644 --- a/test/transform/resource/after-delombok/GetterBoolean.java +++ b/test/transform/resource/after-delombok/GetterBoolean.java @@ -3,17 +3,14 @@ class Getter { boolean isBar; boolean hasBaz; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean isFoo() { return this.foo; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean isBar() { return this.isBar; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean isHasBaz() { return this.hasBaz; } @@ -24,7 +21,6 @@ class MoreGetter { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean isFoo() { return this.foo; } diff --git a/test/transform/resource/after-delombok/GetterDeprecated.java b/test/transform/resource/after-delombok/GetterDeprecated.java index 8bef2b6a..af123509 100644 --- a/test/transform/resource/after-delombok/GetterDeprecated.java +++ b/test/transform/resource/after-delombok/GetterDeprecated.java @@ -7,7 +7,6 @@ class GetterDeprecated { int javadoc; @java.lang.Deprecated @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getAnnotation() { return this.annotation; } @@ -16,7 +15,6 @@ class GetterDeprecated { */ @java.lang.Deprecated @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getJavadoc() { return this.javadoc; } diff --git a/test/transform/resource/after-delombok/GetterEnum.java b/test/transform/resource/after-delombok/GetterEnum.java index 25b5fd8b..272a2ee6 100644 --- a/test/transform/resource/after-delombok/GetterEnum.java +++ b/test/transform/resource/after-delombok/GetterEnum.java @@ -3,18 +3,15 @@ enum GetterEnum { private final int id; private final String name; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private GetterEnum(final int id, final String name) { this.id = id; this.name = name; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getId() { return this.id; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getName() { return this.name; } diff --git a/test/transform/resource/after-delombok/GetterLazy.java b/test/transform/resource/after-delombok/GetterLazy.java index 2ea3cbf2..25a71848 100644 --- a/test/transform/resource/after-delombok/GetterLazy.java +++ b/test/transform/resource/after-delombok/GetterLazy.java @@ -3,7 +3,6 @@ class GetterLazy { } private final java.util.concurrent.atomic.AtomicReference<java.lang.Object> fieldName = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public ValueType getFieldName() { java.lang.Object value = this.fieldName.get(); if (value == null) { diff --git a/test/transform/resource/after-delombok/GetterLazyBoolean.java b/test/transform/resource/after-delombok/GetterLazyBoolean.java index 41349447..3ca127e3 100644 --- a/test/transform/resource/after-delombok/GetterLazyBoolean.java +++ b/test/transform/resource/after-delombok/GetterLazyBoolean.java @@ -6,7 +6,6 @@ class GetterLazyBoolean { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof GetterLazyBoolean)) return false; @@ -16,13 +15,11 @@ class GetterLazyBoolean { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof GetterLazyBoolean; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -31,12 +28,10 @@ class GetterLazyBoolean { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "GetterLazyBoolean(booleanValue=" + this.isBooleanValue() + ")"; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean isBooleanValue() { java.lang.Object value = this.booleanValue.get(); if (value == null) { @@ -52,7 +47,6 @@ class GetterLazyBoolean { return (java.lang.Boolean) value; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean isOtherBooleanValue() { java.lang.Object value = this.otherBooleanValue.get(); if (value == null) { diff --git a/test/transform/resource/after-delombok/GetterLazyEahcToString.java b/test/transform/resource/after-delombok/GetterLazyEahcToString.java index 495087f9..e0a0f6b2 100644 --- a/test/transform/resource/after-delombok/GetterLazyEahcToString.java +++ b/test/transform/resource/after-delombok/GetterLazyEahcToString.java @@ -5,7 +5,6 @@ class GetterLazyEahcToString { @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof GetterLazyEahcToString)) return false; @@ -22,7 +21,6 @@ class GetterLazyEahcToString { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof GetterLazyEahcToString; @@ -30,7 +28,6 @@ class GetterLazyEahcToString { @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -43,14 +40,12 @@ class GetterLazyEahcToString { @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "GetterLazyEahcToString(value=" + this.getValue() + ", value2=" + this.value2 + ")"; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getValue() { java.lang.Object value = this.value.get(); @@ -68,7 +63,6 @@ class GetterLazyEahcToString { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getValue2() { return this.value2; } diff --git a/test/transform/resource/after-delombok/GetterLazyInvalid.java b/test/transform/resource/after-delombok/GetterLazyInvalid.java index 9e7d5bee..81d87c3c 100644 --- a/test/transform/resource/after-delombok/GetterLazyInvalid.java +++ b/test/transform/resource/after-delombok/GetterLazyInvalid.java @@ -13,7 +13,6 @@ class GetterLazyInvalidNone { class GetterLazyInvalidClass { private final String fieldName = ""; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getFieldName() { return this.fieldName; } diff --git a/test/transform/resource/after-delombok/GetterLazyNative.java b/test/transform/resource/after-delombok/GetterLazyNative.java index 0d88558d..b9d471ff 100644 --- a/test/transform/resource/after-delombok/GetterLazyNative.java +++ b/test/transform/resource/after-delombok/GetterLazyNative.java @@ -9,7 +9,6 @@ class GetterLazyNative { private final java.util.concurrent.atomic.AtomicReference<java.lang.Object> charField = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); private final java.util.concurrent.atomic.AtomicReference<java.lang.Object> intArrayField = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean isBooleanField() { java.lang.Object value = this.booleanField.get(); if (value == null) { @@ -25,7 +24,6 @@ class GetterLazyNative { return (java.lang.Boolean) value; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public byte getByteField() { java.lang.Object value = this.byteField.get(); if (value == null) { @@ -41,7 +39,6 @@ class GetterLazyNative { return (java.lang.Byte) value; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public short getShortField() { java.lang.Object value = this.shortField.get(); if (value == null) { @@ -57,7 +54,6 @@ class GetterLazyNative { return (java.lang.Short) value; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getIntField() { java.lang.Object value = this.intField.get(); if (value == null) { @@ -73,7 +69,6 @@ class GetterLazyNative { return (java.lang.Integer) value; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public long getLongField() { java.lang.Object value = this.longField.get(); if (value == null) { @@ -89,7 +84,6 @@ class GetterLazyNative { return (java.lang.Long) value; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public float getFloatField() { java.lang.Object value = this.floatField.get(); if (value == null) { @@ -105,7 +99,6 @@ class GetterLazyNative { return (java.lang.Float) value; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public double getDoubleField() { java.lang.Object value = this.doubleField.get(); if (value == null) { @@ -121,7 +114,6 @@ class GetterLazyNative { return (java.lang.Double) value; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public char getCharField() { java.lang.Object value = this.charField.get(); if (value == null) { @@ -137,7 +129,6 @@ class GetterLazyNative { return (java.lang.Character) value; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int[] getIntArrayField() { java.lang.Object value = this.intArrayField.get(); if (value == null) { diff --git a/test/transform/resource/after-delombok/GetterLazyTransient.java b/test/transform/resource/after-delombok/GetterLazyTransient.java index dbebad90..49093ed1 100644 --- a/test/transform/resource/after-delombok/GetterLazyTransient.java +++ b/test/transform/resource/after-delombok/GetterLazyTransient.java @@ -3,7 +3,6 @@ class GetterLazyTransient { private final transient int transientField = 2; private final transient int nonLazyTransientField = 3; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getNonTransientField() { java.lang.Object value = this.nonTransientField.get(); if (value == null) { @@ -19,7 +18,6 @@ class GetterLazyTransient { return (java.lang.Integer) value; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getNonLazyTransientField() { return this.nonLazyTransientField; } diff --git a/test/transform/resource/after-delombok/GetterNone.java b/test/transform/resource/after-delombok/GetterNone.java index 2ff386a2..5666f6fe 100644 --- a/test/transform/resource/after-delombok/GetterNone.java +++ b/test/transform/resource/after-delombok/GetterNone.java @@ -2,7 +2,6 @@ class GetterNone { int i; int foo; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getI() { return this.i; } diff --git a/test/transform/resource/after-delombok/GetterOnClass.java b/test/transform/resource/after-delombok/GetterOnClass.java index 3a7c76a0..f0025370 100644 --- a/test/transform/resource/after-delombok/GetterOnClass.java +++ b/test/transform/resource/after-delombok/GetterOnClass.java @@ -2,7 +2,6 @@ class GetterOnClass1 { boolean isNone; boolean isPublic; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean isPublic() { return this.isPublic; } @@ -12,12 +11,10 @@ class GetterOnClass2 { boolean isProtected; boolean isPackage; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean isProtected() { return this.isProtected; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") boolean isPackage() { return this.isPackage; } @@ -26,7 +23,6 @@ class GetterOnClass3 { boolean isNone; boolean isPackage; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") boolean isPackage() { return this.isPackage; } @@ -35,7 +31,6 @@ class GetterOnClass4 { boolean isNone; boolean isPrivate; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private boolean isPrivate() { return this.isPrivate; } @@ -44,7 +39,6 @@ class GetterOnClass5 { boolean isNone; boolean isPublic; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean isPublic() { return this.isPublic; } @@ -54,13 +48,11 @@ class GetterOnClass6 { @lombok.NonNull String nonNull; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getCouldBeNull() { return this.couldBeNull; } @lombok.NonNull @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getNonNull() { return this.nonNull; } diff --git a/test/transform/resource/after-delombok/GetterOnMethod.java b/test/transform/resource/after-delombok/GetterOnMethod.java index 37ae83a4..4a5b3622 100644 --- a/test/transform/resource/after-delombok/GetterOnMethod.java +++ b/test/transform/resource/after-delombok/GetterOnMethod.java @@ -6,21 +6,18 @@ class GetterOnMethod { } @Deprecated @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getI() { return this.i; } @java.lang.Deprecated @Test @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getJ() { return this.j; } @java.lang.Deprecated @Test @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getK() { return this.k; } diff --git a/test/transform/resource/after-delombok/GetterOnMethodErrors.java b/test/transform/resource/after-delombok/GetterOnMethodErrors.java index b7fe82c2..a69966ec 100644 --- a/test/transform/resource/after-delombok/GetterOnMethodErrors.java +++ b/test/transform/resource/after-delombok/GetterOnMethodErrors.java @@ -3,7 +3,6 @@ class PlaceFillerToMakeSurePositionIsRelevant { class GetterOnMethodErrors { private int test; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getTest() { return this.test; } diff --git a/test/transform/resource/after-delombok/GetterOnMethodErrors2.java b/test/transform/resource/after-delombok/GetterOnMethodErrors2.java index 3114d23d..639022d0 100644 --- a/test/transform/resource/after-delombok/GetterOnMethodErrors2.java +++ b/test/transform/resource/after-delombok/GetterOnMethodErrors2.java @@ -10,46 +10,38 @@ class GetterOnMethodErrors2 { public @interface Test { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getBad1() { return this.bad1; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getBad2() { return this.bad2; } @Deprecated @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getBad3() { return this.bad3; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getBad4() { return this.bad4; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getGood1() { return this.good1; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getGood2() { return this.good2; } @Deprecated @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getGood3() { return this.good3; } @Deprecated @Test @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getGood4() { return this.good4; } diff --git a/test/transform/resource/after-delombok/GetterOnStatic.java b/test/transform/resource/after-delombok/GetterOnStatic.java index 34c2dba1..99e63e05 100644 --- a/test/transform/resource/after-delombok/GetterOnStatic.java +++ b/test/transform/resource/after-delombok/GetterOnStatic.java @@ -2,12 +2,10 @@ class Getter { static boolean foo; static int bar; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static boolean isFoo() { return Getter.foo; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static int getBar() { return Getter.bar; } diff --git a/test/transform/resource/after-delombok/GetterPlain.java b/test/transform/resource/after-delombok/GetterPlain.java index 9af44b04..ceae2aac 100644 --- a/test/transform/resource/after-delombok/GetterPlain.java +++ b/test/transform/resource/after-delombok/GetterPlain.java @@ -2,12 +2,10 @@ class GetterPlain { int i; int foo; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getI() { return this.i; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getFoo() { return this.foo; } diff --git a/test/transform/resource/after-delombok/GetterSetterJavadoc.java b/test/transform/resource/after-delombok/GetterSetterJavadoc.java index f156de92..019b3c37 100644 --- a/test/transform/resource/after-delombok/GetterSetterJavadoc.java +++ b/test/transform/resource/after-delombok/GetterSetterJavadoc.java @@ -4,7 +4,6 @@ class GetterSetterJavadoc1 { */ private int fieldName; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public GetterSetterJavadoc1() { } /** @@ -13,7 +12,6 @@ class GetterSetterJavadoc1 { * @return Sky is blue1 */ @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getFieldName() { return this.fieldName; } @@ -23,13 +21,11 @@ class GetterSetterJavadoc1 { * @param fieldName Hello, World1 */ @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setFieldName(final int fieldName) { this.fieldName = fieldName; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof GetterSetterJavadoc1)) return false; @@ -39,13 +35,11 @@ class GetterSetterJavadoc1 { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof GetterSetterJavadoc1; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -54,7 +48,6 @@ class GetterSetterJavadoc1 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "GetterSetterJavadoc1(fieldName=" + this.getFieldName() + ")"; } @@ -70,7 +63,6 @@ class GetterSetterJavadoc2 { * @return Sky is blue2 */ @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getFieldName() { return this.fieldName; } @@ -80,7 +72,6 @@ class GetterSetterJavadoc2 { * @param fieldName Hello, World2 */ @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setFieldName(final int fieldName) { this.fieldName = fieldName; } @@ -95,7 +86,6 @@ class GetterSetterJavadoc3 { * @return Sky is blue3 */ @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getFieldName() { return this.fieldName; } @@ -104,7 +94,6 @@ class GetterSetterJavadoc3 { * @param fieldName Hello, World3 */ @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setFieldName(final int fieldName) { this.fieldName = fieldName; } @@ -120,7 +109,6 @@ class GetterSetterJavadoc4 { * @return Sky is blue4 */ @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int fieldName() { return this.fieldName; } @@ -131,7 +119,6 @@ class GetterSetterJavadoc4 { * @return this */ @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public GetterSetterJavadoc4 fieldName(final int fieldName) { this.fieldName = fieldName; return this; @@ -147,7 +134,6 @@ class GetterSetterJavadoc5 { * @return Sky is blue5 */ @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int fieldName() { return this.fieldName; } @@ -157,7 +143,6 @@ class GetterSetterJavadoc5 { * @return Sky is blue5 */ @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public GetterSetterJavadoc5 fieldName(final int fieldName) { this.fieldName = fieldName; return this; diff --git a/test/transform/resource/after-delombok/GetterWithDollar.java b/test/transform/resource/after-delombok/GetterWithDollar.java index 60625e6d..56435665 100644 --- a/test/transform/resource/after-delombok/GetterWithDollar.java +++ b/test/transform/resource/after-delombok/GetterWithDollar.java @@ -1,7 +1,6 @@ class GetterWithDollar1 { int $i; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int get$i() { return this.$i; } @@ -10,12 +9,10 @@ class GetterWithDollar2 { int $i; int i; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int get$i() { return this.$i; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getI() { return this.i; } diff --git a/test/transform/resource/after-delombok/InjectField.java b/test/transform/resource/after-delombok/InjectField.java index 9da58db4..98f9762b 100644 --- a/test/transform/resource/after-delombok/InjectField.java +++ b/test/transform/resource/after-delombok/InjectField.java @@ -5,14 +5,11 @@ enum InjectField1 { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(InjectField1.class.getName()); @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private final java.lang.Object $lock = new java.lang.Object[0]; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final java.lang.Object $LOCK = new java.lang.Object[0]; private static final String LOG_MESSAGE = "static initializer"; @@ -40,10 +37,8 @@ enum InjectField1 { class InjectField2 { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(InjectField2.class.getName()); @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private final java.lang.Object $lock = new java.lang.Object[0]; private static final String LOG_MESSAGE = "static initializer"; @@ -61,7 +56,6 @@ class InjectField2 { class InjectField3 { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(InjectField3.class.getName()); static { log.log(Level.FINE, "static initializer"); diff --git a/test/transform/resource/after-delombok/InnerClass.java b/test/transform/resource/after-delombok/InnerClass.java new file mode 100644 index 00000000..6d42bb79 --- /dev/null +++ b/test/transform/resource/after-delombok/InnerClass.java @@ -0,0 +1,51 @@ +class A { + class B { + String s; + @java.lang.SuppressWarnings("all") + public B(final String s) { + this.s = s; + } + } +} +class C { + final class D { + private final A a; + A.B test(String s) { + return a.new B(s) { + }; + } + @java.lang.SuppressWarnings("all") + public D(final A a) { + this.a = a; + } + @java.lang.SuppressWarnings("all") + public A getA() { + return this.a; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof C.D)) return false; + final C.D other = (C.D) o; + final java.lang.Object this$a = this.getA(); + final java.lang.Object other$a = other.getA(); + if (this$a == null ? other$a != null : !this$a.equals(other$a)) return false; + return true; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int PRIME = 59; + int result = 1; + final java.lang.Object $a = this.getA(); + result = result * PRIME + ($a == null ? 43 : $a.hashCode()); + return result; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "C.D(a=" + this.getA() + ")"; + } + } +}
\ No newline at end of file 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 + * <pre> + * // code + * </pre> */ private int someField; /** diff --git a/test/transform/resource/after-delombok/LoggerCommons.java b/test/transform/resource/after-delombok/LoggerCommons.java index 3cb26794..954e730b 100644 --- a/test/transform/resource/after-delombok/LoggerCommons.java +++ b/test/transform/resource/after-delombok/LoggerCommons.java @@ -1,15 +1,12 @@ class LoggerCommons { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(LoggerCommons.class); } class LoggerCommonsWithImport { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(LoggerCommonsWithImport.class); } class LoggerCommonsWithDifferentName { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog("DifferentName"); } diff --git a/test/transform/resource/after-delombok/LoggerConfig.java b/test/transform/resource/after-delombok/LoggerConfig.java index 1fa6cb2f..d0944126 100644 --- a/test/transform/resource/after-delombok/LoggerConfig.java +++ b/test/transform/resource/after-delombok/LoggerConfig.java @@ -1,5 +1,4 @@ class LoggerWithConfig { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private final org.slf4j.Logger myLogger = org.slf4j.LoggerFactory.getLogger(LoggerWithConfig.class); } diff --git a/test/transform/resource/after-delombok/LoggerJBossLog.java b/test/transform/resource/after-delombok/LoggerJBossLog.java index 864b39fe..41c18805 100644 --- a/test/transform/resource/after-delombok/LoggerJBossLog.java +++ b/test/transform/resource/after-delombok/LoggerJBossLog.java @@ -1,23 +1,19 @@ class LoggerJBossLog { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LoggerJBossLog.class); } class LoggerJBossLogWithImport { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(LoggerJBossLogWithImport.class); } class LoggerJBossLogOuter { static class Inner { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(Inner.class); } } class LoggerJBossLogWithDifferentLoggerName { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger("DifferentLogger"); } diff --git a/test/transform/resource/after-delombok/LoggerJul.java b/test/transform/resource/after-delombok/LoggerJul.java index 80659477..63f96733 100644 --- a/test/transform/resource/after-delombok/LoggerJul.java +++ b/test/transform/resource/after-delombok/LoggerJul.java @@ -1,15 +1,12 @@ class LoggerJul { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LoggerJul.class.getName()); } class LoggerJulWithImport { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LoggerJulWithImport.class.getName()); } class LoggerJulWithDifferentName { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("DifferentName"); } diff --git a/test/transform/resource/after-delombok/LoggerLog4j.java b/test/transform/resource/after-delombok/LoggerLog4j.java index 35c2e42c..7d9d4409 100644 --- a/test/transform/resource/after-delombok/LoggerLog4j.java +++ b/test/transform/resource/after-delombok/LoggerLog4j.java @@ -1,15 +1,12 @@ class LoggerLog4j { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LoggerLog4j.class); } class LoggerLog4jWithImport { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(LoggerLog4jWithImport.class); } class LoggerLog4jWithDifferentName { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger("DifferentName"); } diff --git a/test/transform/resource/after-delombok/LoggerLog4j2.java b/test/transform/resource/after-delombok/LoggerLog4j2.java index 70a09645..3d8b7b5b 100644 --- a/test/transform/resource/after-delombok/LoggerLog4j2.java +++ b/test/transform/resource/after-delombok/LoggerLog4j2.java @@ -1,15 +1,12 @@ class LoggerLog4j2 { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger(LoggerLog4j2.class); } class LoggerLog4j2WithImport { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger(LoggerLog4j2WithImport.class); } class LoggerLog4j2WithDifferentName { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger("DifferentName"); } diff --git a/test/transform/resource/after-delombok/LoggerSlf4j.java b/test/transform/resource/after-delombok/LoggerSlf4j.java index a00bca40..68d685f0 100644 --- a/test/transform/resource/after-delombok/LoggerSlf4j.java +++ b/test/transform/resource/after-delombok/LoggerSlf4j.java @@ -1,23 +1,19 @@ class LoggerSlf4j { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4j.class); } class LoggerSlf4jWithImport { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4jWithImport.class); } class LoggerSlf4jOuter { static class Inner { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Inner.class); } } class LoggerSlf4jWithDifferentLoggerName { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger("DifferentLogger"); } diff --git a/test/transform/resource/after-delombok/LoggerSlf4jTypes.java b/test/transform/resource/after-delombok/LoggerSlf4jTypes.java index 1a13f7a2..6730e805 100644 --- a/test/transform/resource/after-delombok/LoggerSlf4jTypes.java +++ b/test/transform/resource/after-delombok/LoggerSlf4jTypes.java @@ -5,19 +5,16 @@ interface LoggerSlf4jTypesInterface { enum LoggerSlf4jTypesEnum { ; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4jTypesEnum.class); } enum LoggerSlf4jTypesEnumWithElement { FOO; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4jTypesEnumWithElement.class); } interface LoggerSlf4jTypesInterfaceOuter { class Inner { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Inner.class); } } diff --git a/test/transform/resource/after-delombok/LoggerSlf4jWithPackage.java b/test/transform/resource/after-delombok/LoggerSlf4jWithPackage.java index 8a1d543f..b82ed6ec 100644 --- a/test/transform/resource/after-delombok/LoggerSlf4jWithPackage.java +++ b/test/transform/resource/after-delombok/LoggerSlf4jWithPackage.java @@ -1,13 +1,11 @@ package before; class LoggerSlf4jWithPackage { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LoggerSlf4jWithPackage.class); } class LoggerSlf4jWithPackageOuter { static class Inner { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Inner.class); } } diff --git a/test/transform/resource/after-delombok/LoggerXSlf4j.java b/test/transform/resource/after-delombok/LoggerXSlf4j.java index 6940d69f..781733cf 100644 --- a/test/transform/resource/after-delombok/LoggerXSlf4j.java +++ b/test/transform/resource/after-delombok/LoggerXSlf4j.java @@ -1,15 +1,12 @@ class LoggerXSlf4j { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger(LoggerXSlf4j.class); } class LoggerXSlf4jWithImport { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger(LoggerXSlf4jWithImport.class); } class LoggerXSlf4jWithDifferentName { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger("DifferentName"); } diff --git a/test/transform/resource/after-delombok/MixGetterVal.java b/test/transform/resource/after-delombok/MixGetterVal.java index fc178113..a2b44ea0 100644 --- a/test/transform/resource/after-delombok/MixGetterVal.java +++ b/test/transform/resource/after-delombok/MixGetterVal.java @@ -9,7 +9,6 @@ class MixGetterVal { m(a); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } diff --git a/test/transform/resource/after-delombok/MultiFieldGetter.java b/test/transform/resource/after-delombok/MultiFieldGetter.java index 6488d9dc..3586a7e6 100644 --- a/test/transform/resource/after-delombok/MultiFieldGetter.java +++ b/test/transform/resource/after-delombok/MultiFieldGetter.java @@ -2,12 +2,10 @@ class MultiFieldGetter { int x; int y; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected int getX() { return this.x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected int getY() { return this.y; } @@ -16,12 +14,10 @@ class MultiFieldGetter2 { int x; int y; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") int getX() { return this.x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") int getY() { return this.y; } diff --git a/test/transform/resource/after-delombok/NoArgsConstructorForce.java b/test/transform/resource/after-delombok/NoArgsConstructorForce.java index 5b6c6357..3336ca19 100644 --- a/test/transform/resource/after-delombok/NoArgsConstructorForce.java +++ b/test/transform/resource/after-delombok/NoArgsConstructorForce.java @@ -5,7 +5,6 @@ public class NoArgsConstructorForce { private final java.util.List<?>[] fullQualifiedList; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public NoArgsConstructorForce() { this.i = null; this.o = null; diff --git a/test/transform/resource/after-delombok/NonNullPlain.java b/test/transform/resource/after-delombok/NonNullPlain.java index 52a80c1a..f6b8037e 100644 --- a/test/transform/resource/after-delombok/NonNullPlain.java +++ b/test/transform/resource/after-delombok/NonNullPlain.java @@ -10,9 +10,7 @@ class NonNullPlain { @Retention(RetentionPolicy.CLASS) public @interface NotNull { } - @java.beans.ConstructorProperties({"i", "s"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public NonNullPlain(@lombok.NonNull final int i, @lombok.NonNull final String s) { if (s == null) { throw new java.lang.NullPointerException("s"); @@ -22,28 +20,23 @@ class NonNullPlain { } @lombok.NonNull @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getI() { return this.i; } @lombok.NonNull @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getS() { return this.s; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Object getO() { return this.o; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setI(@lombok.NonNull final int i) { this.i = i; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setS(@lombok.NonNull final String s) { if (s == null) { throw new java.lang.NullPointerException("s"); @@ -51,7 +44,6 @@ class NonNullPlain { this.s = s; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setO(final Object o) { this.o = o; } diff --git a/test/transform/resource/after-delombok/NonNullWithAlternateException.java b/test/transform/resource/after-delombok/NonNullWithAlternateException.java index a5c0a2bc..76c6406a 100644 --- a/test/transform/resource/after-delombok/NonNullWithAlternateException.java +++ b/test/transform/resource/after-delombok/NonNullWithAlternateException.java @@ -8,7 +8,6 @@ public class NonNullWithAlternateException { System.out.println(arg); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setTest(@lombok.NonNull final String test) { if (test == null) { throw new java.lang.IllegalArgumentException("test is null"); diff --git a/test/transform/resource/after-delombok/OnXJava7Style.java b/test/transform/resource/after-delombok/OnXJava7Style.java index f3a58d79..7ebf65a3 100644 --- a/test/transform/resource/after-delombok/OnXJava7Style.java +++ b/test/transform/resource/after-delombok/OnXJava7Style.java @@ -13,30 +13,25 @@ public class OnXJava7Style { String e; @Foo @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getA() { return this.a; } @Foo @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setB(final String b) { this.b = b; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setC(@Foo("a") final String c) { this.c = c; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setD(@Bar(stuff = "b") final String d) { this.d = d; } @Foo("c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getE() { return this.e; } diff --git a/test/transform/resource/after-delombok/OnXJava8Style.java b/test/transform/resource/after-delombok/OnXJava8Style.java index b0ea96d6..d2f76e10 100644 --- a/test/transform/resource/after-delombok/OnXJava8Style.java +++ b/test/transform/resource/after-delombok/OnXJava8Style.java @@ -13,30 +13,25 @@ public class OnXJava8Style { String e; @Foo @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getA() { return this.a; } @Foo @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setB(final String b) { this.b = b; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setC(@Foo("a") final String c) { this.c = c; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setD(@Bar(stuff = "b") final String d) { this.d = d; } @Foo("c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getE() { return this.e; } diff --git a/test/transform/resource/after-delombok/SetterAccessLevel.java b/test/transform/resource/after-delombok/SetterAccessLevel.java index b9f9466b..51a58e8e 100644 --- a/test/transform/resource/after-delombok/SetterAccessLevel.java +++ b/test/transform/resource/after-delombok/SetterAccessLevel.java @@ -6,27 +6,22 @@ class SetterAccessLevel { boolean isPublic; boolean value; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private void setPrivate(final boolean isPrivate) { this.isPrivate = isPrivate; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") void setPackage(final boolean isPackage) { this.isPackage = isPackage; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected void setProtected(final boolean isProtected) { this.isProtected = isProtected; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setPublic(final boolean isPublic) { this.isPublic = isPublic; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setValue(final boolean value) { this.value = value; } diff --git a/test/transform/resource/after-delombok/SetterAlreadyExists.java b/test/transform/resource/after-delombok/SetterAlreadyExists.java index 1ff9fdcc..a62f20da 100644 --- a/test/transform/resource/after-delombok/SetterAlreadyExists.java +++ b/test/transform/resource/after-delombok/SetterAlreadyExists.java @@ -23,7 +23,6 @@ class Setter5 { void setFoo() { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setFoo(final String foo) { this.foo = foo; } @@ -33,7 +32,6 @@ class Setter6 { void setFoo(String foo, int x) { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setFoo(final String foo) { this.foo = foo; } diff --git a/test/transform/resource/after-delombok/SetterDeprecated.java b/test/transform/resource/after-delombok/SetterDeprecated.java index 115096be..cc52413b 100644 --- a/test/transform/resource/after-delombok/SetterDeprecated.java +++ b/test/transform/resource/after-delombok/SetterDeprecated.java @@ -7,7 +7,6 @@ class SetterDeprecated { int javadoc; @java.lang.Deprecated @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setAnnotation(final int annotation) { this.annotation = annotation; } @@ -16,7 +15,6 @@ class SetterDeprecated { */ @java.lang.Deprecated @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setJavadoc(final int javadoc) { this.javadoc = javadoc; } diff --git a/test/transform/resource/after-delombok/SetterOnClass.java b/test/transform/resource/after-delombok/SetterOnClass.java index 9c376d43..f2347bcb 100644 --- a/test/transform/resource/after-delombok/SetterOnClass.java +++ b/test/transform/resource/after-delombok/SetterOnClass.java @@ -2,7 +2,6 @@ class SetterOnClass1 { boolean isNone; boolean isPublic; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setPublic(final boolean isPublic) { this.isPublic = isPublic; } @@ -12,12 +11,10 @@ class SetterOnClass2 { boolean isProtected; boolean isPackage; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected void setProtected(final boolean isProtected) { this.isProtected = isProtected; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") void setPackage(final boolean isPackage) { this.isPackage = isPackage; } @@ -26,7 +23,6 @@ class SetterOnClass3 { boolean isNone; boolean isPackage; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") void setPackage(final boolean isPackage) { this.isPackage = isPackage; } @@ -35,7 +31,6 @@ class SetterOnClass4 { boolean isNone; boolean isPrivate; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private void setPrivate(final boolean isPrivate) { this.isPrivate = isPrivate; } @@ -44,7 +39,6 @@ class SetterOnClass5 { boolean isNone; boolean isPublic; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setPublic(final boolean isPublic) { this.isPublic = isPublic; } @@ -54,12 +48,10 @@ class SetterOnClass6 { @lombok.NonNull String nonNull; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setCouldBeNull(final String couldBeNull) { this.couldBeNull = couldBeNull; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setNonNull(@lombok.NonNull final String nonNull) { if (nonNull == null) { throw new java.lang.NullPointerException("nonNull"); diff --git a/test/transform/resource/after-delombok/SetterOnMethodOnParam.java b/test/transform/resource/after-delombok/SetterOnMethodOnParam.java index c166f936..555bf698 100644 --- a/test/transform/resource/after-delombok/SetterOnMethodOnParam.java +++ b/test/transform/resource/after-delombok/SetterOnMethodOnParam.java @@ -6,21 +6,18 @@ class SetterOnMethodOnParam { } @Deprecated @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setI(final int i) { this.i = i; } @java.lang.Deprecated @Test @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setJ(@Test final int j) { this.j = j; } @java.lang.Deprecated @Test @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setK(@Test final int k) { this.k = k; } diff --git a/test/transform/resource/after-delombok/SetterOnStatic.java b/test/transform/resource/after-delombok/SetterOnStatic.java index a1947b36..7ef68362 100644 --- a/test/transform/resource/after-delombok/SetterOnStatic.java +++ b/test/transform/resource/after-delombok/SetterOnStatic.java @@ -2,12 +2,10 @@ class Setter { static boolean foo; static int bar; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static void setFoo(final boolean foo) { Setter.foo = foo; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public static void setBar(final int bar) { Setter.bar = bar; } diff --git a/test/transform/resource/after-delombok/SetterPlain.java b/test/transform/resource/after-delombok/SetterPlain.java index 19acc392..0ec9ca1b 100644 --- a/test/transform/resource/after-delombok/SetterPlain.java +++ b/test/transform/resource/after-delombok/SetterPlain.java @@ -2,12 +2,10 @@ class SetterPlain { int i; int foo; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setI(final int i) { this.i = i; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setFoo(final int foo) { this.foo = foo; } diff --git a/test/transform/resource/after-delombok/SetterWithDollar.java b/test/transform/resource/after-delombok/SetterWithDollar.java index fdcbfe75..8d116e99 100644 --- a/test/transform/resource/after-delombok/SetterWithDollar.java +++ b/test/transform/resource/after-delombok/SetterWithDollar.java @@ -3,7 +3,6 @@ class SetterWithDollar1 { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void set$i(final int $i) { this.$i = $i; @@ -15,13 +14,11 @@ class SetterWithDollar2 { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void set$i(final int $i) { this.$i = $i; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setI(final int i) { this.i = i; } diff --git a/test/transform/resource/after-delombok/SimpleTypeResolution.java b/test/transform/resource/after-delombok/SimpleTypeResolution.java index 1e45bb79..c6e08d70 100644 --- a/test/transform/resource/after-delombok/SimpleTypeResolution.java +++ b/test/transform/resource/after-delombok/SimpleTypeResolution.java @@ -5,7 +5,6 @@ class SimpleTypeResolutionFail { class SimpleTypeResolutionSuccess { private int x; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } diff --git a/test/transform/resource/after-delombok/SynchronizedPlain.java b/test/transform/resource/after-delombok/SynchronizedPlain.java index 229d261a..f178aa4e 100644 --- a/test/transform/resource/after-delombok/SynchronizedPlain.java +++ b/test/transform/resource/after-delombok/SynchronizedPlain.java @@ -1,6 +1,5 @@ class SynchronizedPlain1 { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private final java.lang.Object $lock = new java.lang.Object[0]; void test() { synchronized (this.$lock) { @@ -15,7 +14,6 @@ class SynchronizedPlain1 { } class SynchronizedPlain2 { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private static final java.lang.Object $LOCK = new java.lang.Object[0]; static void test() { synchronized (SynchronizedPlain2.$LOCK) { diff --git a/test/transform/resource/after-delombok/ToStringConfiguration.java b/test/transform/resource/after-delombok/ToStringConfiguration.java index 1baabebd..6fa9111e 100644 --- a/test/transform/resource/after-delombok/ToStringConfiguration.java +++ b/test/transform/resource/after-delombok/ToStringConfiguration.java @@ -2,12 +2,10 @@ class ToStringConfiguration { int x; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ToStringConfiguration(" + this.x + ")"; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @@ -16,7 +14,6 @@ class ToStringConfiguration2 { int x; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ToStringConfiguration2(x=" + this.x + ")"; } @@ -25,12 +22,10 @@ class ToStringConfiguration3 { int x; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ToStringConfiguration3(" + this.getX() + ")"; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } diff --git a/test/transform/resource/after-delombok/ToStringInner.java b/test/transform/resource/after-delombok/ToStringInner.java index ef14bcde..fe77fcfd 100644 --- a/test/transform/resource/after-delombok/ToStringInner.java +++ b/test/transform/resource/after-delombok/ToStringInner.java @@ -5,7 +5,6 @@ class ToStringOuter { int y; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ToStringOuter.ToStringInner(y=" + this.y + ")"; } @@ -14,7 +13,6 @@ class ToStringOuter { int y; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ToStringOuter.ToStringStaticInner(y=" + this.y + ")"; } @@ -24,7 +22,6 @@ class ToStringOuter { String name; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ToStringOuter.ToStringMiddle.ToStringMoreInner(name=" + this.name + ")"; } @@ -33,7 +30,6 @@ class ToStringOuter { @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ToStringOuter(x=" + this.x + ", name=" + this.name + ")"; } diff --git a/test/transform/resource/after-delombok/ToStringPlain.java b/test/transform/resource/after-delombok/ToStringPlain.java index bf0ef419..af9daf4f 100644 --- a/test/transform/resource/after-delombok/ToStringPlain.java +++ b/test/transform/resource/after-delombok/ToStringPlain.java @@ -3,7 +3,6 @@ class ToString1 { String name; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ToString1(x=" + this.x + ", name=" + this.name + ")"; } @@ -13,7 +12,6 @@ class ToString2 { String name; @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ToString2(x=" + this.x + ", name=" + this.name + ")"; } diff --git a/test/transform/resource/after-delombok/Tolerate.java b/test/transform/resource/after-delombok/Tolerate.java index e56979dc..c3e3d7fd 100644 --- a/test/transform/resource/after-delombok/Tolerate.java +++ b/test/transform/resource/after-delombok/Tolerate.java @@ -11,7 +11,6 @@ class Tolerate { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public void setPattern(final Pattern pattern) { this.pattern = pattern; @@ -19,7 +18,6 @@ class Tolerate { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Pattern getPattern() { return this.pattern; @@ -39,7 +37,6 @@ class Tolerate2 { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Pattern getPattern() { return this.pattern; @@ -47,15 +44,12 @@ class Tolerate2 { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Tolerate2 withPattern(final Pattern pattern) { return this.pattern == pattern ? this : new Tolerate2(pattern); } - @java.beans.ConstructorProperties({"pattern"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Tolerate2(final Pattern pattern) { this.pattern = pattern; } diff --git a/test/transform/resource/after-delombok/TrickyTypeResolution.java b/test/transform/resource/after-delombok/TrickyTypeResolution.java index 6badfbf4..9a5aae16 100644 --- a/test/transform/resource/after-delombok/TrickyTypeResolution.java +++ b/test/transform/resource/after-delombok/TrickyTypeResolution.java @@ -14,7 +14,6 @@ class TrickyDoNothing2 { class TrickySuccess { int x; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } diff --git a/test/transform/resource/after-delombok/UtilityClass.java b/test/transform/resource/after-delombok/UtilityClass.java index 32e47557..8d3f4c08 100644 --- a/test/transform/resource/after-delombok/UtilityClass.java +++ b/test/transform/resource/after-delombok/UtilityClass.java @@ -7,7 +7,6 @@ final class UtilityClass { private String innerInnerMember; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private UtilityClass() { throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); } @@ -17,7 +16,6 @@ class UtilityInner { static final class InnerInnerInner { static int member; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private InnerInnerInner() { throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); } @@ -28,7 +26,6 @@ class UtilityInner { static final class InsideEnum { static int member; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private InsideEnum() { throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); } @@ -38,7 +35,6 @@ class UtilityInner { final class InsideInterface { static int member; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private InsideInterface() { throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); } diff --git a/test/transform/resource/after-delombok/ValueCallSuper.java b/test/transform/resource/after-delombok/ValueCallSuper.java index e0065885..63a536cd 100644 --- a/test/transform/resource/after-delombok/ValueCallSuper.java +++ b/test/transform/resource/after-delombok/ValueCallSuper.java @@ -2,12 +2,10 @@ class ValueParent { } final class ValueCallSuper extends ValueParent { @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public ValueCallSuper() { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ValueCallSuper)) return false; @@ -17,22 +15,17 @@ final class ValueCallSuper extends ValueParent { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof ValueCallSuper; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { - final int PRIME = 59; - int result = 1; - result = result * PRIME + super.hashCode(); + int result = super.hashCode(); return result; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ValueCallSuper()"; } diff --git a/test/transform/resource/after-delombok/ValueExperimental.java b/test/transform/resource/after-delombok/ValueExperimental.java deleted file mode 100644 index 95803228..00000000 --- a/test/transform/resource/after-delombok/ValueExperimental.java +++ /dev/null @@ -1,54 +0,0 @@ -final class ValueExperimental1 { - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - public ValueExperimental1() { - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - 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") - @javax.annotation.Generated("lombok") - public int hashCode() { - int result = 1; - return result; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - public java.lang.String toString() { - return "ValueExperimental1()"; - } -} -final class ValueExperimental2 { - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - public ValueExperimental2() { - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - 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") - @javax.annotation.Generated("lombok") - public int hashCode() { - int result = 1; - return result; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - 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 b3bd9db5..00000000 --- a/test/transform/resource/after-delombok/ValueExperimentalStarImport.java +++ /dev/null @@ -1,29 +0,0 @@ -import lombok.experimental.*; -final class ValueExperimentalStarImport { - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - public ValueExperimentalStarImport() { - - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - 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") - @javax.annotation.Generated("lombok") - public int hashCode() { - int result = 1; - return result; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") - public java.lang.String toString() { - return "ValueExperimentalStarImport()"; - } -} diff --git a/test/transform/resource/after-delombok/ValuePlain.java b/test/transform/resource/after-delombok/ValuePlain.java index 056cdacf..cf2c1142 100644 --- a/test/transform/resource/after-delombok/ValuePlain.java +++ b/test/transform/resource/after-delombok/ValuePlain.java @@ -1,26 +1,21 @@ final class Value1 { private final int x; private final String name; - @java.beans.ConstructorProperties({"x", "name"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Value1(final int x, final String name) { this.x = x; this.name = name; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getName() { return this.name; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Value1)) return false; @@ -33,7 +28,6 @@ final class Value1 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -44,7 +38,6 @@ final class Value1 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "Value1(x=" + this.getX() + ", name=" + this.getName() + ")"; } @@ -52,26 +45,21 @@ final class Value1 { class Value2 { public final int x; private final String name; - @java.beans.ConstructorProperties({"x", "name"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Value2(final int x, final String name) { this.x = x; this.name = name; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public String getName() { return this.name; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Value2)) return false; @@ -84,13 +72,11 @@ class Value2 { return true; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected boolean canEqual(final java.lang.Object other) { return other instanceof Value2; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -101,7 +87,6 @@ class Value2 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "Value2(x=" + this.getX() + ", name=" + this.getName() + ")"; } @@ -109,26 +94,21 @@ class Value2 { final class Value3 { private int x; private final int y; - @java.beans.ConstructorProperties({"x", "y"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Value3(final int x, final int y) { this.x = x; this.y = y; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getX() { return this.x; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int getY() { return this.y; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof Value3)) return false; @@ -139,7 +119,6 @@ final class Value3 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { final int PRIME = 59; int result = 1; @@ -149,7 +128,6 @@ final class Value3 { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "Value3(x=" + this.getX() + ", y=" + this.getY() + ")"; } diff --git a/test/transform/resource/after-delombok/ValueStaticField.java b/test/transform/resource/after-delombok/ValueStaticField.java index 7725d1ac..2b489a1a 100644 --- a/test/transform/resource/after-delombok/ValueStaticField.java +++ b/test/transform/resource/after-delombok/ValueStaticField.java @@ -2,12 +2,10 @@ final class ValueStaticField { static int x; static String PASSWORD = "Ken sent me"; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public ValueStaticField() { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public boolean equals(final java.lang.Object o) { if (o == this) return true; if (!(o instanceof ValueStaticField)) return false; @@ -15,14 +13,12 @@ final class ValueStaticField { } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public int hashCode() { int result = 1; return result; } @java.lang.Override @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public java.lang.String toString() { return "ValueStaticField()"; } 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-delombok/WitherAccessLevel.java b/test/transform/resource/after-delombok/WitherAccessLevel.java index 8cf98cec..c687d645 100644 --- a/test/transform/resource/after-delombok/WitherAccessLevel.java +++ b/test/transform/resource/after-delombok/WitherAccessLevel.java @@ -8,27 +8,22 @@ class WitherAccessLevel { WitherAccessLevel(boolean isNone, boolean isPrivate, boolean isPackage, boolean isProtected, boolean isPublic, boolean value) { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") private WitherAccessLevel withPrivate(final boolean isPrivate) { return this.isPrivate == isPrivate ? this : new WitherAccessLevel(this.isNone, isPrivate, this.isPackage, this.isProtected, this.isPublic, this.value); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") WitherAccessLevel withPackage(final boolean isPackage) { return this.isPackage == isPackage ? this : new WitherAccessLevel(this.isNone, this.isPrivate, isPackage, this.isProtected, this.isPublic, this.value); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected WitherAccessLevel withProtected(final boolean isProtected) { return this.isProtected == isProtected ? this : new WitherAccessLevel(this.isNone, this.isPrivate, this.isPackage, isProtected, this.isPublic, this.value); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherAccessLevel withPublic(final boolean isPublic) { return this.isPublic == isPublic ? this : new WitherAccessLevel(this.isNone, this.isPrivate, this.isPackage, this.isProtected, isPublic, this.value); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherAccessLevel withValue(final boolean value) { return this.value == value ? this : new WitherAccessLevel(this.isNone, this.isPrivate, this.isPackage, this.isProtected, this.isPublic, value); } diff --git a/test/transform/resource/after-delombok/WitherAlreadyExists.java b/test/transform/resource/after-delombok/WitherAlreadyExists.java index 8f51af48..d609bc7b 100644 --- a/test/transform/resource/after-delombok/WitherAlreadyExists.java +++ b/test/transform/resource/after-delombok/WitherAlreadyExists.java @@ -33,7 +33,6 @@ class Wither5 { Wither5(String foo) { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Wither5 withFoo(final String foo) { return this.foo == foo ? this : new Wither5(foo); } @@ -45,7 +44,6 @@ class Wither6 { Wither6(String foo) { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public Wither6 withFoo(final String foo) { return this.foo == foo ? this : new Wither6(foo); } diff --git a/test/transform/resource/after-delombok/WitherAndAllArgsConstructor.java b/test/transform/resource/after-delombok/WitherAndAllArgsConstructor.java index 0d0d6525..ff4fe3e2 100644 --- a/test/transform/resource/after-delombok/WitherAndAllArgsConstructor.java +++ b/test/transform/resource/after-delombok/WitherAndAllArgsConstructor.java @@ -4,9 +4,7 @@ class WitherAndAllArgsConstructor<T, J extends T, L extends java.lang.Number> { final int x = 10; int y = 20; final int z; - @java.beans.ConstructorProperties({"test", "test2", "y", "z"}) @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherAndAllArgsConstructor(final J test, final java.util.List<L> test2, final int y, final int z) { this.test = test; this.test2 = test2; @@ -14,12 +12,10 @@ class WitherAndAllArgsConstructor<T, J extends T, L extends java.lang.Number> { this.z = z; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherAndAllArgsConstructor<T, J, L> withTest(final J test) { return this.test == test ? this : new WitherAndAllArgsConstructor<T, J, L>(test, this.test2, this.y, this.z); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherAndAllArgsConstructor<T, J, L> withTest2(final java.util.List<L> test2) { return this.test2 == test2 ? this : new WitherAndAllArgsConstructor<T, J, L>(this.test, test2, this.y, this.z); } diff --git a/test/transform/resource/after-delombok/WitherDeprecated.java b/test/transform/resource/after-delombok/WitherDeprecated.java index 409e773f..b342a861 100644 --- a/test/transform/resource/after-delombok/WitherDeprecated.java +++ b/test/transform/resource/after-delombok/WitherDeprecated.java @@ -9,7 +9,6 @@ class WitherDeprecated { } @java.lang.Deprecated @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherDeprecated withAnnotation(final int annotation) { return this.annotation == annotation ? this : new WitherDeprecated(annotation, this.javadoc); } @@ -18,7 +17,6 @@ class WitherDeprecated { */ @java.lang.Deprecated @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherDeprecated withJavadoc(final int javadoc) { return this.javadoc == javadoc ? this : new WitherDeprecated(this.annotation, javadoc); } diff --git a/test/transform/resource/after-delombok/WitherOnClass.java b/test/transform/resource/after-delombok/WitherOnClass.java index ae352d33..45d0c4b5 100644 --- a/test/transform/resource/after-delombok/WitherOnClass.java +++ b/test/transform/resource/after-delombok/WitherOnClass.java @@ -4,7 +4,6 @@ class WitherOnClass1 { WitherOnClass1(boolean isNone, boolean isPublic) { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherOnClass1 withPublic(final boolean isPublic) { return this.isPublic == isPublic ? this : new WitherOnClass1(this.isNone, isPublic); } @@ -16,12 +15,10 @@ class WitherOnClass2 { WitherOnClass2(boolean isNone, boolean isProtected, boolean isPackage) { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") protected WitherOnClass2 withProtected(final boolean isProtected) { return this.isProtected == isProtected ? this : new WitherOnClass2(this.isNone, isProtected, this.isPackage); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") WitherOnClass2 withPackage(final boolean isPackage) { return this.isPackage == isPackage ? this : new WitherOnClass2(this.isNone, this.isProtected, isPackage); } @@ -33,12 +30,10 @@ class WitherOnClass3 { WitherOnClass3(String couldBeNull, String nonNull) { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherOnClass3 withCouldBeNull(final String couldBeNull) { return this.couldBeNull == couldBeNull ? this : new WitherOnClass3(couldBeNull, this.nonNull); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherOnClass3 withNonNull(@lombok.NonNull final String nonNull) { if (nonNull == null) { throw new java.lang.NullPointerException("nonNull"); @@ -53,7 +48,6 @@ class WitherOnClass4 { this.fY = y; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherOnClass4 withY(final int fY) { return this.fY == fY ? this : new WitherOnClass4(fY); } diff --git a/test/transform/resource/after-delombok/WitherPlain.java b/test/transform/resource/after-delombok/WitherPlain.java index 548ff299..a2e947bd 100644 --- a/test/transform/resource/after-delombok/WitherPlain.java +++ b/test/transform/resource/after-delombok/WitherPlain.java @@ -6,12 +6,10 @@ class WitherPlain { this.foo = foo; } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherPlain withI(final int i) { return this.i == i ? this : new WitherPlain(i, this.foo); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherPlain withFoo(final int foo) { return this.foo == foo ? this : new WitherPlain(this.i, foo); } diff --git a/test/transform/resource/after-delombok/WitherWithAbstract.java b/test/transform/resource/after-delombok/WitherWithAbstract.java index 7cbb1309..f9178e99 100644 --- a/test/transform/resource/after-delombok/WitherWithAbstract.java +++ b/test/transform/resource/after-delombok/WitherWithAbstract.java @@ -1,6 +1,5 @@ abstract class WitherWithAbstract { String foo; @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public abstract WitherWithAbstract withFoo(final String foo); } diff --git a/test/transform/resource/after-delombok/WitherWithGenerics.java b/test/transform/resource/after-delombok/WitherWithGenerics.java index fd466559..98bbd04d 100644 --- a/test/transform/resource/after-delombok/WitherWithGenerics.java +++ b/test/transform/resource/after-delombok/WitherWithGenerics.java @@ -6,17 +6,14 @@ class WitherWithGenerics<T, J extends T, L extends java.lang.Number> { public WitherWithGenerics(J test, java.util.List<L> test2, java.util.List<? extends L> test3) { } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherWithGenerics<T, J, L> withTest(final J test) { return this.test == test ? this : new WitherWithGenerics<T, J, L>(test, this.test2, this.test3); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherWithGenerics<T, J, L> withTest2(final java.util.List<L> test2) { return this.test2 == test2 ? this : new WitherWithGenerics<T, J, L>(this.test, test2, this.test3); } @java.lang.SuppressWarnings("all") - @javax.annotation.Generated("lombok") public WitherWithGenerics<T, J, L> withTest3(final java.util.List<? extends L> test3) { return this.test3 == test3 ? this : new WitherWithGenerics<T, J, L>(this.test, this.test2, test3); } diff --git a/test/transform/resource/after-ecj/Accessors.java b/test/transform/resource/after-ecj/Accessors.java index 450c35fa..8ac92e6e 100644 --- a/test/transform/resource/after-ecj/Accessors.java +++ b/test/transform/resource/after-ecj/Accessors.java @@ -3,10 +3,10 @@ class AccessorsFluent { AccessorsFluent() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String fieldName() { + public @java.lang.SuppressWarnings("all") String fieldName() { return this.fieldName; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") AccessorsFluent fieldName(final String fieldName) { + public @java.lang.SuppressWarnings("all") AccessorsFluent fieldName(final String fieldName) { this.fieldName = fieldName; return this; } @@ -17,14 +17,14 @@ class AccessorsFluent { AccessorsFluentOnClass() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") AccessorsFluentOnClass fieldName(final String fieldName) { + public @java.lang.SuppressWarnings("all") AccessorsFluentOnClass fieldName(final String fieldName) { this.fieldName = fieldName; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String fieldName() { + public @java.lang.SuppressWarnings("all") String fieldName() { return this.fieldName; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getOtherFieldWithOverride() { + public @java.lang.SuppressWarnings("all") String getOtherFieldWithOverride() { return this.otherFieldWithOverride; } } @@ -33,7 +33,7 @@ class AccessorsChain { AccessorsChain() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") AccessorsChain setRunning(final boolean isRunning) { + public @java.lang.SuppressWarnings("all") AccessorsChain setRunning(final boolean isRunning) { this.isRunning = isRunning; return this; } @@ -44,7 +44,7 @@ class AccessorsChain { AccessorsPrefix() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setActualField(final String fActualField) { + public @java.lang.SuppressWarnings("all") void setActualField(final String fActualField) { this.fActualField = fActualField; } } @@ -54,10 +54,10 @@ class AccessorsChain { AccessorsPrefix2() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setFieldName(final String fieldName) { + public @java.lang.SuppressWarnings("all") void setFieldName(final String fieldName) { this.fieldName = fieldName; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setActualField(final String fActualField) { + public @java.lang.SuppressWarnings("all") void setActualField(final String fActualField) { this.fActualField = fActualField; } } @@ -69,10 +69,10 @@ class AccessorsChain { private String getName() { return fName; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("AccessorsPrefix3(fName=" + this.getName()) + ")"); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof AccessorsPrefix3))) @@ -86,10 +86,10 @@ class AccessorsChain { return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof AccessorsPrefix3); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $fName = this.getName(); @@ -102,7 +102,7 @@ class AccessorsFluentGenerics<T extends Number> { AccessorsFluentGenerics() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") AccessorsFluentGenerics<T> name(final String name) { + public @java.lang.SuppressWarnings("all") AccessorsFluentGenerics<T> name(final String name) { this.name = name; return this; } @@ -112,7 +112,7 @@ class AccessorsFluentNoChaining { AccessorsFluentNoChaining() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void name(final String name) { + public @java.lang.SuppressWarnings("all") void name(final String name) { this.name = name; } } @@ -123,7 +123,7 @@ class AccessorsFluentStatic<T extends Number> { AccessorsFluentStatic() { super(); } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void name(final String name) { + public static @java.lang.SuppressWarnings("all") void name(final String name) { AccessorsFluentStatic.name = name; } } diff --git a/test/transform/resource/after-ecj/AccessorsConfiguration.java b/test/transform/resource/after-ecj/AccessorsConfiguration.java index fdf2ff85..6678e020 100644 --- a/test/transform/resource/after-ecj/AccessorsConfiguration.java +++ b/test/transform/resource/after-ecj/AccessorsConfiguration.java @@ -3,10 +3,10 @@ class AccessorsConfiguration { AccessorsConfiguration() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String fieldName() { + public @java.lang.SuppressWarnings("all") String fieldName() { return this.m_FieldName; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void fieldName(final String m_FieldName) { + public @java.lang.SuppressWarnings("all") void fieldName(final String m_FieldName) { this.m_FieldName = m_FieldName; } } @@ -15,7 +15,7 @@ class AccessorsConfiguration { AccessorsConfiguration2() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setM_FieldName(final String m_FieldName) { + public @java.lang.SuppressWarnings("all") void setM_FieldName(final String m_FieldName) { this.m_FieldName = m_FieldName; } } @@ -24,7 +24,7 @@ class AccessorsConfiguration { AccessorsConfiguration3() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") AccessorsConfiguration3 setFieldName(final String fFieldName) { + public @java.lang.SuppressWarnings("all") AccessorsConfiguration3 setFieldName(final String fFieldName) { this.fFieldName = fFieldName; return this; } diff --git a/test/transform/resource/after-ecj/BuilderChainAndFluent.java b/test/transform/resource/after-ecj/BuilderChainAndFluent.java deleted file mode 100644 index 1554cf44..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") @javax.annotation.Generated("lombok") class BuilderChainAndFluentBuilder { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int yes; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderChainAndFluentBuilder() { - super(); - } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setYes(final int yes) { - this.yes = yes; - } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderChainAndFluent build() { - return new BuilderChainAndFluent(yes); - } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { - return (("BuilderChainAndFluent.BuilderChainAndFluentBuilder(yes=" + this.yes) + ")"); - } - } - private final int yes; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderChainAndFluent(final int yes) { - super(); - this.yes = yes; - } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderChainAndFluentBuilder builder() { - return new BuilderChainAndFluentBuilder(); - } -} diff --git a/test/transform/resource/after-ecj/BuilderComplex.java b/test/transform/resource/after-ecj/BuilderComplex.java index c63ad8e6..93d70fe9 100644 --- a/test/transform/resource/after-ecj/BuilderComplex.java +++ b/test/transform/resource/after-ecj/BuilderComplex.java @@ -1,34 +1,34 @@ import java.util.List; -import lombok.experimental.Builder; +import lombok.Builder; class BuilderComplex { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class VoidBuilder<T extends Number> { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") T number; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int arg2; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String arg3; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderComplex selfRef; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") VoidBuilder() { + public static @java.lang.SuppressWarnings("all") class VoidBuilder<T extends Number> { + private @java.lang.SuppressWarnings("all") T number; + private @java.lang.SuppressWarnings("all") int arg2; + private @java.lang.SuppressWarnings("all") String arg3; + private @java.lang.SuppressWarnings("all") BuilderComplex selfRef; + @java.lang.SuppressWarnings("all") VoidBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") VoidBuilder<T> number(final T number) { + public @java.lang.SuppressWarnings("all") VoidBuilder<T> number(final T number) { this.number = number; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") VoidBuilder<T> arg2(final int arg2) { + public @java.lang.SuppressWarnings("all") VoidBuilder<T> arg2(final int arg2) { this.arg2 = arg2; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") VoidBuilder<T> arg3(final String arg3) { + public @java.lang.SuppressWarnings("all") VoidBuilder<T> arg3(final String arg3) { this.arg3 = arg3; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") VoidBuilder<T> selfRef(final BuilderComplex selfRef) { + public @java.lang.SuppressWarnings("all") VoidBuilder<T> selfRef(final BuilderComplex selfRef) { this.selfRef = selfRef; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void execute() { + public @java.lang.SuppressWarnings("all") void execute() { BuilderComplex.<T>testVoidWithGenerics(number, arg2, arg3, selfRef); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((((("BuilderComplex.VoidBuilder(number=" + this.number) + ", arg2=") + this.arg2) + ", arg3=") + this.arg3) + ", selfRef=") + this.selfRef) + ")"); } } @@ -37,7 +37,7 @@ class BuilderComplex { } private static @Builder(buildMethodName = "execute") <T extends Number>void testVoidWithGenerics(T number, int arg2, String arg3, BuilderComplex selfRef) { } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <T extends Number>VoidBuilder<T> builder() { + public static @java.lang.SuppressWarnings("all") <T extends Number>VoidBuilder<T> builder() { return new VoidBuilder<T>(); } } diff --git a/test/transform/resource/after-ecj/BuilderDefaults.java b/test/transform/resource/after-ecj/BuilderDefaults.java new file mode 100644 index 00000000..1a0f1168 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderDefaults.java @@ -0,0 +1,90 @@ +import lombok.Builder; +import lombok.Value; +public final @Value @Builder class BuilderDefaults { + public static @java.lang.SuppressWarnings("all") class BuilderDefaultsBuilder { + private @java.lang.SuppressWarnings("all") int x; + private @java.lang.SuppressWarnings("all") boolean x$set; + private @java.lang.SuppressWarnings("all") String name; + private @java.lang.SuppressWarnings("all") long z; + private @java.lang.SuppressWarnings("all") boolean z$set; + @java.lang.SuppressWarnings("all") BuilderDefaultsBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsBuilder x(final int x) { + this.x = x; + x$set = true; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsBuilder name(final String name) { + this.name = name; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsBuilder z(final long z) { + this.z = z; + z$set = true; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaults build() { + return new BuilderDefaults((x$set ? x : BuilderDefaults.$default$x()), name, (z$set ? z : BuilderDefaults.$default$z())); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((("BuilderDefaults.BuilderDefaultsBuilder(x=" + this.x) + ", name=") + this.name) + ", z=") + this.z) + ")"); + } + } + private final @Builder.Default int x; + private final String name; + private final @Builder.Default long z; + private static @java.lang.SuppressWarnings("all") int $default$x() { + return 10; + } + private static @java.lang.SuppressWarnings("all") long $default$z() { + return System.currentTimeMillis(); + } + @java.lang.SuppressWarnings("all") BuilderDefaults(final int x, final String name, final long z) { + super(); + this.x = x; + this.name = name; + this.z = z; + } + public static @java.lang.SuppressWarnings("all") BuilderDefaultsBuilder builder() { + return new BuilderDefaultsBuilder(); + } + public @java.lang.SuppressWarnings("all") int getX() { + return this.x; + } + public @java.lang.SuppressWarnings("all") String getName() { + return this.name; + } + public @java.lang.SuppressWarnings("all") long getZ() { + return this.z; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof BuilderDefaults))) + return false; + final BuilderDefaults other = (BuilderDefaults) o; + if ((this.getX() != other.getX())) + return false; + final java.lang.Object this$name = this.getName(); + final java.lang.Object other$name = other.getName(); + if (((this$name == null) ? (other$name != null) : (! this$name.equals(other$name)))) + return false; + if ((this.getZ() != other.getZ())) + return false; + return true; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 59; + int result = 1; + result = ((result * PRIME) + this.getX()); + final java.lang.Object $name = this.getName(); + result = ((result * PRIME) + (($name == null) ? 43 : $name.hashCode())); + final long $z = this.getZ(); + result = ((result * PRIME) + (int) ($z ^ ($z >>> 32))); + return result; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((("BuilderDefaults(x=" + this.getX()) + ", name=") + this.getName()) + ", z=") + this.getZ()) + ")"); + } +} diff --git a/test/transform/resource/after-ecj/BuilderDefaultsGenerics.java b/test/transform/resource/after-ecj/BuilderDefaultsGenerics.java new file mode 100644 index 00000000..a8f81afa --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderDefaultsGenerics.java @@ -0,0 +1,57 @@ +import lombok.Builder; +import java.util.*; +public @Builder class BuilderDefaultsGenerics<N extends Number, T, R extends List<T>> { + public static @java.lang.SuppressWarnings("all") class BuilderDefaultsGenericsBuilder<N extends Number, T, R extends List<T>> { + private @java.lang.SuppressWarnings("all") java.util.concurrent.Callable<N> callable; + private @java.lang.SuppressWarnings("all") boolean callable$set; + private @java.lang.SuppressWarnings("all") T tee; + private @java.lang.SuppressWarnings("all") boolean tee$set; + private @java.lang.SuppressWarnings("all") R arrr; + private @java.lang.SuppressWarnings("all") boolean arrr$set; + @java.lang.SuppressWarnings("all") BuilderDefaultsGenericsBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsGenericsBuilder<N, T, R> callable(final java.util.concurrent.Callable<N> callable) { + this.callable = callable; + callable$set = true; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsGenericsBuilder<N, T, R> tee(final T tee) { + this.tee = tee; + tee$set = true; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsGenericsBuilder<N, T, R> arrr(final R arrr) { + this.arrr = arrr; + arrr$set = true; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsGenerics<N, T, R> build() { + return new BuilderDefaultsGenerics<N, T, R>((callable$set ? callable : BuilderDefaultsGenerics.<N, T, R>$default$callable()), (tee$set ? tee : BuilderDefaultsGenerics.<N, T, R>$default$tee()), (arrr$set ? arrr : BuilderDefaultsGenerics.<N, T, R>$default$arrr())); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((("BuilderDefaultsGenerics.BuilderDefaultsGenericsBuilder(callable=" + this.callable) + ", tee=") + this.tee) + ", arrr=") + this.arrr) + ")"); + } + } + private @Builder.Default java.util.concurrent.Callable<N> callable; + private @Builder.Default T tee; + private @Builder.Default R arrr; + private static @java.lang.SuppressWarnings("all") <N extends Number, T, R extends List<T>>java.util.concurrent.Callable<N> $default$callable() { + return null; + } + private static @java.lang.SuppressWarnings("all") <N extends Number, T, R extends List<T>>T $default$tee() { + return null; + } + private static @java.lang.SuppressWarnings("all") <N extends Number, T, R extends List<T>>R $default$arrr() { + return null; + } + @java.lang.SuppressWarnings("all") BuilderDefaultsGenerics(final java.util.concurrent.Callable<N> callable, final T tee, final R arrr) { + super(); + this.callable = callable; + this.tee = tee; + this.arrr = arrr; + } + public static @java.lang.SuppressWarnings("all") <N extends Number, T, R extends List<T>>BuilderDefaultsGenericsBuilder<N, T, R> builder() { + return new BuilderDefaultsGenericsBuilder<N, T, R>(); + } +} diff --git a/test/transform/resource/after-ecj/BuilderDefaultsWarnings.java b/test/transform/resource/after-ecj/BuilderDefaultsWarnings.java new file mode 100644 index 00000000..236632d0 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderDefaultsWarnings.java @@ -0,0 +1,87 @@ +import lombok.Builder; +import lombok.Singular; +public @Builder class BuilderDefaultsWarnings { + public static @java.lang.SuppressWarnings("all") class BuilderDefaultsWarningsBuilder { + private @java.lang.SuppressWarnings("all") long x; + private @java.lang.SuppressWarnings("all") int z; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items; + @java.lang.SuppressWarnings("all") BuilderDefaultsWarningsBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsWarningsBuilder x(final long x) { + this.x = x; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsWarningsBuilder z(final int z) { + this.z = z; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsWarningsBuilder item(String item) { + if ((this.items == null)) + this.items = new java.util.ArrayList<String>(); + this.items.add(item); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsWarningsBuilder items(java.util.Collection<? extends String> items) { + if ((this.items == null)) + this.items = new java.util.ArrayList<String>(); + this.items.addAll(items); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsWarningsBuilder clearItems() { + if ((this.items != null)) + this.items.clear(); + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsWarnings build() { + java.util.List<String> items; + switch (((this.items == null) ? 0 : this.items.size())) { + case 0 : + items = java.util.Collections.emptyList(); + break; + case 1 : + items = java.util.Collections.singletonList(this.items.get(0)); + break; + default : + items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.items)); + } + return new BuilderDefaultsWarnings(x, z, items); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((("BuilderDefaultsWarnings.BuilderDefaultsWarningsBuilder(x=" + this.x) + ", z=") + this.z) + ", items=") + this.items) + ")"); + } + } + long x = System.currentTimeMillis(); + final int y = 5; + @Builder.Default int z; + @Builder.Default @Singular java.util.List<String> items; + @java.lang.SuppressWarnings("all") BuilderDefaultsWarnings(final long x, final int z, final java.util.List<String> items) { + super(); + this.x = x; + this.z = z; + this.items = items; + } + public static @java.lang.SuppressWarnings("all") BuilderDefaultsWarningsBuilder builder() { + return new BuilderDefaultsWarningsBuilder(); + } +} +class NoBuilderButHasDefaults { + public static @java.lang.SuppressWarnings("all") class NoBuilderButHasDefaultsBuilder { + @java.lang.SuppressWarnings("all") NoBuilderButHasDefaultsBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") NoBuilderButHasDefaults build() { + return new NoBuilderButHasDefaults(); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return "NoBuilderButHasDefaults.NoBuilderButHasDefaultsBuilder()"; + } + } + private final @Builder.Default long z = 5; + public @Builder NoBuilderButHasDefaults() { + super(); + } + public static @java.lang.SuppressWarnings("all") NoBuilderButHasDefaultsBuilder builder() { + return new NoBuilderButHasDefaultsBuilder(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/BuilderGenericMethod.java b/test/transform/resource/after-ecj/BuilderGenericMethod.java new file mode 100644 index 00000000..1b770654 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderGenericMethod.java @@ -0,0 +1,35 @@ +import java.util.List; +import lombok.Builder; +import java.util.*; +class BuilderGenericMethod<T> { + public @java.lang.SuppressWarnings("all") class MapBuilder<N extends Number> { + private @java.lang.SuppressWarnings("all") int a; + private @java.lang.SuppressWarnings("all") long b; + @java.lang.SuppressWarnings("all") MapBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") MapBuilder<N> a(final int a) { + this.a = a; + return this; + } + public @java.lang.SuppressWarnings("all") MapBuilder<N> b(final long b) { + this.b = b; + return this; + } + public @java.lang.SuppressWarnings("all") Map<N, T> build() { + return BuilderGenericMethod.this.<N>foo(a, b); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((("BuilderGenericMethod.MapBuilder(a=" + this.a) + ", b=") + this.b) + ")"); + } + } + BuilderGenericMethod() { + super(); + } + public @Builder <N extends Number>Map<N, T> foo(int a, long b) { + return null; + } + public @java.lang.SuppressWarnings("all") <N extends Number>MapBuilder<N> builder() { + return new MapBuilder<N>(); + } +} diff --git a/test/transform/resource/after-ecj/BuilderInstanceMethod.java b/test/transform/resource/after-ecj/BuilderInstanceMethod.java index ff7d0aab..5f57aef7 100644 --- a/test/transform/resource/after-ecj/BuilderInstanceMethod.java +++ b/test/transform/resource/after-ecj/BuilderInstanceMethod.java @@ -1,33 +1,33 @@ import java.util.List; class BuilderInstanceMethod<T> { - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class StringBuilder { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int show; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int yes; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") List<T> also; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int $andMe; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder() { + public @java.lang.SuppressWarnings("all") class StringBuilder { + private @java.lang.SuppressWarnings("all") int show; + private @java.lang.SuppressWarnings("all") int yes; + private @java.lang.SuppressWarnings("all") List<T> also; + private @java.lang.SuppressWarnings("all") int $andMe; + @java.lang.SuppressWarnings("all") StringBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder show(final int show) { + public @java.lang.SuppressWarnings("all") StringBuilder show(final int show) { this.show = show; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder yes(final int yes) { + public @java.lang.SuppressWarnings("all") StringBuilder yes(final int yes) { this.yes = yes; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder also(final List<T> also) { + public @java.lang.SuppressWarnings("all") StringBuilder also(final List<T> also) { this.also = also; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder $andMe(final int $andMe) { + public @java.lang.SuppressWarnings("all") StringBuilder $andMe(final int $andMe) { this.$andMe = $andMe; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String build() { + public @java.lang.SuppressWarnings("all") String build() { return BuilderInstanceMethod.this.create(show, yes, also, $andMe); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((((("BuilderInstanceMethod.StringBuilder(show=" + this.show) + ", yes=") + this.yes) + ", also=") + this.also) + ", $andMe=") + this.$andMe) + ")"); } } @@ -37,7 +37,7 @@ class BuilderInstanceMethod<T> { public @lombok.Builder String create(int show, final int yes, List<T> also, int $andMe) { return (((("" + show) + yes) + also) + $andMe); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder builder() { + public @java.lang.SuppressWarnings("all") StringBuilder builder() { return new StringBuilder(); } } diff --git a/test/transform/resource/after-ecj/BuilderSimple.java b/test/transform/resource/after-ecj/BuilderSimple.java index 53d1ed9e..bc0ff186 100644 --- a/test/transform/resource/after-ecj/BuilderSimple.java +++ b/test/transform/resource/after-ecj/BuilderSimple.java @@ -1,23 +1,23 @@ import java.util.List; @lombok.Builder class BuilderSimple<T> { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderSimpleBuilder<T> { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int yes; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") List<T> also; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSimpleBuilder() { + public static @java.lang.SuppressWarnings("all") class BuilderSimpleBuilder<T> { + private @java.lang.SuppressWarnings("all") int yes; + private @java.lang.SuppressWarnings("all") List<T> also; + @java.lang.SuppressWarnings("all") BuilderSimpleBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSimpleBuilder<T> yes(final int yes) { + public @java.lang.SuppressWarnings("all") BuilderSimpleBuilder<T> yes(final int yes) { this.yes = yes; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSimpleBuilder<T> also(final List<T> also) { + public @java.lang.SuppressWarnings("all") BuilderSimpleBuilder<T> also(final List<T> also) { this.also = also; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSimple<T> build() { + public @java.lang.SuppressWarnings("all") BuilderSimple<T> build() { return new BuilderSimple<T>(yes, also); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("BuilderSimple.BuilderSimpleBuilder(yes=" + this.yes) + ", also=") + this.also) + ")"); } } @@ -25,12 +25,12 @@ import java.util.List; private final int yes; private List<T> also; private int $butNotMe; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSimple(final int yes, final List<T> also) { + @java.lang.SuppressWarnings("all") BuilderSimple(final int yes, final List<T> also) { super(); this.yes = yes; this.also = also; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <T>BuilderSimpleBuilder<T> builder() { + public static @java.lang.SuppressWarnings("all") <T>BuilderSimpleBuilder<T> builder() { return new BuilderSimpleBuilder<T>(); } } diff --git a/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java b/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java index 5cf9f4ac..12c2b293 100644 --- a/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java +++ b/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java @@ -5,96 +5,96 @@ import com.google.common.collect.ImmutableSortedSet; import com.google.common.collect.ImmutableTable; import lombok.Singular; @lombok.Builder class BuilderSingularGuavaListsSets<T> { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderSingularGuavaListsSetsBuilder<T> { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableList.Builder<T> cards; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableList.Builder<Number> frogs; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableSet.Builder<java.lang.Object> rawSet; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableSortedSet.Builder<String> passes; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableTable.Builder<Number, Number, String> users; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder() { + public static @java.lang.SuppressWarnings("all") class BuilderSingularGuavaListsSetsBuilder<T> { + private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableList.Builder<T> cards; + private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableList.Builder<Number> frogs; + private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableSet.Builder<java.lang.Object> rawSet; + private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableSortedSet.Builder<String> passes; + private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableTable.Builder<Number, Number, String> users; + @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> card(T card) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> card(T card) { if ((this.cards == null)) this.cards = com.google.common.collect.ImmutableList.builder(); this.cards.add(card); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> cards(java.lang.Iterable<? extends T> cards) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> cards(java.lang.Iterable<? extends T> cards) { if ((this.cards == null)) this.cards = com.google.common.collect.ImmutableList.builder(); this.cards.addAll(cards); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearCards() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> clearCards() { this.cards = null; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> frog(Number frog) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> frog(Number frog) { if ((this.frogs == null)) this.frogs = com.google.common.collect.ImmutableList.builder(); this.frogs.add(frog); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> frogs(java.lang.Iterable<? extends Number> frogs) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> frogs(java.lang.Iterable<? extends Number> frogs) { if ((this.frogs == null)) this.frogs = com.google.common.collect.ImmutableList.builder(); this.frogs.addAll(frogs); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearFrogs() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> clearFrogs() { this.frogs = null; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> rawSet(java.lang.Object rawSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> rawSet(java.lang.Object rawSet) { if ((this.rawSet == null)) this.rawSet = com.google.common.collect.ImmutableSet.builder(); this.rawSet.add(rawSet); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> rawSet(java.lang.Iterable<?> rawSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> rawSet(java.lang.Iterable<?> rawSet) { if ((this.rawSet == null)) this.rawSet = com.google.common.collect.ImmutableSet.builder(); this.rawSet.addAll(rawSet); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearRawSet() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> clearRawSet() { this.rawSet = null; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> pass(String pass) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> pass(String pass) { if ((this.passes == null)) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); this.passes.add(pass); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> passes(java.lang.Iterable<? extends String> passes) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> passes(java.lang.Iterable<? extends String> passes) { if ((this.passes == null)) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); this.passes.addAll(passes); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearPasses() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> clearPasses() { this.passes = null; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> user(Number rowKey, Number columnKey, String value) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> user(Number rowKey, Number columnKey, String value) { if ((this.users == null)) this.users = com.google.common.collect.ImmutableTable.builder(); this.users.put(rowKey, columnKey, value); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> users(com.google.common.collect.Table<? extends Number, ? extends Number, ? extends String> users) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> users(com.google.common.collect.Table<? extends Number, ? extends Number, ? extends String> users) { if ((this.users == null)) this.users = com.google.common.collect.ImmutableTable.builder(); this.users.putAll(users); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearUsers() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSetsBuilder<T> clearUsers() { this.users = null; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSets<T> build() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSets<T> build() { com.google.common.collect.ImmutableList<T> cards = ((this.cards == null) ? com.google.common.collect.ImmutableList.<T>of() : this.cards.build()); com.google.common.collect.ImmutableCollection<Number> frogs = ((this.frogs == null) ? com.google.common.collect.ImmutableList.<Number>of() : this.frogs.build()); com.google.common.collect.ImmutableSet<java.lang.Object> rawSet = ((this.rawSet == null) ? com.google.common.collect.ImmutableSet.<java.lang.Object>of() : this.rawSet.build()); @@ -102,7 +102,7 @@ import lombok.Singular; com.google.common.collect.ImmutableTable<Number, Number, String> users = ((this.users == null) ? com.google.common.collect.ImmutableTable.<Number, Number, String>of() : this.users.build()); return new BuilderSingularGuavaListsSets<T>(cards, frogs, rawSet, passes, users); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((((((("BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder(cards=" + this.cards) + ", frogs=") + this.frogs) + ", rawSet=") + this.rawSet) + ", passes=") + this.passes) + ", users=") + this.users) + ")"); } } @@ -111,7 +111,7 @@ import lombok.Singular; private @SuppressWarnings("all") @Singular("rawSet") ImmutableSet rawSet; private @Singular ImmutableSortedSet<String> passes; private @Singular ImmutableTable<? extends Number, ? extends Number, String> users; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSets(final ImmutableList<T> cards, final ImmutableCollection<? extends Number> frogs, final ImmutableSet rawSet, final ImmutableSortedSet<String> passes, final ImmutableTable<? extends Number, ? extends Number, String> users) { + @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSets(final ImmutableList<T> cards, final ImmutableCollection<? extends Number> frogs, final ImmutableSet rawSet, final ImmutableSortedSet<String> passes, final ImmutableTable<? extends Number, ? extends Number, String> users) { super(); this.cards = cards; this.frogs = frogs; @@ -119,7 +119,7 @@ import lombok.Singular; this.passes = passes; this.users = users; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <T>BuilderSingularGuavaListsSetsBuilder<T> builder() { + public static @java.lang.SuppressWarnings("all") <T>BuilderSingularGuavaListsSetsBuilder<T> builder() { return new BuilderSingularGuavaListsSetsBuilder<T>(); } } diff --git a/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java b/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java index 378ec309..44533ac1 100644 --- a/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java +++ b/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java @@ -3,81 +3,81 @@ import com.google.common.collect.ImmutableBiMap; import com.google.common.collect.ImmutableSortedMap; import lombok.Singular; @lombok.Builder class BuilderSingularGuavaMaps<K, V> { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderSingularGuavaMapsBuilder<K, V> { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableMap.Builder<K, V> battleaxes; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableSortedMap.Builder<Integer, V> vertices; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableBiMap.Builder<java.lang.Object, java.lang.Object> rawMap; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder() { + public static @java.lang.SuppressWarnings("all") class BuilderSingularGuavaMapsBuilder<K, V> { + private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableMap.Builder<K, V> battleaxes; + private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableSortedMap.Builder<Integer, V> vertices; + private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableBiMap.Builder<java.lang.Object, java.lang.Object> rawMap; + @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> battleaxe(K key, V value) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> battleaxe(K key, V value) { if ((this.battleaxes == null)) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); this.battleaxes.put(key, value); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> battleaxes(java.util.Map<? extends K, ? extends V> battleaxes) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> battleaxes(java.util.Map<? extends K, ? extends V> battleaxes) { if ((this.battleaxes == null)) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); this.battleaxes.putAll(battleaxes); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> clearBattleaxes() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> clearBattleaxes() { this.battleaxes = null; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> vertex(Integer key, V value) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> vertex(Integer key, V value) { if ((this.vertices == null)) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.vertices.put(key, value); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> vertices(java.util.Map<? extends Integer, ? extends V> vertices) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> vertices(java.util.Map<? extends Integer, ? extends V> vertices) { if ((this.vertices == null)) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.vertices.putAll(vertices); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> clearVertices() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> clearVertices() { this.vertices = null; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> rawMap(java.lang.Object key, java.lang.Object value) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> rawMap(java.lang.Object key, java.lang.Object value) { if ((this.rawMap == null)) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); this.rawMap.put(key, value); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> rawMap(java.util.Map<?, ?> rawMap) { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> rawMap(java.util.Map<?, ?> rawMap) { if ((this.rawMap == null)) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); this.rawMap.putAll(rawMap); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> clearRawMap() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMapsBuilder<K, V> clearRawMap() { this.rawMap = null; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMaps<K, V> build() { + public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMaps<K, V> build() { com.google.common.collect.ImmutableMap<K, V> battleaxes = ((this.battleaxes == null) ? com.google.common.collect.ImmutableMap.<K, V>of() : this.battleaxes.build()); com.google.common.collect.ImmutableSortedMap<Integer, V> vertices = ((this.vertices == null) ? com.google.common.collect.ImmutableSortedMap.<Integer, V>of() : this.vertices.build()); com.google.common.collect.ImmutableBiMap<java.lang.Object, java.lang.Object> rawMap = ((this.rawMap == null) ? com.google.common.collect.ImmutableBiMap.<java.lang.Object, java.lang.Object>of() : this.rawMap.build()); return new BuilderSingularGuavaMaps<K, V>(battleaxes, vertices, rawMap); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((("BuilderSingularGuavaMaps.BuilderSingularGuavaMapsBuilder(battleaxes=" + this.battleaxes) + ", vertices=") + this.vertices) + ", rawMap=") + this.rawMap) + ")"); } } private @Singular ImmutableMap<K, V> battleaxes; private @Singular ImmutableSortedMap<Integer, ? extends V> vertices; private @SuppressWarnings("all") @Singular("rawMap") ImmutableBiMap rawMap; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMaps(final ImmutableMap<K, V> battleaxes, final ImmutableSortedMap<Integer, ? extends V> vertices, final ImmutableBiMap rawMap) { + @java.lang.SuppressWarnings("all") BuilderSingularGuavaMaps(final ImmutableMap<K, V> battleaxes, final ImmutableSortedMap<Integer, ? extends V> vertices, final ImmutableBiMap rawMap) { super(); this.battleaxes = battleaxes; this.vertices = vertices; this.rawMap = rawMap; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <K, V>BuilderSingularGuavaMapsBuilder<K, V> builder() { + public static @java.lang.SuppressWarnings("all") <K, V>BuilderSingularGuavaMapsBuilder<K, V> builder() { return new BuilderSingularGuavaMapsBuilder<K, V>(); } } diff --git a/test/transform/resource/after-ecj/BuilderSingularLists.java b/test/transform/resource/after-ecj/BuilderSingularLists.java index e1036262..3e093e1a 100644 --- a/test/transform/resource/after-ecj/BuilderSingularLists.java +++ b/test/transform/resource/after-ecj/BuilderSingularLists.java @@ -3,65 +3,65 @@ import java.util.Collection; import lombok.Singular; @lombok.Builder class BuilderSingularLists<T> { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderSingularListsBuilder<T> { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<T> children; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<Number> scarves; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<java.lang.Object> rawList; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder() { + public static @java.lang.SuppressWarnings("all") class BuilderSingularListsBuilder<T> { + private @java.lang.SuppressWarnings("all") java.util.ArrayList<T> children; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<Number> scarves; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<java.lang.Object> rawList; + @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> child(T child) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> child(T child) { if ((this.children == null)) this.children = new java.util.ArrayList<T>(); this.children.add(child); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> children(java.util.Collection<? extends T> children) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> children(java.util.Collection<? extends T> children) { if ((this.children == null)) this.children = new java.util.ArrayList<T>(); this.children.addAll(children); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> clearChildren() { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> clearChildren() { if ((this.children != null)) this.children.clear(); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> scarf(Number scarf) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> scarf(Number scarf) { if ((this.scarves == null)) this.scarves = new java.util.ArrayList<Number>(); this.scarves.add(scarf); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> scarves(java.util.Collection<? extends Number> scarves) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> scarves(java.util.Collection<? extends Number> scarves) { if ((this.scarves == null)) this.scarves = new java.util.ArrayList<Number>(); this.scarves.addAll(scarves); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> clearScarves() { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> clearScarves() { if ((this.scarves != null)) this.scarves.clear(); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> rawList(java.lang.Object rawList) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> rawList(java.lang.Object rawList) { if ((this.rawList == null)) this.rawList = new java.util.ArrayList<java.lang.Object>(); this.rawList.add(rawList); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> rawList(java.util.Collection<?> rawList) { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> rawList(java.util.Collection<?> rawList) { if ((this.rawList == null)) this.rawList = new java.util.ArrayList<java.lang.Object>(); this.rawList.addAll(rawList); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> clearRawList() { + public @java.lang.SuppressWarnings("all") BuilderSingularListsBuilder<T> clearRawList() { if ((this.rawList != null)) this.rawList.clear(); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularLists<T> build() { + public @java.lang.SuppressWarnings("all") BuilderSingularLists<T> build() { java.util.List<T> children; switch (((this.children == null) ? 0 : this.children.size())) { case 0 : @@ -97,20 +97,20 @@ import lombok.Singular; } return new BuilderSingularLists<T>(children, scarves, rawList); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((("BuilderSingularLists.BuilderSingularListsBuilder(children=" + this.children) + ", scarves=") + this.scarves) + ", rawList=") + this.rawList) + ")"); } } private @Singular List<T> children; private @Singular Collection<? extends Number> scarves; private @SuppressWarnings("all") @Singular("rawList") List rawList; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularLists(final List<T> children, final Collection<? extends Number> scarves, final List rawList) { + @java.lang.SuppressWarnings("all") BuilderSingularLists(final List<T> children, final Collection<? extends Number> scarves, final List rawList) { super(); this.children = children; this.scarves = scarves; this.rawList = rawList; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <T>BuilderSingularListsBuilder<T> builder() { + public static @java.lang.SuppressWarnings("all") <T>BuilderSingularListsBuilder<T> builder() { return new BuilderSingularListsBuilder<T>(); } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/BuilderSingularMaps.java b/test/transform/resource/after-ecj/BuilderSingularMaps.java index 38ac0ed7..efcf5ef5 100644 --- a/test/transform/resource/after-ecj/BuilderSingularMaps.java +++ b/test/transform/resource/after-ecj/BuilderSingularMaps.java @@ -2,19 +2,19 @@ import java.util.Map; import java.util.SortedMap; import lombok.Singular; @lombok.Builder class BuilderSingularMaps<K, V> { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderSingularMapsBuilder<K, V> { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<K> women$key; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<V> women$value; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<K> men$key; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<Number> men$value; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<java.lang.Object> rawMap$key; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<java.lang.Object> rawMap$value; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<String> stringMap$key; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<V> stringMap$value; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder() { + public static @java.lang.SuppressWarnings("all") class BuilderSingularMapsBuilder<K, V> { + private @java.lang.SuppressWarnings("all") java.util.ArrayList<K> women$key; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<V> women$value; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<K> men$key; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<Number> men$value; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<java.lang.Object> rawMap$key; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<java.lang.Object> rawMap$value; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> stringMap$key; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<V> stringMap$value; + @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> woman(K womanKey, V womanValue) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> woman(K womanKey, V womanValue) { if ((this.women$key == null)) { this.women$key = new java.util.ArrayList<K>(); @@ -24,7 +24,7 @@ import lombok.Singular; this.women$value.add(womanValue); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> women(java.util.Map<? extends K, ? extends V> women) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> women(java.util.Map<? extends K, ? extends V> women) { if ((this.women$key == null)) { this.women$key = new java.util.ArrayList<K>(); @@ -37,7 +37,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> clearWomen() { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> clearWomen() { if ((this.women$key != null)) { this.women$key.clear(); @@ -45,7 +45,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> man(K manKey, Number manValue) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> man(K manKey, Number manValue) { if ((this.men$key == null)) { this.men$key = new java.util.ArrayList<K>(); @@ -55,7 +55,7 @@ import lombok.Singular; this.men$value.add(manValue); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> men(java.util.Map<? extends K, ? extends Number> men) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> men(java.util.Map<? extends K, ? extends Number> men) { if ((this.men$key == null)) { this.men$key = new java.util.ArrayList<K>(); @@ -68,7 +68,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> clearMen() { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> clearMen() { if ((this.men$key != null)) { this.men$key.clear(); @@ -76,7 +76,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> rawMap(java.lang.Object rawMapKey, java.lang.Object rawMapValue) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> rawMap(java.lang.Object rawMapKey, java.lang.Object rawMapValue) { if ((this.rawMap$key == null)) { this.rawMap$key = new java.util.ArrayList<java.lang.Object>(); @@ -86,7 +86,7 @@ import lombok.Singular; this.rawMap$value.add(rawMapValue); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> rawMap(java.util.Map<?, ?> rawMap) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> rawMap(java.util.Map<?, ?> rawMap) { if ((this.rawMap$key == null)) { this.rawMap$key = new java.util.ArrayList<java.lang.Object>(); @@ -99,7 +99,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> clearRawMap() { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> clearRawMap() { if ((this.rawMap$key != null)) { this.rawMap$key.clear(); @@ -107,7 +107,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> stringMap(String stringMapKey, V stringMapValue) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> stringMap(String stringMapKey, V stringMapValue) { if ((this.stringMap$key == null)) { this.stringMap$key = new java.util.ArrayList<String>(); @@ -117,7 +117,7 @@ import lombok.Singular; this.stringMap$value.add(stringMapValue); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> stringMap(java.util.Map<? extends String, ? extends V> stringMap) { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> stringMap(java.util.Map<? extends String, ? extends V> stringMap) { if ((this.stringMap$key == null)) { this.stringMap$key = new java.util.ArrayList<String>(); @@ -130,7 +130,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> clearStringMap() { + public @java.lang.SuppressWarnings("all") BuilderSingularMapsBuilder<K, V> clearStringMap() { if ((this.stringMap$key != null)) { this.stringMap$key.clear(); @@ -138,7 +138,7 @@ import lombok.Singular; } return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMaps<K, V> build() { + public @java.lang.SuppressWarnings("all") BuilderSingularMaps<K, V> build() { java.util.Map<K, V> women; switch (((this.women$key == null) ? 0 : this.women$key.size())) { case 0 : @@ -188,7 +188,7 @@ import lombok.Singular; } return new BuilderSingularMaps<K, V>(women, men, rawMap, stringMap); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((((((((((((("BuilderSingularMaps.BuilderSingularMapsBuilder(women$key=" + this.women$key) + ", women$value=") + this.women$value) + ", men$key=") + this.men$key) + ", men$value=") + this.men$value) + ", rawMap$key=") + this.rawMap$key) + ", rawMap$value=") + this.rawMap$value) + ", stringMap$key=") + this.stringMap$key) + ", stringMap$value=") + this.stringMap$value) + ")"); } } @@ -196,14 +196,14 @@ import lombok.Singular; private @Singular SortedMap<K, ? extends Number> men; private @SuppressWarnings("all") @Singular("rawMap") Map rawMap; private @Singular("stringMap") Map<String, V> stringMap; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMaps(final Map<K, V> women, final SortedMap<K, ? extends Number> men, final Map rawMap, final Map<String, V> stringMap) { + @java.lang.SuppressWarnings("all") BuilderSingularMaps(final Map<K, V> women, final SortedMap<K, ? extends Number> men, final Map rawMap, final Map<String, V> stringMap) { super(); this.women = women; this.men = men; this.rawMap = rawMap; this.stringMap = stringMap; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <K, V>BuilderSingularMapsBuilder<K, V> builder() { + public static @java.lang.SuppressWarnings("all") <K, V>BuilderSingularMapsBuilder<K, V> builder() { return new BuilderSingularMapsBuilder<K, V>(); } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/BuilderSingularNoAuto.java b/test/transform/resource/after-ecj/BuilderSingularNoAuto.java index 1b79538c..fa38efc3 100644 --- a/test/transform/resource/after-ecj/BuilderSingularNoAuto.java +++ b/test/transform/resource/after-ecj/BuilderSingularNoAuto.java @@ -1,65 +1,65 @@ import java.util.List; import lombok.Singular; @lombok.Builder class BuilderSingularNoAuto { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderSingularNoAutoBuilder { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<String> things; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<String> widgets; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<String> items; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder() { + public static @java.lang.SuppressWarnings("all") class BuilderSingularNoAutoBuilder { + private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> things; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> widgets; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items; + @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder things(String things) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder things(String things) { if ((this.things == null)) this.things = new java.util.ArrayList<String>(); this.things.add(things); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder things(java.util.Collection<? extends String> things) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder things(java.util.Collection<? extends String> things) { if ((this.things == null)) this.things = new java.util.ArrayList<String>(); this.things.addAll(things); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder clearThings() { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder clearThings() { if ((this.things != null)) this.things.clear(); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder widget(String widget) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder widget(String widget) { if ((this.widgets == null)) this.widgets = new java.util.ArrayList<String>(); this.widgets.add(widget); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder widgets(java.util.Collection<? extends String> widgets) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder widgets(java.util.Collection<? extends String> widgets) { if ((this.widgets == null)) this.widgets = new java.util.ArrayList<String>(); this.widgets.addAll(widgets); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder clearWidgets() { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder clearWidgets() { if ((this.widgets != null)) this.widgets.clear(); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder items(String items) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder items(String items) { if ((this.items == null)) this.items = new java.util.ArrayList<String>(); this.items.add(items); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder items(java.util.Collection<? extends String> items) { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder items(java.util.Collection<? extends String> items) { if ((this.items == null)) this.items = new java.util.ArrayList<String>(); this.items.addAll(items); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder clearItems() { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder clearItems() { if ((this.items != null)) this.items.clear(); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAuto build() { + public @java.lang.SuppressWarnings("all") BuilderSingularNoAuto build() { java.util.List<String> things; switch (((this.things == null) ? 0 : this.things.size())) { case 0 : @@ -95,20 +95,20 @@ import lombok.Singular; } return new BuilderSingularNoAuto(things, widgets, items); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((("BuilderSingularNoAuto.BuilderSingularNoAutoBuilder(things=" + this.things) + ", widgets=") + this.widgets) + ", items=") + this.items) + ")"); } } private @Singular List<String> things; private @Singular("widget") List<String> widgets; private @Singular List<String> items; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAuto(final List<String> things, final List<String> widgets, final List<String> items) { + @java.lang.SuppressWarnings("all") BuilderSingularNoAuto(final List<String> things, final List<String> widgets, final List<String> items) { super(); this.things = things; this.widgets = widgets; this.items = items; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder builder() { + public static @java.lang.SuppressWarnings("all") BuilderSingularNoAutoBuilder builder() { return new BuilderSingularNoAutoBuilder(); } } diff --git a/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java b/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java index 84335f46..4823e46e 100644 --- a/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java +++ b/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java @@ -3,81 +3,81 @@ import java.util.NavigableMap; import java.util.Collection; import lombok.Singular; @lombok.Builder class BuilderSingularRedirectToGuava { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderSingularRedirectToGuavaBuilder { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableSet.Builder<String> dangerMice; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableSortedMap.Builder<Integer, Number> things; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableList.Builder<Class<?>> doohickeys; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder() { + public static @java.lang.SuppressWarnings("all") class BuilderSingularRedirectToGuavaBuilder { + private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableSet.Builder<String> dangerMice; + private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableSortedMap.Builder<Integer, Number> things; + private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableList.Builder<Class<?>> doohickeys; + @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder dangerMouse(String dangerMouse) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder dangerMouse(String dangerMouse) { if ((this.dangerMice == null)) this.dangerMice = com.google.common.collect.ImmutableSet.builder(); this.dangerMice.add(dangerMouse); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder dangerMice(java.lang.Iterable<? extends String> dangerMice) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder dangerMice(java.lang.Iterable<? extends String> dangerMice) { if ((this.dangerMice == null)) this.dangerMice = com.google.common.collect.ImmutableSet.builder(); this.dangerMice.addAll(dangerMice); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder clearDangerMice() { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder clearDangerMice() { this.dangerMice = null; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder thing(Integer key, Number value) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder thing(Integer key, Number value) { if ((this.things == null)) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.things.put(key, value); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder things(java.util.Map<? extends Integer, ? extends Number> things) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder things(java.util.Map<? extends Integer, ? extends Number> things) { if ((this.things == null)) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); this.things.putAll(things); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder clearThings() { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder clearThings() { this.things = null; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder doohickey(Class<?> doohickey) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder doohickey(Class<?> doohickey) { if ((this.doohickeys == null)) this.doohickeys = com.google.common.collect.ImmutableList.builder(); this.doohickeys.add(doohickey); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder doohickeys(java.lang.Iterable<? extends Class<?>> doohickeys) { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder doohickeys(java.lang.Iterable<? extends Class<?>> doohickeys) { if ((this.doohickeys == null)) this.doohickeys = com.google.common.collect.ImmutableList.builder(); this.doohickeys.addAll(doohickeys); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder clearDoohickeys() { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder clearDoohickeys() { this.doohickeys = null; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuava build() { + public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuava build() { java.util.Set<String> dangerMice = ((this.dangerMice == null) ? com.google.common.collect.ImmutableSet.<String>of() : this.dangerMice.build()); java.util.NavigableMap<Integer, Number> things = ((this.things == null) ? com.google.common.collect.ImmutableSortedMap.<Integer, Number>of() : this.things.build()); java.util.Collection<Class<?>> doohickeys = ((this.doohickeys == null) ? com.google.common.collect.ImmutableList.<Class<?>>of() : this.doohickeys.build()); return new BuilderSingularRedirectToGuava(dangerMice, things, doohickeys); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((("BuilderSingularRedirectToGuava.BuilderSingularRedirectToGuavaBuilder(dangerMice=" + this.dangerMice) + ", things=") + this.things) + ", doohickeys=") + this.doohickeys) + ")"); } } private @Singular Set<String> dangerMice; private @Singular NavigableMap<Integer, Number> things; private @Singular Collection<Class<?>> doohickeys; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuava(final Set<String> dangerMice, final NavigableMap<Integer, Number> things, final Collection<Class<?>> doohickeys) { + @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuava(final Set<String> dangerMice, final NavigableMap<Integer, Number> things, final Collection<Class<?>> doohickeys) { super(); this.dangerMice = dangerMice; this.things = things; this.doohickeys = doohickeys; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder builder() { + public static @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuavaBuilder builder() { return new BuilderSingularRedirectToGuavaBuilder(); } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/BuilderSingularSets.java b/test/transform/resource/after-ecj/BuilderSingularSets.java index 118eb16f..bf403831 100644 --- a/test/transform/resource/after-ecj/BuilderSingularSets.java +++ b/test/transform/resource/after-ecj/BuilderSingularSets.java @@ -2,83 +2,83 @@ import java.util.Set; import java.util.SortedSet; import lombok.Singular; @lombok.Builder class BuilderSingularSets<T> { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderSingularSetsBuilder<T> { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<T> dangerMice; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<Number> octopodes; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<java.lang.Object> rawSet; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<String> stringSet; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder() { + public static @java.lang.SuppressWarnings("all") class BuilderSingularSetsBuilder<T> { + private @java.lang.SuppressWarnings("all") java.util.ArrayList<T> dangerMice; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<Number> octopodes; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<java.lang.Object> rawSet; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> stringSet; + @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> dangerMouse(T dangerMouse) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> dangerMouse(T dangerMouse) { if ((this.dangerMice == null)) this.dangerMice = new java.util.ArrayList<T>(); this.dangerMice.add(dangerMouse); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> dangerMice(java.util.Collection<? extends T> dangerMice) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> dangerMice(java.util.Collection<? extends T> dangerMice) { if ((this.dangerMice == null)) this.dangerMice = new java.util.ArrayList<T>(); this.dangerMice.addAll(dangerMice); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> clearDangerMice() { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> clearDangerMice() { if ((this.dangerMice != null)) this.dangerMice.clear(); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> octopus(Number octopus) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> octopus(Number octopus) { if ((this.octopodes == null)) this.octopodes = new java.util.ArrayList<Number>(); this.octopodes.add(octopus); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> octopodes(java.util.Collection<? extends Number> octopodes) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> octopodes(java.util.Collection<? extends Number> octopodes) { if ((this.octopodes == null)) this.octopodes = new java.util.ArrayList<Number>(); this.octopodes.addAll(octopodes); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> clearOctopodes() { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> clearOctopodes() { if ((this.octopodes != null)) this.octopodes.clear(); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> rawSet(java.lang.Object rawSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> rawSet(java.lang.Object rawSet) { if ((this.rawSet == null)) this.rawSet = new java.util.ArrayList<java.lang.Object>(); this.rawSet.add(rawSet); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> rawSet(java.util.Collection<?> rawSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> rawSet(java.util.Collection<?> rawSet) { if ((this.rawSet == null)) this.rawSet = new java.util.ArrayList<java.lang.Object>(); this.rawSet.addAll(rawSet); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> clearRawSet() { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> clearRawSet() { if ((this.rawSet != null)) this.rawSet.clear(); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> stringSet(String stringSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> stringSet(String stringSet) { if ((this.stringSet == null)) this.stringSet = new java.util.ArrayList<String>(); this.stringSet.add(stringSet); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> stringSet(java.util.Collection<? extends String> stringSet) { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> stringSet(java.util.Collection<? extends String> stringSet) { if ((this.stringSet == null)) this.stringSet = new java.util.ArrayList<String>(); this.stringSet.addAll(stringSet); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> clearStringSet() { + public @java.lang.SuppressWarnings("all") BuilderSingularSetsBuilder<T> clearStringSet() { if ((this.stringSet != null)) this.stringSet.clear(); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSets<T> build() { + public @java.lang.SuppressWarnings("all") BuilderSingularSets<T> build() { java.util.Set<T> dangerMice; switch (((this.dangerMice == null) ? 0 : this.dangerMice.size())) { case 0 : @@ -124,7 +124,7 @@ import lombok.Singular; } return new BuilderSingularSets<T>(dangerMice, octopodes, rawSet, stringSet); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((((("BuilderSingularSets.BuilderSingularSetsBuilder(dangerMice=" + this.dangerMice) + ", octopodes=") + this.octopodes) + ", rawSet=") + this.rawSet) + ", stringSet=") + this.stringSet) + ")"); } } @@ -132,14 +132,14 @@ import lombok.Singular; private @Singular SortedSet<? extends Number> octopodes; private @SuppressWarnings("all") @Singular("rawSet") Set rawSet; private @Singular("stringSet") Set<String> stringSet; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSets(final Set<T> dangerMice, final SortedSet<? extends Number> octopodes, final Set rawSet, final Set<String> stringSet) { + @java.lang.SuppressWarnings("all") BuilderSingularSets(final Set<T> dangerMice, final SortedSet<? extends Number> octopodes, final Set rawSet, final Set<String> stringSet) { super(); this.dangerMice = dangerMice; this.octopodes = octopodes; this.rawSet = rawSet; this.stringSet = stringSet; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <T>BuilderSingularSetsBuilder<T> builder() { + public static @java.lang.SuppressWarnings("all") <T>BuilderSingularSetsBuilder<T> builder() { return new BuilderSingularSetsBuilder<T>(); } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/BuilderSingularWithPrefixes.java b/test/transform/resource/after-ecj/BuilderSingularWithPrefixes.java index c0e4af75..12c299c6 100644 --- a/test/transform/resource/after-ecj/BuilderSingularWithPrefixes.java +++ b/test/transform/resource/after-ecj/BuilderSingularWithPrefixes.java @@ -1,28 +1,28 @@ import lombok.Singular; @lombok.Builder @lombok.experimental.Accessors(prefix = "_") class BuilderSingularWithPrefixes { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderSingularWithPrefixesBuilder { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<String> elems; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularWithPrefixesBuilder() { + public static @java.lang.SuppressWarnings("all") class BuilderSingularWithPrefixesBuilder { + private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> elems; + @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularWithPrefixesBuilder elem(String elem) { + public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder elem(String elem) { if ((this.elems == null)) this.elems = new java.util.ArrayList<String>(); this.elems.add(elem); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularWithPrefixesBuilder elems(java.util.Collection<? extends String> elems) { + public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder elems(java.util.Collection<? extends String> elems) { if ((this.elems == null)) this.elems = new java.util.ArrayList<String>(); this.elems.addAll(elems); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularWithPrefixesBuilder clearElems() { + public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder clearElems() { if ((this.elems != null)) this.elems.clear(); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularWithPrefixes build() { + public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixes build() { java.util.List<String> elems; switch (((this.elems == null) ? 0 : this.elems.size())) { case 0 : @@ -36,16 +36,16 @@ import lombok.Singular; } return new BuilderSingularWithPrefixes(elems); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("BuilderSingularWithPrefixes.BuilderSingularWithPrefixesBuilder(elems=" + this.elems) + ")"); } } private @Singular java.util.List<String> _elems; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularWithPrefixes(final java.util.List<String> elems) { + @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixes(final java.util.List<String> elems) { super(); this._elems = elems; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularWithPrefixesBuilder builder() { + public static @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesBuilder builder() { return new BuilderSingularWithPrefixesBuilder(); } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/BuilderValueData.java b/test/transform/resource/after-ecj/BuilderValueData.java index 4fcc04bf..06456e86 100644 --- a/test/transform/resource/after-ecj/BuilderValueData.java +++ b/test/transform/resource/after-ecj/BuilderValueData.java @@ -1,27 +1,27 @@ import java.util.List; final @lombok.Builder @lombok.Value class BuilderAndValue { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderAndValueBuilder { - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderAndValueBuilder() { + public static @java.lang.SuppressWarnings("all") class BuilderAndValueBuilder { + @java.lang.SuppressWarnings("all") BuilderAndValueBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderAndValue build() { + public @java.lang.SuppressWarnings("all") BuilderAndValue build() { return new BuilderAndValue(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return "BuilderAndValue.BuilderAndValueBuilder()"; } } private final int zero = 0; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderAndValue() { + @java.lang.SuppressWarnings("all") BuilderAndValue() { super(); } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderAndValueBuilder builder() { + public static @java.lang.SuppressWarnings("all") BuilderAndValueBuilder builder() { return new BuilderAndValueBuilder(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getZero() { + public @java.lang.SuppressWarnings("all") int getZero() { return this.zero; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof BuilderAndValue))) @@ -31,39 +31,39 @@ final @lombok.Builder @lombok.Value class BuilderAndValue { return false; return true; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getZero()); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("BuilderAndValue(zero=" + this.getZero()) + ")"); } } @lombok.Builder @lombok.Data class BuilderAndData { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderAndDataBuilder { - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderAndDataBuilder() { + public static @java.lang.SuppressWarnings("all") class BuilderAndDataBuilder { + @java.lang.SuppressWarnings("all") BuilderAndDataBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderAndData build() { + public @java.lang.SuppressWarnings("all") BuilderAndData build() { return new BuilderAndData(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return "BuilderAndData.BuilderAndDataBuilder()"; } } private final int zero = 0; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderAndData() { + @java.lang.SuppressWarnings("all") BuilderAndData() { super(); } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderAndDataBuilder builder() { + public static @java.lang.SuppressWarnings("all") BuilderAndDataBuilder builder() { return new BuilderAndDataBuilder(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getZero() { + public @java.lang.SuppressWarnings("all") int getZero() { return this.zero; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof BuilderAndData))) @@ -75,16 +75,16 @@ final @lombok.Builder @lombok.Value class BuilderAndValue { return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof BuilderAndData); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getZero()); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("BuilderAndData(zero=" + this.getZero()) + ")"); } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/BuilderWithAccessors.java b/test/transform/resource/after-ecj/BuilderWithAccessors.java index de93a75c..a7bee291 100644 --- a/test/transform/resource/after-ecj/BuilderWithAccessors.java +++ b/test/transform/resource/after-ecj/BuilderWithAccessors.java @@ -1,32 +1,32 @@ @lombok.Builder @lombok.experimental.Accessors(prefix = {"p", "_"}) class BuilderWithAccessors { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderWithAccessorsBuilder { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int plower; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int upper; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int foo; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int _bar; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithAccessorsBuilder() { + public static @java.lang.SuppressWarnings("all") class BuilderWithAccessorsBuilder { + private @java.lang.SuppressWarnings("all") int plower; + private @java.lang.SuppressWarnings("all") int upper; + private @java.lang.SuppressWarnings("all") int foo; + private @java.lang.SuppressWarnings("all") int _bar; + @java.lang.SuppressWarnings("all") BuilderWithAccessorsBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithAccessorsBuilder plower(final int plower) { + public @java.lang.SuppressWarnings("all") BuilderWithAccessorsBuilder plower(final int plower) { this.plower = plower; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithAccessorsBuilder upper(final int upper) { + public @java.lang.SuppressWarnings("all") BuilderWithAccessorsBuilder upper(final int upper) { this.upper = upper; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithAccessorsBuilder foo(final int foo) { + public @java.lang.SuppressWarnings("all") BuilderWithAccessorsBuilder foo(final int foo) { this.foo = foo; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithAccessorsBuilder _bar(final int _bar) { + public @java.lang.SuppressWarnings("all") BuilderWithAccessorsBuilder _bar(final int _bar) { this._bar = _bar; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithAccessors build() { + public @java.lang.SuppressWarnings("all") BuilderWithAccessors build() { return new BuilderWithAccessors(plower, upper, foo, _bar); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((((("BuilderWithAccessors.BuilderWithAccessorsBuilder(plower=" + this.plower) + ", upper=") + this.upper) + ", foo=") + this.foo) + ", _bar=") + this._bar) + ")"); } } @@ -34,14 +34,14 @@ private final int pUpper; private int _foo; private int __bar; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithAccessors(final int plower, final int upper, final int foo, final int _bar) { + @java.lang.SuppressWarnings("all") BuilderWithAccessors(final int plower, final int upper, final int foo, final int _bar) { super(); this.plower = plower; this.pUpper = upper; this._foo = foo; this.__bar = _bar; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithAccessorsBuilder builder() { + public static @java.lang.SuppressWarnings("all") BuilderWithAccessorsBuilder builder() { return new BuilderWithAccessorsBuilder(); } } diff --git a/test/transform/resource/after-ecj/BuilderWithDeprecated.java b/test/transform/resource/after-ecj/BuilderWithDeprecated.java new file mode 100644 index 00000000..09a0b786 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderWithDeprecated.java @@ -0,0 +1,87 @@ +import com.google.common.collect.ImmutableList; +import lombok.Builder; +import lombok.Singular; +public @Builder class BuilderWithDeprecated { + public static @java.lang.SuppressWarnings("all") class BuilderWithDeprecatedBuilder { + private @java.lang.SuppressWarnings("all") String dep1; + private @java.lang.SuppressWarnings("all") int dep2; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> strings; + private @java.lang.SuppressWarnings("all") com.google.common.collect.ImmutableList.Builder<Integer> numbers; + @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder() { + super(); + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder dep1(final String dep1) { + this.dep1 = dep1; + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder dep2(final int dep2) { + this.dep2 = dep2; + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder string(String string) { + if ((this.strings == null)) + this.strings = new java.util.ArrayList<String>(); + this.strings.add(string); + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder strings(java.util.Collection<? extends String> strings) { + if ((this.strings == null)) + this.strings = new java.util.ArrayList<String>(); + this.strings.addAll(strings); + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder clearStrings() { + if ((this.strings != null)) + this.strings.clear(); + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder number(Integer number) { + if ((this.numbers == null)) + this.numbers = com.google.common.collect.ImmutableList.builder(); + this.numbers.add(number); + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder numbers(java.lang.Iterable<? extends Integer> numbers) { + if ((this.numbers == null)) + this.numbers = com.google.common.collect.ImmutableList.builder(); + this.numbers.addAll(numbers); + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder clearNumbers() { + this.numbers = null; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderWithDeprecated build() { + java.util.List<String> strings; + switch (((this.strings == null) ? 0 : this.strings.size())) { + case 0 : + strings = java.util.Collections.emptyList(); + break; + case 1 : + strings = java.util.Collections.singletonList(this.strings.get(0)); + break; + default : + strings = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.strings)); + } + com.google.common.collect.ImmutableList<Integer> numbers = ((this.numbers == null) ? com.google.common.collect.ImmutableList.<Integer>of() : this.numbers.build()); + return new BuilderWithDeprecated(dep1, dep2, strings, numbers); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((((("BuilderWithDeprecated.BuilderWithDeprecatedBuilder(dep1=" + this.dep1) + ", dep2=") + this.dep2) + ", strings=") + this.strings) + ", numbers=") + this.numbers) + ")"); + } + } + String dep1; + @Deprecated int dep2; + @Singular @Deprecated java.util.List<String> strings; + @Singular @Deprecated ImmutableList<Integer> numbers; + @java.lang.SuppressWarnings("all") BuilderWithDeprecated(final String dep1, final int dep2, final java.util.List<String> strings, final ImmutableList<Integer> numbers) { + super(); + this.dep1 = dep1; + this.dep2 = dep2; + this.strings = strings; + this.numbers = numbers; + } + public static @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder builder() { + return new BuilderWithDeprecatedBuilder(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/BuilderWithExistingBuilderClass.java b/test/transform/resource/after-ecj/BuilderWithExistingBuilderClass.java index 1c23e0ee..0e6ba335 100644 --- a/test/transform/resource/after-ecj/BuilderWithExistingBuilderClass.java +++ b/test/transform/resource/after-ecj/BuilderWithExistingBuilderClass.java @@ -1,26 +1,26 @@ import lombok.Builder; class BuilderWithExistingBuilderClass<T, K extends Number> { public static class BuilderWithExistingBuilderClassBuilder<Z extends Number> { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean arg2; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String arg3; + private @java.lang.SuppressWarnings("all") boolean arg2; + private @java.lang.SuppressWarnings("all") String arg3; private Z arg1; public void arg2(boolean arg) { } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithExistingBuilderClassBuilder() { + @java.lang.SuppressWarnings("all") BuilderWithExistingBuilderClassBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithExistingBuilderClassBuilder<Z> arg1(final Z arg1) { + public @java.lang.SuppressWarnings("all") BuilderWithExistingBuilderClassBuilder<Z> arg1(final Z arg1) { this.arg1 = arg1; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithExistingBuilderClassBuilder<Z> arg3(final String arg3) { + public @java.lang.SuppressWarnings("all") BuilderWithExistingBuilderClassBuilder<Z> arg3(final String arg3) { this.arg3 = arg3; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithExistingBuilderClass<String, Z> build() { + public @java.lang.SuppressWarnings("all") BuilderWithExistingBuilderClass<String, Z> build() { return BuilderWithExistingBuilderClass.<Z>staticMethod(arg1, arg2, arg3); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((("BuilderWithExistingBuilderClass.BuilderWithExistingBuilderClassBuilder(arg1=" + this.arg1) + ", arg2=") + this.arg2) + ", arg3=") + this.arg3) + ")"); } } @@ -30,7 +30,7 @@ class BuilderWithExistingBuilderClass<T, K extends Number> { public static @Builder <Z extends Number>BuilderWithExistingBuilderClass<String, Z> staticMethod(Z arg1, boolean arg2, String arg3) { return null; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <Z extends Number>BuilderWithExistingBuilderClassBuilder<Z> builder() { + public static @java.lang.SuppressWarnings("all") <Z extends Number>BuilderWithExistingBuilderClassBuilder<Z> builder() { return new BuilderWithExistingBuilderClassBuilder<Z>(); } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/BuilderWithRecursiveGenerics.java b/test/transform/resource/after-ecj/BuilderWithRecursiveGenerics.java index f13b8b9b..8246ca2c 100644 --- a/test/transform/resource/after-ecj/BuilderWithRecursiveGenerics.java +++ b/test/transform/resource/after-ecj/BuilderWithRecursiveGenerics.java @@ -5,44 +5,44 @@ public class BuilderWithRecursiveGenerics { interface Inter<T, U extends Inter<T, U>> { } public static final @Builder @Value class Test<Foo, Bar extends Set<Foo>, Quz extends Inter<Bar, Quz>> { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class TestBuilder<Foo, Bar extends Set<Foo>, Quz extends Inter<Bar, Quz>> { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Foo foo; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Bar bar; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") TestBuilder() { + public static @java.lang.SuppressWarnings("all") class TestBuilder<Foo, Bar extends Set<Foo>, Quz extends Inter<Bar, Quz>> { + private @java.lang.SuppressWarnings("all") Foo foo; + private @java.lang.SuppressWarnings("all") Bar bar; + @java.lang.SuppressWarnings("all") TestBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") TestBuilder<Foo, Bar, Quz> foo(final Foo foo) { + public @java.lang.SuppressWarnings("all") TestBuilder<Foo, Bar, Quz> foo(final Foo foo) { this.foo = foo; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") TestBuilder<Foo, Bar, Quz> bar(final Bar bar) { + public @java.lang.SuppressWarnings("all") TestBuilder<Foo, Bar, Quz> bar(final Bar bar) { this.bar = bar; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Test<Foo, Bar, Quz> build() { + public @java.lang.SuppressWarnings("all") Test<Foo, Bar, Quz> build() { return new Test<Foo, Bar, Quz>(foo, bar); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("BuilderWithRecursiveGenerics.Test.TestBuilder(foo=" + this.foo) + ", bar=") + this.bar) + ")"); } } private final Foo foo; private final Bar bar; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Test(final Foo foo, final Bar bar) { + @java.lang.SuppressWarnings("all") Test(final Foo foo, final Bar bar) { super(); this.foo = foo; this.bar = bar; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <Foo, Bar extends Set<Foo>, Quz extends Inter<Bar, Quz>>TestBuilder<Foo, Bar, Quz> builder() { + public static @java.lang.SuppressWarnings("all") <Foo, Bar extends Set<Foo>, Quz extends Inter<Bar, Quz>>TestBuilder<Foo, Bar, Quz> builder() { return new TestBuilder<Foo, Bar, Quz>(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Foo getFoo() { + public @java.lang.SuppressWarnings("all") Foo getFoo() { return this.foo; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Bar getBar() { + public @java.lang.SuppressWarnings("all") Bar getBar() { return this.bar; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof BuilderWithRecursiveGenerics.Test))) @@ -58,7 +58,7 @@ public class BuilderWithRecursiveGenerics { return false; return true; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $foo = this.getFoo(); @@ -67,7 +67,7 @@ public class BuilderWithRecursiveGenerics { result = ((result * PRIME) + (($bar == null) ? 43 : $bar.hashCode())); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("BuilderWithRecursiveGenerics.Test(foo=" + this.getFoo()) + ", bar=") + this.getBar()) + ")"); } } diff --git a/test/transform/resource/after-ecj/BuilderWithToBuilder.java b/test/transform/resource/after-ecj/BuilderWithToBuilder.java index 0d296cb6..d304293c 100644 --- a/test/transform/resource/after-ecj/BuilderWithToBuilder.java +++ b/test/transform/resource/after-ecj/BuilderWithToBuilder.java @@ -1,44 +1,44 @@ import java.util.List; import lombok.Builder; @Builder(toBuilder = true) @lombok.experimental.Accessors(prefix = "m") class BuilderWithToBuilder<T> { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderWithToBuilderBuilder<T> { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String one; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String two; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") T foo; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<T> bars; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderBuilder() { + public static @java.lang.SuppressWarnings("all") class BuilderWithToBuilderBuilder<T> { + private @java.lang.SuppressWarnings("all") String one; + private @java.lang.SuppressWarnings("all") String two; + private @java.lang.SuppressWarnings("all") T foo; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<T> bars; + @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderBuilder<T> one(final String one) { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> one(final String one) { this.one = one; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderBuilder<T> two(final String two) { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> two(final String two) { this.two = two; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderBuilder<T> foo(final T foo) { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> foo(final T foo) { this.foo = foo; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderBuilder<T> bar(T bar) { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> bar(T bar) { if ((this.bars == null)) this.bars = new java.util.ArrayList<T>(); this.bars.add(bar); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderBuilder<T> bars(java.util.Collection<? extends T> bars) { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> bars(java.util.Collection<? extends T> bars) { if ((this.bars == null)) this.bars = new java.util.ArrayList<T>(); this.bars.addAll(bars); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderBuilder<T> clearBars() { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> clearBars() { if ((this.bars != null)) this.bars.clear(); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilder<T> build() { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilder<T> build() { java.util.List<T> bars; switch (((this.bars == null) ? 0 : this.bars.size())) { case 0 : @@ -52,7 +52,7 @@ import lombok.Builder; } return new BuilderWithToBuilder<T>(one, two, foo, bars); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((((("BuilderWithToBuilder.BuilderWithToBuilderBuilder(one=" + this.one) + ", two=") + this.two) + ", foo=") + this.foo) + ", bars=") + this.bars) + ")"); } } @@ -63,39 +63,39 @@ import lombok.Builder; public static <K>K rrr(BuilderWithToBuilder<K> x) { return x.foo; } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilder(final String one, final String two, final T foo, final List<T> bars) { + @java.lang.SuppressWarnings("all") BuilderWithToBuilder(final String one, final String two, final T foo, final List<T> bars) { super(); this.mOne = one; this.mTwo = two; this.foo = foo; this.bars = bars; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <T>BuilderWithToBuilderBuilder<T> builder() { + public static @java.lang.SuppressWarnings("all") <T>BuilderWithToBuilderBuilder<T> builder() { return new BuilderWithToBuilderBuilder<T>(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderBuilder<T> toBuilder() { + public @java.lang.SuppressWarnings("all") BuilderWithToBuilderBuilder<T> toBuilder() { return new BuilderWithToBuilderBuilder<T>().one(this.mOne).two(this.mTwo).foo(BuilderWithToBuilder.rrr(this)).bars(this.bars); } } @lombok.experimental.Accessors(prefix = "m") class ConstructorWithToBuilder<T> { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class ConstructorWithToBuilderBuilder<T> { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String mOne; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") T bar; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ConstructorWithToBuilderBuilder() { + public static @java.lang.SuppressWarnings("all") class ConstructorWithToBuilderBuilder<T> { + private @java.lang.SuppressWarnings("all") String mOne; + private @java.lang.SuppressWarnings("all") T bar; + @java.lang.SuppressWarnings("all") ConstructorWithToBuilderBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ConstructorWithToBuilderBuilder<T> mOne(final String mOne) { + public @java.lang.SuppressWarnings("all") ConstructorWithToBuilderBuilder<T> mOne(final String mOne) { this.mOne = mOne; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ConstructorWithToBuilderBuilder<T> bar(final T bar) { + public @java.lang.SuppressWarnings("all") ConstructorWithToBuilderBuilder<T> bar(final T bar) { this.bar = bar; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ConstructorWithToBuilder<T> build() { + public @java.lang.SuppressWarnings("all") ConstructorWithToBuilder<T> build() { return new ConstructorWithToBuilder<T>(mOne, bar); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("ConstructorWithToBuilder.ConstructorWithToBuilderBuilder(mOne=" + this.mOne) + ", bar=") + this.bar) + ")"); } } @@ -106,32 +106,32 @@ import lombok.Builder; public @Builder(toBuilder = true) ConstructorWithToBuilder(String mOne, @Builder.ObtainVia(field = "foo") T bar) { super(); } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <T>ConstructorWithToBuilderBuilder<T> builder() { + public static @java.lang.SuppressWarnings("all") <T>ConstructorWithToBuilderBuilder<T> builder() { return new ConstructorWithToBuilderBuilder<T>(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ConstructorWithToBuilderBuilder<T> toBuilder() { + public @java.lang.SuppressWarnings("all") ConstructorWithToBuilderBuilder<T> toBuilder() { return new ConstructorWithToBuilderBuilder<T>().mOne(this.mOne).bar(this.foo); } } @lombok.experimental.Accessors(prefix = "m") class StaticWithToBuilder<T, K> { - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class StaticWithToBuilderBuilder<Z> { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String mOne; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Z bar; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StaticWithToBuilderBuilder() { + public static @java.lang.SuppressWarnings("all") class StaticWithToBuilderBuilder<Z> { + private @java.lang.SuppressWarnings("all") String mOne; + private @java.lang.SuppressWarnings("all") Z bar; + @java.lang.SuppressWarnings("all") StaticWithToBuilderBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StaticWithToBuilderBuilder<Z> mOne(final String mOne) { + public @java.lang.SuppressWarnings("all") StaticWithToBuilderBuilder<Z> mOne(final String mOne) { this.mOne = mOne; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StaticWithToBuilderBuilder<Z> bar(final Z bar) { + public @java.lang.SuppressWarnings("all") StaticWithToBuilderBuilder<Z> bar(final Z bar) { this.bar = bar; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StaticWithToBuilder<Z, String> build() { + public @java.lang.SuppressWarnings("all") StaticWithToBuilder<Z, String> build() { return StaticWithToBuilder.<Z>test(mOne, bar); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("StaticWithToBuilder.StaticWithToBuilderBuilder(mOne=" + this.mOne) + ", bar=") + this.bar) + ")"); } } @@ -146,10 +146,10 @@ import lombok.Builder; public static @Builder(toBuilder = true) <Z>StaticWithToBuilder<Z, String> test(String mOne, @Builder.ObtainVia(field = "foo") Z bar) { return new StaticWithToBuilder<Z, String>(); } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <Z>StaticWithToBuilderBuilder<Z> builder() { + public static @java.lang.SuppressWarnings("all") <Z>StaticWithToBuilderBuilder<Z> builder() { return new StaticWithToBuilderBuilder<Z>(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StaticWithToBuilderBuilder<T> toBuilder() { + public @java.lang.SuppressWarnings("all") StaticWithToBuilderBuilder<T> toBuilder() { return new StaticWithToBuilderBuilder<T>().mOne(this.mOne).bar(this.foo); } } diff --git a/test/transform/resource/after-ecj/BuilderWithTolerate.java b/test/transform/resource/after-ecj/BuilderWithTolerate.java index 0b9b46a0..b64fd49a 100644 --- a/test/transform/resource/after-ecj/BuilderWithTolerate.java +++ b/test/transform/resource/after-ecj/BuilderWithTolerate.java @@ -2,21 +2,21 @@ import lombok.Builder; import lombok.experimental.Tolerate; public @Builder class BuilderWithTolerate { public static class BuilderWithTolerateBuilder { - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int value; + private @java.lang.SuppressWarnings("all") int value; public @Tolerate BuilderWithTolerateBuilder value(String s) { return this.value(Integer.parseInt(s)); } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithTolerateBuilder() { + @java.lang.SuppressWarnings("all") BuilderWithTolerateBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithTolerateBuilder value(final int value) { + public @java.lang.SuppressWarnings("all") BuilderWithTolerateBuilder value(final int value) { this.value = value; return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithTolerate build() { + public @java.lang.SuppressWarnings("all") BuilderWithTolerate build() { return new BuilderWithTolerate(value); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("BuilderWithTolerate.BuilderWithTolerateBuilder(value=" + this.value) + ")"); } } @@ -24,11 +24,11 @@ public @Builder class BuilderWithTolerate { public static void main(String[] args) { BuilderWithTolerate.builder().value("42").build(); } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithTolerate(final int value) { + @java.lang.SuppressWarnings("all") BuilderWithTolerate(final int value) { super(); this.value = value; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithTolerateBuilder builder() { + public static @java.lang.SuppressWarnings("all") BuilderWithTolerateBuilder builder() { return new BuilderWithTolerateBuilder(); } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ClassNamedAfterGetter.java b/test/transform/resource/after-ecj/ClassNamedAfterGetter.java index 79b422cc..fdb6f122 100644 --- a/test/transform/resource/after-ecj/ClassNamedAfterGetter.java +++ b/test/transform/resource/after-ecj/ClassNamedAfterGetter.java @@ -3,7 +3,7 @@ class GetFoo { GetFoo() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getFoo() { + public @java.lang.SuppressWarnings("all") int getFoo() { return this.foo; } } diff --git a/test/transform/resource/after-ecj/CommentsInterspersed.java b/test/transform/resource/after-ecj/CommentsInterspersed.java index 95489d54..d708ad72 100644 --- a/test/transform/resource/after-ecj/CommentsInterspersed.java +++ b/test/transform/resource/after-ecj/CommentsInterspersed.java @@ -6,7 +6,7 @@ public class CommentsInterspersed { super(); } public native void gwtTest(); - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getTest() { + public @java.lang.SuppressWarnings("all") String getTest() { return this.test; } } diff --git a/test/transform/resource/after-ecj/ConflictingStaticConstructorNames.java b/test/transform/resource/after-ecj/ConflictingStaticConstructorNames.java index f9437f0e..0d234d36 100644 --- a/test/transform/resource/after-ecj/ConflictingStaticConstructorNames.java +++ b/test/transform/resource/after-ecj/ConflictingStaticConstructorNames.java @@ -1,5 +1,5 @@ @lombok.Data(staticConstructor = "of") @lombok.NoArgsConstructor class ConflictingStaticConstructorNames { - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof ConflictingStaticConstructorNames))) @@ -9,17 +9,17 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof ConflictingStaticConstructorNames); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { int result = 1; return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return "ConflictingStaticConstructorNames()"; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ConflictingStaticConstructorNames() { + public @java.lang.SuppressWarnings("all") ConflictingStaticConstructorNames() { super(); } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/Constructors.java b/test/transform/resource/after-ecj/Constructors.java index 4cc24a81..8f8ee129 100644 --- a/test/transform/resource/after-ecj/Constructors.java +++ b/test/transform/resource/after-ecj/Constructors.java @@ -1,7 +1,7 @@ @lombok.RequiredArgsConstructor class RequiredArgsConstructor1 { final int x; String name; - public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") RequiredArgsConstructor1(final int x) { + public @java.lang.SuppressWarnings("all") RequiredArgsConstructor1(final int x) { super(); this.x = x; } @@ -9,7 +9,7 @@ @lombok.RequiredArgsConstructor(access = lombok.AccessLevel.PROTECTED) class RequiredArgsConstructorAccess { final int x; String name; - protected @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") RequiredArgsConstructorAccess(final int x) { + protected @java.lang.SuppressWarnings("all") RequiredArgsConstructorAccess(final int x) { super(); this.x = x; } @@ -17,18 +17,18 @@ @lombok.RequiredArgsConstructor(staticName = "staticname") class RequiredArgsConstructorStaticName { final int x; String name; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") RequiredArgsConstructorStaticName(final int x) { + private @java.lang.SuppressWarnings("all") RequiredArgsConstructorStaticName(final int x) { super(); this.x = x; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") RequiredArgsConstructorStaticName staticname(final int x) { + public static @java.lang.SuppressWarnings("all") RequiredArgsConstructorStaticName staticname(final int x) { return new RequiredArgsConstructorStaticName(x); } } @lombok.RequiredArgsConstructor() class RequiredArgsConstructorWithAnnotations { final int x; String name; - public @Deprecated @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") RequiredArgsConstructorWithAnnotations(final int x) { + public @Deprecated @java.lang.SuppressWarnings("all") RequiredArgsConstructorWithAnnotations(final int x) { super(); this.x = x; } @@ -36,7 +36,7 @@ @lombok.AllArgsConstructor class AllArgsConstructor1 { final int x; String name; - public @java.beans.ConstructorProperties({"x", "name"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") AllArgsConstructor1(final int x, final String name) { + public @java.lang.SuppressWarnings("all") AllArgsConstructor1(final int x, final String name) { super(); this.x = x; this.name = name; @@ -45,35 +45,35 @@ @lombok.NoArgsConstructor class NoArgsConstructor1 { int x; String name; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") NoArgsConstructor1() { + public @java.lang.SuppressWarnings("all") NoArgsConstructor1() { super(); } } @lombok.RequiredArgsConstructor(staticName = "of") class RequiredArgsConstructorStaticNameGenerics<T extends Number> { final T x; String name; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") RequiredArgsConstructorStaticNameGenerics(final T x) { + private @java.lang.SuppressWarnings("all") RequiredArgsConstructorStaticNameGenerics(final T x) { super(); this.x = x; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <T extends Number>RequiredArgsConstructorStaticNameGenerics<T> of(final T x) { + public static @java.lang.SuppressWarnings("all") <T extends Number>RequiredArgsConstructorStaticNameGenerics<T> of(final T x) { return new RequiredArgsConstructorStaticNameGenerics<T>(x); } } @lombok.RequiredArgsConstructor(staticName = "of") class RequiredArgsConstructorStaticNameGenerics2<T extends Number> { final Class<T> x; String name; - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") RequiredArgsConstructorStaticNameGenerics2(final Class<T> x) { + private @java.lang.SuppressWarnings("all") RequiredArgsConstructorStaticNameGenerics2(final Class<T> x) { super(); this.x = x; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <T extends Number>RequiredArgsConstructorStaticNameGenerics2<T> of(final Class<T> x) { + public static @java.lang.SuppressWarnings("all") <T extends Number>RequiredArgsConstructorStaticNameGenerics2<T> of(final Class<T> x) { return new RequiredArgsConstructorStaticNameGenerics2<T>(x); } } @lombok.AllArgsConstructor(access = lombok.AccessLevel.PACKAGE) class AllArgsConstructorPackageAccess { final String x; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") AllArgsConstructorPackageAccess(final String x) { + @java.lang.SuppressWarnings("all") AllArgsConstructorPackageAccess(final String x) { super(); this.x = x; } @@ -86,7 +86,7 @@ final float f; final String s; byte z; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") NoArgsConstructor2() { + public @java.lang.SuppressWarnings("all") NoArgsConstructor2() { super(); this.x = 0; this.y = 0D; diff --git a/test/transform/resource/after-ecj/ConstructorsConfiguration.java b/test/transform/resource/after-ecj/ConstructorsConfiguration.java index 3ca13844..2e88a59f 100644 --- a/test/transform/resource/after-ecj/ConstructorsConfiguration.java +++ b/test/transform/resource/after-ecj/ConstructorsConfiguration.java @@ -1,6 +1,6 @@ @lombok.AllArgsConstructor class ConstructorsConfiguration { int x; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ConstructorsConfiguration(final int x) { + public @java.lang.SuppressWarnings("all") ConstructorsConfiguration(final int x) { super(); this.x = x; } diff --git a/test/transform/resource/after-ecj/ConstructorsWithAccessors.java b/test/transform/resource/after-ecj/ConstructorsWithAccessors.java index 7c691b42..301e6132 100644 --- a/test/transform/resource/after-ecj/ConstructorsWithAccessors.java +++ b/test/transform/resource/after-ecj/ConstructorsWithAccessors.java @@ -3,7 +3,7 @@ int pUpper; int _huh; int __huh2; - public @java.beans.ConstructorProperties({"plower", "upper", "huh", "_huh2"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ConstructorsWithAccessors(final int plower, final int upper, final int huh, final int _huh2) { + public @java.lang.SuppressWarnings("all") ConstructorsWithAccessors(final int plower, final int upper, final int huh, final int _huh2) { super(); this.plower = plower; this.pUpper = upper; @@ -11,3 +11,32 @@ this.__huh2 = _huh2; } } +@lombok.AllArgsConstructor @lombok.experimental.Accessors(prefix = {"p", "_"}) class ConstructorsWithAccessorsNonNull { + @lombok.NonNull Integer plower; + @lombok.NonNull Integer pUpper; + @lombok.NonNull Integer _huh; + final @lombok.NonNull Integer __huh2; + public @java.lang.SuppressWarnings("all") ConstructorsWithAccessorsNonNull(final @lombok.NonNull Integer plower, final @lombok.NonNull Integer upper, final @lombok.NonNull Integer huh, final @lombok.NonNull Integer _huh2) { + super(); + if ((plower == null)) + { + throw new java.lang.NullPointerException("plower"); + } + if ((upper == null)) + { + throw new java.lang.NullPointerException("upper"); + } + if ((huh == null)) + { + throw new java.lang.NullPointerException("huh"); + } + if ((_huh2 == null)) + { + throw new java.lang.NullPointerException("_huh2"); + } + this.plower = plower; + this.pUpper = upper; + this._huh = huh; + this.__huh2 = _huh2; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/DataConfiguration.java b/test/transform/resource/after-ecj/DataConfiguration.java index 4ca1f093..1e7adfbf 100644 --- a/test/transform/resource/after-ecj/DataConfiguration.java +++ b/test/transform/resource/after-ecj/DataConfiguration.java @@ -1,9 +1,9 @@ @lombok.Data class DataConfiguration { final int x; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof DataConfiguration))) @@ -11,23 +11,23 @@ final DataConfiguration other = (DataConfiguration) o; if ((! other.canEqual((java.lang.Object) this))) return false; - if ((this.getX() != other.getX())) + if ((this.x != other.x)) return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof DataConfiguration); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; - result = ((result * PRIME) + this.getX()); + result = ((result * PRIME) + this.x); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { - return (("DataConfiguration(x=" + this.getX()) + ")"); + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (("DataConfiguration(x=" + this.x) + ")"); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") DataConfiguration(final int x) { + public @java.lang.SuppressWarnings("all") DataConfiguration(final int x) { super(); this.x = x; } diff --git a/test/transform/resource/after-ecj/DataExtended.java b/test/transform/resource/after-ecj/DataExtended.java index 46446a0f..3250421f 100644 --- a/test/transform/resource/after-ecj/DataExtended.java +++ b/test/transform/resource/after-ecj/DataExtended.java @@ -1,12 +1,12 @@ @lombok.Data @lombok.ToString(doNotUseGetters = true) class DataExtended { int x; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setX(final int x) { + public @java.lang.SuppressWarnings("all") void setX(final int x) { this.x = x; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof DataExtended))) @@ -18,19 +18,19 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof DataExtended); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); return result; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") DataExtended() { + public @java.lang.SuppressWarnings("all") DataExtended() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("DataExtended(x=" + this.x) + ")"); } } diff --git a/test/transform/resource/after-ecj/DataIgnore.java b/test/transform/resource/after-ecj/DataIgnore.java index dbf9713f..d3ac8aa3 100644 --- a/test/transform/resource/after-ecj/DataIgnore.java +++ b/test/transform/resource/after-ecj/DataIgnore.java @@ -1,10 +1,10 @@ @lombok.Data class DataIgnore { final int x; String $name; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof DataIgnore))) @@ -16,19 +16,19 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof DataIgnore); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("DataIgnore(x=" + this.getX()) + ")"); } - public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") DataIgnore(final int x) { + public @java.lang.SuppressWarnings("all") DataIgnore(final int x) { super(); this.x = x; } diff --git a/test/transform/resource/after-ecj/DataOnEnum.java b/test/transform/resource/after-ecj/DataOnEnum.java index 917a840b..0f07088e 100644 --- a/test/transform/resource/after-ecj/DataOnEnum.java +++ b/test/transform/resource/after-ecj/DataOnEnum.java @@ -3,13 +3,13 @@ public @lombok.Getter @lombok.ToString @lombok.RequiredArgsConstructor enum Data private final String someField; <clinit>() { } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getSomeField() { + public @java.lang.SuppressWarnings("all") String getSomeField() { return this.someField; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("DataOnEnum(someField=" + this.getSomeField()) + ")"); } - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") DataOnEnum(final String someField) { + private @java.lang.SuppressWarnings("all") DataOnEnum(final String someField) { super(); this.someField = someField; } diff --git a/test/transform/resource/after-ecj/DataOnLocalClass.java b/test/transform/resource/after-ecj/DataOnLocalClass.java index a86837e3..341df49b 100644 --- a/test/transform/resource/after-ecj/DataOnLocalClass.java +++ b/test/transform/resource/after-ecj/DataOnLocalClass.java @@ -7,16 +7,16 @@ class DataOnLocalClass1 { @Data class Local { final int x; String name; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getName() { + public @java.lang.SuppressWarnings("all") String getName() { return this.name; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setName(final String name) { + public @java.lang.SuppressWarnings("all") void setName(final String name) { this.name = name; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof Local))) @@ -32,10 +32,10 @@ class DataOnLocalClass1 { return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Local); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); @@ -43,10 +43,10 @@ class DataOnLocalClass1 { result = ((result * PRIME) + (($name == null) ? 43 : $name.hashCode())); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("Local(x=" + this.getX()) + ", name=") + this.getName()) + ")"); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Local(final int x) { + public @java.lang.SuppressWarnings("all") Local(final int x) { super(); this.x = x; } @@ -58,17 +58,17 @@ class DataOnLocalClass2 { @Data class Local { @Data class InnerLocal { @lombok.NonNull String name; - public @lombok.NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getName() { + public @lombok.NonNull @java.lang.SuppressWarnings("all") String getName() { return this.name; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setName(final @lombok.NonNull String name) { + public @java.lang.SuppressWarnings("all") void setName(final @lombok.NonNull String name) { if ((name == null)) { throw new java.lang.NullPointerException("name"); } this.name = name; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof Local.InnerLocal))) @@ -82,20 +82,20 @@ class DataOnLocalClass2 { return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Local.InnerLocal); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $name = this.getName(); result = ((result * PRIME) + (($name == null) ? 43 : $name.hashCode())); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("Local.InnerLocal(name=" + this.getName()) + ")"); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") InnerLocal(final @lombok.NonNull String name) { + public @java.lang.SuppressWarnings("all") InnerLocal(final @lombok.NonNull String name) { super(); if ((name == null)) { @@ -105,10 +105,10 @@ class DataOnLocalClass2 { } } final int x; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof Local))) @@ -120,19 +120,19 @@ class DataOnLocalClass2 { return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Local); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("Local(x=" + this.getX()) + ")"); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Local(final int x) { + public @java.lang.SuppressWarnings("all") Local(final int x) { super(); this.x = x; } diff --git a/test/transform/resource/after-ecj/DataPlain.java b/test/transform/resource/after-ecj/DataPlain.java index ba6c75c8..eaeef509 100644 --- a/test/transform/resource/after-ecj/DataPlain.java +++ b/test/transform/resource/after-ecj/DataPlain.java @@ -2,16 +2,16 @@ import lombok.Data; @lombok.Data class Data1 { final int x; String name; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getName() { + public @java.lang.SuppressWarnings("all") String getName() { return this.name; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setName(final String name) { + public @java.lang.SuppressWarnings("all") void setName(final String name) { this.name = name; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof Data1))) @@ -27,10 +27,10 @@ import lombok.Data; return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Data1); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); @@ -38,10 +38,10 @@ import lombok.Data; result = ((result * PRIME) + (($name == null) ? 43 : $name.hashCode())); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("Data1(x=" + this.getX()) + ", name=") + this.getName()) + ")"); } - public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Data1(final int x) { + public @java.lang.SuppressWarnings("all") Data1(final int x) { super(); this.x = x; } @@ -49,16 +49,16 @@ import lombok.Data; @Data class Data2 { final int x; String name; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getName() { + public @java.lang.SuppressWarnings("all") String getName() { return this.name; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setName(final String name) { + public @java.lang.SuppressWarnings("all") void setName(final String name) { this.name = name; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof Data2))) @@ -74,10 +74,10 @@ import lombok.Data; return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Data2); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); @@ -85,10 +85,10 @@ import lombok.Data; result = ((result * PRIME) + (($name == null) ? 43 : $name.hashCode())); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("Data2(x=" + this.getX()) + ", name=") + this.getName()) + ")"); } - public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Data2(final int x) { + public @java.lang.SuppressWarnings("all") Data2(final int x) { super(); this.x = x; } @@ -96,16 +96,16 @@ import lombok.Data; final @Data class Data3 { final int x; String name; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getName() { + public @java.lang.SuppressWarnings("all") String getName() { return this.name; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setName(final String name) { + public @java.lang.SuppressWarnings("all") void setName(final String name) { this.name = name; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof Data3))) @@ -119,7 +119,7 @@ final @Data class Data3 { return false; return true; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); @@ -127,10 +127,10 @@ final @Data class Data3 { result = ((result * PRIME) + (($name == null) ? 43 : $name.hashCode())); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("Data3(x=" + this.getX()) + ", name=") + this.getName()) + ")"); } - public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Data3(final int x) { + public @java.lang.SuppressWarnings("all") Data3(final int x) { super(); this.x = x; } @@ -140,16 +140,16 @@ final @Data @lombok.EqualsAndHashCode(callSuper = true) class Data4 extends java Data4() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setX(final int x) { + public @java.lang.SuppressWarnings("all") void setX(final int x) { this.x = x; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("Data4(x=" + this.getX()) + ")"); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof Data4))) @@ -163,19 +163,18 @@ final @Data @lombok.EqualsAndHashCode(callSuper = true) class Data4 extends java return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Data4); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; - int result = 1; - result = ((result * PRIME) + super.hashCode()); + int result = super.hashCode(); result = ((result * PRIME) + this.getX()); return result; } } @Data class Data5 { - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof Data5))) @@ -185,36 +184,36 @@ final @Data @lombok.EqualsAndHashCode(callSuper = true) class Data4 extends java return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Data5); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { int result = 1; return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return "Data5()"; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Data5() { + public @java.lang.SuppressWarnings("all") Data5() { super(); } } final @Data class Data6 { - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof Data6))) return false; return true; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { int result = 1; return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return "Data6()"; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Data6() { + public @java.lang.SuppressWarnings("all") Data6() { super(); } } diff --git a/test/transform/resource/after-ecj/DataWithGetter.java b/test/transform/resource/after-ecj/DataWithGetter.java index 5a358c89..fa291eca 100644 --- a/test/transform/resource/after-ecj/DataWithGetter.java +++ b/test/transform/resource/after-ecj/DataWithGetter.java @@ -2,13 +2,13 @@ private int x; private int y; private final String z; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setX(final int x) { + public @java.lang.SuppressWarnings("all") void setX(final int x) { this.x = x; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setY(final int y) { + public @java.lang.SuppressWarnings("all") void setY(final int y) { this.y = y; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof DataWithGetter))) @@ -26,10 +26,10 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof DataWithGetter); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); @@ -38,20 +38,20 @@ result = ((result * PRIME) + (($z == null) ? 43 : $z.hashCode())); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((("DataWithGetter(x=" + this.getX()) + ", y=") + this.getY()) + ", z=") + this.getZ()) + ")"); } - public @java.beans.ConstructorProperties({"z"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") DataWithGetter(final String z) { + public @java.lang.SuppressWarnings("all") DataWithGetter(final String z) { super(); this.z = z; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getY() { + public @java.lang.SuppressWarnings("all") int getY() { return this.y; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getZ() { + public @java.lang.SuppressWarnings("all") String getZ() { return this.z; } } diff --git a/test/transform/resource/after-ecj/DataWithGetterNone.java b/test/transform/resource/after-ecj/DataWithGetterNone.java index b03ce146..4545dc46 100644 --- a/test/transform/resource/after-ecj/DataWithGetterNone.java +++ b/test/transform/resource/after-ecj/DataWithGetterNone.java @@ -2,13 +2,13 @@ private int x; private int y; private final String z; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setX(final int x) { + public @java.lang.SuppressWarnings("all") void setX(final int x) { this.x = x; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setY(final int y) { + public @java.lang.SuppressWarnings("all") void setY(final int y) { this.y = y; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof DataWithGetterNone))) @@ -26,10 +26,10 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof DataWithGetterNone); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); @@ -38,10 +38,10 @@ result = ((result * PRIME) + (($z == null) ? 43 : $z.hashCode())); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((((("DataWithGetterNone(x=" + this.x) + ", y=") + this.y) + ", z=") + this.z) + ")"); } - public @java.beans.ConstructorProperties({"z"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") DataWithGetterNone(final String z) { + public @java.lang.SuppressWarnings("all") DataWithGetterNone(final String z) { super(); this.z = z; } diff --git a/test/transform/resource/after-ecj/DelegateOnGetter.java b/test/transform/resource/after-ecj/DelegateOnGetter.java index 06b57ceb..59f6a3b8 100644 --- a/test/transform/resource/after-ecj/DelegateOnGetter.java +++ b/test/transform/resource/after-ecj/DelegateOnGetter.java @@ -9,7 +9,7 @@ class DelegateOnGetter { DelegateOnGetter() { super(); } - public @Delegate @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Bar getBar() { + public @Delegate @java.lang.SuppressWarnings("all") Bar getBar() { java.lang.Object value = this.bar.get(); if ((value == null)) { @@ -35,10 +35,10 @@ class DelegateOnGetter { } return (Bar) ((value == this.bar) ? null : value); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getInt() { + public @java.lang.SuppressWarnings("all") int getInt() { return this.getBar().getInt(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setList(final java.util.ArrayList<java.lang.String> list) { + public @java.lang.SuppressWarnings("all") void setList(final java.util.ArrayList<java.lang.String> list) { this.getBar().setList(list); } } diff --git a/test/transform/resource/after-ecj/DelegateOnGetterNone.java b/test/transform/resource/after-ecj/DelegateOnGetterNone.java index 2018e1e9..0cfb02c0 100644 --- a/test/transform/resource/after-ecj/DelegateOnGetterNone.java +++ b/test/transform/resource/after-ecj/DelegateOnGetterNone.java @@ -10,10 +10,10 @@ import lombok.Getter; DelegateOnGetterNone() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getInt() { + public @java.lang.SuppressWarnings("all") int getInt() { return this.bar.getInt(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setList(final java.util.ArrayList<java.lang.String> list) { + public @java.lang.SuppressWarnings("all") void setList(final java.util.ArrayList<java.lang.String> list) { this.bar.setList(list); } } diff --git a/test/transform/resource/after-ecj/DelegateOnMethods.java b/test/transform/resource/after-ecj/DelegateOnMethods.java index 3e833ebb..6560657c 100644 --- a/test/transform/resource/after-ecj/DelegateOnMethods.java +++ b/test/transform/resource/after-ecj/DelegateOnMethods.java @@ -7,7 +7,7 @@ abstract class DelegateOnMethods { super(); } public abstract @Delegate Bar getBar(); - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void bar(final java.util.ArrayList<java.lang.String> list) { + public @java.lang.SuppressWarnings("all") void bar(final java.util.ArrayList<java.lang.String> list) { this.getBar().bar(list); } } diff --git a/test/transform/resource/after-ecj/DelegateTypesAndExcludes.java b/test/transform/resource/after-ecj/DelegateTypesAndExcludes.java index 3718c5d9..86f54139 100644 --- a/test/transform/resource/after-ecj/DelegateTypesAndExcludes.java +++ b/test/transform/resource/after-ecj/DelegateTypesAndExcludes.java @@ -27,10 +27,10 @@ class DelegatePlain { DelegatePlain() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void bar(final java.util.ArrayList<java.lang.String> list) { + public @java.lang.SuppressWarnings("all") void bar(final java.util.ArrayList<java.lang.String> list) { this.bar.bar(list); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void foo() { + public @java.lang.SuppressWarnings("all") void foo() { this.foo.foo(); } } diff --git a/test/transform/resource/after-ecj/DelegateWithDeprecated.java b/test/transform/resource/after-ecj/DelegateWithDeprecated.java index ab3aa188..71eb7889 100644 --- a/test/transform/resource/after-ecj/DelegateWithDeprecated.java +++ b/test/transform/resource/after-ecj/DelegateWithDeprecated.java @@ -9,13 +9,13 @@ class DelegateWithDeprecated { DelegateWithDeprecated() { super(); } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void deprecatedAnnotation() { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void deprecatedAnnotation() { this.bar.deprecatedAnnotation(); } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void deprecatedComment() { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void deprecatedComment() { this.bar.deprecatedComment(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void notDeprecated() { + public @java.lang.SuppressWarnings("all") void notDeprecated() { this.bar.notDeprecated(); } } diff --git a/test/transform/resource/after-ecj/DelegateWithVarargs.java b/test/transform/resource/after-ecj/DelegateWithVarargs.java index a0b5b7b5..71a0ca5a 100644 --- a/test/transform/resource/after-ecj/DelegateWithVarargs.java +++ b/test/transform/resource/after-ecj/DelegateWithVarargs.java @@ -10,16 +10,16 @@ class DelegateWithVarargs { DelegateWithVarargs() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void array(final int[] array) { + public @java.lang.SuppressWarnings("all") void array(final int[] array) { this.bar.array(array); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void arrayVarargs(final int[]... arrayVarargs) { + public @java.lang.SuppressWarnings("all") void arrayVarargs(final int[]... arrayVarargs) { this.bar.arrayVarargs(arrayVarargs); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void justOneParameter(final int... varargs) { + public @java.lang.SuppressWarnings("all") void justOneParameter(final int... varargs) { this.bar.justOneParameter(varargs); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void multipleParameters(final java.lang.String first, final int... varargs) { + public @java.lang.SuppressWarnings("all") void multipleParameters(final java.lang.String first, final int... varargs) { this.bar.multipleParameters(first, varargs); } } diff --git a/test/transform/resource/after-ecj/EqualsAndHashCode.java b/test/transform/resource/after-ecj/EqualsAndHashCode.java index c0bb5bbb..8baa61f2 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCode.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCode.java @@ -7,7 +7,7 @@ EqualsAndHashCode() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCode))) @@ -31,10 +31,10 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCode); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); @@ -56,7 +56,7 @@ final @lombok.EqualsAndHashCode class EqualsAndHashCode2 { EqualsAndHashCode2() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCode2))) @@ -74,7 +74,7 @@ final @lombok.EqualsAndHashCode class EqualsAndHashCode2 { return false; return true; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); @@ -91,7 +91,7 @@ final @lombok.EqualsAndHashCode(callSuper = false) class EqualsAndHashCode3 exte EqualsAndHashCode3() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCode3))) @@ -101,10 +101,10 @@ final @lombok.EqualsAndHashCode(callSuper = false) class EqualsAndHashCode3 exte return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCode3); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { int result = 1; return result; } @@ -113,7 +113,7 @@ final @lombok.EqualsAndHashCode(callSuper = false) class EqualsAndHashCode3 exte EqualsAndHashCode4() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCode4))) @@ -125,13 +125,11 @@ final @lombok.EqualsAndHashCode(callSuper = false) class EqualsAndHashCode3 exte return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCode4); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { - final int PRIME = 59; - int result = 1; - result = ((result * PRIME) + super.hashCode()); + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + int result = super.hashCode(); return result; } } diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeConfigKeys1.java b/test/transform/resource/after-ecj/EqualsAndHashCodeConfigKeys1.java index d2c7b201..1561962c 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCodeConfigKeys1.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeConfigKeys1.java @@ -2,7 +2,7 @@ EqualsAndHashCodeConfigKeys1Parent() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCodeConfigKeys1Parent))) @@ -12,10 +12,10 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCodeConfigKeys1Parent); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { int result = 1; return result; } @@ -25,7 +25,7 @@ EqualsAndHashCodeConfigKeys1() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCodeConfigKeys1))) @@ -37,10 +37,10 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCodeConfigKeys1); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeConfigKeys2.java b/test/transform/resource/after-ecj/EqualsAndHashCodeConfigKeys2.java index 0b93f980..0245eae0 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCodeConfigKeys2.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeConfigKeys2.java @@ -1,8 +1,30 @@ +@lombok.EqualsAndHashCode class EqualsAndHashCodeConfigKeys2Object extends Object { + EqualsAndHashCodeConfigKeys2Object() { + super(); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof EqualsAndHashCodeConfigKeys2Object))) + return false; + final EqualsAndHashCodeConfigKeys2Object other = (EqualsAndHashCodeConfigKeys2Object) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + return true; + } + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + return (other instanceof EqualsAndHashCodeConfigKeys2Object); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + int result = 1; + return result; + } +} @lombok.EqualsAndHashCode class EqualsAndHashCodeConfigKeys2Parent { EqualsAndHashCodeConfigKeys2Parent() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCodeConfigKeys2Parent))) @@ -12,10 +34,10 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCodeConfigKeys2Parent); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { int result = 1; return result; } @@ -25,7 +47,7 @@ EqualsAndHashCodeConfigKeys2() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCodeConfigKeys2))) @@ -39,13 +61,12 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCodeConfigKeys2); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; - int result = 1; - result = ((result * PRIME) + super.hashCode()); + int result = super.hashCode(); result = ((result * PRIME) + this.x); return result; } diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeNestedShadow.java b/test/transform/resource/after-ecj/EqualsAndHashCodeNestedShadow.java index 5af6e9d8..e08f523d 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCodeNestedShadow.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeNestedShadow.java @@ -6,7 +6,7 @@ interface EqualsAndHashCodeNestedShadow { public Foo() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCodeNestedShadow.Bar.Foo))) @@ -16,10 +16,10 @@ interface EqualsAndHashCodeNestedShadow { return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCodeNestedShadow.Bar.Foo); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { int result = 1; return result; } @@ -33,7 +33,7 @@ interface EqualsAndHashCodeNestedShadow { public Foo() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCodeNestedShadow.Baz.Foo))) @@ -43,10 +43,10 @@ interface EqualsAndHashCodeNestedShadow { return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof EqualsAndHashCodeNestedShadow.Baz.Foo); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { int result = 1; return result; } diff --git a/test/transform/resource/after-ecj/EqualsAndHashcodeOfExclude.java b/test/transform/resource/after-ecj/EqualsAndHashCodeOfAndExclude.java index 283c5430..8e93963a 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashcodeOfExclude.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeOfAndExclude.java @@ -4,7 +4,7 @@ final @lombok.EqualsAndHashCode(of = {"x"}) class EqualsAndHashCodeOf { EqualsAndHashCodeOf() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCodeOf))) @@ -14,7 +14,7 @@ final @lombok.EqualsAndHashCode(of = {"x"}) class EqualsAndHashCodeOf { return false; return true; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); @@ -27,7 +27,7 @@ final @lombok.EqualsAndHashCode(exclude = {"y"}) class EqualsAndHashCodeExclude EqualsAndHashCodeExclude() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCodeExclude))) @@ -37,10 +37,10 @@ final @lombok.EqualsAndHashCode(exclude = {"y"}) class EqualsAndHashCodeExclude return false; return true; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); return result; } -}
\ No newline at end of file +} diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeWithExistingMethods.java b/test/transform/resource/after-ecj/EqualsAndHashCodeWithExistingMethods.java index e4efb336..cc0d6544 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCodeWithExistingMethods.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeWithExistingMethods.java @@ -24,7 +24,7 @@ final @lombok.EqualsAndHashCode(callSuper = true) class EqualsAndHashCodeWithExi private boolean canEqual(Object other) { return true; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCodeWithExistingMethods3))) @@ -38,10 +38,9 @@ final @lombok.EqualsAndHashCode(callSuper = true) class EqualsAndHashCodeWithExi return false; return true; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; - int result = 1; - result = ((result * PRIME) + super.hashCode()); + int result = super.hashCode(); result = ((result * PRIME) + this.x); return result; } diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeWithGenericsOnInners.java b/test/transform/resource/after-ecj/EqualsAndHashCodeWithGenericsOnInners.java new file mode 100644 index 00000000..164d0f15 --- /dev/null +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeWithGenericsOnInners.java @@ -0,0 +1,32 @@ +public class EqualsAndHashCodeWithGenericsOnInners<A> { + @lombok.EqualsAndHashCode class Inner<B> { + int x; + Inner() { + super(); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") 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; + } + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + return (other instanceof EqualsAndHashCodeWithGenericsOnInners.Inner); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 59; + int result = 1; + result = ((result * PRIME) + this.x); + return result; + } + } + public EqualsAndHashCodeWithGenericsOnInners() { + super(); + } +} diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeWithOnParam.java b/test/transform/resource/after-ecj/EqualsAndHashCodeWithOnParam.java index a59d2835..d8af4c77 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCodeWithOnParam.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeWithOnParam.java @@ -10,7 +10,7 @@ EqualsAndHashCodeWithOnParam() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final @Nullable java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final @Nullable java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof EqualsAndHashCodeWithOnParam))) @@ -34,10 +34,10 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final @Nullable java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final @Nullable java.lang.Object other) { return (other instanceof EqualsAndHashCodeWithOnParam); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); diff --git a/test/transform/resource/after-ecj/FieldDefaultsViaConfigAndRequiredArgsConstructor.java b/test/transform/resource/after-ecj/FieldDefaultsViaConfigAndRequiredArgsConstructor.java index 6a727f1d..02def41a 100644 --- a/test/transform/resource/after-ecj/FieldDefaultsViaConfigAndRequiredArgsConstructor.java +++ b/test/transform/resource/after-ecj/FieldDefaultsViaConfigAndRequiredArgsConstructor.java @@ -1,6 +1,6 @@ @lombok.RequiredArgsConstructor class FieldDefaultsViaConfigAndRequiredArgsConstructor { final int x; - public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") FieldDefaultsViaConfigAndRequiredArgsConstructor(final int x) { + public @java.lang.SuppressWarnings("all") FieldDefaultsViaConfigAndRequiredArgsConstructor(final int x) { super(); this.x = x; } diff --git a/test/transform/resource/after-ecj/GenerateSuppressFBWarnings.java b/test/transform/resource/after-ecj/GenerateSuppressFBWarnings.java index 407d41b6..9cd996d5 100644 --- a/test/transform/resource/after-ecj/GenerateSuppressFBWarnings.java +++ b/test/transform/resource/after-ecj/GenerateSuppressFBWarnings.java @@ -3,7 +3,7 @@ class GenerateSuppressFBWarnings { GenerateSuppressFBWarnings() { super(); } - public @java.lang.SuppressWarnings("all") @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code") @javax.annotation.Generated("lombok") int getY() { + public @java.lang.SuppressWarnings("all") @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(justification = "generated code") int getY() { return this.y; } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/GetterAccessLevel.java b/test/transform/resource/after-ecj/GetterAccessLevel.java index 533e05cc..14edfb56 100644 --- a/test/transform/resource/after-ecj/GetterAccessLevel.java +++ b/test/transform/resource/after-ecj/GetterAccessLevel.java @@ -13,31 +13,31 @@ class GetterAccessLevel { GetterAccessLevel() { super(); } - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isPrivate() { + private @java.lang.SuppressWarnings("all") boolean isPrivate() { return this.isPrivate; } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isPackage() { + @java.lang.SuppressWarnings("all") boolean isPackage() { return this.isPackage; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isProtected() { + protected @java.lang.SuppressWarnings("all") boolean isProtected() { return this.isProtected; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isPublic() { + public @java.lang.SuppressWarnings("all") boolean isPublic() { return this.isPublic; } - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getPrivateString() { + private @java.lang.SuppressWarnings("all") String getPrivateString() { return this.privateString; } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getPackageString() { + @java.lang.SuppressWarnings("all") String getPackageString() { return this.packageString; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getProtectedString() { + protected @java.lang.SuppressWarnings("all") String getProtectedString() { return this.protectedString; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getPublicString() { + public @java.lang.SuppressWarnings("all") String getPublicString() { return this.publicString; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getValue() { + public @java.lang.SuppressWarnings("all") String getValue() { return this.value; } } diff --git a/test/transform/resource/after-ecj/GetterAlreadyExists.java b/test/transform/resource/after-ecj/GetterAlreadyExists.java index b0856dce..04f5b81e 100644 --- a/test/transform/resource/after-ecj/GetterAlreadyExists.java +++ b/test/transform/resource/after-ecj/GetterAlreadyExists.java @@ -6,7 +6,7 @@ class Getter1 { boolean hasFoo() { return true; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isFoo() { + public @java.lang.SuppressWarnings("all") boolean isFoo() { return this.foo; } } @@ -36,7 +36,7 @@ class Getter4 { String hasFoo() { return null; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getFoo() { + public @java.lang.SuppressWarnings("all") String getFoo() { return this.foo; } } @@ -48,7 +48,7 @@ class Getter5 { String isFoo() { return null; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getFoo() { + public @java.lang.SuppressWarnings("all") String getFoo() { return this.foo; } } @@ -69,7 +69,7 @@ class Getter7 { boolean hasFoo() { return false; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getFoo() { + public @java.lang.SuppressWarnings("all") String getFoo() { return this.foo; } } @@ -81,7 +81,7 @@ class Getter8 { boolean isFoo() { return false; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getFoo() { + public @java.lang.SuppressWarnings("all") String getFoo() { return this.foo; } } @@ -102,7 +102,7 @@ class Getter10 { static boolean hasFoo() { return false; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isFoo() { + public @java.lang.SuppressWarnings("all") boolean isFoo() { return this.foo; } } @@ -132,7 +132,7 @@ class Getter13 { static boolean hasFoo() { return false; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getFoo() { + public @java.lang.SuppressWarnings("all") String getFoo() { return this.foo; } } @@ -144,7 +144,7 @@ class Getter14 { static boolean isFoo() { return false; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getFoo() { + public @java.lang.SuppressWarnings("all") String getFoo() { return this.foo; } } @@ -165,7 +165,7 @@ class Getter16 { static String hasFoo() { return ""; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getFoo() { + public @java.lang.SuppressWarnings("all") String getFoo() { return this.foo; } } @@ -177,7 +177,7 @@ class Getter17 { static String isFoo() { return ""; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getFoo() { + public @java.lang.SuppressWarnings("all") String getFoo() { return this.foo; } } diff --git a/test/transform/resource/after-ecj/GetterBoolean.java b/test/transform/resource/after-ecj/GetterBoolean.java index a1d1446e..a7dc2e2f 100644 --- a/test/transform/resource/after-ecj/GetterBoolean.java +++ b/test/transform/resource/after-ecj/GetterBoolean.java @@ -5,13 +5,13 @@ class Getter { Getter() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isFoo() { + public @java.lang.SuppressWarnings("all") boolean isFoo() { return this.foo; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isBar() { + public @java.lang.SuppressWarnings("all") boolean isBar() { return this.isBar; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isHasBaz() { + public @java.lang.SuppressWarnings("all") boolean isHasBaz() { return this.hasBaz; } } @@ -23,7 +23,7 @@ class MoreGetter { boolean hasFoo() { return true; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isFoo() { + public @java.lang.SuppressWarnings("all") boolean isFoo() { return this.foo; } } diff --git a/test/transform/resource/after-ecj/GetterDeprecated.java b/test/transform/resource/after-ecj/GetterDeprecated.java index fc7ce561..546f7fb7 100644 --- a/test/transform/resource/after-ecj/GetterDeprecated.java +++ b/test/transform/resource/after-ecj/GetterDeprecated.java @@ -5,10 +5,10 @@ class GetterDeprecated { GetterDeprecated() { super(); } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getAnnotation() { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") int getAnnotation() { return this.annotation; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getJavadoc() { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") int getJavadoc() { return this.javadoc; } } diff --git a/test/transform/resource/after-ecj/GetterEnum.java b/test/transform/resource/after-ecj/GetterEnum.java index 22a5b0fd..fd70ce9e 100644 --- a/test/transform/resource/after-ecj/GetterEnum.java +++ b/test/transform/resource/after-ecj/GetterEnum.java @@ -7,13 +7,13 @@ import lombok.RequiredArgsConstructor; private final @Getter String name; <clinit>() { } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getId() { + public @java.lang.SuppressWarnings("all") int getId() { return this.id; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getName() { + public @java.lang.SuppressWarnings("all") String getName() { return this.name; } - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") GetterEnum(final int id, final String name) { + private @java.lang.SuppressWarnings("all") GetterEnum(final int id, final String name) { super(); this.id = id; this.name = name; diff --git a/test/transform/resource/after-ecj/GetterLazy.java b/test/transform/resource/after-ecj/GetterLazy.java index d1ec507c..8394f58d 100644 --- a/test/transform/resource/after-ecj/GetterLazy.java +++ b/test/transform/resource/after-ecj/GetterLazy.java @@ -8,7 +8,7 @@ class GetterLazy { GetterLazy() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ValueType getFieldName() { + public @java.lang.SuppressWarnings("all") ValueType getFieldName() { java.lang.Object value = this.fieldName.get(); if ((value == null)) { diff --git a/test/transform/resource/after-ecj/GetterLazyBoolean.java b/test/transform/resource/after-ecj/GetterLazyBoolean.java index 0a1d2564..174389e8 100644 --- a/test/transform/resource/after-ecj/GetterLazyBoolean.java +++ b/test/transform/resource/after-ecj/GetterLazyBoolean.java @@ -7,7 +7,7 @@ private static boolean calculateBoolean() { return true; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isBooleanValue() { + public @java.lang.SuppressWarnings("all") boolean isBooleanValue() { java.lang.Object value = this.booleanValue.get(); if ((value == null)) { @@ -24,7 +24,7 @@ } return (java.lang.Boolean) value; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isOtherBooleanValue() { + public @java.lang.SuppressWarnings("all") boolean isOtherBooleanValue() { java.lang.Object value = this.otherBooleanValue.get(); if ((value == null)) { @@ -41,7 +41,7 @@ } return (java.lang.Boolean) value; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof GetterLazyBoolean))) @@ -53,16 +53,16 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof GetterLazyBoolean); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + (this.isBooleanValue() ? 79 : 97)); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("GetterLazyBoolean(booleanValue=" + this.isBooleanValue()) + ")"); } } diff --git a/test/transform/resource/after-ecj/GetterLazyEahcToString.java b/test/transform/resource/after-ecj/GetterLazyEahcToString.java index 40716f8b..e66a9c2e 100644 --- a/test/transform/resource/after-ecj/GetterLazyEahcToString.java +++ b/test/transform/resource/after-ecj/GetterLazyEahcToString.java @@ -4,7 +4,7 @@ GetterLazyEahcToString() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getValue() { + public @java.lang.SuppressWarnings("all") String getValue() { java.lang.Object value = this.value.get(); if ((value == null)) { @@ -21,10 +21,10 @@ } return (String) ((value == this.value) ? null : value); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getValue2() { + public @java.lang.SuppressWarnings("all") String getValue2() { return this.value2; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof GetterLazyEahcToString))) @@ -42,10 +42,10 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof GetterLazyEahcToString); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; final java.lang.Object $value = this.getValue(); @@ -54,7 +54,7 @@ result = ((result * PRIME) + (($value2 == null) ? 43 : $value2.hashCode())); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("GetterLazyEahcToString(value=" + this.getValue()) + ", value2=") + this.value2) + ")"); } } diff --git a/test/transform/resource/after-ecj/GetterLazyInvalid.java b/test/transform/resource/after-ecj/GetterLazyInvalid.java index 8e2bc4f3..da89c333 100644 --- a/test/transform/resource/after-ecj/GetterLazyInvalid.java +++ b/test/transform/resource/after-ecj/GetterLazyInvalid.java @@ -27,7 +27,7 @@ class GetterLazyInvalidNone { GetterLazyInvalidClass() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getFieldName() { + public @java.lang.SuppressWarnings("all") String getFieldName() { return this.fieldName; } } diff --git a/test/transform/resource/after-ecj/GetterLazyNative.java b/test/transform/resource/after-ecj/GetterLazyNative.java index 40fe1c84..db70f2f4 100644 --- a/test/transform/resource/after-ecj/GetterLazyNative.java +++ b/test/transform/resource/after-ecj/GetterLazyNative.java @@ -11,7 +11,7 @@ class GetterLazyNative { GetterLazyNative() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isBooleanField() { + public @java.lang.SuppressWarnings("all") boolean isBooleanField() { java.lang.Object value = this.booleanField.get(); if ((value == null)) { @@ -28,7 +28,7 @@ class GetterLazyNative { } return (java.lang.Boolean) value; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") byte getByteField() { + public @java.lang.SuppressWarnings("all") byte getByteField() { java.lang.Object value = this.byteField.get(); if ((value == null)) { @@ -45,7 +45,7 @@ class GetterLazyNative { } return (java.lang.Byte) value; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") short getShortField() { + public @java.lang.SuppressWarnings("all") short getShortField() { java.lang.Object value = this.shortField.get(); if ((value == null)) { @@ -62,7 +62,7 @@ class GetterLazyNative { } return (java.lang.Short) value; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getIntField() { + public @java.lang.SuppressWarnings("all") int getIntField() { java.lang.Object value = this.intField.get(); if ((value == null)) { @@ -79,7 +79,7 @@ class GetterLazyNative { } return (java.lang.Integer) value; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") long getLongField() { + public @java.lang.SuppressWarnings("all") long getLongField() { java.lang.Object value = this.longField.get(); if ((value == null)) { @@ -96,7 +96,7 @@ class GetterLazyNative { } return (java.lang.Long) value; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") float getFloatField() { + public @java.lang.SuppressWarnings("all") float getFloatField() { java.lang.Object value = this.floatField.get(); if ((value == null)) { @@ -113,7 +113,7 @@ class GetterLazyNative { } return (java.lang.Float) value; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") double getDoubleField() { + public @java.lang.SuppressWarnings("all") double getDoubleField() { java.lang.Object value = this.doubleField.get(); if ((value == null)) { @@ -130,7 +130,7 @@ class GetterLazyNative { } return (java.lang.Double) value; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") char getCharField() { + public @java.lang.SuppressWarnings("all") char getCharField() { java.lang.Object value = this.charField.get(); if ((value == null)) { @@ -147,7 +147,7 @@ class GetterLazyNative { } return (java.lang.Character) value; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int[] getIntArrayField() { + public @java.lang.SuppressWarnings("all") int[] getIntArrayField() { java.lang.Object value = this.intArrayField.get(); if ((value == null)) { diff --git a/test/transform/resource/after-ecj/GetterLazyTransient.java b/test/transform/resource/after-ecj/GetterLazyTransient.java index 9bc0d9ae..3ffd9b69 100644 --- a/test/transform/resource/after-ecj/GetterLazyTransient.java +++ b/test/transform/resource/after-ecj/GetterLazyTransient.java @@ -5,7 +5,7 @@ class GetterLazyTransient { GetterLazyTransient() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getNonTransientField() { + public @java.lang.SuppressWarnings("all") int getNonTransientField() { java.lang.Object value = this.nonTransientField.get(); if ((value == null)) { @@ -22,7 +22,7 @@ class GetterLazyTransient { } return (java.lang.Integer) value; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getNonLazyTransientField() { + public @java.lang.SuppressWarnings("all") int getNonLazyTransientField() { return this.nonLazyTransientField; } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/GetterNone.java b/test/transform/resource/after-ecj/GetterNone.java index e13379e0..f08726d0 100644 --- a/test/transform/resource/after-ecj/GetterNone.java +++ b/test/transform/resource/after-ecj/GetterNone.java @@ -6,7 +6,7 @@ import lombok.Getter; GetterNone() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getI() { + public @java.lang.SuppressWarnings("all") int getI() { return this.i; } } diff --git a/test/transform/resource/after-ecj/GetterOnClass.java b/test/transform/resource/after-ecj/GetterOnClass.java index deb56392..7668c9d3 100644 --- a/test/transform/resource/after-ecj/GetterOnClass.java +++ b/test/transform/resource/after-ecj/GetterOnClass.java @@ -4,7 +4,7 @@ GetterOnClass1() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isPublic() { + public @java.lang.SuppressWarnings("all") boolean isPublic() { return this.isPublic; } } @@ -15,10 +15,10 @@ GetterOnClass2() { super(); } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isPackage() { + @java.lang.SuppressWarnings("all") boolean isPackage() { return this.isPackage; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isProtected() { + protected @java.lang.SuppressWarnings("all") boolean isProtected() { return this.isProtected; } } @@ -28,7 +28,7 @@ GetterOnClass3() { super(); } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isPackage() { + @java.lang.SuppressWarnings("all") boolean isPackage() { return this.isPackage; } } @@ -38,7 +38,7 @@ GetterOnClass4() { super(); } - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isPrivate() { + private @java.lang.SuppressWarnings("all") boolean isPrivate() { return this.isPrivate; } } @@ -48,7 +48,7 @@ GetterOnClass5() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isPublic() { + public @java.lang.SuppressWarnings("all") boolean isPublic() { return this.isPublic; } } @@ -58,10 +58,10 @@ GetterOnClass6() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getCouldBeNull() { + public @java.lang.SuppressWarnings("all") String getCouldBeNull() { return this.couldBeNull; } - public @lombok.NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getNonNull() { + public @lombok.NonNull @java.lang.SuppressWarnings("all") String getNonNull() { return this.nonNull; } } diff --git a/test/transform/resource/after-ecj/GetterOnMethod.java b/test/transform/resource/after-ecj/GetterOnMethod.java index 6b227326..a21f628c 100644 --- a/test/transform/resource/after-ecj/GetterOnMethod.java +++ b/test/transform/resource/after-ecj/GetterOnMethod.java @@ -7,13 +7,13 @@ class GetterOnMethod { GetterOnMethod() { super(); } - public @Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getI() { + public @Deprecated @java.lang.SuppressWarnings("all") int getI() { return this.i; } - public @java.lang.Deprecated @Test @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getJ() { + public @java.lang.Deprecated @Test @java.lang.SuppressWarnings("all") int getJ() { return this.j; } - public @java.lang.Deprecated @Test @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getK() { + public @java.lang.Deprecated @Test @java.lang.SuppressWarnings("all") int getK() { return this.k; } } diff --git a/test/transform/resource/after-ecj/GetterOnMethodErrors.java b/test/transform/resource/after-ecj/GetterOnMethodErrors.java index 7ba02422..16c625b5 100644 --- a/test/transform/resource/after-ecj/GetterOnMethodErrors.java +++ b/test/transform/resource/after-ecj/GetterOnMethodErrors.java @@ -8,7 +8,7 @@ class PlaceFillerToMakeSurePositionIsRelevant { GetterOnMethodErrors() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getTest() { + public @java.lang.SuppressWarnings("all") int getTest() { return this.test; } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/GetterOnMethodErrors2.java b/test/transform/resource/after-ecj/GetterOnMethodErrors2.java index 0dfd4c13..bfaa5dd4 100644 --- a/test/transform/resource/after-ecj/GetterOnMethodErrors2.java +++ b/test/transform/resource/after-ecj/GetterOnMethodErrors2.java @@ -12,28 +12,28 @@ class GetterOnMethodErrors2 { GetterOnMethodErrors2() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getBad1() { + public @java.lang.SuppressWarnings("all") int getBad1() { return this.bad1; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getBad2() { + public @java.lang.SuppressWarnings("all") int getBad2() { return this.bad2; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getBad3() { + public @java.lang.SuppressWarnings("all") int getBad3() { return this.bad3; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getBad4() { + public @java.lang.SuppressWarnings("all") int getBad4() { return this.bad4; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getGood1() { + public @java.lang.SuppressWarnings("all") int getGood1() { return this.good1; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getGood2() { + public @java.lang.SuppressWarnings("all") int getGood2() { return this.good2; } - public @Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getGood3() { + public @Deprecated @java.lang.SuppressWarnings("all") int getGood3() { return this.good3; } - public @Deprecated @Test @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getGood4() { + public @Deprecated @Test @java.lang.SuppressWarnings("all") int getGood4() { return this.good4; } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/GetterOnStatic.java b/test/transform/resource/after-ecj/GetterOnStatic.java index 89b83ed0..ee90b897 100644 --- a/test/transform/resource/after-ecj/GetterOnStatic.java +++ b/test/transform/resource/after-ecj/GetterOnStatic.java @@ -6,10 +6,10 @@ class Getter { Getter() { super(); } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean isFoo() { + public static @java.lang.SuppressWarnings("all") boolean isFoo() { return Getter.foo; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getBar() { + public static @java.lang.SuppressWarnings("all") int getBar() { return Getter.bar; } } diff --git a/test/transform/resource/after-ecj/GetterPlain.java b/test/transform/resource/after-ecj/GetterPlain.java index d3801b62..10f0f9d7 100644 --- a/test/transform/resource/after-ecj/GetterPlain.java +++ b/test/transform/resource/after-ecj/GetterPlain.java @@ -5,10 +5,10 @@ class GetterPlain { GetterPlain() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getI() { + public @java.lang.SuppressWarnings("all") int getI() { return this.i; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getFoo() { + public @java.lang.SuppressWarnings("all") int getFoo() { return this.foo; } } diff --git a/test/transform/resource/after-ecj/GetterSetterJavadoc.java b/test/transform/resource/after-ecj/GetterSetterJavadoc.java index 275b408d..4923fd02 100644 --- a/test/transform/resource/after-ecj/GetterSetterJavadoc.java +++ b/test/transform/resource/after-ecj/GetterSetterJavadoc.java @@ -1,12 +1,12 @@ @lombok.Data class GetterSetterJavadoc1 { private int fieldName; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getFieldName() { + public @java.lang.SuppressWarnings("all") int getFieldName() { return this.fieldName; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setFieldName(final int fieldName) { + public @java.lang.SuppressWarnings("all") void setFieldName(final int fieldName) { this.fieldName = fieldName; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof GetterSetterJavadoc1))) @@ -18,19 +18,19 @@ return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof GetterSetterJavadoc1); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getFieldName()); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("GetterSetterJavadoc1(fieldName=" + this.getFieldName()) + ")"); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") GetterSetterJavadoc1() { + public @java.lang.SuppressWarnings("all") GetterSetterJavadoc1() { super(); } } @@ -39,10 +39,10 @@ class GetterSetterJavadoc2 { GetterSetterJavadoc2() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getFieldName() { + public @java.lang.SuppressWarnings("all") int getFieldName() { return this.fieldName; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setFieldName(final int fieldName) { + public @java.lang.SuppressWarnings("all") void setFieldName(final int fieldName) { this.fieldName = fieldName; } } @@ -51,10 +51,10 @@ class GetterSetterJavadoc3 { GetterSetterJavadoc3() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getFieldName() { + public @java.lang.SuppressWarnings("all") int getFieldName() { return this.fieldName; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setFieldName(final int fieldName) { + public @java.lang.SuppressWarnings("all") void setFieldName(final int fieldName) { this.fieldName = fieldName; } } @@ -63,10 +63,10 @@ class GetterSetterJavadoc3 { GetterSetterJavadoc4() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int fieldName() { + public @java.lang.SuppressWarnings("all") int fieldName() { return this.fieldName; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") GetterSetterJavadoc4 fieldName(final int fieldName) { + public @java.lang.SuppressWarnings("all") GetterSetterJavadoc4 fieldName(final int fieldName) { this.fieldName = fieldName; return this; } @@ -76,10 +76,10 @@ class GetterSetterJavadoc3 { GetterSetterJavadoc5() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int fieldName() { + public @java.lang.SuppressWarnings("all") int fieldName() { return this.fieldName; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") GetterSetterJavadoc5 fieldName(final int fieldName) { + public @java.lang.SuppressWarnings("all") GetterSetterJavadoc5 fieldName(final int fieldName) { this.fieldName = fieldName; return this; } diff --git a/test/transform/resource/after-ecj/GetterWithDollar.java b/test/transform/resource/after-ecj/GetterWithDollar.java index 424635ed..f4bc799c 100644 --- a/test/transform/resource/after-ecj/GetterWithDollar.java +++ b/test/transform/resource/after-ecj/GetterWithDollar.java @@ -3,7 +3,7 @@ class GetterWithDollar1 { GetterWithDollar1() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int get$i() { + public @java.lang.SuppressWarnings("all") int get$i() { return this.$i; } } @@ -13,10 +13,10 @@ class GetterWithDollar2 { GetterWithDollar2() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int get$i() { + public @java.lang.SuppressWarnings("all") int get$i() { return this.$i; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getI() { + public @java.lang.SuppressWarnings("all") int getI() { return this.i; } } diff --git a/test/transform/resource/after-ecj/InnerClass.java b/test/transform/resource/after-ecj/InnerClass.java new file mode 100644 index 00000000..32004225 --- /dev/null +++ b/test/transform/resource/after-ecj/InnerClass.java @@ -0,0 +1,56 @@ +class A { + @lombok.AllArgsConstructor class B { + String s; + public @java.lang.SuppressWarnings("all") B(final String s) { + super(); + this.s = s; + } + } + A() { + super(); + } +} +class C { + final @lombok.Value class D { + private final A a; + A.B test(String s) { + return a.new B(s) { + x(<no type> $anonymous0) { + super($anonymous0); + } +}; + } + public @java.lang.SuppressWarnings("all") A getA() { + return this.a; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof C.D))) + return false; + final C.D other = (C.D) o; + final java.lang.Object this$a = this.getA(); + final java.lang.Object other$a = other.getA(); + if (((this$a == null) ? (other$a != null) : (! this$a.equals(other$a)))) + return false; + return true; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 59; + int result = 1; + final java.lang.Object $a = this.getA(); + result = ((result * PRIME) + (($a == null) ? 43 : $a.hashCode())); + return result; + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (("C.D(a=" + this.getA()) + ")"); + } + public @java.lang.SuppressWarnings("all") D(final A a) { + super(); + this.a = a; + } + } + C() { + super(); + } +} diff --git a/test/transform/resource/after-ecj/MixGetterVal.java b/test/transform/resource/after-ecj/MixGetterVal.java index fbc89a02..d9809703 100644 --- a/test/transform/resource/after-ecj/MixGetterVal.java +++ b/test/transform/resource/after-ecj/MixGetterVal.java @@ -13,7 +13,7 @@ class MixGetterVal { final @val int a = getX(); m(a); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/MultiFieldGetter.java b/test/transform/resource/after-ecj/MultiFieldGetter.java index a608578e..151c61c8 100644 --- a/test/transform/resource/after-ecj/MultiFieldGetter.java +++ b/test/transform/resource/after-ecj/MultiFieldGetter.java @@ -6,10 +6,10 @@ class MultiFieldGetter { MultiFieldGetter() { super(); } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + protected @java.lang.SuppressWarnings("all") int getX() { return this.x; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getY() { + protected @java.lang.SuppressWarnings("all") int getY() { return this.y; } } @@ -19,10 +19,10 @@ class MultiFieldGetter { MultiFieldGetter2() { super(); } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + @java.lang.SuppressWarnings("all") int getX() { return this.x; } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getY() { + @java.lang.SuppressWarnings("all") int getY() { return this.y; } } diff --git a/test/transform/resource/after-ecj/NoArgsConstructorForce.java b/test/transform/resource/after-ecj/NoArgsConstructorForce.java index d0e69b0d..850aa8a5 100644 --- a/test/transform/resource/after-ecj/NoArgsConstructorForce.java +++ b/test/transform/resource/after-ecj/NoArgsConstructorForce.java @@ -3,7 +3,7 @@ public @NoArgsConstructor(force = true) class NoArgsConstructorForce { private final int[] i; private final Object[] o; private final java.util.List<?>[] fullQualifiedList; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") NoArgsConstructorForce() { + public @java.lang.SuppressWarnings("all") NoArgsConstructorForce() { super(); this.i = null; this.o = null; diff --git a/test/transform/resource/after-ecj/NonNullPlain.java b/test/transform/resource/after-ecj/NonNullPlain.java index 592ff4b5..9edb576b 100644 --- a/test/transform/resource/after-ecj/NonNullPlain.java +++ b/test/transform/resource/after-ecj/NonNullPlain.java @@ -5,7 +5,7 @@ import java.lang.annotation.*; @lombok.NonNull int i; @lombok.NonNull String s; @NotNull Object o; - public @java.beans.ConstructorProperties({"i", "s"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") NonNullPlain(final @lombok.NonNull int i, final @lombok.NonNull String s) { + public @java.lang.SuppressWarnings("all") NonNullPlain(final @lombok.NonNull int i, final @lombok.NonNull String s) { super(); if ((s == null)) { @@ -14,26 +14,26 @@ import java.lang.annotation.*; this.i = i; this.s = s; } - public @lombok.NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getI() { + public @lombok.NonNull @java.lang.SuppressWarnings("all") int getI() { return this.i; } - public @lombok.NonNull @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getS() { + public @lombok.NonNull @java.lang.SuppressWarnings("all") String getS() { return this.s; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Object getO() { + public @java.lang.SuppressWarnings("all") Object getO() { return this.o; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setI(final @lombok.NonNull int i) { + public @java.lang.SuppressWarnings("all") void setI(final @lombok.NonNull int i) { this.i = i; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setS(final @lombok.NonNull String s) { + public @java.lang.SuppressWarnings("all") void setS(final @lombok.NonNull String s) { if ((s == null)) { throw new java.lang.NullPointerException("s"); } this.s = s; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setO(final Object o) { + public @java.lang.SuppressWarnings("all") void setO(final Object o) { this.o = o; } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/NonNullWithAlternateException.java b/test/transform/resource/after-ecj/NonNullWithAlternateException.java index 1df18538..8a547ecf 100644 --- a/test/transform/resource/after-ecj/NonNullWithAlternateException.java +++ b/test/transform/resource/after-ecj/NonNullWithAlternateException.java @@ -10,7 +10,7 @@ public class NonNullWithAlternateException { } System.out.println(arg); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setTest(final @lombok.NonNull String test) { + public @java.lang.SuppressWarnings("all") void setTest(final @lombok.NonNull String test) { if ((test == null)) { throw new java.lang.IllegalArgumentException("test is null"); diff --git a/test/transform/resource/after-ecj/OnXJava7Style.java b/test/transform/resource/after-ecj/OnXJava7Style.java index 415234d8..67f6e686 100644 --- a/test/transform/resource/after-ecj/OnXJava7Style.java +++ b/test/transform/resource/after-ecj/OnXJava7Style.java @@ -13,19 +13,19 @@ public class OnXJava7Style { public OnXJava7Style() { super(); } - public @Foo @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getA() { + public @Foo @java.lang.SuppressWarnings("all") String getA() { return this.a; } - public @Foo() @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setB(final String b) { + public @Foo() @java.lang.SuppressWarnings("all") void setB(final String b) { this.b = b; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setC(final @Foo("a") String c) { + public @java.lang.SuppressWarnings("all") void setC(final @Foo("a") String c) { this.c = c; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setD(final @Bar(stuff = "b") String d) { + public @java.lang.SuppressWarnings("all") void setD(final @Bar(stuff = "b") String d) { this.d = d; } - public @Foo(value = "c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getE() { + public @Foo(value = "c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") String getE() { return this.e; } } diff --git a/test/transform/resource/after-ecj/OnXJava7StyleOn8.java b/test/transform/resource/after-ecj/OnXJava7StyleOn8.java index da51a5f0..d3adca1c 100644 --- a/test/transform/resource/after-ecj/OnXJava7StyleOn8.java +++ b/test/transform/resource/after-ecj/OnXJava7StyleOn8.java @@ -13,19 +13,19 @@ public class OnXJava7StyleOn8 { public OnXJava7StyleOn8() { super(); } - public @Foo @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getA() { + public @Foo @java.lang.SuppressWarnings("all") String getA() { return this.a; } - public @Foo() @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setB(final String b) { + public @Foo() @java.lang.SuppressWarnings("all") void setB(final String b) { this.b = b; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setC(final @Foo("a") String c) { + public @java.lang.SuppressWarnings("all") void setC(final @Foo("a") String c) { this.c = c; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setD(final @Bar(stuff = "b") String d) { + public @java.lang.SuppressWarnings("all") void setD(final @Bar(stuff = "b") String d) { this.d = d; } - public @Foo(value = "c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getE() { + public @Foo(value = "c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") String getE() { return this.e; } } diff --git a/test/transform/resource/after-ecj/OnXJava8Style.java b/test/transform/resource/after-ecj/OnXJava8Style.java index 0e95a20b..4e39460e 100644 --- a/test/transform/resource/after-ecj/OnXJava8Style.java +++ b/test/transform/resource/after-ecj/OnXJava8Style.java @@ -13,19 +13,19 @@ public class OnXJava8Style { public OnXJava8Style() { super(); } - public @Foo @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getA() { + public @Foo @java.lang.SuppressWarnings("all") String getA() { return this.a; } - public @Foo() @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setB(final String b) { + public @Foo() @java.lang.SuppressWarnings("all") void setB(final String b) { this.b = b; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setC(final @Foo("a") String c) { + public @java.lang.SuppressWarnings("all") void setC(final @Foo("a") String c) { this.c = c; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setD(final @Bar(stuff = "b") String d) { + public @java.lang.SuppressWarnings("all") void setD(final @Bar(stuff = "b") String d) { this.d = d; } - public @Foo(value = "c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getE() { + public @Foo(value = "c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") String getE() { return this.e; } } diff --git a/test/transform/resource/after-ecj/OnXJava8StyleOn7.java b/test/transform/resource/after-ecj/OnXJava8StyleOn7.java index 28afb5a7..fca90ad7 100644 --- a/test/transform/resource/after-ecj/OnXJava8StyleOn7.java +++ b/test/transform/resource/after-ecj/OnXJava8StyleOn7.java @@ -13,19 +13,19 @@ public class OnXJava8StyleOn7 { public OnXJava8StyleOn7() { super(); } - public @Foo @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getA() { + public @Foo @java.lang.SuppressWarnings("all") String getA() { return this.a; } - public @Foo() @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setB(final String b) { + public @Foo() @java.lang.SuppressWarnings("all") void setB(final String b) { this.b = b; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setC(final @Foo("a") String c) { + public @java.lang.SuppressWarnings("all") void setC(final @Foo("a") String c) { this.c = c; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setD(final @Bar(stuff = "b") String d) { + public @java.lang.SuppressWarnings("all") void setD(final @Bar(stuff = "b") String d) { this.d = d; } - public @Foo(value = "c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getE() { + public @Foo(value = "c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") String getE() { return this.e; } } diff --git a/test/transform/resource/after-ecj/SetterAccessLevel.java b/test/transform/resource/after-ecj/SetterAccessLevel.java index db26226f..4c1a0b97 100644 --- a/test/transform/resource/after-ecj/SetterAccessLevel.java +++ b/test/transform/resource/after-ecj/SetterAccessLevel.java @@ -8,19 +8,19 @@ class SetterAccessLevel { SetterAccessLevel() { super(); } - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setPrivate(final boolean isPrivate) { + private @java.lang.SuppressWarnings("all") void setPrivate(final boolean isPrivate) { this.isPrivate = isPrivate; } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setPackage(final boolean isPackage) { + @java.lang.SuppressWarnings("all") void setPackage(final boolean isPackage) { this.isPackage = isPackage; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setProtected(final boolean isProtected) { + protected @java.lang.SuppressWarnings("all") void setProtected(final boolean isProtected) { this.isProtected = isProtected; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setPublic(final boolean isPublic) { + public @java.lang.SuppressWarnings("all") void setPublic(final boolean isPublic) { this.isPublic = isPublic; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setValue(final boolean value) { + public @java.lang.SuppressWarnings("all") void setValue(final boolean value) { this.value = value; } } diff --git a/test/transform/resource/after-ecj/SetterAlreadyExists.java b/test/transform/resource/after-ecj/SetterAlreadyExists.java index 4a4d0c4c..91b011b6 100644 --- a/test/transform/resource/after-ecj/SetterAlreadyExists.java +++ b/test/transform/resource/after-ecj/SetterAlreadyExists.java @@ -37,7 +37,7 @@ class Setter5 { } void setFoo() { } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setFoo(final String foo) { + public @java.lang.SuppressWarnings("all") void setFoo(final String foo) { this.foo = foo; } } @@ -48,7 +48,7 @@ class Setter6 { } void setFoo(String foo, int x) { } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setFoo(final String foo) { + public @java.lang.SuppressWarnings("all") void setFoo(final String foo) { this.foo = foo; } } diff --git a/test/transform/resource/after-ecj/SetterDeprecated.java b/test/transform/resource/after-ecj/SetterDeprecated.java index 91008c96..d76612b7 100644 --- a/test/transform/resource/after-ecj/SetterDeprecated.java +++ b/test/transform/resource/after-ecj/SetterDeprecated.java @@ -5,10 +5,10 @@ class SetterDeprecated { SetterDeprecated() { super(); } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setAnnotation(final int annotation) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void setAnnotation(final int annotation) { this.annotation = annotation; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setJavadoc(final int javadoc) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void setJavadoc(final int javadoc) { this.javadoc = javadoc; } } diff --git a/test/transform/resource/after-ecj/SetterOnClass.java b/test/transform/resource/after-ecj/SetterOnClass.java index 8e6455d3..aa3459bb 100644 --- a/test/transform/resource/after-ecj/SetterOnClass.java +++ b/test/transform/resource/after-ecj/SetterOnClass.java @@ -4,7 +4,7 @@ SetterOnClass1() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setPublic(final boolean isPublic) { + public @java.lang.SuppressWarnings("all") void setPublic(final boolean isPublic) { this.isPublic = isPublic; } } @@ -15,10 +15,10 @@ SetterOnClass2() { super(); } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setPackage(final boolean isPackage) { + @java.lang.SuppressWarnings("all") void setPackage(final boolean isPackage) { this.isPackage = isPackage; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setProtected(final boolean isProtected) { + protected @java.lang.SuppressWarnings("all") void setProtected(final boolean isProtected) { this.isProtected = isProtected; } } @@ -28,7 +28,7 @@ SetterOnClass3() { super(); } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setPackage(final boolean isPackage) { + @java.lang.SuppressWarnings("all") void setPackage(final boolean isPackage) { this.isPackage = isPackage; } } @@ -38,7 +38,7 @@ SetterOnClass4() { super(); } - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setPrivate(final boolean isPrivate) { + private @java.lang.SuppressWarnings("all") void setPrivate(final boolean isPrivate) { this.isPrivate = isPrivate; } } @@ -48,7 +48,7 @@ SetterOnClass5() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setPublic(final boolean isPublic) { + public @java.lang.SuppressWarnings("all") void setPublic(final boolean isPublic) { this.isPublic = isPublic; } } @@ -58,10 +58,10 @@ SetterOnClass6() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setCouldBeNull(final String couldBeNull) { + public @java.lang.SuppressWarnings("all") void setCouldBeNull(final String couldBeNull) { this.couldBeNull = couldBeNull; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setNonNull(final @lombok.NonNull String nonNull) { + public @java.lang.SuppressWarnings("all") void setNonNull(final @lombok.NonNull String nonNull) { if ((nonNull == null)) { throw new java.lang.NullPointerException("nonNull"); diff --git a/test/transform/resource/after-ecj/SetterOnMethod.java b/test/transform/resource/after-ecj/SetterOnMethod.java index 4eaea8e5..8bdff212 100644 --- a/test/transform/resource/after-ecj/SetterOnMethod.java +++ b/test/transform/resource/after-ecj/SetterOnMethod.java @@ -2,10 +2,10 @@ import lombok.Setter; class SetterOnMethod { @lombok.Setter() int i; @lombok.Setter() int j; - public @Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setI(final int i) { + public @Deprecated @java.lang.SuppressWarnings("all") void setI(final int i) { this.i = i; } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setJ(final int j) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void setJ(final int j) { this.j = j; } SetterOnMethod() { @@ -15,10 +15,10 @@ class SetterOnMethod { @lombok.Setter() class SetterOnClassOnMethod { int i; int j; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setI(final int i) { + public @java.lang.SuppressWarnings("all") void setI(final int i) { this.i = i; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setJ(final int j) { + public @java.lang.SuppressWarnings("all") void setJ(final int j) { this.j = j; } SetterOnClassOnMethod() { @@ -28,10 +28,10 @@ class SetterOnMethod { @lombok.Setter() class SetterOnClassAndOnAField { int i; @lombok.Setter() int j; - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setJ(final int j) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void setJ(final int j) { this.j = j; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setI(final int i) { + public @java.lang.SuppressWarnings("all") void setI(final int i) { this.i = i; } SetterOnClassAndOnAField() { diff --git a/test/transform/resource/after-ecj/SetterOnMethodOnParam.java b/test/transform/resource/after-ecj/SetterOnMethodOnParam.java index 28799f42..d4ea9f5d 100644 --- a/test/transform/resource/after-ecj/SetterOnMethodOnParam.java +++ b/test/transform/resource/after-ecj/SetterOnMethodOnParam.java @@ -7,13 +7,13 @@ class SetterOnMethodOnParam { SetterOnMethodOnParam() { super(); } - public @Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setI(final int i) { + public @Deprecated @java.lang.SuppressWarnings("all") void setI(final int i) { this.i = i; } - public @java.lang.Deprecated @Test @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setJ(final @Test int j) { + public @java.lang.Deprecated @Test @java.lang.SuppressWarnings("all") void setJ(final @Test int j) { this.j = j; } - public @java.lang.Deprecated @Test @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setK(final @Test int k) { + public @java.lang.Deprecated @Test @java.lang.SuppressWarnings("all") void setK(final @Test int k) { this.k = k; } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/SetterOnParam.java b/test/transform/resource/after-ecj/SetterOnParam.java index 7c2d1fc6..119c8fc3 100644 --- a/test/transform/resource/after-ecj/SetterOnParam.java +++ b/test/transform/resource/after-ecj/SetterOnParam.java @@ -2,10 +2,10 @@ import lombok.Setter; class SetterOnParam { @lombok.Setter() int i; @lombok.Setter() int j; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setI(final @SuppressWarnings("all") int i) { + public @java.lang.SuppressWarnings("all") void setI(final @SuppressWarnings("all") int i) { this.i = i; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setJ(final @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int j) { + public @java.lang.SuppressWarnings("all") void setJ(final @java.lang.SuppressWarnings("all") int j) { this.j = j; } SetterOnParam() { @@ -15,10 +15,10 @@ class SetterOnParam { @lombok.Setter() class SetterOnClassOnParam { int i; int j; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setI(final int i) { + public @java.lang.SuppressWarnings("all") void setI(final int i) { this.i = i; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setJ(final int j) { + public @java.lang.SuppressWarnings("all") void setJ(final int j) { this.j = j; } SetterOnClassOnParam() { @@ -28,10 +28,10 @@ class SetterOnParam { @lombok.Setter() class SetterOnClassAndOnAFieldParam { int i; @lombok.Setter() int j; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setJ(final @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int j) { + public @java.lang.SuppressWarnings("all") void setJ(final @java.lang.SuppressWarnings("all") int j) { this.j = j; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setI(final int i) { + public @java.lang.SuppressWarnings("all") void setI(final int i) { this.i = i; } SetterOnClassAndOnAFieldParam() { diff --git a/test/transform/resource/after-ecj/SetterOnParamAndOnMethod.java b/test/transform/resource/after-ecj/SetterOnParamAndOnMethod.java index 011b2241..21d22a8f 100644 --- a/test/transform/resource/after-ecj/SetterOnParamAndOnMethod.java +++ b/test/transform/resource/after-ecj/SetterOnParamAndOnMethod.java @@ -1,6 +1,6 @@ class SetterOnParamAndOnMethod { @lombok.Setter() int i; - public @Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setI(final @SuppressWarnings("all") int i) { + public @Deprecated @java.lang.SuppressWarnings("all") void setI(final @SuppressWarnings("all") int i) { this.i = i; } SetterOnParamAndOnMethod() { diff --git a/test/transform/resource/after-ecj/SetterOnStatic.java b/test/transform/resource/after-ecj/SetterOnStatic.java index 1c5b71ae..8a5abdd8 100644 --- a/test/transform/resource/after-ecj/SetterOnStatic.java +++ b/test/transform/resource/after-ecj/SetterOnStatic.java @@ -6,10 +6,10 @@ class Setter { Setter() { super(); } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setFoo(final boolean foo) { + public static @java.lang.SuppressWarnings("all") void setFoo(final boolean foo) { Setter.foo = foo; } - public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setBar(final int bar) { + public static @java.lang.SuppressWarnings("all") void setBar(final int bar) { Setter.bar = bar; } } diff --git a/test/transform/resource/after-ecj/SetterPlain.java b/test/transform/resource/after-ecj/SetterPlain.java index 4f428f0b..a4b40295 100644 --- a/test/transform/resource/after-ecj/SetterPlain.java +++ b/test/transform/resource/after-ecj/SetterPlain.java @@ -5,10 +5,10 @@ class SetterPlain { SetterPlain() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setI(final int i) { + public @java.lang.SuppressWarnings("all") void setI(final int i) { this.i = i; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setFoo(final int foo) { + public @java.lang.SuppressWarnings("all") void setFoo(final int foo) { this.foo = foo; } } diff --git a/test/transform/resource/after-ecj/SetterWithDollar.java b/test/transform/resource/after-ecj/SetterWithDollar.java index e8bd91df..c5bc14f1 100644 --- a/test/transform/resource/after-ecj/SetterWithDollar.java +++ b/test/transform/resource/after-ecj/SetterWithDollar.java @@ -3,7 +3,7 @@ class SetterWithDollar1 { SetterWithDollar1() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void set$i(final int $i) { + public @java.lang.SuppressWarnings("all") void set$i(final int $i) { this.$i = $i; } } @@ -13,10 +13,10 @@ class SetterWithDollar2 { SetterWithDollar2() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void set$i(final int $i) { + public @java.lang.SuppressWarnings("all") void set$i(final int $i) { this.$i = $i; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setI(final int i) { + public @java.lang.SuppressWarnings("all") void setI(final int i) { this.i = i; } } diff --git a/test/transform/resource/after-ecj/SimpleTypeResolution.java b/test/transform/resource/after-ecj/SimpleTypeResolution.java index 736632bc..c413623e 100644 --- a/test/transform/resource/after-ecj/SimpleTypeResolution.java +++ b/test/transform/resource/after-ecj/SimpleTypeResolution.java @@ -7,7 +7,7 @@ class SimpleTypeResolutionSuccess { private @lombok.Getter int x; SimpleTypeResolutionSuccess() { } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } } diff --git a/test/transform/resource/after-ecj/ToStringConfiguration.java b/test/transform/resource/after-ecj/ToStringConfiguration.java index ca36d1b4..8bb99146 100644 --- a/test/transform/resource/after-ecj/ToStringConfiguration.java +++ b/test/transform/resource/after-ecj/ToStringConfiguration.java @@ -5,10 +5,10 @@ import lombok.Getter; ToStringConfiguration() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("ToStringConfiguration(" + this.x) + ")"); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } } @@ -17,7 +17,7 @@ import lombok.Getter; ToStringConfiguration2() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("ToStringConfiguration2(x=" + this.x) + ")"); } } @@ -26,10 +26,10 @@ import lombok.Getter; ToStringConfiguration3() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("ToStringConfiguration3(" + this.getX()) + ")"); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ToStringInner.java b/test/transform/resource/after-ecj/ToStringInner.java index 027ccd0c..a8624823 100644 --- a/test/transform/resource/after-ecj/ToStringInner.java +++ b/test/transform/resource/after-ecj/ToStringInner.java @@ -5,7 +5,7 @@ import lombok.ToString; ToStringInner() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("ToStringOuter.ToStringInner(y=" + this.y) + ")"); } } @@ -14,7 +14,7 @@ import lombok.ToString; ToStringStaticInner() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("ToStringOuter.ToStringStaticInner(y=" + this.y) + ")"); } } @@ -24,7 +24,7 @@ import lombok.ToString; ToStringMoreInner() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("ToStringOuter.ToStringMiddle.ToStringMoreInner(name=" + this.name) + ")"); } } @@ -37,7 +37,7 @@ import lombok.ToString; ToStringOuter() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("ToStringOuter(x=" + this.x) + ", name=") + this.name) + ")"); } } diff --git a/test/transform/resource/after-ecj/ToStringPlain.java b/test/transform/resource/after-ecj/ToStringPlain.java index 939aa78e..7c9b47f5 100644 --- a/test/transform/resource/after-ecj/ToStringPlain.java +++ b/test/transform/resource/after-ecj/ToStringPlain.java @@ -5,7 +5,7 @@ import lombok.ToString; ToString1() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("ToString1(x=" + this.x) + ", name=") + this.name) + ")"); } } @@ -15,7 +15,7 @@ import lombok.ToString; ToString2() { super(); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("ToString2(x=" + this.x) + ", name=") + this.name) + ")"); } } diff --git a/test/transform/resource/after-ecj/Tolerate.java b/test/transform/resource/after-ecj/Tolerate.java index 1c7b1038..1fe5fe4c 100644 --- a/test/transform/resource/after-ecj/Tolerate.java +++ b/test/transform/resource/after-ecj/Tolerate.java @@ -7,10 +7,10 @@ import java.util.regex.Pattern; public @lombok.experimental.Tolerate void setPattern(String pattern) { setPattern(Pattern.compile(pattern)); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setPattern(final Pattern pattern) { + public @java.lang.SuppressWarnings("all") void setPattern(final Pattern pattern) { this.pattern = pattern; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Pattern getPattern() { + public @java.lang.SuppressWarnings("all") Pattern getPattern() { return this.pattern; } } @@ -22,13 +22,13 @@ import java.util.regex.Pattern; public Tolerate2 withPattern(String nameGlob, String extensionGlob) { return withPattern(((nameGlob.replace("*", ".*") + "\\.") + extensionGlob.replace("*", ".*"))); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Pattern getPattern() { + public @java.lang.SuppressWarnings("all") Pattern getPattern() { return this.pattern; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Tolerate2 withPattern(final Pattern pattern) { + public @java.lang.SuppressWarnings("all") Tolerate2 withPattern(final Pattern pattern) { return ((this.pattern == pattern) ? this : new Tolerate2(pattern)); } - public @java.beans.ConstructorProperties({"pattern"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Tolerate2(final Pattern pattern) { + public @java.lang.SuppressWarnings("all") Tolerate2(final Pattern pattern) { super(); this.pattern = pattern; } diff --git a/test/transform/resource/after-ecj/TrickyTypeResolution.java b/test/transform/resource/after-ecj/TrickyTypeResolution.java index 5ea802dc..4553aaba 100644 --- a/test/transform/resource/after-ecj/TrickyTypeResolution.java +++ b/test/transform/resource/after-ecj/TrickyTypeResolution.java @@ -20,7 +20,7 @@ class TrickySuccess { TrickySuccess() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } } diff --git a/test/transform/resource/after-ecj/UtilityClass.java b/test/transform/resource/after-ecj/UtilityClass.java index 81d5d9e6..656c0184 100644 --- a/test/transform/resource/after-ecj/UtilityClass.java +++ b/test/transform/resource/after-ecj/UtilityClass.java @@ -11,7 +11,7 @@ final @lombok.experimental.UtilityClass class UtilityClass { static void someMethod() { System.out.println(); } - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") UtilityClass() { + private @java.lang.SuppressWarnings("all") UtilityClass() { super(); throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); } @@ -22,7 +22,7 @@ class UtilityInner { static int member; <clinit>() { } - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") InnerInnerInner() { + private @java.lang.SuppressWarnings("all") InnerInnerInner() { super(); throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); } @@ -36,7 +36,7 @@ class UtilityInner { static int member; <clinit>() { } - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") InsideEnum() { + private @java.lang.SuppressWarnings("all") InsideEnum() { super(); throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); } @@ -54,7 +54,7 @@ class UtilityInner { static int member; <clinit>() { } - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") InsideInterface() { + private @java.lang.SuppressWarnings("all") InsideInterface() { super(); throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); } diff --git a/test/transform/resource/after-ecj/ValueCallSuper.java b/test/transform/resource/after-ecj/ValueCallSuper.java index ecd4a1ef..0c28b9b6 100644 --- a/test/transform/resource/after-ecj/ValueCallSuper.java +++ b/test/transform/resource/after-ecj/ValueCallSuper.java @@ -4,7 +4,7 @@ class ValueParent { }
}
final @lombok.Value class ValueCallSuper extends ValueParent {
- public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) {
+ public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
if ((o == this))
return true;
if ((! (o instanceof ValueCallSuper)))
@@ -16,19 +16,17 @@ final @lombok.Value class ValueCallSuper extends ValueParent { return false;
return true;
}
- protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) {
+ protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
return (other instanceof ValueCallSuper);
}
- public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() {
- final int PRIME = 59;
- int result = 1;
- result = ((result * PRIME) + super.hashCode());
+ public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
+ int result = super.hashCode();
return result;
}
- public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() {
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return "ValueCallSuper()";
}
- public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ValueCallSuper() {
+ public @java.lang.SuppressWarnings("all") ValueCallSuper() {
super();
}
}
diff --git a/test/transform/resource/after-ecj/ValueExperimental.java b/test/transform/resource/after-ecj/ValueExperimental.java deleted file mode 100644 index 92deb614..00000000 --- a/test/transform/resource/after-ecj/ValueExperimental.java +++ /dev/null @@ -1,39 +0,0 @@ -import lombok.experimental.Value; -final @Value class ValueExperimental1 { - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { - if ((o == this)) - return true; - if ((! (o instanceof ValueExperimental1))) - return false; - return true; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { - int result = 1; - return result; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { - return "ValueExperimental1()"; - } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ValueExperimental1() { - super(); - } -} -final @lombok.experimental.Value class ValueExperimental2 { - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { - if ((o == this)) - return true; - if ((! (o instanceof ValueExperimental2))) - return false; - return true; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { - int result = 1; - return result; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { - return "ValueExperimental2()"; - } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ValueExperimental2() { - super(); - } -}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValueExperimentalStarImport.java b/test/transform/resource/after-ecj/ValueExperimentalStarImport.java deleted file mode 100644 index 5b366e04..00000000 --- a/test/transform/resource/after-ecj/ValueExperimentalStarImport.java +++ /dev/null @@ -1,20 +0,0 @@ -import lombok.experimental.*; -final @Value class ValueExperimentalStarImport { - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { - if ((o == this)) - return true; - if ((! (o instanceof ValueExperimentalStarImport))) - return false; - return true; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { - int result = 1; - return result; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { - return "ValueExperimentalStarImport()"; - } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ValueExperimentalStarImport() { - super(); - } -} diff --git a/test/transform/resource/after-ecj/ValuePlain.java b/test/transform/resource/after-ecj/ValuePlain.java index 6a3265c9..442a63ac 100644 --- a/test/transform/resource/after-ecj/ValuePlain.java +++ b/test/transform/resource/after-ecj/ValuePlain.java @@ -2,13 +2,13 @@ import lombok.Value; final @lombok.Value class Value1 { private final int x; private final String name; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getName() { + public @java.lang.SuppressWarnings("all") String getName() { return this.name; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof Value1))) @@ -22,7 +22,7 @@ final @lombok.Value class Value1 { return false; return true; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); @@ -30,10 +30,10 @@ final @lombok.Value class Value1 { result = ((result * PRIME) + (($name == null) ? 43 : $name.hashCode())); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("Value1(x=" + this.getX()) + ", name=") + this.getName()) + ")"); } - public @java.beans.ConstructorProperties({"x", "name"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Value1(final int x, final String name) { + public @java.lang.SuppressWarnings("all") Value1(final int x, final String name) { super(); this.x = x; this.name = name; @@ -42,13 +42,13 @@ final @lombok.Value class Value1 { @Value @lombok.experimental.NonFinal class Value2 { public final int x; private final String name; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getName() { + public @java.lang.SuppressWarnings("all") String getName() { return this.name; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof Value2))) @@ -64,10 +64,10 @@ final @lombok.Value class Value1 { return false; return true; } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean canEqual(final java.lang.Object other) { + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { return (other instanceof Value2); } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); @@ -75,10 +75,10 @@ final @lombok.Value class Value1 { result = ((result * PRIME) + (($name == null) ? 43 : $name.hashCode())); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("Value2(x=" + this.getX()) + ", name=") + this.getName()) + ")"); } - public @java.beans.ConstructorProperties({"x", "name"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Value2(final int x, final String name) { + public @java.lang.SuppressWarnings("all") Value2(final int x, final String name) { super(); this.x = x; this.name = name; @@ -87,13 +87,13 @@ final @lombok.Value class Value1 { final @Value class Value3 { private @lombok.experimental.NonFinal int x; private final int y; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getX() { + public @java.lang.SuppressWarnings("all") int getX() { return this.x; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getY() { + public @java.lang.SuppressWarnings("all") int getY() { return this.y; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof Value3))) @@ -105,17 +105,17 @@ final @Value class Value3 { return false; return true; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); result = ((result * PRIME) + this.getY()); return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("Value3(x=" + this.getX()) + ", y=") + this.getY()) + ")"); } - public @java.beans.ConstructorProperties({"x", "y"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Value3(final int x, final int y) { + public @java.lang.SuppressWarnings("all") Value3(final int x, final int y) { super(); this.x = x; this.y = y; diff --git a/test/transform/resource/after-ecj/ValueStaticField.java b/test/transform/resource/after-ecj/ValueStaticField.java index 75e337ce..dd116fc7 100644 --- a/test/transform/resource/after-ecj/ValueStaticField.java +++ b/test/transform/resource/after-ecj/ValueStaticField.java @@ -4,21 +4,21 @@ final @Value class ValueStaticField { static String PASSWORD = "Ken sent me"; <clinit>() { } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") boolean equals(final java.lang.Object o) { + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) return true; if ((! (o instanceof ValueStaticField))) return false; return true; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int hashCode() { + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { int result = 1; return result; } - public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return "ValueStaticField()"; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") ValueStaticField() { + public @java.lang.SuppressWarnings("all") ValueStaticField() { super(); } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/VarComplex.java b/test/transform/resource/after-ecj/VarComplex.java index 10c456eb..97a0a177 100644 --- a/test/transform/resource/after-ecj/VarComplex.java +++ b/test/transform/resource/after-ecj/VarComplex.java @@ -1,4 +1,4 @@ -import lombok.experimental.var; +import lombok.var; public class VarComplex { private String field = ""; private static final int CONSTANT = 20; diff --git a/test/transform/resource/after-ecj/VarInFor.java b/test/transform/resource/after-ecj/VarInFor.java index 0192aaed..1799d9b7 100644 --- a/test/transform/resource/after-ecj/VarInFor.java +++ b/test/transform/resource/after-ecj/VarInFor.java @@ -1,4 +1,4 @@ -import lombok.experimental.var; +import lombok.var; public class VarInFor { public VarInFor() { super(); diff --git a/test/transform/resource/after-ecj/VarInForOld.java b/test/transform/resource/after-ecj/VarInForOld.java index 98fedf03..065ea94d 100644 --- a/test/transform/resource/after-ecj/VarInForOld.java +++ b/test/transform/resource/after-ecj/VarInForOld.java @@ -1,4 +1,4 @@ -import lombok.experimental.var; +import lombok.var; public class VarInForOld { public VarInForOld() { super(); diff --git a/test/transform/resource/after-ecj/VarNullInit.java b/test/transform/resource/after-ecj/VarNullInit.java index 3eb2d506..848744cc 100644 --- a/test/transform/resource/after-ecj/VarNullInit.java +++ b/test/transform/resource/after-ecj/VarNullInit.java @@ -1,4 +1,4 @@ -import lombok.experimental.var; +import lombok.var; public class VarNullInit { public VarNullInit() { super(); diff --git a/test/transform/resource/after-ecj/VarWarning.java b/test/transform/resource/after-ecj/VarWarning.java new file mode 100644 index 00000000..4caf90f8 --- /dev/null +++ b/test/transform/resource/after-ecj/VarWarning.java @@ -0,0 +1,10 @@ +import lombok.var; +public class VarWarning { + public VarWarning() { + super(); + } + public void isOkay() { + @var java.lang.String x = "Warning"; + x.toLowerCase(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/WitherAccessLevel.java b/test/transform/resource/after-ecj/WitherAccessLevel.java index 18b896df..09a2e514 100644 --- a/test/transform/resource/after-ecj/WitherAccessLevel.java +++ b/test/transform/resource/after-ecj/WitherAccessLevel.java @@ -9,19 +9,19 @@ class WitherAccessLevel { WitherAccessLevel(boolean isNone, boolean isPrivate, boolean isPackage, boolean isProtected, boolean isPublic, boolean value) { super(); } - private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherAccessLevel withPrivate(final boolean isPrivate) { + private @java.lang.SuppressWarnings("all") WitherAccessLevel withPrivate(final boolean isPrivate) { return ((this.isPrivate == isPrivate) ? this : new WitherAccessLevel(this.isNone, isPrivate, this.isPackage, this.isProtected, this.isPublic, this.value)); } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherAccessLevel withPackage(final boolean isPackage) { + @java.lang.SuppressWarnings("all") WitherAccessLevel withPackage(final boolean isPackage) { return ((this.isPackage == isPackage) ? this : new WitherAccessLevel(this.isNone, this.isPrivate, isPackage, this.isProtected, this.isPublic, this.value)); } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherAccessLevel withProtected(final boolean isProtected) { + protected @java.lang.SuppressWarnings("all") WitherAccessLevel withProtected(final boolean isProtected) { return ((this.isProtected == isProtected) ? this : new WitherAccessLevel(this.isNone, this.isPrivate, this.isPackage, isProtected, this.isPublic, this.value)); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherAccessLevel withPublic(final boolean isPublic) { + public @java.lang.SuppressWarnings("all") WitherAccessLevel withPublic(final boolean isPublic) { return ((this.isPublic == isPublic) ? this : new WitherAccessLevel(this.isNone, this.isPrivate, this.isPackage, this.isProtected, isPublic, this.value)); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherAccessLevel withValue(final boolean value) { + public @java.lang.SuppressWarnings("all") WitherAccessLevel withValue(final boolean value) { return ((this.value == value) ? this : new WitherAccessLevel(this.isNone, this.isPrivate, this.isPackage, this.isProtected, this.isPublic, value)); } } diff --git a/test/transform/resource/after-ecj/WitherAlreadyExists.java b/test/transform/resource/after-ecj/WitherAlreadyExists.java index f0186ca3..ded10755 100644 --- a/test/transform/resource/after-ecj/WitherAlreadyExists.java +++ b/test/transform/resource/after-ecj/WitherAlreadyExists.java @@ -37,7 +37,7 @@ class Wither5 { Wither5(String foo) { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Wither5 withFoo(final String foo) { + public @java.lang.SuppressWarnings("all") Wither5 withFoo(final String foo) { return ((this.foo == foo) ? this : new Wither5(foo)); } } @@ -48,7 +48,7 @@ class Wither6 { Wither6(String foo) { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") Wither6 withFoo(final String foo) { + public @java.lang.SuppressWarnings("all") Wither6 withFoo(final String foo) { return ((this.foo == foo) ? this : new Wither6(foo)); } } diff --git a/test/transform/resource/after-ecj/WitherAndAllArgsConstructor.java b/test/transform/resource/after-ecj/WitherAndAllArgsConstructor.java index 4443085c..10e993e1 100644 --- a/test/transform/resource/after-ecj/WitherAndAllArgsConstructor.java +++ b/test/transform/resource/after-ecj/WitherAndAllArgsConstructor.java @@ -4,13 +4,13 @@ final int x = 10; int y = 20; final int z; - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherAndAllArgsConstructor<T, J, L> withTest(final J test) { + public @java.lang.SuppressWarnings("all") WitherAndAllArgsConstructor<T, J, L> withTest(final J test) { return ((this.test == test) ? this : new WitherAndAllArgsConstructor<T, J, L>(test, this.test2, this.y, this.z)); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherAndAllArgsConstructor<T, J, L> withTest2(final java.util.List<L> test2) { + public @java.lang.SuppressWarnings("all") WitherAndAllArgsConstructor<T, J, L> withTest2(final java.util.List<L> test2) { return ((this.test2 == test2) ? this : new WitherAndAllArgsConstructor<T, J, L>(this.test, test2, this.y, this.z)); } - public @java.beans.ConstructorProperties({"test", "test2", "y", "z"}) @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherAndAllArgsConstructor(final J test, final java.util.List<L> test2, final int y, final int z) { + public @java.lang.SuppressWarnings("all") WitherAndAllArgsConstructor(final J test, final java.util.List<L> test2, final int y, final int z) { super(); this.test = test; this.test2 = test2; diff --git a/test/transform/resource/after-ecj/WitherDeprecated.java b/test/transform/resource/after-ecj/WitherDeprecated.java index 90e5fb88..b57d0d79 100644 --- a/test/transform/resource/after-ecj/WitherDeprecated.java +++ b/test/transform/resource/after-ecj/WitherDeprecated.java @@ -5,10 +5,10 @@ class WitherDeprecated { WitherDeprecated(int annotation, int javadoc) { super(); } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherDeprecated withAnnotation(final int annotation) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") WitherDeprecated withAnnotation(final int annotation) { return ((this.annotation == annotation) ? this : new WitherDeprecated(annotation, this.javadoc)); } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherDeprecated withJavadoc(final int javadoc) { + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") WitherDeprecated withJavadoc(final int javadoc) { return ((this.javadoc == javadoc) ? this : new WitherDeprecated(this.annotation, javadoc)); } } diff --git a/test/transform/resource/after-ecj/WitherOnClass.java b/test/transform/resource/after-ecj/WitherOnClass.java index 1d5414d0..82132e87 100644 --- a/test/transform/resource/after-ecj/WitherOnClass.java +++ b/test/transform/resource/after-ecj/WitherOnClass.java @@ -4,7 +4,7 @@ WitherOnClass1(boolean isNone, boolean isPublic) { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherOnClass1 withPublic(final boolean isPublic) { + public @java.lang.SuppressWarnings("all") WitherOnClass1 withPublic(final boolean isPublic) { return ((this.isPublic == isPublic) ? this : new WitherOnClass1(this.isNone, isPublic)); } } @@ -15,10 +15,10 @@ WitherOnClass2(boolean isNone, boolean isProtected, boolean isPackage) { super(); } - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherOnClass2 withPackage(final boolean isPackage) { + @java.lang.SuppressWarnings("all") WitherOnClass2 withPackage(final boolean isPackage) { return ((this.isPackage == isPackage) ? this : new WitherOnClass2(this.isNone, this.isProtected, isPackage)); } - protected @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherOnClass2 withProtected(final boolean isProtected) { + protected @java.lang.SuppressWarnings("all") WitherOnClass2 withProtected(final boolean isProtected) { return ((this.isProtected == isProtected) ? this : new WitherOnClass2(this.isNone, isProtected, this.isPackage)); } } @@ -28,10 +28,10 @@ WitherOnClass3(String couldBeNull, String nonNull) { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherOnClass3 withCouldBeNull(final String couldBeNull) { + public @java.lang.SuppressWarnings("all") WitherOnClass3 withCouldBeNull(final String couldBeNull) { return ((this.couldBeNull == couldBeNull) ? this : new WitherOnClass3(couldBeNull, this.nonNull)); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherOnClass3 withNonNull(final @lombok.NonNull String nonNull) { + public @java.lang.SuppressWarnings("all") WitherOnClass3 withNonNull(final @lombok.NonNull String nonNull) { if ((nonNull == null)) { throw new java.lang.NullPointerException("nonNull"); @@ -46,7 +46,7 @@ super(); this.fY = y; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherOnClass4 withY(final int fY) { + public @java.lang.SuppressWarnings("all") WitherOnClass4 withY(final int fY) { return ((this.fY == fY) ? this : new WitherOnClass4(fY)); } } diff --git a/test/transform/resource/after-ecj/WitherPlain.java b/test/transform/resource/after-ecj/WitherPlain.java index 52177ef1..ae1988bc 100644 --- a/test/transform/resource/after-ecj/WitherPlain.java +++ b/test/transform/resource/after-ecj/WitherPlain.java @@ -7,10 +7,10 @@ class WitherPlain { this.i = i; this.foo = foo; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherPlain withI(final int i) { + public @java.lang.SuppressWarnings("all") WitherPlain withI(final int i) { return ((this.i == i) ? this : new WitherPlain(i, this.foo)); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherPlain withFoo(final int foo) { + public @java.lang.SuppressWarnings("all") WitherPlain withFoo(final int foo) { return ((this.foo == foo) ? this : new WitherPlain(this.i, foo)); } } diff --git a/test/transform/resource/after-ecj/WitherWithAbstract.java b/test/transform/resource/after-ecj/WitherWithAbstract.java index 90fd6448..ed71347e 100644 --- a/test/transform/resource/after-ecj/WitherWithAbstract.java +++ b/test/transform/resource/after-ecj/WitherWithAbstract.java @@ -3,5 +3,5 @@ abstract class WitherWithAbstract { WitherWithAbstract() { super(); } - public abstract @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherWithAbstract withFoo(final String foo); + public abstract @java.lang.SuppressWarnings("all") WitherWithAbstract withFoo(final String foo); } diff --git a/test/transform/resource/after-ecj/WitherWithGenerics.java b/test/transform/resource/after-ecj/WitherWithGenerics.java index 66d8a8f8..ee73297c 100644 --- a/test/transform/resource/after-ecj/WitherWithGenerics.java +++ b/test/transform/resource/after-ecj/WitherWithGenerics.java @@ -6,13 +6,13 @@ class WitherWithGenerics<T, J extends T, L extends java.lang.Number> { public WitherWithGenerics(J test, java.util.List<L> test2, java.util.List<? extends L> test3) { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherWithGenerics<T, J, L> withTest(final J test) { + public @java.lang.SuppressWarnings("all") WitherWithGenerics<T, J, L> withTest(final J test) { return ((this.test == test) ? this : new WitherWithGenerics<T, J, L>(test, this.test2, this.test3)); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherWithGenerics<T, J, L> withTest2(final java.util.List<L> test2) { + public @java.lang.SuppressWarnings("all") WitherWithGenerics<T, J, L> withTest2(final java.util.List<L> test2) { return ((this.test2 == test2) ? this : new WitherWithGenerics<T, J, L>(this.test, test2, this.test3)); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") WitherWithGenerics<T, J, L> withTest3(final java.util.List<? extends L> test3) { + public @java.lang.SuppressWarnings("all") WitherWithGenerics<T, J, L> withTest3(final java.util.List<? extends L> test3) { return ((this.test3 == test3) ? this : new WitherWithGenerics<T, J, L>(this.test, this.test2, test3)); } } diff --git a/test/transform/resource/before/BuilderChainAndFluent.java b/test/transform/resource/before/BuilderChainAndFluent.java deleted file mode 100644 index 4d08741b..00000000 --- a/test/transform/resource/before/BuilderChainAndFluent.java +++ /dev/null @@ -1,4 +0,0 @@ -@lombok.experimental.Builder(fluent = false, chain = false) -class BuilderChainAndFluent { - private final int yes; -} diff --git a/test/transform/resource/before/BuilderComplex.java b/test/transform/resource/before/BuilderComplex.java index 590a2723..c13f5877 100644 --- a/test/transform/resource/before/BuilderComplex.java +++ b/test/transform/resource/before/BuilderComplex.java @@ -1,5 +1,5 @@ import java.util.List; -import lombok.experimental.Builder; +import lombok.Builder; class BuilderComplex { @Builder(buildMethodName = "execute") diff --git a/test/transform/resource/before/BuilderDefaults.java b/test/transform/resource/before/BuilderDefaults.java new file mode 100644 index 00000000..a1ce14a5 --- /dev/null +++ b/test/transform/resource/before/BuilderDefaults.java @@ -0,0 +1,9 @@ +import lombok.Builder; +import lombok.Value; + +@Value @Builder +public class BuilderDefaults { + @Builder.Default int x = 10; + String name; + @Builder.Default long z = System.currentTimeMillis(); +} diff --git a/test/transform/resource/before/BuilderDefaultsGenerics.java b/test/transform/resource/before/BuilderDefaultsGenerics.java new file mode 100644 index 00000000..fffc9739 --- /dev/null +++ b/test/transform/resource/before/BuilderDefaultsGenerics.java @@ -0,0 +1,9 @@ +import lombok.Builder; +import java.util.*; + +@Builder +public class BuilderDefaultsGenerics<N extends Number, T, R extends List<T>> { + @Builder.Default private java.util.concurrent.Callable<N> callable = null; + @Builder.Default private T tee = null; + @Builder.Default private R arrr = null; +} diff --git a/test/transform/resource/before/BuilderDefaultsWarnings.java b/test/transform/resource/before/BuilderDefaultsWarnings.java new file mode 100644 index 00000000..8ef3dc59 --- /dev/null +++ b/test/transform/resource/before/BuilderDefaultsWarnings.java @@ -0,0 +1,18 @@ +import lombok.Builder; +import lombok.Singular; + +@Builder +public class BuilderDefaultsWarnings { + long x = System.currentTimeMillis(); + final int y = 5; + @Builder.Default int z; + @Builder.Default @Singular java.util.List<String> items; +} + +class NoBuilderButHasDefaults { + @Builder.Default private final long z = 5; + + @Builder + public NoBuilderButHasDefaults() { + } +} diff --git a/test/transform/resource/before/BuilderGenericMethod.java b/test/transform/resource/before/BuilderGenericMethod.java new file mode 100644 index 00000000..63dcb4db --- /dev/null +++ b/test/transform/resource/before/BuilderGenericMethod.java @@ -0,0 +1,11 @@ +import java.util.List; + +import lombok.Builder; +import java.util.*; + +class BuilderGenericMethod<T> { + @Builder + public <N extends Number> Map<N,T> foo(int a, long b) { + return null; + } +} diff --git a/test/transform/resource/before/BuilderWithDeprecated.java b/test/transform/resource/before/BuilderWithDeprecated.java new file mode 100644 index 00000000..cd8ffad9 --- /dev/null +++ b/test/transform/resource/before/BuilderWithDeprecated.java @@ -0,0 +1,11 @@ +import com.google.common.collect.ImmutableList; +import lombok.Builder; +import lombok.Singular; + +@Builder +public class BuilderWithDeprecated { + /** @deprecated */ String dep1; + @Deprecated int dep2; + @Singular @Deprecated java.util.List<String> strings; + @Singular @Deprecated ImmutableList<Integer> numbers; +} diff --git a/test/transform/resource/before/ConstructorsWithAccessors.java b/test/transform/resource/before/ConstructorsWithAccessors.java index e5d2939f..e67a47ce 100644 --- a/test/transform/resource/before/ConstructorsWithAccessors.java +++ b/test/transform/resource/before/ConstructorsWithAccessors.java @@ -4,3 +4,11 @@ int _huh; int __huh2; } + +@lombok.AllArgsConstructor @lombok.experimental.Accessors(prefix={"p", "_"}) class ConstructorsWithAccessorsNonNull { + @lombok.NonNull Integer plower; + @lombok.NonNull Integer pUpper; + @lombok.NonNull Integer _huh; + @lombok.NonNull final Integer __huh2; +} + diff --git a/test/transform/resource/before/DataConfiguration.java b/test/transform/resource/before/DataConfiguration.java index 660d6d18..8b9657f9 100644 --- a/test/transform/resource/before/DataConfiguration.java +++ b/test/transform/resource/before/DataConfiguration.java @@ -1,4 +1,6 @@ //CONF: lombok.anyConstructor.suppressConstructorProperties = true +//CONF: lombok.toString.doNotUseGetters = true +//CONF: lombok.equalsAndHashCode.doNotUseGetters = true @lombok.Data class DataConfiguration { final int x; diff --git a/test/transform/resource/before/EqualsAndHashCodeConfigKeys2.java b/test/transform/resource/before/EqualsAndHashCodeConfigKeys2.java index e3cf5a9c..08698184 100644 --- a/test/transform/resource/before/EqualsAndHashCodeConfigKeys2.java +++ b/test/transform/resource/before/EqualsAndHashCodeConfigKeys2.java @@ -1,5 +1,7 @@ //CONF: lombok.equalsAndHashCode.callSuper = call - +@lombok.EqualsAndHashCode +class EqualsAndHashCodeConfigKeys2Object extends Object { +} @lombok.EqualsAndHashCode class EqualsAndHashCodeConfigKeys2Parent { } diff --git a/test/transform/resource/before/EqualsAndHashCodeOfExclude.java b/test/transform/resource/before/EqualsAndHashCodeOfAndExclude.java index 0625ba52..b8ba21fb 100644 --- a/test/transform/resource/before/EqualsAndHashCodeOfExclude.java +++ b/test/transform/resource/before/EqualsAndHashCodeOfAndExclude.java @@ -8,4 +8,4 @@ final class EqualsAndHashCodeOf { final class EqualsAndHashCodeExclude { int x; int y; -}
\ No newline at end of file +} diff --git a/test/transform/resource/before/EqualsAndHashCodeWithGenericsOnInners.java b/test/transform/resource/before/EqualsAndHashCodeWithGenericsOnInners.java new file mode 100644 index 00000000..7af1d054 --- /dev/null +++ b/test/transform/resource/before/EqualsAndHashCodeWithGenericsOnInners.java @@ -0,0 +1,6 @@ +public class EqualsAndHashCodeWithGenericsOnInners<A> { + @lombok.EqualsAndHashCode class Inner<B> { + int x; + } +} + diff --git a/test/transform/resource/before/GeneratedJavaxOnLombokOn.java b/test/transform/resource/before/GeneratedJavaxOnLombokOn.java index cee391ad..4eb86de1 100644 --- a/test/transform/resource/before/GeneratedJavaxOnLombokOn.java +++ b/test/transform/resource/before/GeneratedJavaxOnLombokOn.java @@ -1,5 +1,6 @@ //CONF: lombok.addJavaxGeneratedAnnotation = true //CONF: lombok.addLombokGeneratedAnnotation = true +//version :8 class GeneratedJavaxOnLombokOn { @lombok.Getter int x; diff --git a/test/transform/resource/before/GeneratedOffJavaxOn.java b/test/transform/resource/before/GeneratedOffJavaxOn.java index a3547913..83c03eac 100644 --- a/test/transform/resource/before/GeneratedOffJavaxOn.java +++ b/test/transform/resource/before/GeneratedOffJavaxOn.java @@ -1,5 +1,6 @@ //CONF: lombok.addGeneratedAnnotation = false //CONF: lombok.addJavaxGeneratedAnnotation = true +//version :8 class GeneratedOffJavaxOn { @lombok.Getter int x; diff --git a/test/transform/resource/before/InnerClass.java b/test/transform/resource/before/InnerClass.java new file mode 100644 index 00000000..ba020686 --- /dev/null +++ b/test/transform/resource/before/InnerClass.java @@ -0,0 +1,17 @@ +class A { + @lombok.AllArgsConstructor + class B { + String s; + } +} + +class C { + @lombok.Value + class D { + A a; + + A.B test(String s) { + return a.new B(s) {}; + } + } +}
\ No newline at end of file diff --git a/test/transform/resource/before/JavadocGenerally.java b/test/transform/resource/before/JavadocGenerally.java index e47de44d..1df93385 100644 --- a/test/transform/resource/before/JavadocGenerally.java +++ b/test/transform/resource/before/JavadocGenerally.java @@ -11,6 +11,9 @@ package testPackage; class JavadocGenerally { /** * Doc on field + * <pre> + * // code + * </pre> */ 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/BuilderDefaultsWarnings.java.messages b/test/transform/resource/messages-delombok/BuilderDefaultsWarnings.java.messages new file mode 100644 index 00000000..694511f8 --- /dev/null +++ b/test/transform/resource/messages-delombok/BuilderDefaultsWarnings.java.messages @@ -0,0 +1,4 @@ +13 @Builder.Default requires @Builder on the class for it to mean anything. +6 @Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. If it is not supposed to be settable during building, make the field final. +8 @Builder.Default requires an initializing expression (' = something;'). +9 @Builder.Default and @Singular cannot be mixed. diff --git a/test/transform/resource/messages-delombok/GetterOnMethodErrors2.java.messages b/test/transform/resource/messages-delombok/GetterOnMethodErrors2.java.messages index 6a181265..3386b565 100644 --- a/test/transform/resource/messages-delombok/GetterOnMethodErrors2.java.messages +++ b/test/transform/resource/messages-delombok/GetterOnMethodErrors2.java.messages @@ -1,4 +1,4 @@ -2 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation}) -3 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation}) -4 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation}) -5 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation}) +3 The correct format is +4 The correct format is +5 The correct format is +6 The correct format is 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/BuilderDefaultsWarnings.java.messages b/test/transform/resource/messages-ecj/BuilderDefaultsWarnings.java.messages new file mode 100644 index 00000000..f64aa5d5 --- /dev/null +++ b/test/transform/resource/messages-ecj/BuilderDefaultsWarnings.java.messages @@ -0,0 +1,5 @@ +6 @Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. If it is not supposed to be settable during building, make the field final. +8 @Builder.Default requires an initializing expression (' = something;'). +9 @Builder.Default and @Singular cannot be mixed. +13 @Builder.Default requires @Builder on the class for it to mean anything. + diff --git a/test/transform/resource/messages-ecj/GetterOnMethodErrors2.java.messages b/test/transform/resource/messages-ecj/GetterOnMethodErrors2.java.messages index 6a181265..3386b565 100644 --- a/test/transform/resource/messages-ecj/GetterOnMethodErrors2.java.messages +++ b/test/transform/resource/messages-ecj/GetterOnMethodErrors2.java.messages @@ -1,4 +1,4 @@ -2 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation}) -3 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation}) -4 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation}) -5 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation}) +3 The correct format is +4 The correct format is +5 The correct format is +6 The correct format is 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/test/transform/resource/messages-idempotent/NonNullPlain.java.messages b/test/transform/resource/messages-idempotent/NonNullPlain.java.messages index 0b520462..3a3a052d 100644 --- a/test/transform/resource/messages-idempotent/NonNullPlain.java.messages +++ b/test/transform/resource/messages-idempotent/NonNullPlain.java.messages @@ -1,3 +1,3 @@ 3 @NonNull is meaningless on a primitive. -16 @NonNull is meaningless on a primitive. -42 @NonNull is meaningless on a primitive.
\ No newline at end of file +14 @NonNull is meaningless on a primitive. +36 @NonNull is meaningless on a primitive. diff --git a/usage_examples/BuilderExample_post.jpage b/usage_examples/BuilderExample_post.jpage index 54b064d7..0b64703c 100644 --- a/usage_examples/BuilderExample_post.jpage +++ b/usage_examples/BuilderExample_post.jpage @@ -1,6 +1,7 @@ import java.util.Set; public class BuilderExample { + private long created; private String name; private int age; private Set<String> occupations; @@ -11,11 +12,17 @@ public class BuilderExample { this.occupations = occupations; } + private static long $default$created() { + return System.currentTimeMillis(); + } + public static BuilderExampleBuilder builder() { return new BuilderExampleBuilder(); } public static class BuilderExampleBuilder { + private long created; + private boolean created$set; private String name; private int age; private java.util.ArrayList<String> occupations; @@ -23,6 +30,12 @@ public class BuilderExample { BuilderExampleBuilder() { } + public BuilderExampleBuilder created(long created) { + this.created = created; + this.created$set = true; + return this; + } + public BuilderExampleBuilder name(String name) { this.name = name; return this; @@ -63,12 +76,12 @@ public class BuilderExample { // complicated switch statement to produce a compact properly sized immutable set omitted. // go to https://projectlombok.org/features/Singular-snippet.html to see it. Set<String> occupations = ...; - return new BuilderExample(name, age, occupations); + return new BuilderExample(created$set ? created : BuilderExample.$default$created(), name, age, occupations); } @java.lang.Override public String toString() { - return "BuilderExample.BuilderExampleBuilder(name = " + this.name + ", age = " + this.age + ", occupations = " + this.occupations + ")"; + return "BuilderExample.BuilderExampleBuilder(created = " + this.created + ", name = " + this.name + ", age = " + this.age + ", occupations = " + this.occupations + ")"; } } }
\ No newline at end of file diff --git a/usage_examples/BuilderExample_pre.jpage b/usage_examples/BuilderExample_pre.jpage index 1557fff4..3b1b0df2 100644 --- a/usage_examples/BuilderExample_pre.jpage +++ b/usage_examples/BuilderExample_pre.jpage @@ -4,6 +4,7 @@ import java.util.Set; @Builder public class BuilderExample { + @Builder.Default private long created = System.currentTimeMillis(); private String name; private int age; @Singular private Set<String> occupations; diff --git a/usage_examples/ToStringExample_pre.jpage b/usage_examples/ToStringExample_pre.jpage index a15fb944..39b25892 100644 --- a/usage_examples/ToStringExample_pre.jpage +++ b/usage_examples/ToStringExample_pre.jpage @@ -9,7 +9,7 @@ public class ToStringExample { private int id; public String getName() { - return this.getName(); + return this.name; } @ToString(callSuper=true, includeFieldNames=true) diff --git a/usage_examples/experimental/WitherExample_post.jpage b/usage_examples/experimental/WitherExample_post.jpage index bb5952af..3447192a 100644 --- a/usage_examples/experimental/WitherExample_post.jpage +++ b/usage_examples/experimental/WitherExample_post.jpage @@ -3,19 +3,19 @@ import lombok.NonNull; public class WitherExample { private final int age; private @NonNull final String name; - + public WitherExample(String name, int age) { if (name == null) throw new NullPointerException(); this.name = name; this.age = age; } - + public WitherExample withAge(int age) { - return this.age == age ? this : new WitherExample(age, name); + return this.age == age ? this : new WitherExample(name, age); } - + protected WitherExample withName(@NonNull String name) { if (name == null) throw new java.lang.NullPointerException("name"); - return this.name == name ? this : new WitherExample(age, name); + return this.name == name ? this : new WitherExample(name, age); } }
\ No newline at end of file diff --git a/usage_examples/experimental/varExample_post.jpage b/usage_examples/experimental/varExample_post.jpage index 41c022d3..d0a7c124 100644 --- a/usage_examples/experimental/varExample_post.jpage +++ b/usage_examples/experimental/varExample_post.jpage @@ -1,7 +1,7 @@ import java.util.ArrayList; import lombok.var; -public class ValExample { +public class VarExample { public String example() { ArrayList<String> example = new ArrayList<String>(); example.add("Hello, World!"); diff --git a/usage_examples/experimental/varExample_pre.jpage b/usage_examples/experimental/varExample_pre.jpage index 0786c0df..e58c4c0d 100644 --- a/usage_examples/experimental/varExample_pre.jpage +++ b/usage_examples/experimental/varExample_pre.jpage @@ -1,7 +1,7 @@ import java.util.ArrayList; import lombok.var; -public class ValExample { +public class VarExample { public String example() { var example = new ArrayList<String>(); example.add("Hello, World!"); diff --git a/website/all-versions.html b/website/all-versions.html deleted file mode 100644 index c597d619..00000000 --- a/website/all-versions.html +++ /dev/null @@ -1,88 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="logi/reset.css" /> - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok - Historic versions</title> - <style type="text/css"> - code { - font-size: 12px; - font-family: monospaced; - } - - #downloadLink { - font-size: 14px; - } - - .meat { - margin: 16px auto 0 auto; - width: 800px; - } - - .backLink { - padding-top: 100px; - width: 100%; - text-align: right; - } - - h1 { - padding-bottom: 0; - margin-bottom: 4px; - } - </style> -</head><body> - <div class="meat download edge"> - <h1>Download older versions of lombok</h1> - <div>See the <a href="changelog.html">changelog</a> for dates and modifications.</div> - <ul> - <li><a href="downloads/lombok-1.16.4.jar">lombok-1.16.4.jar</a></li> - <li><a href="downloads/lombok-1.16.2.jar">lombok-1.16.2.jar</a></li> - <li><a href="downloads/lombok-1.16.0.jar">lombok-1.16.0.jar</a></li> - <li><a href="downloads/lombok-1.14.8.jar">lombok-1.14.8.jar</a></li> - <li><a href="downloads/lombok-1.14.6.jar">lombok-1.14.6.jar</a></li> - <li><a href="downloads/lombok-1.14.4.jar">lombok-1.14.4.jar</a></li> - <li><a href="downloads/lombok-1.14.2.jar">lombok-1.14.2.jar</a></li> - <li><a href="downloads/lombok-1.14.0.jar">lombok-1.14.0.jar</a></li> - <li><a href="downloads/lombok-1.12.6.jar">lombok-1.12.6.jar</a></li> - <li><a href="downloads/lombok-1.12.4.jar">lombok-1.12.4.jar</a></li> - <li><a href="downloads/lombok-1.12.2.jar">lombok-1.12.2.jar</a></li> - <li><a href="downloads/lombok-0.12.0.jar">lombok-0.12.0.jar</a></li> - <li><a href="downloads/lombok-0.11.8.jar">lombok-0.11.8.jar</a></li> - <li><a href="downloads/lombok-0.11.6.jar">lombok-0.11.6.jar</a></li> - <li><a href="downloads/lombok-0.11.4.jar">lombok-0.11.4.jar</a></li> - <li><a href="downloads/lombok-0.11.2.jar">lombok-0.11.2.jar</a></li> - <li><a href="downloads/lombok-0.11.0.jar">lombok-0.11.0.jar</a></li> - <li><a href="downloads/lombok-0.10.8.jar">lombok-0.10.8.jar</a></li> - <li><a href="downloads/lombok-0.10.6.jar">lombok-0.10.6.jar</a></li> - <li><a href="downloads/lombok-0.10.4.jar">lombok-0.10.4.jar</a></li> - <li><a href="downloads/lombok-0.10.2.jar">lombok-0.10.2.jar</a></li> - <li><a href="downloads/lombok-0.10.1.jar">lombok-0.10.1.jar</a></li> - <li><a href="downloads/lombok-0.10.0.jar">lombok-0.10.0.jar</a></li> - <li><a href="downloads/lombok-0.9.3.jar">lombok-0.9.3.jar</a></li> - <li><a href="downloads/lombok-0.9.2.jar">lombok-0.9.2.jar</a></li> - <li><a href="downloads/lombok-0.9.1.jar">lombok-0.9.1.jar</a></li> - <li><a href="downloads/lombok-0.9.0.jar">lombok-0.9.0.jar</a></li> - <li><a href="downloads/lombok-0.8.jar">lombok-0.8.jar</a></li> - <li><a href="downloads/lombok-0.8.5.jar">lombok-0.8.5.jar</a></li> - <li><a href="downloads/lombok-0.8.4.jar">lombok-0.8.4.jar</a></li> - <li><a href="downloads/lombok-0.8.3.jar">lombok-0.8.3.jar</a></li> - <li><a href="downloads/lombok-0.8.2.jar">lombok-0.8.2.jar</a></li> - <li><a href="downloads/lombok-0.8.1.jar">lombok-0.8.1.jar</a></li> - <li><a href="downloads/lombok-0.4.jar">lombok-0.4.jar</a></li> - </ul> - <div class="backLink"> - <a href="index.html">back to the project homepage</a> - </div> - </div> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> -</body></html> diff --git a/website/buttonbar.jpg b/website/buttonbar.jpg Binary files differdeleted file mode 100644 index 6eb10e71..00000000 --- a/website/buttonbar.jpg +++ /dev/null diff --git a/website/buttonbar.psd b/website/buttonbar.psd Binary files differdeleted file mode 100644 index b8335cbb..00000000 --- a/website/buttonbar.psd +++ /dev/null diff --git a/website/buttonbar_unmodified.png b/website/buttonbar_unmodified.png Binary files differdeleted file mode 100644 index 6a3121af..00000000 --- a/website/buttonbar_unmodified.png +++ /dev/null diff --git a/website/changelog.html b/website/changelog.html deleted file mode 100644 index df09e661..00000000 --- a/website/changelog.html +++ /dev/null @@ -1,15 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="logi/reset.css" /> - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok - Changelog</title> - <style type="text/css"> - body { - margin: 8px; - } - </style> -</head><body> - @CHANGELOG@ -</body></html> diff --git a/website/clear.gif b/website/clear.gif Binary files differdeleted file mode 100644 index 35d42e80..00000000 --- a/website/clear.gif +++ /dev/null diff --git a/website/credits.html b/website/credits.html deleted file mode 100644 index de83981e..00000000 --- a/website/credits.html +++ /dev/null @@ -1,132 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="logi/reset.css" /> - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok - Credits</title> - <style type="text/css"> - h1 { - font-size: 14px; - text-align: center; - width: 100%; - } - - .meat { - margin: 16px auto 0 auto; - width: 800px; - } - - .personList { - clear: both; - padding-top: 16px; - } - - .personList h3 { - font-size: 1em; - } - - .person { - width: 128px; - float: left; - margin-right: 32px; - } - - .person .imgCt { - width: 128px; - } - - .person img { - text-align: center; - margin: 0 auto; - display: block; - } - - .person .name { - margin: 0 auto 0 auto; - width: 100%; - text-align: center; - display: block; - } - - .thanks { - clear: both; - padding-top: 32px; - } - - .back { - margin-top: 32px; - } - - ul { - list-style-image: url(lombokBullet.png); - list-style-position: inside; - } - </style> -</head><body> - <div class="meat"> - <h1>Project Lombok - About the authors and everyone that's helped us create Project Lombok.</h1> - <div class="credits"> - <div class="committers personList"> - <h3>Regular contributors to Project Lombok:</h3> - <div class="person"> - <div class="imgCt"><img class="jappeImg" src="unknown_person.gif" /></div> - <span class="name">Jappe van der Hel</span> - </div> - <div class="person"> - <div class="imgCt"><img class="philippImg" src="unknown_person.gif" /></div> - <span class="name">Philipp Eichhorn</span> - </div> - <div class="person"> - <div class="imgCt"><img class="reinierImg" src="reinier.jpg" /></div> - <span class="name">Reinier Zwitserloot</span> - </div> - <div class="person"> - <div class="imgCt"><img class="rjImg" src="robbertjan.jpg" /></div> - <span class="name">Robbert Jan Grootjans</span> - </div> - <div class="person"> - <div class="imgCt"><img class="roelImg" src="roel.jpg" /></div> - <span class="name">Roel Spilker</span> - </div> - <div class="person"> - <div class="imgCt"><img class="sanderImg" src="sander.jpg" /></div> - <span class="name">Sander Koning</span> - </div> - </div> - <div class="thanks"> - We'd like to thank:<ul> - <li>Perry Nguyen (pfn on ##java on freenode) for creating the inspiration for project lombok.</li> - <li>Tor Norbye, Jan Lahoda, and Petr Jiricka for helping out with Netbeans internals and/or javac.</li> - <li><a href="http://javaposse.com/">The Java Posse</a> for making the java community <em>awesome</em>. Listen to their podcast!</li> - <li>all contributors who submitted patches or helped answering questions!</li> - </ul> - as well as the authors of the following tools that we use:<ul> - <li><a href="https://github.com/">Github</a> for hosting lombok's repository and issue tracker.</li> - <li>The <a href="http://asm.ow2.org/index.html">ASM team</a> at ObjectWeb for creating an excellent class file editing tool. - Lombok uses ASM to interact with Eclipse.</li> - <li>Markus Gebhard for creating <a href="http://java2html.de/">java2html</a> which we use for the example code snippets on the - features pages.</li> - <li><a href="http://camendesign.com/code/video_for_everybody">Kroc Camen</a>'s video for everbody. The lombok demo video - runs on just about every system imaginable because of it.</a></li> - <li>Longtail Video's <a href="http://www.longtailvideo.com/players/jw-flv-player/">JWPlayer</a>, which is bringing the video to - those of you who have an aging browser.</li> - <li>The <a href="https://code.google.com/p/spi/">spi project</a>, which makes it very easy to extend lombok with your own transformations.</li> - <li><a href="http://ant.apache.org/ivy/">Apache Ivy</a> - Dependency management</li> - <li><a href="http://cobertura.sourceforge.net/">Cobertura</a> which we use to ensure our tests cover as much as possible.</li> - </ul> - </div> - </div> - <div class="back"><a href="index.html">Back to the home page</a>. - </div> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> -</body></html> diff --git a/website/disableCheckedExceptions.html b/website/disableCheckedExceptions.html deleted file mode 100644 index 64ad1cd8..00000000 --- a/website/disableCheckedExceptions.html +++ /dev/null @@ -1,61 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="logi/reset.css" /> - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok side projects - Disable checked Exceptions</title> - <style type="text/css"> - code { - font-size: 12px; - font-family: monospaced; - } - - .meat { - margin: 16px auto 0 auto; - width: 800px; - } - - .backLink { - padding-top: 100px; - width: 100%; - text-align: right; - } - </style> -</head><body> - <div class="meat"> - <h1>Tired of checked exceptions?</h1> - <p> - This lombok spinoff project consists of a hack that only works in javac - not eclipse or any other IDE.<br /> - It will completely disable the notion of checked exceptions. You may throw any exception anywhere, and you may - also catch any exception anywhere. In standard javac, you may not catch a checked exception that is not declared - as thrown by at least 1 statement in your try block, unless it is <code>Exception</code> or <code>Throwable</code>.<br /> - This restriction is lifted as well. - </p> - <h3>Usage</h3> - <p> - Just make sure <code>disableCheckedExceptions-alpha.jar</code> is on the classpath as you compile. For example:<br /> - <code>javac -cp disableCheckedExceptions-alpha.jar MySource.java</code> - </p> - <p> - Ready to try it out? download it here: <a href="downloads/disableCheckedExceptions-alpha.jar">disableCheckedExceptions-alpha.jar</a> - </p> - <p> - Want to know how its done? Grab the lombok repository <a href="https://github.com/rzwitserloot/lombok/tree/disableCheckedExceptions">here on github</a>, - and look in the <code>experimental</code> directory. - </p> - <div class="backLink"> - <a href="index.html">back to the project homepage</a> - </div> - </div> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> -</body></html> diff --git a/website/download-edge-none.html b/website/download-edge-none.html deleted file mode 100644 index 07091b90..00000000 --- a/website/download-edge-none.html +++ /dev/null @@ -1,54 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="logi/reset.css" /> - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok - Cutting Edge build</title> - <style type="text/css"> - code { - font-size: 12px; - font-family: monospaced; - } - - #downloadLink { - font-size: 14px; - } - - .meat { - margin: 16px auto 0 auto; - width: 800px; - } - - .backLink { - padding-top: 100px; - width: 100%; - text-align: right; - } - - h1 { - padding-bottom: 0; - margin-bottom: 4px; - } - </style> -</head><body> - <div class="meat download edge"> - <h1>Download Lombok Cutting Edge build</h1> - <div class="versionInfo"> - No edge build as been released since the last <a href="download.html">stable release</a> of lombok. - </div> - <div class="backLink"> - <a href="index.html">back to the project homepage</a> - </div> - </div> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> -</body></html> diff --git a/website/download-edge.html b/website/download-edge.html deleted file mode 100644 index 4cf794a6..00000000 --- a/website/download-edge.html +++ /dev/null @@ -1,63 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="logi/reset.css" /> - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok - Cutting Edge build</title> - <style type="text/css"> - code { - font-size: 12px; - font-family: monospaced; - } - - #downloadLink { - font-size: 14px; - } - - .meat { - margin: 16px auto 0 auto; - width: 800px; - } - - .backLink { - padding-top: 100px; - width: 100%; - text-align: right; - } - - h1 { - padding-bottom: 0; - margin-bottom: 4px; - } - </style> -</head><body> - <div class="meat download edge"> - <h1>Download Lombok Cutting Edge build</h1> - <div class="versionInfo"> - version: @VERSION-EDGE@ - </div> - <p id="changelog"> - @CHANGELOG-EDGE@ - </p> - <a href="lombok-edge.jar" id="downloadLink"> - Download now! - </a> - <p> - Cutting edge a bit too gutsy for you? You can grab the <a href="download.html">stable release</a> instead. - </p> - <div class="backLink"> - <a href="index.html">back to the project homepage</a> - </div> - </div> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> -</body></html> diff --git a/website/download.html b/website/download.html deleted file mode 100644 index f2e85976..00000000 --- a/website/download.html +++ /dev/null @@ -1,97 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <script src="logi/jQuery-all.js" type="text/javascript"></script> - <link rel="stylesheet" type="text/css" href="logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="index.css" /> - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok</title> - <!--[if lt IE 7]><script type="text/javascript" src="logi/iepngfix_tilebg.js"></script><![endif]--> -</head><body> - <a id="forkMe" href="https://github.com/rzwitserloot/lombok"><img style="position: absolute; top: 0; right: 0; border: 0;" src="//s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a> - <div class="meat"> - <h1><a href="/">Project Lombok</a> - Download</h1> - <div id="buttonBar" class="buttonBar"> - <a class="button" href="features/index.html"> - <img src="icon_overview.png" /> - <span>Feature Overview</span> - </a> - <a class="button" href="https://groups.google.com/group/project-lombok"> - <img src="icon_discussion.png" /> - <span>Discuss / Help</span> - </a> - <a class="button" href="https://wiki.github.com/rzwitserloot/lombok/contributing"> - <img src="icon_contribute.png" /> - <span>Contribute</span> - </a> - <a class="button" href="https://github.com/rzwitserloot/lombok/issues"> - <img src="icon_bugs.png" /> - <span>Report an issue</span> - </a> - <div class="downloadContainer"> - <a class="downloadLink" id="downloadLink" href="download.html"> - <img src="icon_download.png" /> - <span>Download!</span> - </a> - <div class="versionInfo"> - Version: @VERSION@ | <a href="changelog.html">changelog</a> - </div> - </div> - </div> - <div class="downloadHelp"> - <div class="stableLink">Download <a href="/downloads/lombok.jar">lombok.jar</a> @VERSION@.</div> - <div class="edgeLink">Feeling adventurous? Download the latest <a href="download-edge.html">snapshot</a> release.</div> - - <table cellspacing="0" cellpadding="0"> - <tr><td class="platform">Maven, Ivy or Gradle</td> - <td class="instruction">Lombok is in maven central. <a href="mavenrepo/index.html">More…</a></td></tr> - - <tr><td class="platform">Javac</td> - <td class="instruction">Just put <code>lombok.jar</code> on the classpath.</td></tr> - - <tr><td class="platform">NetBeans</td> - <td class="instruction">Just put <code>lombok.jar</code> on the classpath and enable annotation processing. <a href="setup/netbeans.html">More…</a></td></tr> - - <tr><td class="platform">Eclipse and variants</td> - <td class="instruction">Run <code>lombok.jar</code> as a java app (i.e. doubleclick it, usually) to install. Also add lombok.jar to your project. <span style="font-size: 0.8em;"><em>Supported variants: Springsource Tool Suite, JBoss Developer Studio</em></span></td></tr> - - <tr><td class="platform">IDEA IntelliJ</td> - <td class="instruction"><a href="https://github.com/mplushnikov/lombok-intellij-plugin">A plugin developed by Michael Plushnikov</a> adds support for most features.</td></tr> - - <tr><td class="platform">Javadoc</td> - <td class="instruction">First delombok your code then run javadoc on the result. <a href="features/delombok.html">More…</a></td></tr> - - <tr><td class="platform">Android</td> - <td class="instruction">The proper way to use lombok with android is somewhat complicated but possible. <a href="setup/android.html">More…</a></td></tr> - - <tr><td class="platform">GWT</td> - <td class="instruction">Lombok works with GWT. <a href="setup/gwt.html">More…</a></td></tr> - - <tr><td class="platform">Play! Framework</td> - <td class="instruction">Use Aaron Freeman's <a href="https://github.com/aaronfreeman/play-lombok#readme">lombok play plugin</a>.</td></tr> - - <tr><td class="platform">ecj</td> - <td class="instruction">Lombok works on ecj and ecj-based tools. <a href="setup/ecj.html">More…</a></td></tr> - </table> - <p style="font-size: 0.9em"> - Or, <a href="all-versions.html">download</a> a previous version of lombok. - </p> - </div> - <div class="endBar"> - </div> - <div class="footer"> - <a href="credits.html" class="creditsLink">credits</a> | Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>. - </div> - </div> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> -</body></html> diff --git a/website/downloadButton.png b/website/downloadButton.png Binary files differdeleted file mode 100644 index 8a0c73b8..00000000 --- a/website/downloadButton.png +++ /dev/null diff --git a/website/downloadButton.svg b/website/downloadButton.svg deleted file mode 100644 index ce5e33a8..00000000 --- a/website/downloadButton.svg +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Created with Inkscape (http://www.inkscape.org/) --> -<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="800" height="200" version="1.1"> - <defs id="defs4"> - <linearGradient id="lg1"> - <stop id="s1" offset="0" style="stop-color:white;stop-opacity:0;" /> - <stop id="s2" offset="1" style="stop-color:white;stop-opacity: .3" /> - </linearGradient> - <linearGradient xlink:href="#lg1" id="lg3" x1="191" y1="156" x2="148" y2="10" gradientUnits="userSpaceOnUse" /> - </defs> - <g id="layer1"> - <rect x="1%" y="1%" width="98%" height="98%" rx="18px" ry="18px" style="stroke:#d40000;fill:#ff5050;stroke-width: 2;" /> - <rect x="1%" y="1%" width="98%" height="98%" rx="18px" ry="18px" style="fill:url(#lg3);" /> - </g> -</svg>
\ No newline at end of file diff --git a/website/extra/htaccess b/website/extra/htaccess new file mode 100644 index 00000000..db3393af --- /dev/null +++ b/website/extra/htaccess @@ -0,0 +1,59 @@ +RewriteEngine On + +RewriteRule ^$ /main.html [L,END] +RewriteRule ^(index|home)(\.html)?$ / [NC,R=301] + +RewriteRule ^setup/overview$ /setup/main.html [L,END] +RewriteRule ^setup/main(\.html)?$ /setup/overview [NC,R=301] +RewriteRule ^setup/index(\.html)?$ /setup/overview [NC,R=301] +RewriteRule ^setup(/(overview)?)?$ /setup/overview [NC,R=301] + +RewriteRule ^changelog$ /changelog.html [L,END] +RewriteRule ^changelog(\.html)?$ /changelog [NC,R=301] +RewriteRule ^credits$ /credits.html [L,END] +RewriteRule ^credits(\.html)?$ /credits [NC,R=301] +RewriteRule ^download$ /download.html [L,END] +RewriteRule ^download(\.html)?$ /download [NC,R=301] +RewriteRule ^download-edge$ /download-edge.html [L,END] +RewriteRule ^download-edge(\.html)?$ /download-edge [NC,R=301] +RewriteRule ^all-versions$ /all-versions.html [L,END] +RewriteRule ^all-versions(\.html)?$ /all-versions [NC,R=301] +RewriteRule ^all-versions$ /all-versions.html [L,END] +RewriteRule ^all-versions(\.html)?$ /all-versions [NC,R=301] +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] +RewriteRule ^setup/${pg?no_esc}(\.html)?$ /setup/${pg?no_esc} [NC,R=301] +</#list> + +RewriteRule ^features/all$ /features/index.html [L,END] +RewriteRule ^features(/all)?$ /features/all [NC,R=301] +RewriteRule ^features/index(\.html)?$ /features/all [NC,R=301] + +<#list featurePages as pg> +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] + +<#list experimentalPages as pg> +RewriteRule ^features/experimental/${pg?no_esc}$ /features/experimental/${pg?no_esc}.html [L,END] +RewriteRule ^features/experimental/${pg?no_esc}(\.html)?$ /features/experimental/${pg?no_esc} [NC,R=301] +</#list> diff --git a/website/favicon.ico b/website/favicon.ico Binary files differdeleted file mode 100644 index bf83a474..00000000 --- a/website/favicon.ico +++ /dev/null diff --git a/website/features/Builder.html b/website/features/Builder.html deleted file mode 100644 index 22708c8d..00000000 --- a/website/features/Builder.html +++ /dev/null @@ -1,177 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@Builder</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@Builder</h1> - <div class="byline">... and Bob's your uncle: No-hassle fancy-pants APIs for object creation!</div> - <div class="since"> - <h3>Since</h3> - <p> - <code>@Builder</code> was introduced as experimental feature in lombok v0.12.0. - </p><p> - <code>@Builder</code> gained <code>@Singular</code> support and was promoted to the main <code>lombok</code> package since lombok v1.16.0. - </p><p> - <code>@Builder</code> with <code>@Singular</code> adds a clear method since lombok v1.16.8. - </div> - <div class="overview"> - <h3>Overview</h3> - <p> - The <code>@Builder</code> annotation produces complex builder APIs for your classes. - </p><p> - <code>@Builder</code> lets you automatically produce the code required to have your class be instantiable with code such as:<br /> - <code>Person.builder().name("Adam Savage").city("San Francisco").job("Mythbusters").job("Unchained Reaction").build();</code> - </p><p> - <code>@Builder</code> can be placed on a class, or on a constructor, or on a method. While the "on a class" and "on a constructor" - mode are the most common use-case, <code>@Builder</code> is most easily explained with the "method" use-case. - </p><p> - A method annotated with <code>@Builder</code> (from now on called the <em>target</em>) causes the following 7 things to be generated:<ul> - <li>An inner class named <code><em>Foo</em>Builder</code>, with the same type arguments as the method (called the <em>builder</em>).</li> - <li>In the <em>builder</em>: One private non-static non-final field for each parameter of the <em>target</em>.</li> - <li>In the <em>builder</em>: A package private no-args empty constructor.</li> - <li>In the <em>builder</em>: A 'setter'-like method for each parameter of the <em>target</em>: It has the same type as that parameter and the same name. - It returns the builder itself, so that the setter calls can be chained, as in the above example.</li> - <li>In the <em>builder</em>: A <code>build()</code> method which calls the method, passing in each field. It returns the same type that the - <em>target</em> returns.</li> - <li>In the <em>builder</em>: A sensible <code>toString()</code> implementation.</li> - <li>In the class containing the <em>target</em>: A static <code>builder()</code> method, which creates a new instance of the <em>builder</em>.</li> - </ul> - Each listed generated element will be silently skipped if that element already exists (disregarding parameter counts and looking only at names). This - includes the <em>builder</em> itself: If that class already exists, lombok will simply start injecting fields and methods inside this already existing - class, unless of course the fields / methods to be injected already exist. You may not put any other method (or constructor) generating lombok annotation - on a builder class though; for example, you can not put <code>@EqualsAndHashCode</code> on the builder class. - </p><p> - <code>@Builder</code> can generate so-called 'singular' methods for collection parameters/fields. These take 1 element instead of an entire list, and add the - element to the list. For example: <code>Person.builder().job("Mythbusters").job("Unchained Reaction").build();</code> would result in the <code>List<String> jobs</code> - field to have 2 strings in it. To get this behaviour, the field/parameter needs to be annotated with <code>@Singular</code>. The feature has <a href="#singular">its own documentation</a>. - </p><p> - Now that the "method" mode is clear, putting a <code>@Builder</code> annotation on a constructor functions similarly; effectively, - constructors are just static methods that have a special syntax to invoke them: Their 'return type' is the class they construct, and their - type parameters are the same as the type parameters of the class itself. - </p><p> - Finally, applying <code>@Builder</code> to a class is as if you added <code>@AllArgsConstructor(access = AccessLevel.PACKAGE)</code> to the class and applied the - <code>@Builder</code> annotation to this all-args-constructor. This only works if you haven't written any explicit constructors yourself. If you do have an - explicit constructor, put the <code>@Builder</code> annotation on the constructor instead of on the class. - </p><p> - If using <code>@Builder</code> to generate builders to produce instances of your own class (this is always the case unless adding <code>@Builder</code> to a static method that doesn't return your own type), you can use <code>@Builder(toBuilder = true)</code> to also generate an instance method in your class called <code>toBuilder()</code>; it creates a new builder that starts out with all the values of this instance. You can put the <code>@Builder.ObtainVia</code> annotation on the parameters (in case of a constructor or static method) or fields (in case of <code>@Builder</code> on a type) to indicate alternative means by which the value for that field/parameter is obtained from the instance. For example, you can specify a method to be invoked: <code>@Builder.ObtainVia(method = "calculateFoo")</code>. - </p><p> - The name of the builder class is <code><em>Foobar</em>Builder</code>, where <em>Foobar</em> is the simplified, title-cased form of the return type of the - <em>target</em> - that is, the name of your type for <code>@Builder</code> on constructors and types, and the name of the return type for <code>@Builder</code> - on methods. For example, if <code>@Builder</code> is applied to a class named <code>com.yoyodyne.FancyList<T></code>, then the builder name will be - <code>FancyListBuilder<T></code>. If <code>@Builder</code> is applied to a method that returns <code>void</code>, the builder will be named - <code>VoidBuilder</code>. - </p><p> - The configurable aspects of builder are:<ul> - <li>The <em>builder's class name</em> (default: return type + 'Builder')</li> - <li>The <em>build()</em> method's name (default: <code>"build"</code>)</li> - <li>The <em>builder()</em> method's name (default: <code>"builder"</code>)</li> - <li>If you want <code>toBuilder()</code> (default: no)</li> - </ul> - Example usage where all options are changed from their defaults:<br /> - <code>@Builder(builderClassName = "HelloWorldBuilder", buildMethodName = "execute", builderMethodName = "helloWorld", toBuilder = true)</code><br /> - </p> - </div> - <div class="overview"> - <h3><a name="singular">@Singular</a></h3> - <p> - By annotating one of the parameters (if annotating a method or constructor with <code>@Builder</code>) or fields (if annotating a class with <code>@Builder</code>) with the - <code>@Singular</code> annotation, lombok will treat that builder node as a collection, and it generates 2 'adder' methods instead of a 'setter' method. One which adds a single element to the collection, and one - which adds all elements of another collection to the collection. No setter to just set the collection (replacing whatever was already added) will be generated. A 'clear' method is also generated. These 'singular' builders - are very complicated in order to guarantee the following properties: - <ul> - <li>When invoking <code>build()</code>, the produced collection will be immutable.</li> - <li>Calling one of the 'adder' methods, or the 'clear' method, after invoking <code>build()</code> does not modify any already generated objects, and, if <code>build()</code> is later called again, another collection with all the elements added since the creation of the builder is generated.</li> - <li>The produced collection will be compacted to the smallest feasible format while remaining efficient.</li> - </ul> - </p><p> - <code>@Singular</code> can only be applied to collection types known to lombok. Currently, the supported types are: - <ul> - <li><a href="https://docs.oracle.com/javase/8/docs/api/java/util/package-summary.html"><code>java.util</code></a>:<ul> - <li><code>Iterable</code>, <code>Collection</code>, and <code>List</code> (backed by a compacted unmodifiable <code>ArrayList</code> in the general case).</li> - <li><code>Set</code>, <code>SortedSet</code>, and <code>NavigableSet</code> (backed by a smartly sized unmodifiable <code>HashSet</code> or <code>TreeSet</code> in the general case).</li> - <li><code>Map</code>, <code>SortedMap</code>, and <code>NavigableMap</code> (backed by a smartly sized unmodifiable <code>HashMap</code> or <code>TreeMap</code> in the general case).</li> - </ul></li> - <li><a href="https://github.com/google/guava">Guava</a>'s <code>com.google.common.collect</code>:<ul> - <li><code>ImmutableCollection</code> and <code>ImmutableList</code> (backed by the builder feature of <code>ImmutableList</code>).</li> - <li><code>ImmutableSet</code> and <code>ImmutableSortedSet</code> (backed by the builder feature of those types).</li> - <li><code>ImmutableMap</code>, <code>ImmutableBiMap</code>, and <code>ImmutableSortedMap</code> (backed by the builder feature of those types).</li> - <li><code>ImmutableTable</code> (backed by the builder feature of <code>ImmutableTable</code>).</li> - </ul></li> - </ul> - </p><p> - If your identifiers are written in common english, lombok assumes that the name of any collection with <code>@Singular</code> on it is an english plural and will attempt to automatically - singularize that name. If this is possible, the add-one method will use this name. For example, if your collection is called <code>statuses</code>, then the add-one method will automatically - be called <code>status</code>. You can also specify the singular form of your identifier explictly by passing the singular form as argument to the annotation like so: <code>@Singular("axis") List<Line> axes;</code>.<br /> - If lombok cannot singularize your identifier, or it is ambiguous, lombok will generate an error and force you to explicitly specify the singular name. - </p><p> - The snippet below does not show what lombok generates for a <code>@Singular</code> field/parameter because it is rather complicated. - You can view a snippet <a href="Singular-snippet.html">here</a>. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.builder.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@Builder</code> as a warning or error if configured.</dd> - <dt><code>lombok.singular.useGuava</code> = [<code>true</code> | <code>false</code>] (default: false)</dt> - <dd>If <code>true</code>, lombok will use guava's <code>ImmutableXxx</code> builders and types to implement <code>java.util</code> collection interfaces, instead of creating - implementations based on <code>Collections.unmodifiableXxx</code>. You must ensure that guava is actually available on the classpath and buildpath if you use this setting. - Guava is used automatically if your field/parameter has one of the guava <code>ImmutableXxx</code> types. - <dt><code>lombok.singular.auto</code> = [<code>true</code> | <code>false</code>] (default: true)</dt> - <dd>If <code>true</code> (which is the default), lombok automatically tries to singularize your identifier name by assuming that it is a common english plural. - If <code>false</code>, you must always explicitly specify the singular name, and lombok will generate an error if you don't (useful if you write your code in a language other than english). - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - @Singular support for <code>java.util.NavigableMap/Set</code> only works if you are compiling with JDK1.8 or higher. - </p><p> - You cannot manually provide some or all parts of a <code>@Singular</code> node; the code lombok generates is too complex for this. If you want to - manually control (part of) the builder code associated with some field or parameter, don't use <code>@Singular</code> and add everything you need manually. - </p><p> - The sorted collections (java.util: <code>SortedSet</code>, <code>NavigableSet</code>, <code>SortedMap</code>, <code>NavigableMap</code> and guava: <code>ImmutableSortedSet</code>, <code>ImmutableSortedMap</code>) require that the type argument of the collection has natural order (implements <code>java.util.Comparable</code>). There is no way to pass an explicit <code>Comparator</code> to use in the builder. - </p><p> - An <code>ArrayList</code> is used to store added elements as call methods of a <code>@Singular</code> marked field, if the target collection is from the <code>java.util</code> package, <em>even if the collection is a set or map</em>. Because lombok ensures that generated collections are compacted, a new backing instance of a set or map must be constructed anyway, and storing the data as an <code>ArrayList</code> during the build process is more efficient that storing it as a map or set. This behaviour is not externally visible, an an implementation detail of the current implementation of the <code>java.util</code> recipes for <code>@Singular @Builder</code>. - </p><p> - With <code>toBuilder = true</code> applied to static methods, any type parameter on the annotated static method must show up in the returntype. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="Value.html">Previous feature (@Value)</a> | <a href="SneakyThrows.html">Next feature (@SneakyThrows)</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/Cleanup.html b/website/features/Cleanup.html deleted file mode 100644 index 37e53c18..00000000 --- a/website/features/Cleanup.html +++ /dev/null @@ -1,86 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@Cleanup</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@Cleanup</h1> - <div class="byline">Automatic resource management: Call your <code>close()</code> methods safely with no hassle.</div> - <div class="overview"> - <h3>Overview</h3> - <p> - You can use <code>@Cleanup</code> to ensure a given resource is automatically cleaned up before the code execution path exits your - current scope. You do this by annotating any local variable declaration with the <code>@Cleanup</code> annotation like so:<br /> - <code>@Cleanup InputStream in = new FileInputStream("some/file");</code><br /> - As a result, at the end of the scope you're in, <code>in.close()</code> is called. This call is guaranteed to run by way of a - try/finally construct. Look at the example below to see how this works. - </p><p> - If the type of object you'd like to cleanup does not have a <code>close()</code> method, but some other no-argument method, you can - specify the name of this method like so:<br /> - <code>@Cleanup("dispose") org.eclipse.swt.widgets.CoolBar bar = new CoolBar(parent, 0);</code><br /> - By default, the cleanup method is presumed to be <code>close()</code>. A cleanup method that takes 1 or more arguments cannot be called via - <code>@Cleanup</code>. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.cleanup.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@Cleanup</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - In the finally block, the cleanup method is only called if the given resource is not <code>null</code>. However, if you use <code>delombok</code> - on the code, a call to <code>lombok.Lombok.preventNullAnalysis(Object o)</code> is inserted to prevent warnings if static code analysis could - determine that a null-check would not be needed. Compilation with <code>lombok.jar</code> on the classpath removes that method call, - so there is no runtime dependency. - </p> - <p> - If your code throws an exception, and the cleanup method call that is then triggered also throws an exception, then the original exception - is hidden by the exception thrown by the cleanup call. You should <em>not</em> rely on this 'feature'. Preferably, lombok would like to generate - code so that, if the main body has thrown an exception, any exception thrown by the close call is silently swallowed (but if the main body - exited in any other way, exceptions by the close call will not be swallowed). The authors of lombok do not currently know of a feasible way - to implement this scheme, but if java updates allow it, or we find a way, we'll fix it. - </p><p> - You do still need to handle any exception that the cleanup method can generate! - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="NonNull.html">Previous feature (@NonNull)</a> | <a href="GetterSetter.html">Next feature (@Getter / @Setter)</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/Constructor.html b/website/features/Constructor.html deleted file mode 100644 index 88a8f6ac..00000000 --- a/website/features/Constructor.html +++ /dev/null @@ -1,110 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@XArgsConstructor</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@NoArgsConstructor, @RequiredArgsConstructor, @AllArgsConstructor</h1> - <div class="byline">Constructors made to order: Generates constructors that take no arguments, one argument per final / non-null field, or one argument for every field.</div> - <div class="overview"> - <h3>Overview</h3> - <p> - This set of 3 annotations generate a constructor that will accept 1 parameter for certain fields, and simply assigns this parameter to the field. - </p><p> - <code>@NoArgsConstructor</code> will generate a constructor with no parameters. If this is not possible (because of final fields), a compiler error will result instead, unless <code>@NoArgsConstructor(force = true)</code> is used, then all final fields are initialized with 0 / false / null. For fields with constraints, such as <code>@NonNull</code> fields, <em>no</em> check or assignment is generated, so be aware that these constraints may then not be - fulfilled until those fields are properly initialized later. Certain java constructs, such as hibernate and the Service Provider Interface require a no-args constructor. - This annotation is useful primarily in combination with either <code>@Data</code> or one of the other constructor generating annotations. - </p><p> - <code>@RequiredArgsConstructor</code> generates a constructor with 1 parameter for each field that requires special handling. All non-initialized <code>final</code> fields get a parameter, - as well as any fields that are marked as <code>@NonNull</code> that aren't initialized where they are declared. For those fields marked with <code>@NonNull</code>, an explicit - null check is also generated. The constructor will throw a <code>NullPointerException</code> if any of the parameters intended for the fields marked with <code>@NonNull</code> - contain <code>null</code>. The order of the parameters match the order in which the fields appear in your class. - </p><p> - <code>@AllArgsConstructor</code> generates a constructor with 1 parameter for each field in your class. Fields marked with <code>@NonNull</code> result in null checks on - those parameters. - </p><p> - Each of these annotations allows an alternate form, where the generated constructor is always private, and an additional static factory method that wraps around the - private constructor is generated. This mode is enabled by supplying the <code>staticName</code> value for the annotation, like so: <code>@RequiredArgsConstructor(staticName="of")</code>. - Such a static factory method will infer generics, unlike a normal constructor. This means your API users get write <code>MapEntry.of("foo", 5)</code> instead of the much longer - <code>new MapEntry<String, Integer>("foo", 5)</code>. - </p><p> - To put annotations on the generated constructor, you can use <code>onConstructor=@__({@AnnotationsHere})</code>, but be careful; this is an experimental feature. For more details see the documentation on the <a href="experimental/onX.html">onX</a> feature. - </p><p> - Static fields are skipped by these annotations. Also, a <code>@java.beans.ConstructorProperties</code> annotation is added for all constructors with at least 1 argument, - which allows bean editor tools to call the generated constructors. <code>@ConstructorProperties</code> is new in Java 1.6, which means that if your code is intended for - compilation on Java 1.5, a compiler error will occur. <em>Running</em> on a JVM 1.5 should be no problem (the annotation will be ignored). To suppress the generation of - the <code>@ConstructorProperties</code> annotation, add a parameter to your annotation: <code>@AllArgsConstructor(suppressConstructorProperties=true)</code>. However, - as java 1.5, which has already been end-of-lifed, fades into obscurity, this parameter will eventually be removed. It has also been marked deprecated for this reason. - </p><p> - Unlike most other lombok annotations, the existence of an explicit constructor does not stop these annotations from generating their own constructor. This means you can write your own specialized constructor, and let lombok generate the boilerplate ones as well. If a conflict arises (one of your constructors ends up with the same signature as one that lombok generates), a compiler error will occur. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.anyConstructor.suppressConstructorProperties</code> = [<code>true</code> | <code>false</code>] (default: <code>false</code>)</dt> - <dd>If set to <code>true</code>, then lombok will skip adding a <code>@java.beans.ConstructorProperties</code> to generated constructors. This is useful in android and GWT development where that annotation is not usually available.</dd> - <dt><code>lombok.</code>[<code>allArgsConstructor</code>|<code>requiredArgsConstructor</code>|<code>noArgsConstructor</code>]<code>.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of the relevant annotation (<code>@AllArgsConstructor</code>, <code>@RequiredArgsConstructor</code> or <code>@NoArgsConstructor</code>) as a warning or error if configured.</dd> - <dt><code>lombok.anyConstructor.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of any of the 3 constructor-generating annotations as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - Even if a field is explicitly initialized with <code>null</code>, lombok will consider the requirement to avoid null as fulfilled, and will <em>NOT</em> consider - the field as a 'required' argument. The assumption is that if you explicitly assign <code>null</code> to a field that you've also marked as <code>@NonNull</code> - signals you must know what you're doing. - </p><p> - The <code>@java.beans.ConstructorProperties</code> annotation is never generated for a constructor with no arguments. This also explains why <code>@NoArgsConstructor</code> - lacks the <code>suppressConstructorProperties</code> annotation method. The <code>@ConstructorProperties</code> annotation is also omitted for private constructors. The - generated static factory methods also do not get <code>@ConstructorProperties</code>, as this annotation can only be added to real constructors. - </p><p> - <code>@XArgsConstructor</code> can also be used on an enum definition. The generated constructor will always be - private, because non-private constructors aren't legal in enums. You don't have to specify <code>AccessLevel.PRIVATE</code>. - </p><p> - While <code>suppressConstructorProperties</code> has been marked deprecated in anticipation of a world where all java environments have the - <code>@ConstructorProperties</code> annotation available, first GWT 2.2 and Android 2.3.3, which do not (yet) have this annotation, will have - to be ancient history before this annotation parameter will be removed. - </p><p> - The <code>flagUsage</code> configuration keys do not trigger when a constructor is generated by <code>@Data</code>, <code>@Value</code> or any other lombok annotation. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="EqualsAndHashCode.html">Previous feature (@EqualsAndHashCode)</a> | <a href="Data.html">Next feature (@Data)</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/Data.html b/website/features/Data.html deleted file mode 100644 index d69cfac3..00000000 --- a/website/features/Data.html +++ /dev/null @@ -1,84 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@Data</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@Data</h1> - <div class="byline">All together now: A shortcut for <code>@ToString</code>, <code>@EqualsAndHashCode</code>, - <code>@Getter</code> on all fields, <code>@Setter</code> on all non-final fields, and <code>@RequiredArgsConstructor</code>!</div> - <div class="overview"> - <h3>Overview</h3> - <p> - <code>@Data</code> is a convenient shortcut annotation that bundles the features of <a href="ToString.html"><code>@ToString</code></a>, <a href="EqualsAndHashCode.html"><code>@EqualsAndHashCode</code></a>, <a href="GetterSetter.html"><code>@Getter</code> / <code>@Setter</code></a> and <a href="Constructor.html"><code>@RequiredArgsConstructor</code></a> together: In other words, <code>@Data</code> generates <em>all</em> the boilerplate that is normally associated with simple POJOs (Plain Old Java Objects) and beans: getters for all fields, setters for all non-final fields, and appropriate <code>toString</code>, <code>equals</code> and <code>hashCode</code> implementations that involve the fields of the class, and a constructor that initializes all final fields, as well as all non-final fields with no initializer that have been marked with <code>@NonNull</code>, in order to ensure the field is never null. - </p><p> - <code>@Data</code> is like having implicit <code>@Getter</code>, <code>@Setter</code>, <code>@ToString</code>, <code>@EqualsAndHashCode</code> and <code>@RequiredArgsConstructor</code> annotations on the class (except that no constructor will be generated if any explicitly written constructor exists). However, the parameters of these annotations (such as <code>callSuper</code>, <code>includeFieldNames</code> and <code>exclude</code>) cannot be set with <code>@Data</code>. If you need to set non-default values for any of these parameters, just add those annotations explicitly; <code>@Data</code> is smart enough to defer to those annotations. - </p><p> - All generated getters and setters will be <code>public</code>. To override the access level, annotate the field or class with an explicit <code>@Setter</code> and/or <code>@Getter</code> annotation. You can also use this annotation (by combining it with <code>AccessLevel.NONE</code>) to suppress generating a getter and/or setter altogether. - </p><p> - All fields marked as <code>transient</code> will not be considered for <code>hashCode</code> and <code>equals</code>. All static fields will be skipped entirely (not considered for any of the generated methods, and no setter/getter will be made for them). - </p><p> - If the class already contains a method with the same name and parameter count as any method that would normally be generated, that method is not generated, and no warning or error is emitted. For example, if you already have a method with signature <code>equals(AnyType param)</code>, no <code>equals</code> method will be generated, even though technically it might be an entirely different method due to having different parameter types. The same rule applies to the constructor (any explicit constructor will prevent <code>@Data</code> from generating one), as well as <code>toString</code>, <code>equals</code>, and all getters and setters. You can mark any constructor or method with <code>@lombok.experimental.Tolerate</code> to hide them from lombok. - </p><p> - <code>@Data</code> can handle generics parameters for fields just fine. In order to reduce the boilerplate when constructing objects for classes with - generics, you can use the <code>staticConstructor</code> parameter to generate a private constructor, as well as a static method that returns a new instance. This way, javac will infer the variable name. Thus, by declaring like so: <code>@Data(staticConstructor="of") class Foo<T> { private T x;}</code> you can create new instances of <code>Foo</code> by writing: <code>Foo.of(5);</code> instead of having to write: <code>new Foo<Integer>(5);</code>. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.data.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@Data</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p>See the small print of <a href="ToString.html"><code>@ToString</code></a>, <a href="EqualsAndHashCode.html"><code>@EqualsAndHashCode</code></a>, - <a href="GetterSetter.html"><code>@Getter / @Setter</code></a> and <a href="Constructor.html">@RequiredArgsConstructor</a>. - </p><p> - Any annotations named <code>@NonNull</code> (case insensitive) on a field are interpreted as: This field must not ever hold - <em>null</em>. Therefore, these annotations result in an explicit null check in the generated constructor for the provided field. Also, these - annotations (as well as any annotation named <code>@Nullable</code>) are copied to the constructor parameter, in both the true constructor and - any static constructor. The same principle applies to generated getters and setters (see the documentation for <a href="GetterSetter.html">@Getter / @Setter</a>) - </p><p> - By default, any variables that start with a $ symbol are excluded automatically. - You can include them by specifying an explicit annotation (<code>@Getter</code> or <code>@ToString</code>, for example) and using the 'of' parameter. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="Constructor.html">Previous feature (@<em>X</em>Constructor)</a> | <a href="Value.html">Next feature (@Value)</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/EqualsAndHashCode.html b/website/features/EqualsAndHashCode.html deleted file mode 100644 index d0298a7b..00000000 --- a/website/features/EqualsAndHashCode.html +++ /dev/null @@ -1,97 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@EqualsAndHashCode</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@EqualsAndHashCode</h1> - <div class="byline">Equality made easy: Generates <code>hashCode</code> and <code>equals</code> implementations from the fields of your object.</div> - <div class="overview"> - <h3>Overview</h3> - <p> - Any class definition may be annotated with <code>@EqualsAndHashCode</code> to let lombok generate implementations of the <code>equals(Object other)</code> and <code>hashCode()</code> methods. By default, it'll use all non-static, non-transient fields, but you can exclude more fields by naming them in the optional <code>exclude</code> parameter to the annotation. Alternatively, you can specify exactly which fields you wish to be used by naming them in the <code>of</code> parameter. - </p><p> - If applying <code>@EqualsAndHashCode</code> to a class that extends another, this feature gets a bit trickier. Normally, auto-generating an <code>equals</code> and <code>hashCode</code> method for such classes is a bad idea, as the superclass also defines fields, which also need equals/hashCode code but - this code will not be generated. By setting <code>callSuper</code> to <em>true</em>, you can include the <code>equals</code> and <code>hashCode</code> methods of your superclass in the generated methods. For <code>hashCode</code>, the result of <code>super.hashCode()</code> is included in the hash algorithm, and for <code>equals</code>, the generated method will return false if the super implementation thinks it is not equal to the passed in object. Be aware that not all <code>equals</code> implementations handle this situation properly. However, lombok-generated <code>equals</code> implementations <strong>do</strong> handle this situation properly, so you can safely call your superclass equals if it, too, has a lombok-generated <code>equals</code> method. If you have an explicit superclass you are forced to supply some value for <code>callSuper</code> to acknowledge that you've considered it; failure to do so results in a warning.<br /> - </p><p> - Setting <code>callSuper</code> to <em>true</em> when you don't extend anything (you extend <code>java.lang.Object</code>) is a compile-time error, because it would turn the generated <code>equals()</code> and <code>hashCode()</code> implementations into having the same behaviour as simply inheriting these methods from <code>java.lang.Object</code>: only the same object will be equal to each other and will have the same hashCode. Not setting <code>callSuper</code> to <em>true</em> when you extend another class generates a warning, because unless the superclass has no (equality-important) fields, lombok cannot generate an implementation for you that takes into account the fields declared by your superclasses. You'll need to write your own implementations, or rely on the - <code>callSuper</code> chaining facility. You can also use the <code>lombok.equalsAndHashCode.callSuper</code> config key. - </p><p> - <em>NEW in Lombok 0.10: </em>Unless your class is <code>final</code> and extends <code>java.lang.Object</code>, lombok generates a <code>canEqual</code> method - which means JPA proxies can still be equal to their base class, but subclasses that add new state don't break the equals contract. The complicated reasons for - why such a method is necessary are explained in this paper: <a href="http://www.artima.com/lejava/articles/equality.html">How to Write an Equality Method in Java</a>. - If all classes in a hierarchy are a mix of scala case classes and classes with lombok-generated equals methods, all equality will 'just work'. - If you need to write your own equals methods, you should always override <code>canEqual</code> if you change <code>equals</code> and <code>hashCode</code>. - </p><p> - <em>NEW in Lombok 1.14.0: </em>To put annotations on the <code>other</code> parameter of the <code>equals</code> (and, if relevant, <code>canEqual</code>) method, you can use <code>onParam=@__({@AnnotationsHere})</code>. Be careful though! This is an experimental feature. For more details see the documentation on the <a href="experimental/onX.html">onX</a> feature. - - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.equalsAndHashCode.doNotUseGetters</code> = [<code>true</code> | <code>false</code>] (default: false)</dt> - <dd>If set to <code>true</code>, lombok will access fields directly instead of using getters (if available) when generating <code>equals</code> and <code>hashCode</code> methods. The annotation parameter '<code>doNotUseGetters</code>', if explicitly specified, takes precedence over this setting.</dd> - <dt><code>lombok.equalsAndHashCode.callSuper</code> = [<code>call</code> | <code>skip</code> | <code>warn</code>] (default: warn)</dt> - <dd>If set to <code>call</code>, lombok will generate calls to the superclass implementation of <code>hashCode</code> and <code>equals</code> if your class extends something. If set to <code>skip</code> no such calls are generated. The default behaviour is like <code>skip</code>, with an additional warning.</dd> - <dt><code>lombok.equalsAndHashCode.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@EqualsAndHashCode</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - Arrays are 'deep' compared/hashCoded, which means that arrays that contain themselves will result in <code>StackOverflowError</code>s. However, this behaviour is no different from e.g. <code>ArrayList</code>. - </p><p> - You may safely presume that the hashCode implementation used will not change between versions of lombok, however this guarantee is not set in stone; if there's a significant performance improvement to be gained from using an alternate hash algorithm, that will be substituted in a future version. - </p><p> - For the purposes of equality, 2 <code>NaN</code> (not a number) values for floats and doubles are considered equal, eventhough 'NaN == NaN' would return false. This is analogous to <code>java.lang.Double</code>'s equals method, and is in fact required to ensure that comparing an object to an exact copy of itself returns <code>true</code> for equality. - </p><p> - If there is <em>any</em> method named either <code>hashCode</code> or <code>equals</code>, regardless of return type, no methods will be generated, and a warning is emitted instead. These 2 methods need to be in sync with each other, which lombok cannot guarantee unless it generates all the methods, hence you always get a warning if one <em>or</em> both of the methods already exist. You can mark any method with <code>@lombok.experimental.Tolerate</code> to hide them from lombok. - </p><p> - Attempting to exclude fields that don't exist or would have been excluded anyway (because they are static or transient) results in warnings on the named fields. You therefore don't have to worry about typos. - </p><p> - Having both <code>exclude</code> and <code>of</code> generates a warning; the <code>exclude</code> parameter will be ignored in that case. - </p><p> - By default, any variables that start with a $ symbol are excluded automatically. You can only include them by using the 'of' parameter. - </p><p> - If a getter exists for a field to be included, it is called instead of using a direct field reference. This behaviour can be suppressed:<br /> - <code>@EqualsAndHashCode(doNotUseGetters = true)</code> - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="ToString.html">Previous feature (@ToString)</a> | <a href="Constructor.html">Next feature (@<em>X</em>Constructor)</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/GetterLazy.html b/website/features/GetterLazy.html deleted file mode 100644 index 01a11c55..00000000 --- a/website/features/GetterLazy.html +++ /dev/null @@ -1,66 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@Getter(lazy=true)</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@Getter(lazy=true)</h1> - <div class="byline">Laziness is a virtue!</div> - <div class="overview"> - <h3>Overview</h3> - <p> - <em>NEW IN Lombok 0.10: </em>You can let lombok generate a getter which will calculate a value once, the first time this getter is called, and cache it from then on. This can be useful if calculating the value takes a lot of CPU, or the value takes a lot of memory. To use this feature, create a <code>private final</code> variable, initialize it with the expression that's expensive to run, and annotate your field with <code>@Getter(lazy=true)</code>. The field will be hidden from the rest of your code, and the expression will be evaluated no more than once, when the getter is first called. There are no magic marker values (i.e. even if the result of your expensive calculation is <code>null</code>, the result is cached) and your expensive calculation need not be thread-safe, as lombok takes care of locking. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys (in addition to those listed on <a href="GetterSetter.html"><code>@Getter</code>'s main page</a>):</h3> - <dl> - <dt><code>lombok.getter.lazy.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@Getter(lazy=true)</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - You should never refer to the field directly, always use the getter generated by lombok, because the type of the field will be mangled into an <code>AtomicReference</code>. Do not try to directly access this <code>AtomicReference</code>; if it points to itself, the value has been calculated, and it is <code>null</code>. If the reference points to <code>null</code>, then the value has not been calculated. This behaviour may change in future versions. Therefore, <em>always</em> use the generated getter to access your field! - </p><p> - Other Lombok annotations such as <code>@ToString</code> always call the getter even if you use <code>doNotUseGetters=true</code>. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="Synchronized.html">Previous feature (@Synchronized)</a> | <a href="Log.html">Next feature (@Log)</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/GetterSetter.html b/website/features/GetterSetter.html deleted file mode 100644 index f26d24d9..00000000 --- a/website/features/GetterSetter.html +++ /dev/null @@ -1,105 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@Getter and @Setter</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@Getter and @Setter</h1> - <div class="byline">Never write <code>public int getFoo() {return foo;}</code> again.</div> - <div class="overview"> - <h3>Overview</h3> - <p> - You can annotate any field with <code>@Getter</code> and/or <code>@Setter</code>, to let lombok generate the default getter/setter automatically.<br /> - A default getter simply returns the field, and is named <code>getFoo</code> if the field is called <code>foo</code> (or <code>isFoo</code> if the field's type is <code>boolean</code>). A default setter is named <code>setFoo</code> if the field is called <code>foo</code>, returns <code>void</code>, and takes 1 parameter of the same type as the field. It simply sets the field to this value. - </p><p> - The generated getter/setter method will be <code>public</code> unless you explicitly specify an <code>AccessLevel</code>, as shown in the example below. Legal access levels are <code>PUBLIC</code>, <code>PROTECTED</code>, <code>PACKAGE</code>, and <code>PRIVATE</code>. - </p><p> - You can also put a <code>@Getter</code> and/or <code>@Setter</code> annotation on a class. In that case, it's as if you annotate all the non-static fields in that class with the annotation. - </p><p> - You can always manually disable getter/setter generation for any field by using the special <code>AccessLevel.NONE</code> access level. This lets you override the behaviour of a <code>@Getter</code>, <code>@Setter</code> or <code>@Data</code> annotation on a class. - </p><p> - To put annotations on the generated method, you can use <code>onMethod=@__({@AnnotationsHere})</code>; to put annotations on the only parameter of a generated setter method, you can use <code>onParam=@__({@AnnotationsHere})</code>. Be careful though! This is an experimental feature. For more details see the documentation on the <a href="experimental/onX.html">onX</a> feature. - </p><p> - <em>NEW in lombok v1.12.0:</em> javadoc on the field will now be copied to generated getters and setters. Normally, all text is copied, and <code>@return</code> is <em>moved</em> to the getter, whilst <code>@param</code> lines are <em>moved</em> to the setter. Moved means: Deleted from the field's javadoc. It is also possible to define unique text for each getter/setter. To do that, you create a 'section' named <code>GETTER</code> and/or <code>SETTER</code>. A section is a line in your javadoc containing 2 or more dashes, then the text 'GETTER' or 'SETTER', followed by 2 or more dashes, and nothing else on the line. If you use sections, <code>@return</code> and <code>@param</code> stripping for that section is no longer done (move the <code>@return</code> or <code>@param</code> line into the section). - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.accessors.chain</code> = [<code>true</code> | <code>false</code>] (default: false)</dt> - <dd>If set to <code>true</code>, generated setters will return <code>this</code> (instead of <code>void</code>). An explicitly configured <code>chain</code> parameter of an <a href="experimental/Accessors.html"><code>@Accessors</code></a> annotation takes precedence over this setting.</dd> - <dt><code>lombok.accessors.fluent</code> = [<code>true</code> | <code>false</code>] (default: false)</dt> - <dd>If set to <code>true</code>, generated getters and setters will not be prefixed with the bean-standard '<code>get</code>, <code>is</code> or <code>set</code>; instead, the methods will use the same name as the field (minus prefixes). An explicitly configured <code>chain</code> parameter of an <a href="experimental/Accessors.html"><code>@Accessors</code></a> annotation takes precedence over this setting.</dd> - <dt><code>lombok.accessors.prefix</code> += <em>a field prefix</em> (default: empty list)</dt> - <dd>This is a list property; entries can be added with the <code>+=</code> operator. Inherited prefixes from parent config files can be removed with the <code>-=</code> operator. Lombok will strip any matching field prefix from the name of a field in order to determine the name of the getter/setter to generate. For example, if <code>m</code> is one of the prefixes listed in this setting, then a field named <code>mFoobar</code> will result in a getter named <code>getFoobar()</code>, not <code>getMFoobar()</code>. An explicitly configured <code>prefix</code> parameter of an <a href="experimental/Accessors.html"><code>@Accessors</code></a> annotation takes precedence over this setting.</dd> - <dt><code>lombok.getter.noIsPrefix</code> = [<code>true</code> | <code>false</code>] (default: false)</dt> - <dd>If set to <code>true</code>, getters generated for <code>boolean</code> fields will use the <code>get</code> prefix instead of the default<code>is</code> prefix, and any generated code that calls getters, such as <code>@ToString</code>, will also use <code>get</code> instead of <code>is</code> - <dt><code>lombok.setter.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@Setter</code> as a warning or error if configured.</dd> - <dt><code>lombok.getter.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@Getter</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - For generating the method names, the first character of the field, if it is a lowercase character, is title-cased, otherwise, it is left unmodified. Then, get/set/is is prefixed. - </p><p> - No method is generated if any method already exists with the same name (case insensitive) and same parameter count. For example, <code>getFoo()</code> will not be generated if there's already a method <code>getFoo(String... x)</code> even though it is technically possible to make the method. This caveat exists to prevent confusion. If the generation of a method is skipped for this reason, a warning is emitted instead. Varargs count as 0 to N parameters. You can mark any method with <code>@lombok.experimental.Tolerate</code> to hide them from lombok. - </p><p> - For <code>boolean</code> fields that start with <code>is</code> immediately followed by a title-case letter, nothing is prefixed to generate the getter name. - </p><p> - Any variation on <code>boolean</code> will <em>not</em> result in using the <code>is</code> prefix instead of the <code>get</code> prefix; for example, - returning <code>java.lang.Boolean</code> results in a <code>get</code> prefix, not an <code>is</code> prefix. - </p><p> - Any annotations named <code>@NonNull</code> (case insensitive) on the field are interpreted as: This field must not ever hold - <em>null</em>. Therefore, these annotations result in an explicit null check in the generated setter. Also, these - annotations (as well as any annotation named <code>@Nullable</code> or <code>@CheckForNull</code>) are copied to setter parameter and getter method. - </p><p> - You can annotate a class with a <code>@Getter</code> or <code>@Setter</code> annotation. Doing so is equivalent to annotating all non-static fields - in that class with that annotation. <code>@Getter</code>/<code>@Setter</code> annotations on fields take precedence over the ones on classes. - </p><p> - Using the <code>AccessLevel.NONE</code> access level simply generates nothing. It's useful only in combination with - <a href="Data.html"><code>@Data</code></a> or a class-wide <code>@Getter</code> or <code>@Setter</code>. - </p><p> - <code>@Getter</code> can also be used on enums. <code>@Setter</code> can't, not for a technical reason, but - for a pragmatic one: Setters on enums are an extremely bad idea. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="Cleanup.html">Previous feature (@Cleanup)</a> | <a href="ToString.html">Next feature (@ToString)</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/Log.html b/website/features/Log.html deleted file mode 100644 index 9415ddd9..00000000 --- a/website/features/Log.html +++ /dev/null @@ -1,105 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@Log (and friends)</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@Log (and friends)</h1> - <div class="byline">Captain's Log, stardate 24435.7: "What was that line again?"</div> - <div class="overview"> - <h3>Overview</h3> - <p> - <em>NEW in lombok 0.10: </em>You can annotate any class with a log annotation to let lombok generate a logger field.<br /> - The logger is named <code>log</code> and the field's type depends on which logger you have selected. - </p><p> - There are several choices available:<br /> - <dl> - <dt><code>@CommonsLog</code></dt> - <dd>Creates <code><span class="keyword">private static final </span><a href="http://commons.apache.org/logging/apidocs/org/apache/commons/logging/Log.html">org.apache.commons.logging.Log</a> <span class="staticfield">log</span> = <a href="http://commons.apache.org/logging/apidocs/org/apache/commons/logging/LogFactory.html#getLog(java.lang.Class)">org.apache.commons.logging.LogFactory.getLog</a>(LogExample.<span class="keyword">class</span>);</code></dd> - <dt><code>@JBossLog</code></dt> - <dd>Creates <code><span class="keyword">private static final </span><a href="http://docs.jboss.org/jbosslogging/latest/org/jboss/logging/Logger.html">org.jboss.logging.Logger</a> <span class="staticfield">log</span> = <a href="http://docs.jboss.org/jbosslogging/latest/org/jboss/logging/Logger.html#getLogger(java.lang.Class)">org.jboss.logging.Logger.getLogger</a>(LogExample.<span class="keyword">class</span>);</code></dd> - <dt><code>@Log</code></dt> - <dd>Creates <code><span class="keyword">private static final </span><a href="http://download.oracle.com/javase/6/docs/api/java/util/logging/Logger.html">java.util.logging.Logger</a> <span class="staticfield">log</span> = <a href="http://download.oracle.com/javase/6/docs/api/java/util/logging/Logger.html#getLogger(java.lang.String)">java.util.logging.Logger.getLogger</a>(LogExample.<span class="keyword">class</span>.getName());</code></dd> - <dt><code>@Log4j</code></dt> - <dd>Creates <code><span class="keyword">private static final </span><a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Logger.html">org.apache.log4j.Logger</a> <span class="staticfield">log</span> = <a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Logger.html#getLogger(java.lang.Class)">org.apache.log4j.Logger.getLogger</a>(LogExample.<span class="keyword">class</span>);</code></dd> - <dt><code>@Log4j2</code></dt> - <dd>Creates <code><span class="keyword">private static final </span><a href="http://logging.apache.org/log4j/2.0/log4j-api/apidocs/org/apache/logging/log4j/Logger.html">org.apache.logging.log4j.Logger</a> <span class="staticfield">log</span> = <a href="http://logging.apache.org/log4j/2.0/log4j-api/apidocs/org/apache/logging/log4j/LogManager.html#getLogger(java.lang.Class)">org.apache.logging.log4j.LogManager.getLogger</a>(LogExample.<span class="keyword">class</span>);</code></dd> - <dt><code>@Slf4j</code></dt> - <dd>Creates <code><span class="keyword">private static final </span><a href="http://www.slf4j.org/api/org/slf4j/Logger.html">org.slf4j.Logger</a> <span class="staticfield">log</span> = <a href="http://www.slf4j.org/apidocs/org/slf4j/LoggerFactory.html#getLogger(java.lang.Class)">org.slf4j.LoggerFactory.getLogger</a>(LogExample.<span class="keyword">class</span>);</code></dd> - <dt><code>@XSlf4j</code></dt> - <dd>Creates <code><span class="keyword">private static final </span><a href="http://www.slf4j.org/api/org/slf4j/ext/XLogger.html">org.slf4j.ext.XLogger</a> <span class="staticfield">log</span> = <a href="http://www.slf4j.org/apidocs/org/slf4j/ext/XLoggerFactory.html#getXLogger(java.lang.Class)">org.slf4j.ext.XLoggerFactory.getXLogger</a>(LogExample.<span class="keyword">class</span>);</code></dd> - </dl> - </p><p> - By default, the topic (or name) of the logger will be the class name of the class annotated with the <code>@Log</code> annotation. This can be customised by specifying the <code>topic</code> parameter. For example: <code>@XSlf4j(topic="reporting")</code>. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.log.fieldName</code> = <em>an identifier</em> (default: <code>log</code>)</dt> - <dd>The generated logger fieldname is by default '<code>log</code>', but you can change it to a different name with this setting.</dd> - <dt><code>lombok.log.fieldIsStatic</code> = [<code>true</code> | <code>false</code>] (default: true)</dt> - <dd>Normally the generated logger is a <code>static</code> field. By setting this key to <code>false</code>, the generated field will be an instance field instead.</dd> - <dt><code>lombok.log.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of any of the various log annotations as a warning or error if configured.</dd> - <dt><code>lombok.log.apacheCommons.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@lombok.extern.apachecommons.CommonsLog</code> as a warning or error if configured.</dd> - <dt><code>lombok.log.javaUtilLogging.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@lombok.extern.java.Log</code> as a warning or error if configured.</dd> - <dt><code>lombok.log.jbosslog.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@lombok.extern.jbosslog.JBossLog</code> as a warning or error if configured.</dd> - <dt><code>lombok.log.log4j.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@lombok.extern.log4j.Log4j</code> as a warning or error if configured.</dd> - <dt><code>lombok.log.log4j2.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@lombok.extern.log4j.Log4j2</code> as a warning or error if configured.</dd> - <dt><code>lombok.log.slf4j.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@lombok.extern.slf4j.Slf4j</code> as a warning or error if configured.</dd> - <dt><code>lombok.log.xslf4j.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@lombok.extern.slf4j.XSlf4j</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - If a field called <code>log</code> already exists, a warning will be emitted and no code will be generated. - </p><p> - A future feature of lombok's diverse log annotations is to find calls to the logger field and, if the chosen logging framework supports it and the log level can be compile-time determined from the log call, guard it with an <code>if</code> statement. This way if the log statement ends up being ignored, the potentially expensive calculation of the log string is avoided entirely. This does mean that you should <em>NOT</em> put any side-effects in the expression that you log. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="GetterLazy.html">Previous feature (@Getter(lazy=true))</a> | <a href="configuration.html">Next feature (configuration)</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/NonNull.html b/website/features/NonNull.html deleted file mode 100644 index c322309e..00000000 --- a/website/features/NonNull.html +++ /dev/null @@ -1,86 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@NonNull</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@NonNull</h1> - <div class="byline">or: How I learned to stop worrying and love the NullPointerException.</div> - <div class="overview"> - <h3>Overview</h3> - <p> - <em>NEW in Lombok 0.11.10: </em>You can use <code>@NonNull</code> on the parameter of a method or constructor to have lombok generate a null-check statement for you.<br /> - </p><p> - Lombok has always treated any annotation named <code>@NonNull</code> on a field as a signal to generate a null-check if lombok generates an entire method or constructor for you, via - for example <a href="Data.html"><code>@Data</code></a>. Now, however, using lombok's own <code>@lombok.NonNull</code> on a parameter results in the insertion of just the null-check - statement inside your own method or constructor. - </p><p> - The null-check looks like <code>if (param == null) throw new NullPointerException("param");</code> and will be inserted at the very top of your method. For constructors, the null-check - will be inserted immediately following any explicit <code>this()</code> or <code>super()</code> calls. - </p><p> - If a null-check is already present at the top, no additional null-check will be generated. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.nonNull.exceptionType</code> = [<code>NullPointerException</code> | <code>IllegalArgumentException</code>] (default: <code>NullPointerException</code>). - <dd>When lombok generates a null-check <code>if</code> statement, by default, a <code>java.lang.NullPointerException</code> will be thrown with the field name as the exception message. - However, you can use <code>IllegalArgumentException</code> in this configuration key to have lombok throw that exception, with '<em>fieldName</em> is null' as exception message.</dd> - <dt><code>lombok.nonNull.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@NonNull</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - Lombok's detection scheme for already existing null-checks consists of scanning for if statements that look just like lombok's own. Any 'throws' statement as - the 'then' part of the if statement, whether in braces or not, counts. The conditional of the if statement <em>must</em> look exactly like <code>PARAMNAME == null</code>. - The first statement in your method that is not such a null-check stops the process of inspecting for null-checks. - </p><p> - While <code>@Data</code> and other method-generating lombok annotations will trigger on any annotation named <code>@NonNull</code> regardless of casing or package name, - this feature only triggers on lombok's own <code>@NonNull</code> annotation from the <code>lombok</code> package. - </p><p> - A <code>@NonNull</code> on a primitive parameter results in a warning. No null-check will be generated. - </p><p> - A <code>@NonNull</code> on a parameter of an abstract method used to generate a warning; starting with version 1.16.8, this is no longer the case, to acknowledge the notion that <code>@NonNull</code> also has a - documentary role. For the same reason, you can annotate a method as <code>@NonNull</code>; this is allowed, generates no warning, and does not generate any code. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="val.html">Previous feature (val)</a> | <a href="Cleanup.html">Next feature (@Cleanup)</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/Singular-snippet.html b/website/features/Singular-snippet.html deleted file mode 100644 index 8933ef47..00000000 --- a/website/features/Singular-snippet.html +++ /dev/null @@ -1,43 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@Builder's @Singular (snippet)</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@Singular snippet</h1> - <div class="singleColumnSnippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="footer"> - <a href="Builder.html">Back to @Builder</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/SneakyThrows.html b/website/features/SneakyThrows.html deleted file mode 100644 index 11937e63..00000000 --- a/website/features/SneakyThrows.html +++ /dev/null @@ -1,96 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@SneakyThrows</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@SneakyThrows</h1> - <div class="byline">To boldly throw checked exceptions where no one has thrown them before!</div> - <div class="overview"> - <h3>Overview</h3> - <p> - <code>@SneakyThrows</code> can be used to sneakily throw checked exceptions without actually declaring this in your method's <code>throws</code> - clause. This somewhat contentious ability should be used carefully, of course. The code generated by lombok will not ignore, wrap, replace, - or otherwise modify the thrown checked exception; it simply fakes out the compiler. On the JVM (class file) level, all exceptions, checked or not, - can be thrown regardless of the <code>throws</code> clause of your methods, which is why this works. - </p><p> - Common use cases for when you want to opt out of the checked exception mechanism center around 2 situations:<br /><ul> - <li>A needlessly strict interface, such as <code>Runnable</code> - whatever exception propagates out of your <code>run()</code> method, - checked or not, it will be passed to the <code>Thread</code>'s unhandled exception handler. Catching a checked exception and wrapping it - in some sort of <code>RuntimeException</code> is only obscuring the real cause of the issue.</li> - <li>An 'impossible' exception. For example, <code>new String(someByteArray, "UTF-8");</code> declares that it can throw an - <code>UnsupportedEncodingException</code> but according to the JVM specification, UTF-8 <em>must</em> always be available. An - <code>UnsupportedEncodingException</code> here is about as likely as a <code>ClassNotFoundError</code> when you use a String object, - and you don't catch those either!</li></ul> - </p><p> - Be aware that it is <em>impossible</em> to catch sneakily thrown checked types directly, as javac will not let you write a catch block - for an exception type that no method call in the try body declares as thrown. This problem is not relevant in either of the use cases listed - above, so let this serve as a warning that you should not use the <code>@SneakyThrows</code> mechanism without some deliberation! - </p><p> - You can pass any number of exceptions to the <code>@SneakyThrows</code> annotation. If you pass no exceptions, you may throw any - exception sneakily. - </p><p> - <em>NOTE: </em> with lombok versions older than 0.10, unlike other lombok transformations, you need to put <strong>lombok.jar</strong> on your - classpath when you run your program. - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.sneakyThrows.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@SneakyThrows</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - Because <code>@SneakyThrows</code> is an implementation detail and not part of your method signature, it is an error if you try to - declare a checked exception as sneakily thrown when you don't call any methods that throw this exception. (Doing so is perfectly legal - for <code>throws</code> statements to accommodate subclasses). Similarly, <code>@SneakyThrows</code> does not inherit. - </p><p> - For the nay-sayers in the crowd: Out of the box, Eclipse will offer a 'quick-fix' for uncaught exceptions that wraps the offending - statement in a try/catch block with just <code>e.printStackTrace()</code> in the catch block. This is so spectacularly non-productive - compared to just sneakily throwing the exception onwards, that Roel and Reinier feel more than justified in claiming that the - checked exception system is far from perfect, and thus an opt-out mechanism is warranted. - </p><p> - If you put <code>@SneakyThrows</code> on a constructor, any call to a sibling or super constructor is <em>excluded</em> from the <code>@SneakyThrows</code> treatment. This is a - java restriction we cannot work around: Calls to sibling/super constructors MUST be the first statement in the constructor; they cannot be placed inside try/catch blocks. - </p><p> - <code>@SneakyThrows</code> on an empty method, or a constructor that is empty or only has a call to a sibling / super constructor results in no try/catch block and a warning. - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="Builder.html">Previous feature (@Builder)</a> | <a href="Synchronized.html">Next feature (@Synchronized)</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/Synchronized.html b/website/features/Synchronized.html deleted file mode 100644 index b575e47c..00000000 --- a/website/features/Synchronized.html +++ /dev/null @@ -1,85 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@Synchronized</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@Synchronized</h1> - <div class="byline"><code>synchronized</code> done right: Don't expose your locks.</div> - <div class="overview"> - <h3>Overview</h3> - <p> - <code>@Synchronized</code> is a safer variant of the <code>synchronized</code> method modifier. Like <code>synchronized</code>, the - annotation can be used on static and instance methods only. It operates similarly to the <code>synchronized</code> keyword, but it locks - on different objects. The keyword locks on <code>this</code>, but the annotation locks on a field named <code>$lock</code>, which is private.<br /> - If the field does not exist, it is created for you. If you annotate a <code>static</code> method, the annotation locks on a static field - named <code>$LOCK</code> instead. - </p><p> - If you want, you can create these locks yourself. The <code>$lock</code> and <code>$LOCK</code> fields will of course not be generated if you - already created them yourself. You can also choose to lock on another field, by specifying it as parameter to the <code>@Synchronized</code> - annotation. In this usage variant, the fields will not be created automatically, and you must explicitly create them yourself, or an error will be emitted. - </p><p> - Locking on <code>this</code> or your own class object can have unfortunate side-effects, as other code not under your control can lock on these - objects as well, which can cause race conditions and other nasty threading-related bugs. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.synchronized.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@Synchronized</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - If <code>$lock</code> and/or <code>$LOCK</code> are auto-generated, the fields are initialized with an empty <code>Object[]</code> array, and not - just a <code>new Object()</code> as most snippets showing this pattern in action use. Lombok does this because a new object is <em>NOT</em> - serializable, but 0-size array is. Therefore, using <code>@Synchronized</code> will not prevent your object from being serialized. - </p><p> - Having at least one <code>@Synchronized</code> method in your class means there will be a lock field, but if you later remove all such methods, - there will no longer be a lock field. That means your predetermined <code>serialVersionUID</code> changes. We suggest you <em>always</em> add - a <code>serialVersionUID</code> to your classes if you intend to store them long-term via java's serialization mechanism. If you do so, removing - all <code>@Synchronized</code> annotations from your method will not break serialization. - </p><p> - If you'd like to know why a field is not automatically generated when you choose your own name for the lock object: Because otherwise making a typo - in the field name will result in a <em>very</em> hard to find bug! - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="SneakyThrows.html">Previous feature (@SneakyThrows)</a> | <a href="GetterLazy.html">Next feature (@Getter(lazy=true))</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/ToString.html b/website/features/ToString.html deleted file mode 100644 index 6571714d..00000000 --- a/website/features/ToString.html +++ /dev/null @@ -1,92 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@ToString</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@ToString</h1> - <div class="byline">No need to start a debugger to see your fields: Just let lombok generate a <code>toString</code> for you!</div> - <div class="overview"> - <h3>Overview</h3> - <p> - Any class definition may be annotated with <code>@ToString</code> to let lombok generate an implementation of the <code>toString()</code> method. By default, it'll print your class name, along with each field, in order, separated by commas. - </p><p> - By setting the <code>includeFieldNames</code> parameter to <em>true</em> you can add some clarity (but also quite some length) to the output of the <code>toString()</code> method. - </p><p> - By default, all non-static fields will be printed. If you want to skip some fields, you can name them in the <code>exclude</code> parameter; each named field will not be printed at all. Alternatively, you can specify exactly which fields you wish to be used by naming them in the <code>of</code> parameter. - </p><p> - By setting <code>callSuper</code> to <em>true</em>, you can include the output of the superclass implementation of <code>toString</code> to the output. Be aware that the default implementation of <code>toString()</code> in <code>java.lang.Object</code> is pretty much meaningless, so you probably don't want to do this unless you are extending another class. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.toString.includeFieldNames</code> = [<code>true</code> | <code>false</code>] (default: true)</dt> - <dd>Normally lombok generates a fragment of the toString response for each field in the form of <code>fieldName = fieldValue</code>. If this setting is set to <code>false</code>, lombok will omit the name of the field and simply deploy a comma-separated list of all the field values. The annotation parameter '<code>includeFieldNames</code>', if explicitly specified, takes precedence over this setting.</dd> - <dt><code>lombok.toString.doNotUseGetters</code> = [<code>true</code> | <code>false</code>] (default: false)</dt> - <dd>If set to <code>true</code>, lombok will access fields directly instead of using getters (if available) when generating <code>toString</code> methods. The annotation parameter '<code>doNotUseGetters</code>', if explicitly specified, takes precedence over this setting.</dd> - <dt><code>lombok.toString.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@ToString</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - If there is <em>any</em> method named <code>toString</code> with no arguments, regardless of return type, no method will be generated, and instead a warning is emitted explaining that your <code>@ToString</code> annotation is doing nothing. You can mark any method with <code>@lombok.experimental.Tolerate</code> to hide them from lombok. - </p><p> - Arrays are printed via <code>Arrays.deepToString</code>, which means that arrays that contain themselves will result in <code>StackOverflowError</code>s. However, - this behaviour is no different from e.g. <code>ArrayList</code>. - </p><p> - Attempting to exclude fields that don't exist or would have been excluded anyway (because they are static) results in warnings on the named fields. - You therefore don't have to worry about typos. - </p><p> - Having both <code>exclude</code> and <code>of</code> generates a warning; the <code>exclude</code> parameter will be ignored in that case. - </p><p> - We don't promise to keep the output of the generated <code>toString()</code> methods the same between lombok versions. You should never design your API so that - other code is forced to parse your <code>toString()</code> output anyway! - </p><p> - By default, any variables that start with a $ symbol are excluded automatically. You can only include them by using the 'of' parameter. - </p><p> - If a getter exists for a field to be included, it is called instead of using a direct field reference. This behaviour can be suppressed:<br /> - <code>@ToString(doNotUseGetters = true)</code> - </p><p> - <code>@ToString</code> can also be used on an enum definition. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="GetterSetter.html">Previous feature (@Getter / @Setter)</a> | <a href="EqualsAndHashCode.html">Next feature (@EqualsAndHashCode)</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/Value.html b/website/features/Value.html deleted file mode 100644 index 6c86a77b..00000000 --- a/website/features/Value.html +++ /dev/null @@ -1,87 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@Value</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>@Value</h1> - <div class="byline">Immutable classes made very easy.</div> - <div class="since"> - <h3>Since</h3> - <p> - <code>@Value</code> was introduced as experimental feature in lombok v0.11.4. - </p><p> - <code>@Value</code> no longer implies <code>@Wither</code> since lombok v0.11.8. - </p><p> - <code>@Value</code> promoted to the main <code>lombok</code> package since lombok v0.12.0. - </p> - </div> - <div class="overview"> - <h3>Overview</h3> - <p> - <code>@Value</code> is the immutable variant of <a href="Data.html"><code>@Data</code></a>; all fields are made <code>private</code> and <code>final</code> by default, and setters are not generated. The class itself is also made <code>final</code> by default, because immutability is not something that can be forced onto a subclass. Like <code>@Data</code>, useful <code>toString()</code>, <code>equals()</code> and <code>hashCode()</code> methods are also generated, each field gets a getter method, and a constructor that covers every - argument (except <code>final</code> fields that are initialized in the field declaration) is also generated. - </p><p> - In practice, <code>@Value</code> is shorthand for: <code>final @ToString @EqualsAndHashCode @AllArgsConstructor @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @Getter</code>, except that explicitly including an implementation of any of the relevant methods simply means that part won't be generated and no warning will be emitted. For example, if you write your own <code>toString</code>, no error occurs, and lombok will not generate a <code>toString</code>. Also, <em>any</em> explicit constructor, no matter the arguments list, implies lombok will not generate a constructor. If you do want lombok to generate the all-args constructor, add <code>@AllArgsConstructor</code> to the class. You can mark any constructor or method with <code>@lombok.experimental.Tolerate</code> to hide them from lombok. - </p><p> - It is possible to override the final-by-default and private-by-default behavior using either an explicit access level on a field, or by using the <code>@NonFinal</code> or <code>@PackagePrivate</code> annotations.<br /> - It is possible to override any default behavior for any of the 'parts' that make up <code>@Value</code> by explicitly using that annotation. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.value.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@Value</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - Look for the documentation on the 'parts' of <code>@Value</code>: <a href="ToString.html"><code>@ToString</code></a>, <a href="EqualsAndHashCode.html"><code>@EqualsAndHashCode</code></a>, <a href="Constructor.html"><code>@AllArgsConstructor</code></a>, <a href="experimental/FieldDefaults.html"><code>@FieldDefaults</code></a>, and <a href="GetterSetter.html"><code>@Getter</code></a>. - </p><p> - For classes with generics, it's useful to have a static method which serves as a constructor, because inference of generic parameters via static methods works in java6 and avoids having to use the diamond operator. While you can force this by applying an explicit <code>@AllArgsConstructor(staticConstructor="of")</code> annotation, there's also the <code>@Value(staticConstructor="of")</code> feature, which will make the generated all-arguments constructor private, and generates a public static method named <code>of</code> which is a wrapper around this private constructor. - </p><p> - <code>@Value</code> was an experimental feature from v0.11.4 to v0.11.9 (as <code>@lombok.experimental.Value</code>). It has since been moved into the core package. The old annotation is still - around (and is an alias). It will eventually be removed in a future version, though. - </p><p> - It is not possible to use <code>@FieldDefaults</code> to 'undo' the private-by-default and final-by-default aspect of fields in the annotated class. Use <code>@NonFinal</code> and <code>@PackagePrivate</code> on the fields in the class to override this behaviour. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="Data.html">Previous feature (@Data)</a> | <a href="Builder.html">Next feature (@Builder)</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/clear.gif b/website/features/clear.gif Binary files differdeleted file mode 100644 index 35d42e80..00000000 --- a/website/features/clear.gif +++ /dev/null diff --git a/website/features/configuration.html b/website/features/configuration.html deleted file mode 100644 index ee7dabd5..00000000 --- a/website/features/configuration.html +++ /dev/null @@ -1,115 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Configuration system</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>Configuration system</h1> - <div class="byline">Lombok, made to order: Configure lombok features in one place for your entire project or even your workspace.</div> - <div class="overview"> - <h3>Overview</h3> - <p> - <em>NEW in lombok 1.14: </em>You can create <code>lombok.config</code> files in any directory and put configuration directives in it. These apply to all source files in this directory and all child directories.<br /> - The configuration system is particularly useful for configurable aspects of lombok which tend to be the same across an entire project, such as the name of your log variable. The configuration system can also be used to tell lombok to flag any usage of some lombok feature you don't like as a warning or even an error. - </p><p> - Usually, a user of lombok puts a <code>lombok.config</code> file with their preferences in a workspace or project root directory, with the special <code>config.stopBubbling = true</code> key to tell lombok this is your root directory. You can then create <code>lombok.config</code> files in any subdirectories (generally representing projects or source packages) with different settings. - </p><p> - An up to date list of all configuration keys supported by your version of lombok can be generated by running: - <div class="snippet example"> - <code>java -jar lombok.jar config -g --verbose</code> - </div> - The output of the <em>config</em> tool is itself a valid <code>lombok.config</code> file.<br /> - The <em>config</em> tool can also be used to display the complete lombok configuration used for any given directory or source file by supplying these as arguments. - </p><p> - A sample of available configuration options (see the feature pages of the lombok features for their related config keys, as well as <code>java -jar lombok.jar config -g</code> for the complete list): - <dl> - <dt><code>lombok.accessors.chain</code></dt> - <dd>If set to <code>true</code>, generated setters will 'chain' by default (They will return <code>this</code> instead of having a <code>void</code> return type).</dd> - <dt><code>lombok.accessors.fluent</code></dt> - <dd>If set to <code>true</code>, generated setters and getters will simply be named the same as the field name, without a <code>get</code> or <code>set</code> prefix.</dd> - <dt><code>lombok.anyConstructor.suppressConstructorProperties</code></dt> - <dd>If <code>true</code>, lombok will not generate a <code>@java.beans.ConstructorProperties</code> annotation when generating constructors. This is particularly useful for GWT and Android development.</dd> - <dt><code>lombok.log.fieldName</code></dt> - <dd>The name of the generated log field (default: <code>log</code>).</dd> - <dt><code>lombok.<em>(featureName)</em>.flagUsage</code></dt> - <dd>Allows you to forcibly stop or discourage use of a lombok feature. Legal values for this key are <code>warning</code> or <code>error</code>. Some examples of values for <em>(featureName)</em> are: "<code>experimental</code>" (flags use of any of the <a href="experimental/index.html">experimental</a> features)</li>, "<a href="experimental/Builder.html"><code>builder</code></a>", "<a href="SneakyThrows.html"><code>sneakyThrows</code></a>", or "<a href="experimental/ExtensionMethod.html"><code>extensionMethod</code></a>".</dd> - </dl> - </p><p> - Configuration files are hierarchical: Any configuration setting applies to all source files in that directory, and all source files in subdirectories, but configuration settings closer to the source file take precedence. For example, if you have in <code>/Users/me/projects/lombok.config</code> the following: - <div class="snippet example"> - <code>lombok.log.fieldName = foobar</code> - </div> - and in <code>/Users/me/projects/MyProject/lombok.config</code> you have: - <div class="snippet example"> - <code>lombok.log.fieldName = xyzzy</code> - </div> - - Then the various <a href="Log.html"><code>@Log</code></a> annotations will use <code>foobar</code> instead of the default <code>log</code> as a field name to generate in all your projects, - except for your project in <code>/Users/me/projects/MyProject</code>, where <code>xyzzy</code> is used instead. - </p><p> - To restore a configuration key set by a parent config file back to the default, the <code>clear</code> option can be used. For example, if a parent configuration file has configured all use of <code>val</code> to emit a warning, you can turn off the warnings for a subdirectory by including in it a <code>lombok.config</code> file with: - <div class="snippet example"> - <code>clear lombok.val.flagUsage</code> - </div> - </p><p> - Some configuration keys take lists. For lists, use <code>+=</code> to add an entry. You can remove a single item from the list (useful to undo a parent configuration file's setting) with <code>-=</code>. For example: - <div class="snippet example"> - <code>lombok.accessors.prefix += m_</code> - </div> - </p><p> - Comments can be included in <code>lombok.config</code> files; any line that starts with <code>#</code> is considered a comment. - </p> - </div> - <div class="overview" style="clear: left;"> - <h3>Global config keys</h3> - <p> - To stop lombok from looking at parent directories for more configuration files, the special key: - <div class="snippet example"> - <code>config.stopBubbling = true</code> - </div> - can be included. We suggest you put this in the root of your workspace directory. - </p><p> - Lombok normally adds <code>@javax.annotation.Generated</code> annotations to all generated nodes where possible. You can stop this with: - <div class="snippet example"> - <code>lombok.addGeneratedAnnotation = false</code> - </div> - </p><p> - Lombok can add the <code>@SuppressFBWarnings</code> annotation which is useful if you want to run <a href="http://findbugs.sourceforge.net/">FindBugs</a> on your class files. To enable this feature, make sure findbugs is on the classpath when you compile, and add the following config key: - <div class="snippet example"> - <code>lombok.extern.findbugs.addSuppressFBWarnings = true</code> - </div> - </div> - <div class="overview" style="clear: left;"> - <h3>Config keys that can even affect source files with 0 lombok annotations</h3> - <p> - <div class="snippet example"> - <code>lombok.fieldDefaults.defaultPrivate = true</code><br /> - <code>lombok.fieldDefaults.defaultFinal = true</code> - </div> - Turning either of these options on means lombok will make <em>every</em> field in <em>every</em> source file final and/or private unless it has an explicit access modifier or annotation to suppress this. <a href="experimental/FieldDefaults.html">See the <code>@FieldDefaults</code> documentation for more</a>. - </div> - <div style="clear: left;"></div> - <div class="footer"> - <a href="index.html">Back to features</a> | <a href="Log.html">Previous feature (@Log)</a> | <span class="disabled">Next feature</span><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/delombok.html b/website/features/delombok.html deleted file mode 100644 index f321db45..00000000 --- a/website/features/delombok.html +++ /dev/null @@ -1,80 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>delombok</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>delombok</h1> - <div class="overview"> - <h3>Overview</h3> - <p> - Normally, lombok adds support for all the lombok features directly to your IDE and compiler by plugging into them.<br /> - However, lombok doesn't cover all tools. For example, lombok cannot plug into javadoc, nor can it plug into the Google Widget Toolkit, both of which - run on java sources. Delombok still allows you to use lombok with these tools by preprocessing your java code into java code with all of lombok's - transformations already applied. - </p><p> - Delombok can of course also help understand what's happening with your source by letting you look at exactly what lombok is doing 'under the hood'. - </p><p> - Delombok's standard mode of operation is that it copies an entire directory into another directory, recursively, skipping class files, and applying - lombok transformations to any java source files it encounters. - </p><p> - Delombok's output format can be configured with command line options (use <code>--format-help</code> for a complete list). A few such options are automatically scanned from input if possible (such as indent). If delombok's formatting is not conforming to your preferred code style, have a look! - </p> - <h3>Running delombok on the command line</h3> - <p> - Delombok is included in <code>lombok.jar</code>. To use it, all you need to run on the command line is: - <div class="snippet"><pre>java -jar lombok.jar delombok src -d src-delomboked</pre></div> - <br /> - Which will duplicate the contents of the <code>src</code> directory into the <code>src-delomboked</code> directory, which will be created if it - doesn't already exist, but delomboked of course. Delombok on the command line has a few more options; use the <code>--help</code> parameter to see more options. - </p><p> - To let delombok print the transformation result of a single java file directly to standard output, you can use: - <div class="snippet"><pre>java -jar lombok.jar delombok -p MyJavaFile.java</pre></div> - </p> - <h3>Running delombok in ant</h3> - <code>lombok.jar</code> includes an ant task which can apply delombok for you. For example, to create javadoc for your project, your <code>build.xml</code> file - would look something like: - <div class="snippet"><pre><target name="javadoc"> - <taskdef classname="lombok.delombok.ant.Tasks$Delombok" classpath="lib/lombok.jar" name="delombok" /> - <mkdir dir="build/src-delomboked" /> - <strong><delombok verbose="true" encoding="UTF-8" to="build/src-delomboked" from="src"></strong> - <strong><format value="suppressWarnings:skip" /></strong> - <strong></delombok></strong> - <mkdir dir="build/api" /> - <javadoc sourcepath="build/src-delomboked" defaultexcludes="yes" destdir="build/api" /> -</target></pre></div> - <br /> - Instead of a <code>from</code> attribute, you can also nest <code><fileset></code> nodes. - <h3>Running delombok in maven</h3> - Anthony Whitford has written a <a href="https://github.com/awhitford/lombok.maven">maven plugin</a> for delomboking your source code. - <h3>Limitations</h3> - Delombok tries to preserve your code as much as it can, but comments may move around a little bit, especially comments that are in the middle of - a syntax node. For example, any comments appearing in the middle of a list of method modifiers, such as <code>public /*comment*/ static ...</code> will - move towards the front of the list of modifiers. In practice, any java source parsing tool will not be affected.<br /> - To keep any changes to your code style to a minimum, delombok just copies a source file directly without changing any of it if the source file contains - no lombok transformations. - </div> - <div class="footer"> - <a href="index.html">Back to features</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/experimental/Accessors.html b/website/features/experimental/Accessors.html deleted file mode 100644 index 909c0873..00000000 --- a/website/features/experimental/Accessors.html +++ /dev/null @@ -1,116 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../features.css" /> - <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>EXPERIMENTAL – @Accessors</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../../index.html">Project Lombok</a></div> - <h1>@Accessors</h1> - <div class="byline">A more fluent API for getters and setters.</div> - <div class="since"> - <h3>Since</h3> - <p> - @Accessors was introduced as experimental feature in lombok v0.11.0. - </p> - </div> - <div class="experimental"> - <h3>Experimental</h3> - <p> - Experimental because: - <ul> - <li>We may want to roll these features into a more complete property support concept.</li> - <li>New feature - community feedback requested.</li> - </ul> - Current status: <em>positive</em> - Currently we feel this feature may move out of experimental status with no or minor changes soon. - </div> - <div class="overview"> - <h3>Overview</h3> - <p> - The <code>@Accessors</code> annotation is used to configure how lombok generates and looks for getters and setters. - </p><p> - By default, lombok follows the <em>bean specification</em> for getters and setters: The getter for a field named <code>pepper</code> - is <code>getPepper</code> for example. However, some might like to break with the <em>bean specification</em> in order to end up with - nicer looking APIs. <code>@Accessors</code> lets you do this. - </p><p> - Some programmers like to use a prefix for their fields, i.e. they write <code>fPepper</code> instead of <code>pepper</code>. - We <em>strongly</em> discourage doing this, as you can't unit test the validity of your prefixes, and refactor scripts may turn fields - into local variables or method names. Furthermore, your tools (such as your editor) can take care of rendering the identifier in a - certain way if you want this information to be instantly visible. Nevertheless, you can list the prefixes that your project uses via - <code>@Accessors</code> as well. - </p><p> - <code>@Accessors</code> therefore has 3 options:<ul> - <li><code>fluent</code> - A boolean. If <em>true</em>, the getter for <code>pepper</code> is just <code>pepper()</code>, and the - setter is <code>pepper(T newValue)</code>. Furthermore, unless specified, <code>chain</code> defaults to <em>true</em>.<br /> - Default: <em>false</em>.</li> - <li><code>chain</code> - A boolean. If <em>true</em>, generated setters return <code>this</code> instead of <code>void</code>.<br /> - Default: <em>false</em>, unless <code>fluent=true</code>, then Default: <em>true</em>.</li> - <li><code>prefix</code> - A list of strings. If present, fields must be prefixed with any of these prefixes. Each field name is - compared to each prefix in the list in turn, and if a match is found, the prefix is stripped out to create the base name for - the field. It is legal to include an empty string in the list, which will always match. For characters which are letters, the - character following the prefix must not be a lowercase letter, i.e. <code>pepper</code> is not a match even to prefix <code>p</code>, - but <code>pEpper</code> would be (and would mean the base name of this field is <code>epper</code>).</li> - </p><p> - The <code>@Accessors</code> annotation is legal on types and fields; the annotation that applies is the one on the field if present, - otherwise the one on the class. When a <code>@Accessors</code> annotation on a field is present, any <code>@Accessors</code> annotation - also present on that field's type is ignored. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.accessors.chain</code> = [<code>true</code> | <code>false</code>] (default: false)</dt> - <dd>If set to <code>true</code>, any class that either doesn't have an <code>@Accessors</code> annotation, or it does, but that annotation does not have an explicit value for the <code>chain</code> parameter, will act as if <code>@Accessors(chain = true)</code> is present.</dd> - <dt><code>lombok.accessors.fluent</code> = [<code>true</code> | <code>false</code>] (default: false)</dt> - <dd>If set to <code>true</code>, any class that either doesn't have an <code>@Accessors</code> annotation, or it does, but that annotation does not have an explicit value for the <code>fluent</code> parameter, will act as if <code>@Accessors(fluent = true)</code> is present.</dd> - <dt><code>lombok.accessors.prefix</code> += <em>a field prefix</em> (default: empty list)</dt> - <dd>This is a list property; entries can be added with the <code>+=</code> operator. Inherited prefixes from parent config files can be removed with the <code>-=</code> operator. Any class that either doesn't have an <code>@Accessors</code> annotation, or it does, but that annotation does not have an explicit value for the <code>prefix</code> parameter, will act as if <code>@Accessors(prefix = {<em>prefixes listed in configuration</em>})</code> is present.</dd> - <dt><code>lombok.accessors.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@Accessors</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - The nearest <code>@Accessors</code> annotation is also used for the various methods in lombok that look for getters, such as - <code>@EqualsAndHashCode</code>. - </p><p> - If a prefix list is provided and a field does not start with one of them, that field is skipped entirely by lombok, and - a warning will be generated. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to experimental features</a> | <a href="var.html">Previous feature (var)</a> | <a href="ExtensionMethod.html">Next feature (@ExtensionMethod)</a><br /> - <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/experimental/Builder.html b/website/features/experimental/Builder.html deleted file mode 100644 index e1c545fc..00000000 --- a/website/features/experimental/Builder.html +++ /dev/null @@ -1,36 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../features.css" /> - <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>@Builder</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../../index.html">Project Lombok</a></div> - <h1>@Builder</h1> - <div class="byline">... and Bob's your uncle: No-hassle fancy-pants APIs for object creation!</div> - <div class="moved"> - @Builder has been promoted to the core package in lombok release v1.16.0.<br /> - The documentation has been moved here: <a href="../Builder.html">@lombok.Builder</a>. - </div> - <div class="footer"> - <a href="index.html">Back to experimental features</a><br /> - <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/experimental/Delegate.html b/website/features/experimental/Delegate.html deleted file mode 100644 index 5173376d..00000000 --- a/website/features/experimental/Delegate.html +++ /dev/null @@ -1,100 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../features.css" /> - <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>EXPERIMENTAL – @Delegate</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../../index.html">Project Lombok</a></div> - <h1>@Delegate</h1> - <div class="byline">Don't lose your composition.</div> - <div class="since"> - <h3>Since</h3> - <p> - @Delegate was introduced as feature in lombok v0.10. It was moved to the experimental package in lombok v1.14; the old version from the main lombok package is now deprecated. - </p> - </div> - <div class="experimental"> - <h3>Experimental</h3> - <p> - Experimental because: - <ul> - <li>Not used that much</li> - <li>Difficult to support for edge cases, such as recursive delegation.</li> - <li>API is rather unfriendly; it would be a lot nicer if you can simply implement some methods and let <code>@Delegate</code> generate delegates for whatever you didn't manually implement, but due to issues with generics erasure this also can't be made to work without caveats. - </ul> - Current status: <em>negative</em> - Currently we feel this feature will not move out of experimental status anytime soon, and support for this feature may be dropped if future versions of javac or ecj make it difficult to continue to maintain the feature. - </div> - <div class="overview"> - <h3>Overview</h3> - <p> - Any field or no-argument method can be annotated with <code>@Delegate</code> to let lombok generate delegate methods that forward the call to this field (or the result of invoking this method). - </p><p> - Lombok delegates all <code>public</code> methods of the field's type (or method's return type), as well as those of its supertypes except for all - methods declared in <code>java.lang.Object</code>. - </p><p> - You can pass any number of classes into the <code>@Delegate</code> annotation's <code>types</code> parameter. - If you do that, then lombok will delegate all <code>public</code> methods in those types (and their supertypes, except <code>java.lang.Object</code>) instead of looking at the field/method's type. - </p><p> - All public non-<code>Object</code> methods that are part of the calculated type(s) are copied, whether or not you also wrote implementations for those methods. That would thus result in duplicate method errors. You can avoid these - by using the <code>@Delegate(excludes=SomeType.class)</code> parameter to exclude all public methods in the excluded type(s), and their supertypes. - </p><p> - To have very precise control over what is delegated and what isn't, write private inner interfaces with method signatures, then specify these - private inner interfaces as types in <code>@Delegate(types=PrivateInnerInterfaceWithIncludesList.class, excludes=SameForExcludes.class)</code>. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.delegate.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@Delegate</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - When passing classes to the annotation's <code>types</code> or <code>excludes</code> parameter, you cannot include generics. - This is a limitation of java. Use private inner interfaces or classes that extend the intended type including the - generics parameter to work around this problem. - </p><p> - When passing classes to the annotation, these classes do not need to be supertypes of the field. See the example. - </p><p> - <code>@Delegate</code> cannot be used on static fields or methods. - </p><p> - <code>@Delegate</code> cannot be used when the calculated type(s) to delegate / exclude themselves contain <code>@Delegate</code> annotations; in other words, <code>@Delegate</code> will error if you attempt to use it recursively. - </div> - </div> - <div class="footer"> - <a href="index.html">Back to experimental features</a> | <a href="FieldDefaults.html">Previous feature (@FieldDefaults)</a> | <a href="Wither.html">Next feature (@Wither)</a><br /> - <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/experimental/ExtensionMethod.html b/website/features/experimental/ExtensionMethod.html deleted file mode 100644 index 7090fd19..00000000 --- a/website/features/experimental/ExtensionMethod.html +++ /dev/null @@ -1,116 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../features.css" /> - <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>EXPERIMENTAL – @ExtensionMethod</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../../index.html">Project Lombok</a></div> - <h1>@ExtensionMethod</h1> - <div class="byline">Annoying API? Fix it yourself: Add new methods to existing types!</div> - <div class="since"> - <h3>Since</h3> - <p> - @ExtensionMethod was introduced as experimental feature in lombok v0.11.2. - </p> - </div> - <div class="experimental"> - <h3>Experimental</h3> - <p> - Experimental because: - <ul> - <li>High-impact on code style</li> - <li>Really would like to ship with utility methods to expand common classes, but so far lombok doesn't have a good distribution method for such runtime dependencies</li> - <li>Affects quite a bit of eclipse, and auto-complete e.d. do not work yet in netbeans</li> - <li>Should @ExtensionMethod be legal on methods? Should it be legal on packages?</li> - </ul> - Current status: <em>positive</em> - Currently we feel this feature may move out of experimental status with no or minor changes soon. - </div> - <div class="overview"> - <h3>Overview</h3> - <p> - You can make a class containing a bunch of <code>public</code>, <code>static</code> methods which all take at least 1 - parameter. These methods will extend the type of the first parameter, as if they were instance methods, using the - <code>@ExtensionMethod</code> feature. - </p> - </p><p> - For example, if you create <code>public static String toTitleCase(String in) { ... }</code>, you can use the - <code>@ExtensionMethod</code> feature to make it look like the <code>java.lang.String</code> class has a method named - <code>toTitleCase</code>, which has no arguments. The first argument of the static method fills the role of <code>this</code> - in instance methods. - </p><p> - All methods that are <code>public</code>, <code>static</code>, and have at least 1 argument whose type is not primitive, are - considered extension methods, and each will be injected into the namespace of the type of the first parameter as if they were - instance methods. As in the above example, a call that looks like: <code>foo.toTitleCase()</code> is replaced with - <code>ClassContainingYourExtensionMethod.toTitleCase(foo);</code>. Note that it is actually not an instant - <code>NullPointerException</code> if <code>foo</code> is null - it is passed like any other parameter. - </p><p> - You can pass any number of classes to the <code>@ExtensionMethod</code> annotation; they will all be searched for - extension methods. These extension methods apply for any code that is in the annotated class. - </p><p> - Lombok does not (currently) have any runtime dependencies which means lombok does not (currently) ship with any useful - extension methods so you'll have to make your own. However, here's one that might spark your imagination: - <pre>public class ObjectExtensions { - public static <T> or(T object, T ifNull) { - return object != null ? object : ifNull; - } -}</pre> - With the above class, if you add <code>@ExtensionMethod(ObjectExtensions.class)</code> to your class definition, you can write: - <pre>String x = null; -System.out.println(x.or("Hello, World!"));</pre> - The above code will not fail with a <code>NullPointerException</code>; it will actually output <code>Hello, World!</code> - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.extensionMethod.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@ExtensionMethod</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - Calls are rewritten to a call to the extension method; the static method itself is not inlined. Therefore, the - extension method must be present both at compile and at runtime. - </p><p> - Generics is fully applied to figure out extension methods. i.e. if the first parameter of your extension method is - <code>List<? extends String></code>, then any expression that is compatible with that will have your extension method, - but other kinds of lists won't. So, a <code>List<Object></code> won't get it, but a <code>List<String></code> will. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to experimental features</a> | <a href="Accessors.html">Previous feature (@Accessors)</a> | <a href="FieldDefaults.html">Next feature (@FieldDefaults)</a><br /> - <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/experimental/FieldDefaults.html b/website/features/experimental/FieldDefaults.html deleted file mode 100644 index a253198b..00000000 --- a/website/features/experimental/FieldDefaults.html +++ /dev/null @@ -1,95 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../features.css" /> - <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>EXPERIMENTAL – @FieldDefaults</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../../index.html">Project Lombok</a></div> - <h1>@FieldDefaults</h1> - <div class="byline">New default field modifiers for the 21st century.</div> - <div class="since"> - <h3>Since</h3> - <p> - @FieldDefaults was introduced as experimental feature in lombok v0.11.4. - </p> - </div> - <div class="experimental"> - <h3>Experimental</h3> - <p> - Experimental because: - <ul> - <li>New feature; unsure if this busts enough boilerplate</li> - <li>Would be nice if you could stick this on the package-info.java package to set the default for all classes in that package</li> - <li>Part of the work on @Value, which is experimental</li> - </ul> - Current status: <em>positive</em> - Currently we feel this feature may move out of experimental status with no or minor changes soon. - </div> - <div class="overview"> - <h3>Overview</h3> - <p> - The <code>@FieldDefaults</code> annotation can add an access modifier (<code>public</code>, <code>private</code>, or <code>protected</code>) - to each field in the annotated class or enum. It can also add <code>final</code> to each field in the annotated class or enum. - </p> - </p><p> - To add <code>final</code> to each (instance) field, use <code>@FieldDefaults(makeFinal=true)</code>. Any non-final field which must remain nonfinal - can be annotated with <code>@NonFinal</code> (also in the <code>lombok.experimental</code> package). - </p><p> - To add an access modifier to each (instance) field, use <code>@FieldDefaults(level=AccessLevel.PRIVATE)</code>. Any field that does not already have an - access modifier (i.e. any field that looks like package private access) is changed to have the appropriate access modifier. Any package private - field which must remain package private can be annotated with <code>@PackagePrivate</code> (also in the <code>lombok.experimental</code> package). - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.fieldDefaults.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@FieldDefaults</code> as a warning or error if configured.</dd> - <dt><code>lombok.fieldDefaults.defaultPrivate</code> = [<code>true</code> | <code>false</code>] (default: false)</dt> - <dd>(Since 1.16.8) If set to <code>true</code>, <em>every</em> field in <em>every</em> class or enum anywhere in the sources being compiled will be marked as <code>private</code> unless it has an explicit access modifier or the <code>@PackagePrivate</code> annotation, or an explicit <code>@FieldDefaults</code> annotation is present to override this config key.</dd> - <dt><code>lombok.fieldDefaults.defaultFinal</code> = [<code>true</code> | <code>false</code>] (default: false)</dt> - <dd>(Since 1.16.8) If set to <code>true</code>, <em>every</em> field in <em>every</em> class or enum anywhere in the sources being compiled will be marked as <code>final</code> unless it has the <code>@NonFinal</code> annotation, or an explicit <code>@FieldDefaults</code> annotation is present to override this config key.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - Like other lombok handlers that touch fields, any field whose name starts with a dollar (<code>$</code>) symbol is skipped entirely. - Such a field will not be modified at all. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to experimental features</a> | <a href="ExtensionMethod.html">Previous feature (@ExtensionMethod)</a> | <a href="Delegate.html">Next feature (@Delegate)</a><br /> - <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/experimental/Helper.html b/website/features/experimental/Helper.html deleted file mode 100644 index da474fc2..00000000 --- a/website/features/experimental/Helper.html +++ /dev/null @@ -1,83 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../features.css" /> - <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>EXPERIMENTAL – @Helper</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../../index.html">Project Lombok</a></div> - <h1>@Helper</h1> - <div class="byline">With a little help from my friends... Helper methods for java.</div> - <div class="since"> - <h3>Since</h3> - <p> - <code>@Helper</code> was introduced as an experimental feature in lombok v1.16.6. - </p> - </div> - <div class="experimental"> - <h3>Experimental</h3> - <p> - Experimental because: - <ul> - <li>Lambdas with general function types offer an alternative strategy.</li> - <li>Perhaps a way to make helper methods with less boilerplate is possible, making this feature obsolete.</li> - </ul> - Current status: <em>unknown</em> - We don't have enough experience with this feature to make predictions on its future. - </div> - <div class="overview"> - <h3>Overview</h3> - <p> - This annotation lets you put methods in methods. You might not know this, but you can declare classes inside methods, and the methods in this class can access any (effectively) final local variable or parameter defined and set before the declaration. Unfortunately, to actually call any methods you'd have to make an instance of this method local class first, but that's where <code>@Helper</code> comes in and helps you out! Annotate a method local class with <code>@Helper</code> and it's as if all the methods in that helper class are methods that you can call directly, just as if java had allowed methods to exist inside methods. - </p><p> - Normally you'd have to declare an instance of your helper, for example: <code>HelperClass h = new HelperClass();</code> directly after declaring your helper class, and then call methods in your helper class with <code>h.helperMethod();</code>. With <code>@Helper</code>, both of these things are no longer needed: You do not need to waste a line of code declaring an instance of the helper, and you don't need to prefix all your calls to helper methods with <code>nameOfHelperInstance.</code> - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - <code>@Helper</code> requires that the helper class has a no-args constructor. A compiler error will be generated if this is not the case. - </p><p> - Currently, the instance of your helper that's made under the hood is called <code>$Foo</code>, where <code>Foo</code> is the name of your helper. We might change this in the future; please don't rely on this variable existing. We might even replace this later with a sibling method instead. - </p><p> - Please don't rely on <code>this</code> making any sense in the helper method code. You can refer to the real 'this' by using the syntax <code>NameOfMyClass.this</code>. - </p><p> - <em>ANY</em> unqualified method call in code that exists <em>below</em> the declaration of the helper method with the same name as any method in the helper is assumed to be a call to the helper. If the arguments don't end up being compatible, you get a compiler error. - </p><p> - Unless you're using JDK8 or higher (which introduced the concept of 'effectively final'), you'll have to declare local variables and parameters as <code>final</code> if you wish to refer to them in your method local class. This is a java limitation, not something specific to lombok's <code>@Helper</code>. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to experimental features</a> | <a href="UtilityClass.html">Previous feature (@UtilityClass)</a> | <span class="disabled">Next feature</span><br /> - <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/experimental/UtilityClass.html b/website/features/experimental/UtilityClass.html deleted file mode 100644 index d123b384..00000000 --- a/website/features/experimental/UtilityClass.html +++ /dev/null @@ -1,80 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../features.css" /> - <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>EXPERIMENTAL – @UtilityClass</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../../index.html">Project Lombok</a></div> - <h1>@UtilityClass</h1> - <div class="byline">Utility, metility, wetility! Utility classes for the masses.</div> - <div class="since"> - <h3>Since</h3> - <p> - <code>@UtilityClass</code> was introduced as an experimental feature in lombok v1.16.2. - </p> - </div> - <div class="experimental"> - <h3>Experimental</h3> - <p> - Experimental because: - <ul> - <li>Some debate as to whether its common enough to count as boilerplate.</li> - </ul> - Current status: <em>positive</em> - Currently we feel this feature may move out of experimental status with no or minor changes soon. - </div> - <div class="overview"> - <h3>Overview</h3> - <p> - A utility class is a class that is just a namespace for functions. No instances of it can exist, and all its members - are static. For example, <code>java.lang.Math</code> and <code>java.util.Collections</code> are well known utility classes. This annotation automatically turns the annotated class into one. - </p><p> - A utility class cannot be instantiated. By marking your class with <code>@UtilityClass</code>, lombok will automatically - generate a private constructor that throws an exception, flags as error any explicit constructors you add, and marks - the class <code>final</code>. If the class is an inner class, the class is also marked <code>static</code>. - </p><p> - <em>All</em> members of a utility class are automatically marked as <code>static</code>. Even fields and inner classes. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - There isn't currently any way to create non-static members, or to define your own constructor. If you want to instantiate - the utility class, even only as an internal implementation detail, <code>@UtilityClass</code> cannot be used. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to experimental features</a> | <a href="onX.html">Previous feature (onX)</a> | <a href="Helper.html">Next feature (@Helper)</a><br /> - <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/experimental/Value.html b/website/features/experimental/Value.html deleted file mode 100644 index ec0ff9e4..00000000 --- a/website/features/experimental/Value.html +++ /dev/null @@ -1,36 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../features.css" /> - <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>EXPERIMENTAL – @Value</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../../index.html">Project Lombok</a></div> - <h1>@Value</h1> - <div class="byline">Immutable classes made very easy.</div> - <div class="moved"> - @Value has been promoted to the core package in lombok release v1.12.0.<br /> - The documentation has been moved here: <a href="../Value.html">@lombok.Value</a>. - </div> - <div class="footer"> - <a href="index.html">Back to experimental features</a><br /> - <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/experimental/Wither.html b/website/features/experimental/Wither.html deleted file mode 100644 index c8030bd9..00000000 --- a/website/features/experimental/Wither.html +++ /dev/null @@ -1,113 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../features.css" /> - <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>EXPERIMENTAL – @Wither</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../../index.html">Project Lombok</a></div> - <h1>@Wither</h1> - <div class="byline">Immutable 'setters' - methods that create a clone but with one changed field.</div> - <div class="since"> - <h3>Since</h3> - <p> - @Wither was introduced as experimental feature in lombok v0.11.4. - </p> - </div> - <div class="experimental"> - <h3>Experimental</h3> - <p> - Experimental because: - <ul> - <li>Still not sure that <code>@Wither</code> is an appropriate name for this feature.</li> - <li>Should there be an option to supply a way of cloning the input somehow?</li> - <li>Should the way that the clone is created by configurable?</li> - <li>Should we replace @Wither entirely with a builder class?</li> - </ul> - Current status: <em>neutral</em> - More feedback requires on the items in the above list before promotion to the main package is warranted. - </div> - <div class="overview"> - <h3>Overview</h3> - <p> - The next best alternative to a setter for an immutable property is to construct a clone of the object, but with a new value for this one field. - A method to generate this clone is precisely what <code>@Wither</code> generates: a <code>withFieldName(newValue)</code> method which produces a clone - except for the new value for the associated field. - </p><p> - For example, if you create <code>public class Point { private final int x, y; }</code>, setters make no sense because the fields - are final. <code>@Wither</code> can generate a <code>withX(int newXValue)</code> method for you which will return a new point with the supplied - value for <code>x</code> and the same value for <code>y</code>. - </p><p> - Like <a href="../GetterSetter.html"><code>@Setter</code></a>, you can specify an access level in case you want the generated wither to be something other than <code>public</code>:<br /> - <code>@Wither(level = AccessLevel.PROTECTED)</code>. Also like <a href="../GetterSetter.html"><code>@Setter</code></a>, you can also put a <code>@Wither</code> annotation on a type, which means - a 'wither' is generated for each field (even non-final fields). - </p><p> - To put annotations on the generated method, you can use <code>onMethod=@__({@AnnotationsHere})</code>; to put annotations on the only parameter of a generated wither method, you can use <code>onParam=@__({@AnnotationsHere})</code>. Be careful though! This is an experimental feature. For more details see the documentation on the <a href="onX.html">onX</a> feature. - </p><p> - <em>NEW in lombok v1.12.0:</em> javadoc on the field will now be copied to generated withers. Normally, all text is copied, and <code>@param</code> is <em>moved</em> to the wither, whilst <code>@return</code> lines are stripped from the wither's javadoc. Moved means: Deleted from the field's javadoc. It is also possible to define unique text for the wither's javadoc. To do that, you create a 'section' named <code>WITHER</code>. A section is a line in your javadoc containing 2 or more dashes, then the text 'WITHER', followed by 2 or more dashes, and nothing else on the line. If you use sections, <code>@return</code> and <code>@param</code> stripping / copying for that section is no longer done (move the <code>@param</code> line into the section). - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.wither.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>@Wither</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - Withers cannot be generated for static fields because that makes no sense. - </p><p> - Withers can be generated for abstract classes, but this generates an abstract method with the appropriate signature. - </p><p> - When applying <code>@Wither</code> to a type, static fields and fields whose name start with a $ are skipped. - </p><p> - For generating the method names, the first character of the field, if it is a lowercase character, is title-cased, otherwise, it is left unmodified. - Then, <code>with</code> is prefixed. - </p><p> - No method is generated if any method already exists with the same name (case insensitive) and same parameter count. For example, <code>withX(int x)</code> - will not be generated if there's already a method <code>withX(String... x)</code> even though it is technically possible to make the method. This caveat - exists to prevent confusion. If the generation of a method is skipped for this reason, a warning is emitted instead. Varargs count as 0 to N parameters. - </p><p> - For <code>boolean</code> fields that start with <code>is</code> immediately followed by a title-case letter, nothing is prefixed to generate the wither name. - </p><p> - Any annotations named <code>@NonNull</code> (case insensitive) on the field are interpreted as: This field must not ever hold - <em>null</em>. Therefore, these annotations result in an explicit null check in the generated wither. Also, these - annotations (as well as any annotation named <code>@Nullable</code> or <code>@CheckForNull</code>) are copied to wither parameter. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to experimental features</a> | <a href="Delegate.html">Previous feature (@Delegate)</a> | <a href="onX.html">Next feature (onX)</a><br /> - <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/experimental/index.html b/website/features/experimental/index.html deleted file mode 100644 index 4a6d12bb..00000000 --- a/website/features/experimental/index.html +++ /dev/null @@ -1,77 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../features.css" /> - <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Lombok feature overview</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../../index.html">Project Lombok</a></div> - <h1>Lombok experimental features</h1> - <div class="index overview"> - Experimental features are available in your normal lombok installation, but are not as robustly supported as lombok's main features. - In particular, experimental features:<ul> - <li>Are not tested as well as the core features.</li> - <li>Do not get bugs fixed as quickly as core features.</li> - <li>May have APIs that will change, possibly drastically if we find a different, better way to solve the same problem.</li> - <li>May disappear entirely if the feature is too difficult to support or does bust enough boilerplate.</li> - </ul> - Features that receive positive community feedback and which seem to produce clean, flexible code will eventually become accepted - as a core feature and move out of the experimental package. - <dl> - <dt><a href="var.html"><code>@var</code></a></dt> - <dd>The same as @val but modifiable.</dd> - <dt><a href="Accessors.html"><code>@Accessors</code></a></dt> - <dd>A more fluent API for getters and setters.</dd> - <dt><a href="ExtensionMethod.html"><code>@ExtensionMethod</code></a></dt> - <dd>Annoying API? Fix it yourself: Add new methods to existing types!</dd> - <dt><a href="FieldDefaults.html"><code>@FieldDefaults</code></a></dt> - <dd>New default field modifiers for the 21st century.</dd> - <dt><a href="Delegate.html"><code>@Delegate</code></a></dt> - <dd>Don't lose your composition.</dd> - <dt><a href="Wither.html"><code>@Wither</code></a></dt> - <dd>Immutable 'setters' - methods that create a clone but with one changed field.</dd> - <dt><a href="onX.html"><code>onMethod= / onConstructor= / onParam=</code></a></dt> - <dd>Sup dawg, we heard you like annotations, so we put annotations in your annotations so you can annotate while you're annotating.</dd> - <dt><a href="UtilityClass.html"><code>@UtilityClass</code></a></dt> - <dd>Utility, metility, wetility! Utility classes for the masses.</dd> - <dt><a href="Helper.html"><code>@Helper</code></a></dt> - <dd>With a little help from my friends... Helper methods for java.</dd> - </dl> - </div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.experimental.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of any of the features listed here as a warning or error if configured.</dd> - </dl> - </div> - <div class="index overview"> - <h3>Putting the "Ex" in "Experimental": promoted or deleted experimental features.</h3> - <dl> - <dt><a href="../Value.html"><code>@Value</code></a>: Promoted</dt> - <dd><code>@Value</code> has proven its value and has been moved to the main package.</li> - <dt><a href="../Builder.html"><code>@Builder</code></a>: Promoted</dt> - <dd><code>@Builder</code> is a solid base to build APIs on, and has been moved to the main package.</li> - </dl> - </div> - <div class="footer"> - <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/experimental/onX.html b/website/features/experimental/onX.html deleted file mode 100644 index 39faa1bf..00000000 --- a/website/features/experimental/onX.html +++ /dev/null @@ -1,92 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../features.css" /> - <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>EXPERIMENTAL – onX</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../../index.html">Project Lombok</a></div> - <h1>onX</h1> - <div class="byline">Sup dawg, we heard you like annotations, so we put annotations in your annotations so you can annotate while you're annotating.</div> - <div class="since"> - <h3>Since</h3> - <p> - onX was introduced as experimental feature in lombok v0.11.8. - </p> - </div> - <div class="experimental"> - <h3>Experimental</h3> - <p> - Experimental because: - <ul> - <li>Ugly syntax. The syntax of this feature is not optimal, but it is the least convoluted syntax that could possibly work (for now!)</li> - <li>Possibly java 9 will offer (much) better ways of supporting this feature.</li> - <li>Uncertainty: Future versions of javac may break this feature, and we may not be able to restore it.</li> - </ul> - Current status: <em>uncertain</em> - Currently we feel this feature cannot move out of experimental status. - </div> - <div class="overview"> - <h3>Overview</h3> - <p> - <strong>This feature is considered 'workaround status' - it exists in order to allow users of lombok that cannot work without this feature to have access to it anyway. If we find a better way to implement this feature, or some future java version introduces an alternative strategy, this feature can disappear without a reasonable deprecation period. Also, this feature may not work in future versions of javac. Use at your own discretion.</strong> - </p><p> - Most annotations that make lombok generate methods or constructors can be configured to also make lombok put custom annotations on elements in the generated code. - </p><p> - <code>@Getter</code>, <code>@Setter</code>, and <code>@Wither</code> support the <code>onMethod</code> option, which will put the listed annotations on the generated method. - </p><p> - <code>@AllArgsConstructor</code>, <code>@NoArgsConstructor</code>, and <code>@RequiredArgsConstructor</code> support the <code>onConstructor</code> option which will put the listed annotations on the generated constructor. - </p><p> - <code>@Setter</code> and <code>@Wither</code> support <code>onParam</code> in addition to <code>onMethod</code>; annotations listed will be put on the only parameter that the generated method has. <code>@EqualsAndHashCode</code> also supports <code>onParam</code>; the listed annotation(s) will be placed on the single parameter of the generated <code>equals</code> method, as well as any generated <code>canEqual</code> method. - </p><p> - The syntax is a little strange and depends on the javac you are using.<br /> - On javac7, to use any of the 3 <code>onX</code> features, you must wrap the annotations to be applied to the constructor / method / parameter in <code>@__(@AnnotationGoesHere)</code>. To apply multiple annotations, use <code>@__({@Annotation1, @Annotation2})</code>. The annotations can themselves obviously have parameters as well.<br /> - On javac8 and up, you add an underscore after <code>onMethod</code>, <code>onParam</code>, or <code>onConstructor</code>. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - The reason of the weird syntax is to make this feature work in javac 7 compilers; the <code>@__</code> type is an annotation reference to the annotation type <code>__</code> (double underscore) which doesn't actually exist; this makes javac 7 delay aborting the compilation process due to an error because it is possible an annotation processor will later create the <code>__</code> type. Instead, lombok applies the annotations and removes the references so that the error will never actually occur. The point is: The <code>__</code> type <em>must not exist</em>, otherwise the feature does not work. In the rare case that the <code>__</code> type does exist (and is imported or in the package), you can simply add more underscores. Technically any non-existent type would work, but to maintain consistency and readability and catch erroneous use, lombok considers it an error if the 'wrapper' annotation is anything but a series of underscores. - </p><p> - In javac8, the above feature should work but due to a bug in javac8 it does not. However, starting in javac8, if the parameter name does not exist in the annotation type, compilation proceeds to a phase where lombok can fix it. - </p><p> - To reiterate: This feature can disappear at any time; if you use this feature, be prepared to adjust your code when we find a nicer way of implementing this feature, or, if a future version of javac forces us to remove this feature entirely with no alternative. - </p><p> - The <code>onX</code> parameter is not legal on any type-wide variant. For example, a <code>@Getter</code> annotation on a class does not support <code>onMethod</code>. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to experimental features</a> | <a href="Wither.html">Previous feature (@Wither)</a> | <a href="UtilityClass.html">Next feature (@UtilityClass)</a><br /> - <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/experimental/var.html b/website/features/experimental/var.html deleted file mode 100644 index dde9c35e..00000000 --- a/website/features/experimental/var.html +++ /dev/null @@ -1,83 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../features.css" /> - <link rel="shortcut icon" href="../../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>EXPERIMENTAL – @var</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../../index.html">Project Lombok</a></div> - <h1>@var</h1> - <div class="byline">Modifiable local variables with a type inferred by assigning value.</div> - <div class="since"> - <h3>Since</h3> - <p> - @var was introduced as experimental feature in lombok v1.16.12. - </p> - </div> - <div class="experimental"> - <h3>Experimental</h3> - <p> - Experimental because: - <ul> - <li>This feature is very controversial.</li> - <li>There is <a href="http://openjdk.java.net/jeps/286">JEP 286</a> that should make the @var obsolete.</li> - </ul>Current status: <em>uncertain</em> - Currently we feel this feature cannot move out of experimental status. - </div> - <div class="overview"> - <h3>Overview</h3> - <p> - The <code>@var</code> has the same mission as the <a href="../val.html">@val</a> annotation but modifable. - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.val.flagUsage</code> = [<code>allow</code>] (default: not set)</dt> - <dd><strong>Lombok will flag any usage of <code>var</code> as an error if not configured.</strong></dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - For compound types, the most common superclass is inferred, not any shared interfaces. For example, <code>bool ? new HashSet() : new ArrayList()</code> - is an expression with a compound type: The result is both <code>AbstractCollection</code> as well as <code>Serializable</code>. The type inferred will be - <code>AbstractCollection</code>, as that is a class, whereas <code>Serializable</code> is an interface. - </p><p> - In ambiguous cases, <code>java.lang.Object</code> is inferred. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to experimental features</a> | <span class="disabled">Previous feature</span> | <a href="Accessors.html">Next feature (@Accessors)</a><br /> - <a href="../../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/features.css b/website/features/features.css deleted file mode 100644 index 58897ccd..00000000 --- a/website/features/features.css +++ /dev/null @@ -1,179 +0,0 @@ -.confType { - font-weight: bold; -} - -body { - font-family: Verdana; - background-image: url(gradient.png); - background-repeat: repeat-x; - background-attachment: fixed; -} - -#pepper { - background-image: url(lombok-background.png); - background-repeat: no-repeat; - background-attachment: fixed; - background-position: 50px 20px; -} - -* html #pepper { - background: none; -} - -.meat { - padding: 0px 48px; -} - -.meat .header { - position: absolute; - top: 10px; - left: 30px; -} - -.minimumHeight { - height: 700px; - width: 1px; - float: right; -} - -* html .minimumHeight { - height: 0px; -} - -h1 { - padding: 8px 0 10px 0; - font-size: 20px; - width: 100%; - text-align: center; -} - -.byline { - width: 100%; - text-align: center; - font-style: italic; - font-size: 1.3em; -} - -.index { - font-size: 1.2em; - margin: 48px 0px 32px 64px; -} - -.index dt { - margin-top: 8px; - font-size: 1.2em; -} - -.index dd { - margin-left: 32px; -} - -dt { - margin-top: 4px; - font-size: 1.2em; -} - -dd { - margin-left: 16px; -} - -.overview code { - font-size: 1.1em; - white-space: nowrap; -} - -.smallprint { - font-size: 0.8em; - color: #444; -} - -.smallprint code { - font-size: 1em; - white-space: nowrap; -} - -.snippets, .singleColumnSnippets { - margin-top: 0px; -} - -.snippets .pre { - float: left; - width: 45%; -} - -.snippet { - overflow: auto; - padding: 4px; - border: 1px dotted #888; -} - -.snippet font { - white-space: pre; -} - -.snippets .sep { - display: block; - width: 5%; - height: 1px; - float: left; -} - -.snippets .post { - float: left; - width: 45%; -} - -.snippets .end { - clear: both; -} - -.snippet code { - font-size: 14px; -} - -.snippet.example { - margin: 8px 16px 8px 16px; -} - -.footer { - clear: left; - margin: 0 auto 0 auto; - padding: 16px 0 16px 0; - display: block; - text-align: center; -} - -.footer .disabled { - color: #aaa; -} - -.footer .copyright { - color: #555; - font-size: 11px; - font-style: italic; -} - -.creditsLink { - font-style: normal; - font-weight: bold; -} - -code a { - color: black; - text-decoration: none; -} - -code a:hover { - color: black; - text-decoration: underline; -} - -code .keyword { - color: #7f0055; - font-weight: bold; -} - -code .staticfield { - color: #2a00ff; - font-style: italic; -}
\ No newline at end of file diff --git a/website/features/gradient.png b/website/features/gradient.png Binary files differdeleted file mode 100644 index 3ffcde2c..00000000 --- a/website/features/gradient.png +++ /dev/null diff --git a/website/features/index.html b/website/features/index.html deleted file mode 100644 index bfa33217..00000000 --- a/website/features/index.html +++ /dev/null @@ -1,90 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Lombok feature overview</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>Lombok features</h1> - <div class="index overview"> - <dl> - <dt><a href="val.html"><code>val</code></a></dt> - <dd>Finally! Hassle-free final local variables.</dd> - <dt><a href="NonNull.html"><code>@NonNull</code></a></dt> - <dd>or: How I learned to stop worrying and love the NullPointerException.</dd> - <dt><a href="Cleanup.html"><code>@Cleanup</code></a></dt> - <dd>Automatic resource management: Call your <code>close()</code> methods safely with no hassle.</dd> - <dt><a href="GetterSetter.html"><code>@Getter</code> / <code>@Setter</code></a></dt> - <dd>Never write <code>public int getFoo() {return foo;}</code> again.</dd> - <dt><a href="ToString.html"><code>@ToString</code></a></dt> - <dd>No need to start a debugger to see your fields: Just let lombok generate a <code>toString</code> for you!</dd> - <dt><a href="EqualsAndHashCode.html"><code>@EqualsAndHashCode</code></a></dt> - <dd>Equality made easy: Generates <code>hashCode</code> and <code>equals</code> implementations from the fields of your object.</dd> - <dt><a href="Constructor.html"><code>@NoArgsConstructor</code>, <code>@RequiredArgsConstructor</code> and <code>@AllArgsConstructor</code></a></dt> - <dd>Constructors made to order: Generates constructors that take no arguments, one argument per final / non-null field, or one argument for every field.</dd> - <dt><a href="Data.html"><code>@Data</code></a></dt> - <dd>All together now: A shortcut for <code>@ToString</code>, <code>@EqualsAndHashCode</code>, - <code>@Getter</code> on all fields, and <code>@Setter</code> on all non-final fields, and <code>@RequiredArgsConstructor</code>!</dd> - <dt><a href="Value.html"><code>@Value</code></a></dt> - <dd>Immutable classes made very easy.</dd> - <dt><a href="Builder.html"><code>@Builder</code></a></dt> - <dd>... and Bob's your uncle: No-hassle fancy-pants APIs for object creation!</dd> - <dt><a href="SneakyThrows.html"><code>@SneakyThrows</code></a></dt> - <dd>To boldly throw checked exceptions where no one has thrown them before!</dd> - <dt><a href="Synchronized.html"><code>@Synchronized</code></a></dt> - <dd><code>synchronized</code> done right: Don't expose your locks.</dd> - <dt><a href="GetterLazy.html"><code>@Getter(lazy=true)</code></a></dt> - <dd>Laziness is a virtue!</dd> - <dt><a href="Log.html"><code>@Log</code></a></dt> - <dd>Captain's Log, stardate 24435.7: "What was that line again?"</dd> - <dt><a href="configuration.html">Configuration system</a></dt> - <dd>Lombok, made to order: Configure lombok features in one place for your entire project or even your workspace.</dd> - <dt><a href="experimental/index.html">Experimental features</a></dt> - <dd>Here be dragons: Extra features which aren't quite ready for prime time yet.</dd> - </dl> - </div> - <div class="pointer"> - If you'd rather read a longer tutorial, <a href="http://jnb.ociweb.com/jnb/jnbJan2010.html">here is a great tutorial (including a walkthrough through some of the above features)</a> written by Michael Kimberlin. - </div> - <div class="pointer"> - The documentation above is a lot easier to follow, but if you want to build your own transformations, - or you want to add javadoc to <code>lombok.jar</code> in your IDE, you can also check out <a href="../api/index.html">the javadoc</a>. - </div> - <h1>Running Lombok</h1> - <h3>On eclipse</h3> - Execute lombok.jar (doubleclick it, or run java -jar lombok.jar). Follow instructions. - <h3>On javac (and maven, ant, and other build tools)</h3> - Include lombok.jar on the classpath as you compile. That's all there is to it!<br /> - Lombok hosts its own maven repository, so adding lombok to maven is very simple. <a href="/mavenrepo/index.html">full instructions are here</a>. - <h3>On GWT (Google Widget Toolkit)</h3> - See <a href="../setup/gwt.html">gwt</a> setup. - <h3>On javadoc, and other source-based tools</h3> - Use <a href="delombok.html">delombok</a> first, then run javadoc or GWT on the delombok-ed code. - <h1>Running delombok</h1> - <div>Delombok copies your source files to another directory, replacing all lombok annotations with their desugared form. So, it'll turn <code>@Getter</code> - back into the actual getter. It then removes the annotation. This is useful for all sorts of reasons; you can check out what's happening under the hood, - if the unthinkable happens and you want to stop using lombok, you can easily remove all traces of it in your source, and you can use delombok to preprocess - your source files for source-level tools such as javadoc and GWT. More information about how to run delombok, including instructions for build tools - can be found at the <a href="delombok.html">delombok page</a>.</div> - <div class="footer"> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/features/lombok-background.png b/website/features/lombok-background.png Binary files differdeleted file mode 100644 index aac3195a..00000000 --- a/website/features/lombok-background.png +++ /dev/null diff --git a/website/features/val.html b/website/features/val.html deleted file mode 100644 index 82c96b39..00000000 --- a/website/features/val.html +++ /dev/null @@ -1,76 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="features.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>val</title> -</head><body><div id="pepper"> - <div class="minimumHeight"></div> - <div class="meat"> - <div class="header"><a href="../index.html">Project Lombok</a></div> - <h1>val</h1> - <div class="byline">Finally! Hassle-free final local variables.</div> - <div class="overview"> - <h3>Overview</h3> - <p> - <em>NEW in Lombok 0.10: </em>You can use <code>val</code> as the type of a local variable declaration instead of actually writing the type. When you do this, - the type will be inferred from the initializer expression. The local variable will also be made final. This feature works - on local variables and on foreach loops only, not on fields. The initializer expression is required. - </p><p> - <code>val</code> is actually a 'type' of sorts, and exists as a real class in the <code>lombok</code> package. You must import it for val to work (or use <code>lombok.val</code> as the type). - The existence of this type on a local variable declaration triggers both the adding of the <code>final</code> keyword as well as copying the type of the initializing expression which overwrites - the 'fake' <code>val</code> type. - </p><p> - <em>WARNING: This feature does not currently work in NetBeans. We're working on fixing that.</em> - </p> - </div> - <div class="snippets"> - <div class="pre"> - <h3>With Lombok</h3> - <div class="snippet">@HTML_PRE@</div> - </div> - <div class="sep"></div> - <div class="post"> - <h3>Vanilla Java</h3> - <div class="snippet">@HTML_POST@</div> - </div> - </div> - <div style="clear: left;"></div> - <div class="overview confKeys"> - <h3>Supported configuration keys:</h3> - <dl> - <dt><code>lombok.val.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)</dt> - <dd>Lombok will flag any usage of <code>val</code> as a warning or error if configured.</dd> - </dl> - </div> - <div class="overview"> - <h3>Small print</h3><div class="smallprint"> - <p> - For compound types, the most common superclass is inferred, not any shared interfaces. For example, <code>bool ? new HashSet() : new ArrayList()</code> - is an expression with a compound type: The result is both <code>AbstractCollection</code> as well as <code>Serializable</code>. The type inferred will be - <code>AbstractCollection</code>, as that is a class, whereas <code>Serializable</code> is an interface. - </p><p> - In ambiguous cases, such as when the initializer expression is <code>null</code>, <code>java.lang.Object</code> is inferred. - </p> - </div> - </div> - <div class="footer"> - <a href="index.html">Back to features</a> | <span class="disabled">Previous feature</span> | <a href="NonNull.html">Next feature (@NonNull)</a><br /> - <a href="../credits.html" class="creditsLink">credits</a> | <span class="copyright">Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>.</span> - </div> - <div style="clear: both;"></div> - </div> -</div> -<script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); -</script> -<script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} -</script> -</body></html> diff --git a/website/icon_brush_unused.png b/website/icon_brush_unused.png Binary files differdeleted file mode 100644 index 7ebf2f06..00000000 --- a/website/icon_brush_unused.png +++ /dev/null diff --git a/website/icon_bugs.png b/website/icon_bugs.png Binary files differdeleted file mode 100644 index 713b6fe8..00000000 --- a/website/icon_bugs.png +++ /dev/null diff --git a/website/icon_contribute.png b/website/icon_contribute.png Binary files differdeleted file mode 100644 index a7f630a5..00000000 --- a/website/icon_contribute.png +++ /dev/null diff --git a/website/icon_discussion.png b/website/icon_discussion.png Binary files differdeleted file mode 100644 index d1e3fd5e..00000000 --- a/website/icon_discussion.png +++ /dev/null diff --git a/website/icon_download.png b/website/icon_download.png Binary files differdeleted file mode 100644 index bfe07288..00000000 --- a/website/icon_download.png +++ /dev/null diff --git a/website/icon_overview.png b/website/icon_overview.png Binary files differdeleted file mode 100644 index 806b4421..00000000 --- a/website/icon_overview.png +++ /dev/null diff --git a/website/index.css b/website/index.css deleted file mode 100644 index eeb330ce..00000000 --- a/website/index.css +++ /dev/null @@ -1,182 +0,0 @@ -img,div,a,input,button,.pngfix { - behavior: url(logi/iepngfix.htc); -} - -body { - font-family: Verdana; -} - -.meat { - width: 800px; - margin: 0 auto 0 auto; -} - -h1 { - padding: 8px 0 10px 0; - font-size: 20px; - width: 100%; - text-align: center; -} - -#buttonBar a.button, a.downloadLink { - text-decoration: none; - color: black; -} - -#buttonBar a.button:hover, a.downloadLink:hover { - text-decoration: underline; - color: blue; -} - -.buttonBar { - -webkit-border-top-right-radius: 15px 15px; - -webkit-border-top-left-radius: 15px 15px; - -moz-border-radius-topright: 15px; - -moz-border-radius-topleft: 15px; - border-top-right-radius: 15px 15px; - border-top-left-radius: 15px 15px; - background-image: url(buttonbar.jpg); - width: 800px; - height: 170px; -} - -.separator { - background-image: url(buttonbar.jpg); - width: 800px; - height: 8px; - line-height: 8px; - font-size: 14px; - text-align: center; - clear: both; -} - -.endBar { - -webkit-border-bottom-right-radius: 15px 15px; - -webkit-border-bottom-left-radius: 15px 15px; - -moz-border-radius-bottomright: 15px; - -moz-border-radius-bottomleft: 15px; - border-bottom-right-radius: 15px 15px; - border-bottom-left-radius: 15px 15px; - background-image: url(buttonbar.jpg); - width: 800px; - height: 30px; - line-height: 30px; - font-size: 14px; - text-align: center; - clear: both; -} - -.button { - margin: 30px 16px auto 16px; - float: left; - width: 80px; - height: 100px; -} - -.button:first-child { - margin-left: 64px; -} - -.button img { - padding: 0 8px 0 8px; - display: block; -} - -.button span { - display: block; - width: 80px; - text-align: center; - font-size: 14px; -} - -.downloadContainer { - float: left; - margin: 34px 8px 57px 40px; -} - -code { - font-weight: bold; -} - -.attribution { - font-size: 0.6em; -} - -.downloadLink { - background-image: url(downloadButton.png); - display: block; - line-height: 56px; - width: 225px; - height: 56px; -} - -.downloadLink img { - margin: 4px 20px 4px 16px; - float: left; - width: 48px; -} - -.downloadLink span { - display: block; - font-size: 16px; - font-weight: bold; -} - -.versionInfo { - font-size: 12px; - margin-top: 4px; - font-weight: normal; - width: 100%; - text-align: center; -} - -#downloadInfo { - font-size: 14px; -} - -#downloadInfo p { - padding: 8px; -} - -.downloadActions { - margin-top: 8px; - margin-left: 32px; -} - -.note { - color: grey; -} - -.footer { - margin-top: 8px; - display: block; - color: #555; - font-style: italic; - font-size: 11px; - width: 100%; - text-align: center; -} - -.creditsLink { - font-style: normal; - font-weight: bold; -} - -.downloadHelp { - margin: 32px 16px 32px 0px; -} - -.downloadHelp .platform { - font-size: 1.2em; - font-weight: bold; - padding-right: 32px; -} - -.stableLink { - font-size: 1.5em; - margin-bottom: 16px; -} - -.edgeLink { - margin-bottom: 16px; -} diff --git a/website/index.html b/website/index.html deleted file mode 100644 index bc89941c..00000000 --- a/website/index.html +++ /dev/null @@ -1,96 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <meta name="google-site-verification" content="uCgX3Or3kDRGpbJ6JCsQc3Ub4JsnR5-p0itfsKAYZ_U" /> - <script src="logi/jQuery-all.js" type="text/javascript"></script> - <link rel="stylesheet" type="text/css" href="logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="index.css" /> - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok</title> - <script type="text/javascript" src="videos/swfobject.js"></script> - <script type="text/javascript"> - swfobject.registerObject("player","9.0.98","videos/expressInstall.swf"); - </script> - <!--[if lt IE 7]><script type="text/javascript" src="logi/iepngfix_tilebg.js"></script><![endif]--> -</head><body> - <a id="forkMe" href="https://github.com/rzwitserloot/lombok"><img style="position: absolute; top: 0; right: 0; border: 0;" src="//s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a> - <div class="meat"> - <h1>Project Lombok</h1> - <div id="buttonBar" class="buttonBar"> - <a class="button" href="features/index.html"> - <img src="icon_overview.png" /> - <span>Feature Overview</span> - </a> - <a class="button" href="https://groups.google.com/group/project-lombok"> - <img src="icon_discussion.png" /> - <span>Discuss / Help</span> - </a> - <a class="button" href="https://wiki.github.com/rzwitserloot/lombok/contributing"> - <img src="icon_contribute.png" /> - <span>Contribute</span> - </a> - <a class="button" href="https://github.com/rzwitserloot/lombok/issues"> - <img src="icon_bugs.png" /> - <span>Report an issue</span> - </a> - <div class="downloadContainer"> - <a class="downloadLink" id="downloadLink" href="download.html"> - <img src="icon_download.png" /> - <span>Download!</span> - </a> - <div class="versionInfo"> - Version: @VERSION@ | <a href="changelog.html">changelog</a> - </div> - </div> - </div> - <div class="video"> - <video width="800" height="480" poster="videos/poster.png" controls="controls" preload="none"> - <source src="videos/lombok.ogv" type="video/ogg" /> - <source src="videos/lombok.mp4" type="video/mp4" /> - <source src="videos/lombok-iPhone.m4v" type="video/mp4" /> - <object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="500"> - <param name="movie" value="videos/player.swf?image=poster.png&file=lombok.mp4" /> - <param name="allowfullscreen" value="true" /> - <!--[if !IE]>--> - <object width="800" height="500" type="application/x-shockwave-flash" - data="videos/player.swf?image=poster.png&file=lombok.mp4" allowfullscreen="true"> - <!--<![endif]--> - <h3>Video: Lombok Demo</h3> - <p> - <strong>No video playback capabilities detected.</strong> - Why not download it instead?<br /> - <a href="videos/lombok.mp4">MPEG4 / H.264 (Windows / Mac)</a> | - <a href="videos/lombok.ogv">Ogg Theora & Vorbis ".ogv" (Linux)</a> - </p><p> - To play the video in the webpage, please do one of the following: - </p><ul> - <li>Upgrade to <a href="https://www.mozilla.org/firefox/">Firefox</a> or - <a href="https://www.google.com/chrome/">Chrome</a> - </li> - <li>Install <a href="https://get.adobe.com/flashplayer/">Adobe Flash</a></li> - </ul> - <!--[if !IE]>--> - </object> - <!--<![endif]--> - </object> - </video> - </div> - <div class="endBar"> - <a href="novideo.html">I can't see the video</a> | <a href="http://jnb.ociweb.com/jnb/jnbJan2010.html">Show me a text and images based explanation and tutorial instead!</a> - </div> - <div class="footer"> - <a href="credits.html" class="creditsLink">credits</a> | Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>. - </div> - </div> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> -</body></html> diff --git a/website/logi/iepngfix.htc b/website/logi/iepngfix.htc deleted file mode 100755 index bbfb23c5..00000000 --- a/website/logi/iepngfix.htc +++ /dev/null @@ -1,187 +0,0 @@ -<public:component> -<script type="text/javascript"> - -// IE5.5+ PNG Alpha Fix v2.0 Alpha -// (c) 2004-2008 Angus Turnbull http://www.twinhelix.com - -// This is licensed under the GNU LGPL, version 2.1 or later. -// For details, see: http://creativecommons.org/licenses/LGPL/2.1/ - -var IEPNGFix = window.IEPNGFix || {}; -IEPNGFix.data = IEPNGFix.data || {}; - - -// This must be a path to a blank image, relative to the HTML document(s). -// In production use I suggest '/images/blankImg' or similar. That's all! -IEPNGFix.blankImg = 'clear.gif'; - - -IEPNGFix.fix = function(elm, src, t) { - // Applies an image 'src' to an element 'elm' using the DirectX filter. - // If 'src' is null, filter is disabled. - // Disables the 'hook' to prevent infinite recursion on setting BG/src. - // 't' = type, where background tile = 0, background = 1, IMG SRC = 2. - - var h = this.hook.enabled; - this.hook.enabled = 0; - - var f = 'DXImageTransform.Microsoft.AlphaImageLoader'; - src = (src || '').replace(/\(/g, '%28').replace(/\)/g, '%29'); - - if ( - src && !(/IMG|INPUT/.test(elm.nodeName) && (t != 2)) && - elm.currentStyle.width == 'auto' && elm.currentStyle.height == 'auto' - ) { - elm.style.width = elm.offsetWidth + 'px'; - elm.style.height = elm.clientHeight + 'px'; - if (elm.currentStyle.display == 'inline') { - elm.style.display = 'inline-block'; - } - } - - if (t == 1) { - elm.style.backgroundImage = 'url("' + this.blankImg + '")'; - } - if (t == 2) { - elm.src = this.blankImg; - } - - if (elm.filters[f]) { - elm.filters[f].enabled = src ? true : false; - if (src) { - elm.filters[f].src = src; - } - } else if (src) { - elm.style.filter = 'progid:' + f + '(src="' + src + - '",sizingMethod="' + (t == 2 ? 'scale' : 'crop') + '")'; - } - - this.hook.enabled = h; -}; - - -IEPNGFix.process = function(elm, init) { - // Checks the onpropertychange event (on first 'init' run, a fake event) - // and calls the filter-applying-functions. - - if ( - !/MSIE (5\.5|6)/.test(navigator.userAgent) || - typeof elm.filters == 'unknown' - ) { - return; - } - if (!this.data[elm.uniqueID]) { - this.data[elm.uniqueID] = { - className: '' - }; - } - var data = this.data[elm.uniqueID], - evt = init ? { propertyName: 'src,backgroundImage' } : event, - isSrc = /src/.test(evt.propertyName), - isBg = /backgroundImage/.test(evt.propertyName), - isPos = /width|height|background(Pos|Rep)/.test(evt.propertyName), - isClass = !init && ((elm.className != data.className) && - (elm.className || data.className)); - if (!(isSrc || isBg || isPos || isClass)) { - return; - } - data.className = elm.className; - var blank = this.blankImg.match(/([^\/]+)$/)[1], - eS = elm.style, - eCS = elm.currentStyle; - - // Required for Whatever:hover - erase set BG if className changes. - if ( - isClass && (eS.backgroundImage.indexOf('url(') == -1 || - eS.backgroundImage.indexOf(blank) > -1) - ) { - return setTimeout(function() { - eS.backgroundImage = ''; - }, 0); - } - - // Foregrounds. - if (isSrc && elm.src && { IMG: 1, INPUT: 1 }[elm.nodeName]) { - if ((/\.png/i).test(elm.src)) { - this.fix(elm, elm.src, 2); - } else if (elm.src.indexOf(blank) == -1) { - this.fix(elm, ''); - } - } - - // Backgrounds. - var bgSrc = eCS.backgroundImage || eS.backgroundImage; - if ((bgSrc + elm.src).indexOf(blank) == -1) { - var bgPNG = bgSrc.match(/url[("']+(.*\.png[^\)"']*)[\)"']/i); - if (bgPNG) { - if (this.tileBG && !{ IMG: 1, INPUT: 1 }[elm.nodeName]) { - this.tileBG(elm, bgPNG[1]); - this.fix(elm, '', 1); - } else { - if (data.tiles && data.tiles.src) { - this.tileBG(elm, ''); - } - this.fix(elm, bgPNG[1], 1); - this.childFix(elm); - } - } else { - if (data.tiles && data.tiles.src) { - this.tileBG(elm, ''); - } - this.fix(elm, ''); - } - } else if ((isPos || isClass) && data.tiles && data.tiles.src) { - this.tileBG(elm, data.tiles.src); - } - - if (init) { - this.hook.enabled = 1; - elm.attachEvent('onpropertychange', this.hook); - } -}; - - -IEPNGFix.childFix = function(elm) { - // "hasLayout" fix for unclickable children inside PNG backgrounds. - var tags = [ - 'a', - 'input', - 'select', - 'textarea', - 'button', - 'iframe', - 'object' - ], - t = tags.length, - tFix = []; - while (t--) { - var pFix = elm.all.tags(tags[t]), - e = pFix.length; - while (e--) { - tFix.push(pFix[e]); - } - } - t = tFix.length; - if (t && (/relative|absolute/i).test(elm.currentStyle.position)) { - alert('IEPNGFix: Unclickable children of element:' + - '\n\n<' + elm.nodeName + (elm.id && ' id=' + elm.id) + '>'); - } - while (t--) { - if (!(/relative|absolute/i).test(tFix[t].currentStyle.position)) { - tFix[t].style.position = 'relative'; - } - } -}; - - -IEPNGFix.hook = function() { - if (IEPNGFix.hook.enabled) { - IEPNGFix.process(element, 0); - } -}; - - -IEPNGFix.process(element, 1); - -</script> -</public:component> diff --git a/website/logi/iepngfix_tilebg.js b/website/logi/iepngfix_tilebg.js deleted file mode 100755 index 48795631..00000000 --- a/website/logi/iepngfix_tilebg.js +++ /dev/null @@ -1,178 +0,0 @@ -// IE5.5+ PNG Alpha Fix v2.0 Alpha: Background Tiling Support -// (c) 2008 Angus Turnbull http://www.twinhelix.com - -// This is licensed under the GNU LGPL, version 2.1 or later. -// For details, see: http://creativecommons.org/licenses/LGPL/2.1/ - -var IEPNGFix = window.IEPNGFix || {}; - -IEPNGFix.tileBG = function(elm, pngSrc, ready) { - // Params: A reference to a DOM element, the PNG src file pathname, and a - // hidden "ready-to-run" passed when called back after image preloading. - - var data; - try { - data = this.data[elm.uniqueID], - elmW = Math.max(elm.clientWidth, elm.scrollWidth), - elmH = Math.max(elm.clientHeight, elm.scrollHeight), - bgX = elm.currentStyle.backgroundPositionX, - bgY = elm.currentStyle.backgroundPositionY, - bgR = elm.currentStyle.backgroundRepeat; - } catch ( e ) { - return; - } - - // Cache of DIVs created per element, and image preloader/data. - if (!data.tiles) { - data.tiles = { - elm: elm, - src: '', - cache: [], - img: new Image(), - old: {} - }; - } - var tiles = data.tiles, - pngW = tiles.img.width, - pngH = tiles.img.height; - - if (pngSrc) { - if (!ready && pngSrc != tiles.src) { - // New image? Preload it with a callback to detect dimensions. - tiles.img.onload = function() { - this.onload = null; - IEPNGFix.tileBG(elm, pngSrc, 1); - }; - return tiles.img.src = pngSrc; - } - } else { - // No image? - if (tiles.src) ready = 1; - pngW = pngH = 0; - } - tiles.src = pngSrc; - - if (!ready && elmW == tiles.old.w && elmH == tiles.old.h && - bgX == tiles.old.x && bgY == tiles.old.y && bgR == tiles.old.r) { - return; - } - - // Convert English and percentage positions to pixels. - var pos = { - top: '0%', - left: '0%', - center: '50%', - bottom: '100%', - right: '100%' - }, - x, - y, - pc; - x = pos[bgX] || bgX; - y = pos[bgY] || bgY; - if (pc = x.match(/(\d+)%/)) { - x = Math.round((elmW - pngW) * (parseInt(pc[1]) / 100)); - } - if (pc = y.match(/(\d+)%/)) { - y = Math.round((elmH - pngH) * (parseInt(pc[1]) / 100)); - } - x = parseInt(x); - y = parseInt(y); - - // Handle backgroundRepeat. - var repeatX = { 'repeat': 1, 'repeat-x': 1 }[bgR], - repeatY = { 'repeat': 1, 'repeat-y': 1 }[bgR]; - if (repeatX) { - x %= pngW; - if (x > 0) x -= pngW; - } - if (repeatY) { - y %= pngH; - if (y > 0) y -= pngH; - } - - // Go! - this.hook.enabled = 0; - if (!({ relative: 1, absolute: 1 }[elm.currentStyle.position])) { - elm.style.position = 'relative'; - } - var count = 0, - xPos, - maxX = repeatX ? elmW : x + 0.1, - yPos, - maxY = repeatY ? elmH : y + 0.1, - d, - s, - isNew; - if (pngW && pngH) { - for (xPos = x; xPos < maxX; xPos += pngW) { - for (yPos = y; yPos < maxY; yPos += pngH) { - isNew = 0; - if (!tiles.cache[count]) { - tiles.cache[count] = document.createElement('div'); - isNew = 1; - } - var clipR = (xPos + pngW > elmW ? elmW - xPos : pngW), - clipB = (yPos + pngH > elmH ? elmH - yPos : pngH); - d = tiles.cache[count]; - s = d.style; - s.behavior = 'none'; - s.left = xPos + 'px'; - s.top = yPos + 'px'; - s.width = clipR + 'px'; - s.height = clipB + 'px'; - s.clip = 'rect(' + - (yPos < 0 ? 0 - yPos : 0) + 'px,' + - clipR + 'px,' + - clipB + 'px,' + - (xPos < 0 ? 0 - xPos : 0) + 'px)'; - s.display = 'block'; - if (isNew) { - s.position = 'absolute'; - s.zIndex = -999; - if (elm.firstChild) { - elm.insertBefore(d, elm.firstChild); - } else { - elm.appendChild(d); - } - } - this.fix(d, pngSrc, 0); - count++; - } - } - } - while (count < tiles.cache.length) { - this.fix(tiles.cache[count], '', 0); - tiles.cache[count++].style.display = 'none'; - } - - this.hook.enabled = 1; - - // Cache so updates are infrequent. - tiles.old = { - w: elmW, - h: elmH, - x: bgX, - y: bgY, - r: bgR - }; -}; - - -IEPNGFix.update = function() { - // Update all PNG backgrounds. - for (var i in IEPNGFix.data) { - var t = IEPNGFix.data[i].tiles; - if (t && t.elm && t.src) { - IEPNGFix.tileBG(t.elm, t.src); - } - } -}; -IEPNGFix.update.timer = 0; - -if (window.attachEvent && !window.opera) { - window.attachEvent('onresize', function() { - clearTimeout(IEPNGFix.update.timer); - IEPNGFix.update.timer = setTimeout(IEPNGFix.update, 100); - }); -} diff --git a/website/logi/jQuery-all.js b/website/logi/jQuery-all.js deleted file mode 100644 index 9f8ffce7..00000000 --- a/website/logi/jQuery-all.js +++ /dev/null @@ -1,143 +0,0 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); - -/* - * jQuery Color Animations - * Copyright 2007 John Resig - * Released under the MIT and GPL licenses. - */ - -(function(jQuery){ - - // We override the animation for all of these color styles - jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){ - jQuery.fx.step[attr] = function(fx){ - if ( fx.state == 0 ) { - fx.start = getColor( fx.elem, attr ); - fx.end = getRGB( fx.end ); - } - - fx.elem.style[attr] = "rgb(" + [ - Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), - Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), - Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0) - ].join(",") + ")"; - } - }); - - // Color Conversion functions from highlightFade - // By Blair Mitchelmore - // http://jquery.offput.ca/highlightFade/ - - // Parse strings looking for color tuples [255,255,255] - function getRGB(color) { - var result; - - // Check if we're already dealing with an array of colors - if ( color && color.constructor == Array && color.length == 3 ) - return color; - - // Look for rgb(num,num,num) - if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) - return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])]; - - // Look for rgb(num%,num%,num%) - if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) - return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; - - // Look for #a0b1c2 - if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) - return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; - - // Look for #fff - if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) - return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; - - // Otherwise, we're most likely dealing with a named color - return colors[jQuery.trim(color).toLowerCase()]; - } - - function getColor(elem, attr) { - var color; - - do { - color = jQuery.curCSS(elem, attr); - - // Keep going until we find an element that has color, or we hit the body - if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") ) - break; - - attr = "backgroundColor"; - } while ( elem = elem.parentNode ); - - return getRGB(color); - }; - - // Some named colors to work with - // From Interface by Stefan Petre - // http://interface.eyecon.ro/ - - var colors = { - aqua:[0,255,255], - azure:[240,255,255], - beige:[245,245,220], - black:[0,0,0], - blue:[0,0,255], - brown:[165,42,42], - cyan:[0,255,255], - darkblue:[0,0,139], - darkcyan:[0,139,139], - darkgrey:[169,169,169], - darkgreen:[0,100,0], - darkkhaki:[189,183,107], - darkmagenta:[139,0,139], - darkolivegreen:[85,107,47], - darkorange:[255,140,0], - darkorchid:[153,50,204], - darkred:[139,0,0], - darksalmon:[233,150,122], - darkviolet:[148,0,211], - fuchsia:[255,0,255], - gold:[255,215,0], - green:[0,128,0], - indigo:[75,0,130], - khaki:[240,230,140], - lightblue:[173,216,230], - lightcyan:[224,255,255], - lightgreen:[144,238,144], - lightgrey:[211,211,211], - lightpink:[255,182,193], - lightyellow:[255,255,224], - lime:[0,255,0], - magenta:[255,0,255], - maroon:[128,0,0], - navy:[0,0,128], - olive:[128,128,0], - orange:[255,165,0], - pink:[255,192,203], - purple:[128,0,128], - violet:[128,0,128], - red:[255,0,0], - silver:[192,192,192], - white:[255,255,255], - yellow:[255,255,0] - }; - -})(jQuery); diff --git a/website/logi/reset.css b/website/logi/reset.css deleted file mode 100644 index 91c616e9..00000000 --- a/website/logi/reset.css +++ /dev/null @@ -1,67 +0,0 @@ -html,body,div,span,applet,object,iframe, -pre,abbr,address,cite,code,del,dfn,em,img, -ins,kbd,q,strong,tt,var,dl,dt,dd,blockquote, -fieldset,form,i,b,caption,tbody,tfoot,thead,tr,th,td{ - margin:0; - padding:0; - vertical-align:baseline; -} - -body{ - background:#fff; - color:#000; - font:75%/1.5em Verdana, Helvetica, Arial, sans-serif; -} - -:focus{ - outline:0; -} - -code,kbd,tt{ - font-family: "Courier new", Courier; - line-height:1; - *line-height:1.5; -} - -del{ - text-decoration:line-through; -} - -*::-moz-focus-inner { - border: 0; -} - -img{ - border: 0; - display:inline-block; - vertical-align:bottom; -} - -ol{ - list-style:inside decimal; -} - -ul{ - list-style:inside disc; -} - -pre{ - font-family:"Courier New", Courier; - margin:0 0 1.5em; -} - -sub{ - top:0.4em; - font-size:0.85em; - line-height:1; - position:relative; - vertical-align:baseline; -} - -sup{ - font-size:0.85em; - line-height:1; - position:relative; - bottom:0.5em; - vertical-align:baseline; -} diff --git a/website/lombokBullet.png b/website/lombokBullet.png Binary files differdeleted file mode 100644 index b19beee2..00000000 --- a/website/lombokBullet.png +++ /dev/null diff --git a/website/mavenrepo/index.html b/website/mavenrepo/index.html deleted file mode 100644 index a51a5a20..00000000 --- a/website/mavenrepo/index.html +++ /dev/null @@ -1,99 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok</title> - <style type="text/css"> - code { - font-size: 12px; - font-family: monospaced; - } - - .snippet { - white-space: pre; - border: 1px dashed #888; - margin: 8px 8px 8px 0px; - padding: 8px; - font-family: "Courier New", Courier; - } - - .meat { - margin: 16px auto 0 auto; - width: 800px; - } - - .backLink { - padding-top: 100px; - width: 100%; - text-align: right; - } - - h1 { - padding-bottom: 0; - margin-bottom: 8px; - } - - #downloadLink { - display: block; - margin-top: 32px; - font-size: 14px; - } - </style> -</head><body> - <div class="meat"> - <h2>Maven</h1> - <div> - You can use lombok with maven by adding the following to your <strong>pom.xml</strong>: - <div class="snippet"><dependencies> - <dependency> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - <version>@VERSION@</version> - <scope>provided</scope> - </dependency> -</dependencies></div> - </div> - <h2>Ivy</h2> - <div> - You can use lombok with ivy by adding the following to your <strong>ivy.xml</strong>: - <div class="snippet"><dependency org="org.projectlombok" name="lombok" rev="@VERSION@" conf="build" /></div> - </div> - <h2>SBT</h2> - <div> - You can use lombok with SBT by adding the following to your <strong>build.sbt</strong>: - <div class="snippet">libraryDependencies += "org.projectlombok" % "lombok" % "@VERSION@"</div> - </div> - <h2>Gradle</h2> - - <div> - If your gradle version is <strong> >= 2.12</strong> you can use lombok by adding the following to your <strong>build.gradle</strong> in the <strong>dependencies</strong> block: - <div class="snippet">compileOnly "org.projectlombok:lombok:@VERSION@"</div> - </div> - <div> - If you use an older version you can still use the following: - <div class="snippet">provided "org.projectlombok:lombok:@VERSION@"</div> - as long as your gradle build include a war task (otherwise the "provided" scope is not available and you have to create your own configuration as <a href="https://issues.gradle.org/browse/GRADLE-784">explained here</a> ) - </div> - <br> - <div> - <strong><em>NOTE:</em></strong> You'll still need to download lombok, or doubleclick on the lombok.jar file downloaded by maven / ivy / gradle, to install lombok into your eclipse installation. - </div> - <a id="downloadLink" href="https://projectlombok.org/downloads/lombok.jar">Download lombok.jar</a> - </div> - <div class="backLink"> - <a href="../index.html">back to the project homepage</a> - </div> - </div> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> -</body></html> diff --git a/website/novideo.html b/website/novideo.html deleted file mode 100644 index a3fff7dc..00000000 --- a/website/novideo.html +++ /dev/null @@ -1,55 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="stylesheet" type="text/css" href="logi/reset.css" /> - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok</title> - <style type="text/css"> - code { - font-size: 12px; - font-family: monospaced; - } - - .meat { - margin: 16px auto 0 auto; - width: 800px; - } - - .backLink { - padding-top: 100px; - width: 100%; - text-align: right; - } - </style> -</head><body> - <div class="meat"> - <h1>Can't see the video?</h1> - <p> - Why not download it instead?<br /> - <a href="videos/lombok.mp4">MPEG4 / H.264 (Windows / Mac)</a> | - <a href="videos/lombok.ogv">Ogg Theora & Vorbis ".ogv" (Linux)</a> - </p><p> - If the video won't play on the webpage and you want it to, please do one of the following: - </p><ul> - <li>Upgrade to <a href="https://getfirefox.com/">Firefox 3.5</a>, - <a href="https://apple.com/safari">Safari 4</a> or - <a href="https://www.google.com/chrome/">Chrome 2</a></li> - <li>Install <a href="https://get.adobe.com/flashplayer/">Adobe Flash</a></li> - <li>Install <a href="https://apple.com/quicktime/download/">QuickTime</a></li> - </ul> - <div class="backLink"> - <a href="index.html">back to the project homepage</a> - </div> - </div> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> -</body></html> diff --git a/website/peppery_background_large.jpg b/website/peppery_background_large.jpg Binary files differdeleted file mode 100644 index 6524dc6f..00000000 --- a/website/peppery_background_large.jpg +++ /dev/null diff --git a/website/poster.png b/website/poster.png Binary files differdeleted file mode 100644 index 4911408f..00000000 --- a/website/poster.png +++ /dev/null diff --git a/website/resources/W8BEN_lombok.pdf b/website/resources/W8BEN_lombok.pdf Binary files differnew file mode 100644 index 00000000..b87bded8 --- /dev/null +++ b/website/resources/W8BEN_lombok.pdf diff --git a/website/resources/css/bootstrap.css b/website/resources/css/bootstrap.css new file mode 100644 index 00000000..8a8b0192 --- /dev/null +++ b/website/resources/css/bootstrap.css @@ -0,0 +1,6706 @@ +@import url("//fonts.googleapis.com/css?family=Open+Sans:400,700"); +/*! + * bootswatch v3.3.4+1 + * Homepage: http://bootswatch.com + * Copyright 2012-2015 Thomas Park + * Licensed under MIT + * Based on Bootstrap +*/ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ +html { + font-family: sans-serif; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} +body { + margin: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +a { + background-color: transparent; +} +a:active, +a:hover { + outline: 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +dfn { + font-style: italic; +} +h1 { + font-size: 2em; + margin: 0.67em 0; +} +mark { + background: #ff0; + color: #000; +} +small { + font-size: 80%; +} +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 1em 40px; +} +hr { + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} +pre { + overflow: auto; +} +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} +button, +input, +optgroup, +select, +textarea { + color: inherit; + font: inherit; + margin: 0; +} +button { + overflow: visible; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} +input { + line-height: normal; +} +input[type="checkbox"], +input[type="radio"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} +input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} +legend { + border: 0; + padding: 0; +} +textarea { + overflow: auto; +} +optgroup { + font-weight: bold; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +td, +th { + padding: 0; +} +/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ +@media print { + *, + *:before, + *:after { + background: transparent !important; + color: #000 !important; + -webkit-box-shadow: none !important; + box-shadow: none !important; + text-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + a[href]:after { + content: " (" attr(href) ")"; + } + abbr[title]:after { + content: " (" attr(title) ")"; + } + a[href^="#"]:after, + a[href^="javascript:"]:after { + content: ""; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + img { + max-width: 100% !important; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } + select { + background: #fff !important; + } + .navbar { + display: none; + } + .btn > .caret, + .dropup > .btn > .caret { + border-top-color: #000 !important; + } + .label { + border: 1px solid #000; + } + .table { + border-collapse: collapse !important; + } + .table td, + .table th { + background-color: #fff !important; + } + .table-bordered th, + .table-bordered td { + border: 1px solid #ddd !important; + } +} +@font-face { + font-family: 'Glyphicons Halflings'; + src: url('../fonts/glyphicons-halflings-regular.eot'); + src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg'); +} +.glyphicon { + position: relative; + top: 1px; + display: inline-block; + font-family: 'Glyphicons Halflings'; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.glyphicon-asterisk:before { + content: "\2a"; +} +.glyphicon-plus:before { + content: "\2b"; +} +.glyphicon-euro:before, +.glyphicon-eur:before { + content: "\20ac"; +} +.glyphicon-minus:before { + content: "\2212"; +} +.glyphicon-cloud:before { + content: "\2601"; +} +.glyphicon-envelope:before { + content: "\2709"; +} +.glyphicon-pencil:before { + content: "\270f"; +} +.glyphicon-glass:before { + content: "\e001"; +} +.glyphicon-music:before { + content: "\e002"; +} +.glyphicon-search:before { + content: "\e003"; +} +.glyphicon-heart:before { + content: "\e005"; +} +.glyphicon-star:before { + content: "\e006"; +} +.glyphicon-star-empty:before { + content: "\e007"; +} +.glyphicon-user:before { + content: "\e008"; +} +.glyphicon-film:before { + content: "\e009"; +} +.glyphicon-th-large:before { + content: "\e010"; +} +.glyphicon-th:before { + content: "\e011"; +} +.glyphicon-th-list:before { + content: "\e012"; +} +.glyphicon-ok:before { + content: "\e013"; +} +.glyphicon-remove:before { + content: "\e014"; +} +.glyphicon-zoom-in:before { + content: "\e015"; +} +.glyphicon-zoom-out:before { + content: "\e016"; +} +.glyphicon-off:before { + content: "\e017"; +} +.glyphicon-signal:before { + content: "\e018"; +} +.glyphicon-cog:before { + content: "\e019"; +} +.glyphicon-trash:before { + content: "\e020"; +} +.glyphicon-home:before { + content: "\e021"; +} +.glyphicon-file:before { + content: "\e022"; +} +.glyphicon-time:before { + content: "\e023"; +} +.glyphicon-road:before { + content: "\e024"; +} +.glyphicon-download-alt:before { + content: "\e025"; +} +.glyphicon-download:before { + content: "\e026"; +} +.glyphicon-upload:before { + content: "\e027"; +} +.glyphicon-inbox:before { + content: "\e028"; +} +.glyphicon-play-circle:before { + content: "\e029"; +} +.glyphicon-repeat:before { + content: "\e030"; +} +.glyphicon-refresh:before { + content: "\e031"; +} +.glyphicon-list-alt:before { + content: "\e032"; +} +.glyphicon-lock:before { + content: "\e033"; +} +.glyphicon-flag:before { + content: "\e034"; +} +.glyphicon-headphones:before { + content: "\e035"; +} +.glyphicon-volume-off:before { + content: "\e036"; +} +.glyphicon-volume-down:before { + content: "\e037"; +} +.glyphicon-volume-up:before { + content: "\e038"; +} +.glyphicon-qrcode:before { + content: "\e039"; +} +.glyphicon-barcode:before { + content: "\e040"; +} +.glyphicon-tag:before { + content: "\e041"; +} +.glyphicon-tags:before { + content: "\e042"; +} +.glyphicon-book:before { + content: "\e043"; +} +.glyphicon-bookmark:before { + content: "\e044"; +} +.glyphicon-print:before { + content: "\e045"; +} +.glyphicon-camera:before { + content: "\e046"; +} +.glyphicon-font:before { + content: "\e047"; +} +.glyphicon-bold:before { + content: "\e048"; +} +.glyphicon-italic:before { + content: "\e049"; +} +.glyphicon-text-height:before { + content: "\e050"; +} +.glyphicon-text-width:before { + content: "\e051"; +} +.glyphicon-align-left:before { + content: "\e052"; +} +.glyphicon-align-center:before { + content: "\e053"; +} +.glyphicon-align-right:before { + content: "\e054"; +} +.glyphicon-align-justify:before { + content: "\e055"; +} +.glyphicon-list:before { + content: "\e056"; +} +.glyphicon-indent-left:before { + content: "\e057"; +} +.glyphicon-indent-right:before { + content: "\e058"; +} +.glyphicon-facetime-video:before { + content: "\e059"; +} +.glyphicon-picture:before { + content: "\e060"; +} +.glyphicon-map-marker:before { + content: "\e062"; +} +.glyphicon-adjust:before { + content: "\e063"; +} +.glyphicon-tint:before { + content: "\e064"; +} +.glyphicon-edit:before { + content: "\e065"; +} +.glyphicon-share:before { + content: "\e066"; +} +.glyphicon-check:before { + content: "\e067"; +} +.glyphicon-move:before { + content: "\e068"; +} +.glyphicon-step-backward:before { + content: "\e069"; +} +.glyphicon-fast-backward:before { + content: "\e070"; +} +.glyphicon-backward:before { + content: "\e071"; +} +.glyphicon-play:before { + content: "\e072"; +} +.glyphicon-pause:before { + content: "\e073"; +} +.glyphicon-stop:before { + content: "\e074"; +} +.glyphicon-forward:before { + content: "\e075"; +} +.glyphicon-fast-forward:before { + content: "\e076"; +} +.glyphicon-step-forward:before { + content: "\e077"; +} +.glyphicon-eject:before { + content: "\e078"; +} +.glyphicon-chevron-left:before { + content: "\e079"; +} +.glyphicon-chevron-right:before { + content: "\e080"; +} +.glyphicon-plus-sign:before { + content: "\e081"; +} +.glyphicon-minus-sign:before { + content: "\e082"; +} +.glyphicon-remove-sign:before { + content: "\e083"; +} +.glyphicon-ok-sign:before { + content: "\e084"; +} +.glyphicon-question-sign:before { + content: "\e085"; +} +.glyphicon-info-sign:before { + content: "\e086"; +} +.glyphicon-screenshot:before { + content: "\e087"; +} +.glyphicon-remove-circle:before { + content: "\e088"; +} +.glyphicon-ok-circle:before { + content: "\e089"; +} +.glyphicon-ban-circle:before { + content: "\e090"; +} +.glyphicon-arrow-left:before { + content: "\e091"; +} +.glyphicon-arrow-right:before { + content: "\e092"; +} +.glyphicon-arrow-up:before { + content: "\e093"; +} +.glyphicon-arrow-down:before { + content: "\e094"; +} +.glyphicon-share-alt:before { + content: "\e095"; +} +.glyphicon-resize-full:before { + content: "\e096"; +} +.glyphicon-resize-small:before { + content: "\e097"; +} +.glyphicon-exclamation-sign:before { + content: "\e101"; +} +.glyphicon-gift:before { + content: "\e102"; +} +.glyphicon-leaf:before { + content: "\e103"; +} +.glyphicon-fire:before { + content: "\e104"; +} +.glyphicon-eye-open:before { + content: "\e105"; +} +.glyphicon-eye-close:before { + content: "\e106"; +} +.glyphicon-warning-sign:before { + content: "\e107"; +} +.glyphicon-plane:before { + content: "\e108"; +} +.glyphicon-calendar:before { + content: "\e109"; +} +.glyphicon-random:before { + content: "\e110"; +} +.glyphicon-comment:before { + content: "\e111"; +} +.glyphicon-magnet:before { + content: "\e112"; +} +.glyphicon-chevron-up:before { + content: "\e113"; +} +.glyphicon-chevron-down:before { + content: "\e114"; +} +.glyphicon-retweet:before { + content: "\e115"; +} +.glyphicon-shopping-cart:before { + content: "\e116"; +} +.glyphicon-folder-close:before { + content: "\e117"; +} +.glyphicon-folder-open:before { + content: "\e118"; +} +.glyphicon-resize-vertical:before { + content: "\e119"; +} +.glyphicon-resize-horizontal:before { + content: "\e120"; +} +.glyphicon-hdd:before { + content: "\e121"; +} +.glyphicon-bullhorn:before { + content: "\e122"; +} +.glyphicon-bell:before { + content: "\e123"; +} +.glyphicon-certificate:before { + content: "\e124"; +} +.glyphicon-thumbs-up:before { + content: "\e125"; +} +.glyphicon-thumbs-down:before { + content: "\e126"; +} +.glyphicon-hand-right:before { + content: "\e127"; +} +.glyphicon-hand-left:before { + content: "\e128"; +} +.glyphicon-hand-up:before { + content: "\e129"; +} +.glyphicon-hand-down:before { + content: "\e130"; +} +.glyphicon-circle-arrow-right:before { + content: "\e131"; +} +.glyphicon-circle-arrow-left:before { + content: "\e132"; +} +.glyphicon-circle-arrow-up:before { + content: "\e133"; +} +.glyphicon-circle-arrow-down:before { + content: "\e134"; +} +.glyphicon-globe:before { + content: "\e135"; +} +.glyphicon-wrench:before { + content: "\e136"; +} +.glyphicon-tasks:before { + content: "\e137"; +} +.glyphicon-filter:before { + content: "\e138"; +} +.glyphicon-briefcase:before { + content: "\e139"; +} +.glyphicon-fullscreen:before { + content: "\e140"; +} +.glyphicon-dashboard:before { + content: "\e141"; +} +.glyphicon-paperclip:before { + content: "\e142"; +} +.glyphicon-heart-empty:before { + content: "\e143"; +} +.glyphicon-link:before { + content: "\e144"; +} +.glyphicon-phone:before { + content: "\e145"; +} +.glyphicon-pushpin:before { + content: "\e146"; +} +.glyphicon-usd:before { + content: "\e148"; +} +.glyphicon-gbp:before { + content: "\e149"; +} +.glyphicon-sort:before { + content: "\e150"; +} +.glyphicon-sort-by-alphabet:before { + content: "\e151"; +} +.glyphicon-sort-by-alphabet-alt:before { + content: "\e152"; +} +.glyphicon-sort-by-order:before { + content: "\e153"; +} +.glyphicon-sort-by-order-alt:before { + content: "\e154"; +} +.glyphicon-sort-by-attributes:before { + content: "\e155"; +} +.glyphicon-sort-by-attributes-alt:before { + content: "\e156"; +} +.glyphicon-unchecked:before { + content: "\e157"; +} +.glyphicon-expand:before { + content: "\e158"; +} +.glyphicon-collapse-down:before { + content: "\e159"; +} +.glyphicon-collapse-up:before { + content: "\e160"; +} +.glyphicon-log-in:before { + content: "\e161"; +} +.glyphicon-flash:before { + content: "\e162"; +} +.glyphicon-log-out:before { + content: "\e163"; +} +.glyphicon-new-window:before { + content: "\e164"; +} +.glyphicon-record:before { + content: "\e165"; +} +.glyphicon-save:before { + content: "\e166"; +} +.glyphicon-open:before { + content: "\e167"; +} +.glyphicon-saved:before { + content: "\e168"; +} +.glyphicon-import:before { + content: "\e169"; +} +.glyphicon-export:before { + content: "\e170"; +} +.glyphicon-send:before { + content: "\e171"; +} +.glyphicon-floppy-disk:before { + content: "\e172"; +} +.glyphicon-floppy-saved:before { + content: "\e173"; +} +.glyphicon-floppy-remove:before { + content: "\e174"; +} +.glyphicon-floppy-save:before { + content: "\e175"; +} +.glyphicon-floppy-open:before { + content: "\e176"; +} +.glyphicon-credit-card:before { + content: "\e177"; +} +.glyphicon-transfer:before { + content: "\e178"; +} +.glyphicon-cutlery:before { + content: "\e179"; +} +.glyphicon-header:before { + content: "\e180"; +} +.glyphicon-compressed:before { + content: "\e181"; +} +.glyphicon-earphone:before { + content: "\e182"; +} +.glyphicon-phone-alt:before { + content: "\e183"; +} +.glyphicon-tower:before { + content: "\e184"; +} +.glyphicon-stats:before { + content: "\e185"; +} +.glyphicon-sd-video:before { + content: "\e186"; +} +.glyphicon-hd-video:before { + content: "\e187"; +} +.glyphicon-subtitles:before { + content: "\e188"; +} +.glyphicon-sound-stereo:before { + content: "\e189"; +} +.glyphicon-sound-dolby:before { + content: "\e190"; +} +.glyphicon-sound-5-1:before { + content: "\e191"; +} +.glyphicon-sound-6-1:before { + content: "\e192"; +} +.glyphicon-sound-7-1:before { + content: "\e193"; +} +.glyphicon-copyright-mark:before { + content: "\e194"; +} +.glyphicon-registration-mark:before { + content: "\e195"; +} +.glyphicon-cloud-download:before { + content: "\e197"; +} +.glyphicon-cloud-upload:before { + content: "\e198"; +} +.glyphicon-tree-conifer:before { + content: "\e199"; +} +.glyphicon-tree-deciduous:before { + content: "\e200"; +} +.glyphicon-cd:before { + content: "\e201"; +} +.glyphicon-save-file:before { + content: "\e202"; +} +.glyphicon-open-file:before { + content: "\e203"; +} +.glyphicon-level-up:before { + content: "\e204"; +} +.glyphicon-copy:before { + content: "\e205"; +} +.glyphicon-paste:before { + content: "\e206"; +} +.glyphicon-alert:before { + content: "\e209"; +} +.glyphicon-equalizer:before { + content: "\e210"; +} +.glyphicon-king:before { + content: "\e211"; +} +.glyphicon-queen:before { + content: "\e212"; +} +.glyphicon-pawn:before { + content: "\e213"; +} +.glyphicon-bishop:before { + content: "\e214"; +} +.glyphicon-knight:before { + content: "\e215"; +} +.glyphicon-baby-formula:before { + content: "\e216"; +} +.glyphicon-tent:before { + content: "\26fa"; +} +.glyphicon-blackboard:before { + content: "\e218"; +} +.glyphicon-bed:before { + content: "\e219"; +} +.glyphicon-apple:before { + content: "\f8ff"; +} +.glyphicon-erase:before { + content: "\e221"; +} +.glyphicon-hourglass:before { + content: "\231b"; +} +.glyphicon-lamp:before { + content: "\e223"; +} +.glyphicon-duplicate:before { + content: "\e224"; +} +.glyphicon-piggy-bank:before { + content: "\e225"; +} +.glyphicon-scissors:before { + content: "\e226"; +} +.glyphicon-bitcoin:before { + content: "\e227"; +} +.glyphicon-btc:before { + content: "\e227"; +} +.glyphicon-xbt:before { + content: "\e227"; +} +.glyphicon-yen:before { + content: "\00a5"; +} +.glyphicon-jpy:before { + content: "\00a5"; +} +.glyphicon-ruble:before { + content: "\20bd"; +} +.glyphicon-rub:before { + content: "\20bd"; +} +.glyphicon-scale:before { + content: "\e230"; +} +.glyphicon-ice-lolly:before { + content: "\e231"; +} +.glyphicon-ice-lolly-tasted:before { + content: "\e232"; +} +.glyphicon-education:before { + content: "\e233"; +} +.glyphicon-option-horizontal:before { + content: "\e234"; +} +.glyphicon-option-vertical:before { + content: "\e235"; +} +.glyphicon-menu-hamburger:before { + content: "\e236"; +} +.glyphicon-modal-window:before { + content: "\e237"; +} +.glyphicon-oil:before { + content: "\e238"; +} +.glyphicon-grain:before { + content: "\e239"; +} +.glyphicon-sunglasses:before { + content: "\e240"; +} +.glyphicon-text-size:before { + content: "\e241"; +} +.glyphicon-text-color:before { + content: "\e242"; +} +.glyphicon-text-background:before { + content: "\e243"; +} +.glyphicon-object-align-top:before { + content: "\e244"; +} +.glyphicon-object-align-bottom:before { + content: "\e245"; +} +.glyphicon-object-align-horizontal:before { + content: "\e246"; +} +.glyphicon-object-align-left:before { + content: "\e247"; +} +.glyphicon-object-align-vertical:before { + content: "\e248"; +} +.glyphicon-object-align-right:before { + content: "\e249"; +} +.glyphicon-triangle-right:before { + content: "\e250"; +} +.glyphicon-triangle-left:before { + content: "\e251"; +} +.glyphicon-triangle-bottom:before { + content: "\e252"; +} +.glyphicon-triangle-top:before { + content: "\e253"; +} +.glyphicon-console:before { + content: "\e254"; +} +.glyphicon-superscript:before { + content: "\e255"; +} +.glyphicon-subscript:before { + content: "\e256"; +} +.glyphicon-menu-left:before { + content: "\e257"; +} +.glyphicon-menu-right:before { + content: "\e258"; +} +.glyphicon-menu-down:before { + content: "\e259"; +} +.glyphicon-menu-up:before { + content: "\e260"; +} +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +*:before, +*:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html { + font-size: 10px; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +body { + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + line-height: 1.42857143; + color: #777777; + background-color: #fcfcfc; +} +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +a { + color: #d9230f; + text-decoration: none; +} +a:hover, +a:focus { + color: #91170a; + text-decoration: underline; +} +a:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +figure { + margin: 0; +} +img { + vertical-align: middle; +} +.img-responsive, +.thumbnail > img, +.thumbnail a > img, +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + display: block; + max-width: 100%; + height: auto; +} +.img-rounded { + border-radius: 6px; +} +.img-thumbnail { + padding: 4px; + line-height: 1.42857143; + background-color: #fcfcfc; + border: 1px solid #dddddd; + border-radius: 4px; + -webkit-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + display: inline-block; + max-width: 100%; + height: auto; +} +.img-circle { + border-radius: 50%; +} +hr { + margin-top: 18px; + margin-bottom: 18px; + border: 0; + border-top: 1px solid #dddddd; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} +[role="button"] { + cursor: pointer; +} +h1, +h2, +h3, +h4, +h5, +h6, +.h1, +.h2, +.h3, +.h4, +.h5, +.h6 { + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 300; + line-height: 1.1; + color: #444444; +} +h1 small, +h2 small, +h3 small, +h4 small, +h5 small, +h6 small, +.h1 small, +.h2 small, +.h3 small, +.h4 small, +.h5 small, +.h6 small, +h1 .small, +h2 .small, +h3 .small, +h4 .small, +h5 .small, +h6 .small, +.h1 .small, +.h2 .small, +.h3 .small, +.h4 .small, +.h5 .small, +.h6 .small { + font-weight: normal; + line-height: 1; + color: #808080; +} +h1, +.h1, +h2, +.h2, +h3, +.h3 { + margin-top: 18px; + margin-bottom: 9px; +} +h1 small, +.h1 small, +h2 small, +.h2 small, +h3 small, +.h3 small, +h1 .small, +.h1 .small, +h2 .small, +.h2 .small, +h3 .small, +.h3 .small { + font-size: 65%; +} +h4, +.h4, +h5, +.h5, +h6, +.h6 { + margin-top: 9px; + margin-bottom: 9px; +} +h4 small, +.h4 small, +h5 small, +.h5 small, +h6 small, +.h6 small, +h4 .small, +.h4 .small, +h5 .small, +.h5 .small, +h6 .small, +.h6 .small { + font-size: 75%; +} +h1, +.h1 { + font-size: 33px; +} +h2, +.h2 { + font-size: 27px; +} +h3, +.h3 { + font-size: 23px; +} +h4, +.h4 { + font-size: 17px; +} +h5, +.h5 { + font-size: 13px; +} +h6, +.h6 { + font-size: 12px; +} +p { + margin: 0 0 9px; +} +.lead { + margin-bottom: 18px; + font-size: 14px; + font-weight: 300; + line-height: 1.4; +} +@media (min-width: 768px) { + .lead { + font-size: 19.5px; + } +} +small, +.small { + font-size: 92%; +} +mark, +.mark { + background-color: #fcf8e3; + padding: .2em; +} +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} +.text-center { + text-align: center; +} +.text-justify { + text-align: justify; +} +.text-nowrap { + white-space: nowrap; +} +.text-lowercase { + text-transform: lowercase; +} +.text-uppercase { + text-transform: uppercase; +} +.text-capitalize { + text-transform: capitalize; +} +.text-muted { + color: #808080; +} +.text-primary { + color: #d9230f; +} +a.text-primary:hover { + color: #a91b0c; +} +.text-success { + color: #468847; +} +a.text-success:hover { + color: #356635; +} +.text-info { + color: #3a87ad; +} +a.text-info:hover { + color: #2d6987; +} +.text-warning { + color: #c09853; +} +a.text-warning:hover { + color: #a47e3c; +} +.text-danger { + color: #b94a48; +} +a.text-danger:hover { + color: #953b39; +} +.bg-primary { + color: #fff; + background-color: #d9230f; +} +a.bg-primary:hover { + background-color: #a91b0c; +} +.bg-success { + background-color: #dff0d8; +} +a.bg-success:hover { + background-color: #c1e2b3; +} +.bg-info { + background-color: #d9edf7; +} +a.bg-info:hover { + background-color: #afd9ee; +} +.bg-warning { + background-color: #fcf8e3; +} +a.bg-warning:hover { + background-color: #f7ecb5; +} +.bg-danger { + background-color: #f2dede; +} +a.bg-danger:hover { + background-color: #e4b9b9; +} +.page-header { + padding-bottom: 8px; + margin: 36px 0 18px; + border-bottom: 1px solid #dddddd; +} +ul, +ol { + margin-top: 0; + margin-bottom: 9px; +} +ul ul, +ol ul, +ul ol, +ol ol { + margin-bottom: 0; +} +.list-unstyled { + padding-left: 0; + list-style: none; +} +.list-inline { + padding-left: 0; + list-style: none; + margin-left: -5px; +} +.list-inline > li { + display: inline-block; + padding-left: 5px; + padding-right: 5px; +} +dl { + margin-top: 0; + margin-bottom: 18px; +} +dt, +dd { + line-height: 1.42857143; +} +dt { + font-weight: bold; +} +dd { + margin-left: 0; +} +@media (min-width: 768px) { + .dl-horizontal dt { + float: left; + width: 160px; + clear: left; + text-align: right; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .dl-horizontal dd { + margin-left: 180px; + } +} +abbr[title], +abbr[data-original-title] { + cursor: help; + border-bottom: 1px dotted #808080; +} +.initialism { + font-size: 90%; + text-transform: uppercase; +} +blockquote { + padding: 9px 18px; + margin: 0 0 18px; + font-size: 16.25px; + border-left: 5px solid #dddddd; +} +blockquote p:last-child, +blockquote ul:last-child, +blockquote ol:last-child { + margin-bottom: 0; +} +blockquote footer, +blockquote small, +blockquote .small { + display: block; + font-size: 80%; + line-height: 1.42857143; + color: #808080; +} +blockquote footer:before, +blockquote small:before, +blockquote .small:before { + content: '\2014 \00A0'; +} +.blockquote-reverse, +blockquote.pull-right { + padding-right: 15px; + padding-left: 0; + border-right: 5px solid #dddddd; + border-left: 0; + text-align: right; +} +.blockquote-reverse footer:before, +blockquote.pull-right footer:before, +.blockquote-reverse small:before, +blockquote.pull-right small:before, +.blockquote-reverse .small:before, +blockquote.pull-right .small:before { + content: ''; +} +.blockquote-reverse footer:after, +blockquote.pull-right footer:after, +.blockquote-reverse small:after, +blockquote.pull-right small:after, +.blockquote-reverse .small:after, +blockquote.pull-right .small:after { + content: '\00A0 \2014'; +} +address { + margin-bottom: 18px; + font-style: normal; + line-height: 1.42857143; +} +code, +kbd, +pre, +samp { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; +} +code { + padding: 2px 4px; + font-size: 90%; + color: #c7254e; + background-color: #f9f2f4; + border-radius: 4px; +} +kbd { + padding: 2px 4px; + font-size: 90%; + color: #ffffff; + background-color: #333333; + border-radius: 3px; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); +} +kbd kbd { + padding: 0; + font-size: 100%; + font-weight: bold; + -webkit-box-shadow: none; + box-shadow: none; +} +pre { + display: block; + padding: 8.5px; + margin: 0 0 9px; + font-size: 12px; + line-height: 1.42857143; + word-break: break-all; + word-wrap: break-word; + color: #444444; + background-color: #f5f5f5; + border: 1px solid #cccccc; + border-radius: 4px; +} +pre code { + padding: 0; + font-size: inherit; + color: inherit; + white-space: pre-wrap; + background-color: transparent; + border-radius: 0; +} +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} +.container { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} +@media (min-width: 768px) { + .container { + width: 750px; + } +} +@media (min-width: 992px) { + .container { + width: 970px; + } +} +@media (min-width: 1200px) { + .container { + width: 1170px; + } +} +.container-fluid { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} +.row { + margin-left: -15px; + margin-right: -15px; +} +.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { + position: relative; + min-height: 1px; + padding-left: 15px; + padding-right: 15px; +} +.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 { + float: left; +} +.col-xs-12 { + width: 100%; +} +.col-xs-11 { + width: 91.66666667%; +} +.col-xs-10 { + width: 83.33333333%; +} +.col-xs-9 { + width: 75%; +} +.col-xs-8 { + width: 66.66666667%; +} +.col-xs-7 { + width: 58.33333333%; +} +.col-xs-6 { + width: 50%; +} +.col-xs-5 { + width: 41.66666667%; +} +.col-xs-4 { + width: 33.33333333%; +} +.col-xs-3 { + width: 25%; +} +.col-xs-2 { + width: 16.66666667%; +} +.col-xs-1 { + width: 8.33333333%; +} +.col-xs-pull-12 { + right: 100%; +} +.col-xs-pull-11 { + right: 91.66666667%; +} +.col-xs-pull-10 { + right: 83.33333333%; +} +.col-xs-pull-9 { + right: 75%; +} +.col-xs-pull-8 { + right: 66.66666667%; +} +.col-xs-pull-7 { + right: 58.33333333%; +} +.col-xs-pull-6 { + right: 50%; +} +.col-xs-pull-5 { + right: 41.66666667%; +} +.col-xs-pull-4 { + right: 33.33333333%; +} +.col-xs-pull-3 { + right: 25%; +} +.col-xs-pull-2 { + right: 16.66666667%; +} +.col-xs-pull-1 { + right: 8.33333333%; +} +.col-xs-pull-0 { + right: auto; +} +.col-xs-push-12 { + left: 100%; +} +.col-xs-push-11 { + left: 91.66666667%; +} +.col-xs-push-10 { + left: 83.33333333%; +} +.col-xs-push-9 { + left: 75%; +} +.col-xs-push-8 { + left: 66.66666667%; +} +.col-xs-push-7 { + left: 58.33333333%; +} +.col-xs-push-6 { + left: 50%; +} +.col-xs-push-5 { + left: 41.66666667%; +} +.col-xs-push-4 { + left: 33.33333333%; +} +.col-xs-push-3 { + left: 25%; +} +.col-xs-push-2 { + left: 16.66666667%; +} +.col-xs-push-1 { + left: 8.33333333%; +} +.col-xs-push-0 { + left: auto; +} +.col-xs-offset-12 { + margin-left: 100%; +} +.col-xs-offset-11 { + margin-left: 91.66666667%; +} +.col-xs-offset-10 { + margin-left: 83.33333333%; +} +.col-xs-offset-9 { + margin-left: 75%; +} +.col-xs-offset-8 { + margin-left: 66.66666667%; +} +.col-xs-offset-7 { + margin-left: 58.33333333%; +} +.col-xs-offset-6 { + margin-left: 50%; +} +.col-xs-offset-5 { + margin-left: 41.66666667%; +} +.col-xs-offset-4 { + margin-left: 33.33333333%; +} +.col-xs-offset-3 { + margin-left: 25%; +} +.col-xs-offset-2 { + margin-left: 16.66666667%; +} +.col-xs-offset-1 { + margin-left: 8.33333333%; +} +.col-xs-offset-0 { + margin-left: 0%; +} +@media (min-width: 768px) { + .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { + float: left; + } + .col-sm-12 { + width: 100%; + } + .col-sm-11 { + width: 91.66666667%; + } + .col-sm-10 { + width: 83.33333333%; + } + .col-sm-9 { + width: 75%; + } + .col-sm-8 { + width: 66.66666667%; + } + .col-sm-7 { + width: 58.33333333%; + } + .col-sm-6 { + width: 50%; + } + .col-sm-5 { + width: 41.66666667%; + } + .col-sm-4 { + width: 33.33333333%; + } + .col-sm-3 { + width: 25%; + } + .col-sm-2 { + width: 16.66666667%; + } + .col-sm-1 { + width: 8.33333333%; + } + .col-sm-pull-12 { + right: 100%; + } + .col-sm-pull-11 { + right: 91.66666667%; + } + .col-sm-pull-10 { + right: 83.33333333%; + } + .col-sm-pull-9 { + right: 75%; + } + .col-sm-pull-8 { + right: 66.66666667%; + } + .col-sm-pull-7 { + right: 58.33333333%; + } + .col-sm-pull-6 { + right: 50%; + } + .col-sm-pull-5 { + right: 41.66666667%; + } + .col-sm-pull-4 { + right: 33.33333333%; + } + .col-sm-pull-3 { + right: 25%; + } + .col-sm-pull-2 { + right: 16.66666667%; + } + .col-sm-pull-1 { + right: 8.33333333%; + } + .col-sm-pull-0 { + right: auto; + } + .col-sm-push-12 { + left: 100%; + } + .col-sm-push-11 { + left: 91.66666667%; + } + .col-sm-push-10 { + left: 83.33333333%; + } + .col-sm-push-9 { + left: 75%; + } + .col-sm-push-8 { + left: 66.66666667%; + } + .col-sm-push-7 { + left: 58.33333333%; + } + .col-sm-push-6 { + left: 50%; + } + .col-sm-push-5 { + left: 41.66666667%; + } + .col-sm-push-4 { + left: 33.33333333%; + } + .col-sm-push-3 { + left: 25%; + } + .col-sm-push-2 { + left: 16.66666667%; + } + .col-sm-push-1 { + left: 8.33333333%; + } + .col-sm-push-0 { + left: auto; + } + .col-sm-offset-12 { + margin-left: 100%; + } + .col-sm-offset-11 { + margin-left: 91.66666667%; + } + .col-sm-offset-10 { + margin-left: 83.33333333%; + } + .col-sm-offset-9 { + margin-left: 75%; + } + .col-sm-offset-8 { + margin-left: 66.66666667%; + } + .col-sm-offset-7 { + margin-left: 58.33333333%; + } + .col-sm-offset-6 { + margin-left: 50%; + } + .col-sm-offset-5 { + margin-left: 41.66666667%; + } + .col-sm-offset-4 { + margin-left: 33.33333333%; + } + .col-sm-offset-3 { + margin-left: 25%; + } + .col-sm-offset-2 { + margin-left: 16.66666667%; + } + .col-sm-offset-1 { + margin-left: 8.33333333%; + } + .col-sm-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 992px) { + .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { + float: left; + } + .col-md-12 { + width: 100%; + } + .col-md-11 { + width: 91.66666667%; + } + .col-md-10 { + width: 83.33333333%; + } + .col-md-9 { + width: 75%; + } + .col-md-8 { + width: 66.66666667%; + } + .col-md-7 { + width: 58.33333333%; + } + .col-md-6 { + width: 50%; + } + .col-md-5 { + width: 41.66666667%; + } + .col-md-4 { + width: 33.33333333%; + } + .col-md-3 { + width: 25%; + } + .col-md-2 { + width: 16.66666667%; + } + .col-md-1 { + width: 8.33333333%; + } + .col-md-pull-12 { + right: 100%; + } + .col-md-pull-11 { + right: 91.66666667%; + } + .col-md-pull-10 { + right: 83.33333333%; + } + .col-md-pull-9 { + right: 75%; + } + .col-md-pull-8 { + right: 66.66666667%; + } + .col-md-pull-7 { + right: 58.33333333%; + } + .col-md-pull-6 { + right: 50%; + } + .col-md-pull-5 { + right: 41.66666667%; + } + .col-md-pull-4 { + right: 33.33333333%; + } + .col-md-pull-3 { + right: 25%; + } + .col-md-pull-2 { + right: 16.66666667%; + } + .col-md-pull-1 { + right: 8.33333333%; + } + .col-md-pull-0 { + right: auto; + } + .col-md-push-12 { + left: 100%; + } + .col-md-push-11 { + left: 91.66666667%; + } + .col-md-push-10 { + left: 83.33333333%; + } + .col-md-push-9 { + left: 75%; + } + .col-md-push-8 { + left: 66.66666667%; + } + .col-md-push-7 { + left: 58.33333333%; + } + .col-md-push-6 { + left: 50%; + } + .col-md-push-5 { + left: 41.66666667%; + } + .col-md-push-4 { + left: 33.33333333%; + } + .col-md-push-3 { + left: 25%; + } + .col-md-push-2 { + left: 16.66666667%; + } + .col-md-push-1 { + left: 8.33333333%; + } + .col-md-push-0 { + left: auto; + } + .col-md-offset-12 { + margin-left: 100%; + } + .col-md-offset-11 { + margin-left: 91.66666667%; + } + .col-md-offset-10 { + margin-left: 83.33333333%; + } + .col-md-offset-9 { + margin-left: 75%; + } + .col-md-offset-8 { + margin-left: 66.66666667%; + } + .col-md-offset-7 { + margin-left: 58.33333333%; + } + .col-md-offset-6 { + margin-left: 50%; + } + .col-md-offset-5 { + margin-left: 41.66666667%; + } + .col-md-offset-4 { + margin-left: 33.33333333%; + } + .col-md-offset-3 { + margin-left: 25%; + } + .col-md-offset-2 { + margin-left: 16.66666667%; + } + .col-md-offset-1 { + margin-left: 8.33333333%; + } + .col-md-offset-0 { + margin-left: 0%; + } +} +@media (min-width: 1200px) { + .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { + float: left; + } + .col-lg-12 { + width: 100%; + } + .col-lg-11 { + width: 91.66666667%; + } + .col-lg-10 { + width: 83.33333333%; + } + .col-lg-9 { + width: 75%; + } + .col-lg-8 { + width: 66.66666667%; + } + .col-lg-7 { + width: 58.33333333%; + } + .col-lg-6 { + width: 50%; + } + .col-lg-5 { + width: 41.66666667%; + } + .col-lg-4 { + width: 33.33333333%; + } + .col-lg-3 { + width: 25%; + } + .col-lg-2 { + width: 16.66666667%; + } + .col-lg-1 { + width: 8.33333333%; + } + .col-lg-pull-12 { + right: 100%; + } + .col-lg-pull-11 { + right: 91.66666667%; + } + .col-lg-pull-10 { + right: 83.33333333%; + } + .col-lg-pull-9 { + right: 75%; + } + .col-lg-pull-8 { + right: 66.66666667%; + } + .col-lg-pull-7 { + right: 58.33333333%; + } + .col-lg-pull-6 { + right: 50%; + } + .col-lg-pull-5 { + right: 41.66666667%; + } + .col-lg-pull-4 { + right: 33.33333333%; + } + .col-lg-pull-3 { + right: 25%; + } + .col-lg-pull-2 { + right: 16.66666667%; + } + .col-lg-pull-1 { + right: 8.33333333%; + } + .col-lg-pull-0 { + right: auto; + } + .col-lg-push-12 { + left: 100%; + } + .col-lg-push-11 { + left: 91.66666667%; + } + .col-lg-push-10 { + left: 83.33333333%; + } + .col-lg-push-9 { + left: 75%; + } + .col-lg-push-8 { + left: 66.66666667%; + } + .col-lg-push-7 { + left: 58.33333333%; + } + .col-lg-push-6 { + left: 50%; + } + .col-lg-push-5 { + left: 41.66666667%; + } + .col-lg-push-4 { + left: 33.33333333%; + } + .col-lg-push-3 { + left: 25%; + } + .col-lg-push-2 { + left: 16.66666667%; + } + .col-lg-push-1 { + left: 8.33333333%; + } + .col-lg-push-0 { + left: auto; + } + .col-lg-offset-12 { + margin-left: 100%; + } + .col-lg-offset-11 { + margin-left: 91.66666667%; + } + .col-lg-offset-10 { + margin-left: 83.33333333%; + } + .col-lg-offset-9 { + margin-left: 75%; + } + .col-lg-offset-8 { + margin-left: 66.66666667%; + } + .col-lg-offset-7 { + margin-left: 58.33333333%; + } + .col-lg-offset-6 { + margin-left: 50%; + } + .col-lg-offset-5 { + margin-left: 41.66666667%; + } + .col-lg-offset-4 { + margin-left: 33.33333333%; + } + .col-lg-offset-3 { + margin-left: 25%; + } + .col-lg-offset-2 { + margin-left: 16.66666667%; + } + .col-lg-offset-1 { + margin-left: 8.33333333%; + } + .col-lg-offset-0 { + margin-left: 0%; + } +} +table { + background-color: transparent; +} +caption { + padding-top: 8px; + padding-bottom: 8px; + color: #808080; + text-align: left; +} +th { + text-align: left; +} +.table { + width: 100%; + max-width: 100%; + margin-bottom: 18px; +} +.table > thead > tr > th, +.table > tbody > tr > th, +.table > tfoot > tr > th, +.table > thead > tr > td, +.table > tbody > tr > td, +.table > tfoot > tr > td { + padding: 8px; + line-height: 1.42857143; + vertical-align: top; + border-top: 1px solid #dddddd; +} +.table > thead > tr > th { + vertical-align: bottom; + border-bottom: 2px solid #dddddd; +} +.table > caption + thead > tr:first-child > th, +.table > colgroup + thead > tr:first-child > th, +.table > thead:first-child > tr:first-child > th, +.table > caption + thead > tr:first-child > td, +.table > colgroup + thead > tr:first-child > td, +.table > thead:first-child > tr:first-child > td { + border-top: 0; +} +.table > tbody + tbody { + border-top: 2px solid #dddddd; +} +.table .table { + background-color: #fcfcfc; +} +.table-condensed > thead > tr > th, +.table-condensed > tbody > tr > th, +.table-condensed > tfoot > tr > th, +.table-condensed > thead > tr > td, +.table-condensed > tbody > tr > td, +.table-condensed > tfoot > tr > td { + padding: 5px; +} +.table-bordered { + border: 1px solid #dddddd; +} +.table-bordered > thead > tr > th, +.table-bordered > tbody > tr > th, +.table-bordered > tfoot > tr > th, +.table-bordered > thead > tr > td, +.table-bordered > tbody > tr > td, +.table-bordered > tfoot > tr > td { + border: 1px solid #dddddd; +} +.table-bordered > thead > tr > th, +.table-bordered > thead > tr > td { + border-bottom-width: 2px; +} +.table-striped > tbody > tr:nth-of-type(odd) { + background-color: #f9f9f9; +} +.table-hover > tbody > tr:hover { + background-color: #f5f5f5; +} +table col[class*="col-"] { + position: static; + float: none; + display: table-column; +} +table td[class*="col-"], +table th[class*="col-"] { + position: static; + float: none; + display: table-cell; +} +.table > thead > tr > td.active, +.table > tbody > tr > td.active, +.table > tfoot > tr > td.active, +.table > thead > tr > th.active, +.table > tbody > tr > th.active, +.table > tfoot > tr > th.active, +.table > thead > tr.active > td, +.table > tbody > tr.active > td, +.table > tfoot > tr.active > td, +.table > thead > tr.active > th, +.table > tbody > tr.active > th, +.table > tfoot > tr.active > th { + background-color: #f5f5f5; +} +.table-hover > tbody > tr > td.active:hover, +.table-hover > tbody > tr > th.active:hover, +.table-hover > tbody > tr.active:hover > td, +.table-hover > tbody > tr:hover > .active, +.table-hover > tbody > tr.active:hover > th { + background-color: #e8e8e8; +} +.table > thead > tr > td.success, +.table > tbody > tr > td.success, +.table > tfoot > tr > td.success, +.table > thead > tr > th.success, +.table > tbody > tr > th.success, +.table > tfoot > tr > th.success, +.table > thead > tr.success > td, +.table > tbody > tr.success > td, +.table > tfoot > tr.success > td, +.table > thead > tr.success > th, +.table > tbody > tr.success > th, +.table > tfoot > tr.success > th { + background-color: #dff0d8; +} +.table-hover > tbody > tr > td.success:hover, +.table-hover > tbody > tr > th.success:hover, +.table-hover > tbody > tr.success:hover > td, +.table-hover > tbody > tr:hover > .success, +.table-hover > tbody > tr.success:hover > th { + background-color: #d0e9c6; +} +.table > thead > tr > td.info, +.table > tbody > tr > td.info, +.table > tfoot > tr > td.info, +.table > thead > tr > th.info, +.table > tbody > tr > th.info, +.table > tfoot > tr > th.info, +.table > thead > tr.info > td, +.table > tbody > tr.info > td, +.table > tfoot > tr.info > td, +.table > thead > tr.info > th, +.table > tbody > tr.info > th, +.table > tfoot > tr.info > th { + background-color: #d9edf7; +} +.table-hover > tbody > tr > td.info:hover, +.table-hover > tbody > tr > th.info:hover, +.table-hover > tbody > tr.info:hover > td, +.table-hover > tbody > tr:hover > .info, +.table-hover > tbody > tr.info:hover > th { + background-color: #c4e3f3; +} +.table > thead > tr > td.warning, +.table > tbody > tr > td.warning, +.table > tfoot > tr > td.warning, +.table > thead > tr > th.warning, +.table > tbody > tr > th.warning, +.table > tfoot > tr > th.warning, +.table > thead > tr.warning > td, +.table > tbody > tr.warning > td, +.table > tfoot > tr.warning > td, +.table > thead > tr.warning > th, +.table > tbody > tr.warning > th, +.table > tfoot > tr.warning > th { + background-color: #fcf8e3; +} +.table-hover > tbody > tr > td.warning:hover, +.table-hover > tbody > tr > th.warning:hover, +.table-hover > tbody > tr.warning:hover > td, +.table-hover > tbody > tr:hover > .warning, +.table-hover > tbody > tr.warning:hover > th { + background-color: #faf2cc; +} +.table > thead > tr > td.danger, +.table > tbody > tr > td.danger, +.table > tfoot > tr > td.danger, +.table > thead > tr > th.danger, +.table > tbody > tr > th.danger, +.table > tfoot > tr > th.danger, +.table > thead > tr.danger > td, +.table > tbody > tr.danger > td, +.table > tfoot > tr.danger > td, +.table > thead > tr.danger > th, +.table > tbody > tr.danger > th, +.table > tfoot > tr.danger > th { + background-color: #f2dede; +} +.table-hover > tbody > tr > td.danger:hover, +.table-hover > tbody > tr > th.danger:hover, +.table-hover > tbody > tr.danger:hover > td, +.table-hover > tbody > tr:hover > .danger, +.table-hover > tbody > tr.danger:hover > th { + background-color: #ebcccc; +} +.table-responsive { + overflow-x: auto; + min-height: 0.01%; +} +@media screen and (max-width: 767px) { + .table-responsive { + width: 100%; + margin-bottom: 13.5px; + overflow-y: hidden; + -ms-overflow-style: -ms-autohiding-scrollbar; + border: 1px solid #dddddd; + } + .table-responsive > .table { + margin-bottom: 0; + } + .table-responsive > .table > thead > tr > th, + .table-responsive > .table > tbody > tr > th, + .table-responsive > .table > tfoot > tr > th, + .table-responsive > .table > thead > tr > td, + .table-responsive > .table > tbody > tr > td, + .table-responsive > .table > tfoot > tr > td { + white-space: nowrap; + } + .table-responsive > .table-bordered { + border: 0; + } + .table-responsive > .table-bordered > thead > tr > th:first-child, + .table-responsive > .table-bordered > tbody > tr > th:first-child, + .table-responsive > .table-bordered > tfoot > tr > th:first-child, + .table-responsive > .table-bordered > thead > tr > td:first-child, + .table-responsive > .table-bordered > tbody > tr > td:first-child, + .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; + } + .table-responsive > .table-bordered > thead > tr > th:last-child, + .table-responsive > .table-bordered > tbody > tr > th:last-child, + .table-responsive > .table-bordered > tfoot > tr > th:last-child, + .table-responsive > .table-bordered > thead > tr > td:last-child, + .table-responsive > .table-bordered > tbody > tr > td:last-child, + .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; + } + .table-responsive > .table-bordered > tbody > tr:last-child > th, + .table-responsive > .table-bordered > tfoot > tr:last-child > th, + .table-responsive > .table-bordered > tbody > tr:last-child > td, + .table-responsive > .table-bordered > tfoot > tr:last-child > td { + border-bottom: 0; + } +} +fieldset { + padding: 0; + margin: 0; + border: 0; + min-width: 0; +} +legend { + display: block; + width: 100%; + padding: 0; + margin-bottom: 18px; + font-size: 19.5px; + line-height: inherit; + color: #777777; + border: 0; + border-bottom: 1px solid #e5e5e5; +} +label { + display: inline-block; + max-width: 100%; + margin-bottom: 5px; + font-weight: bold; +} +input[type="search"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +input[type="radio"], +input[type="checkbox"] { + margin: 4px 0 0; + margin-top: 1px \9; + line-height: normal; +} +input[type="file"] { + display: block; +} +input[type="range"] { + display: block; + width: 100%; +} +select[multiple], +select[size] { + height: auto; +} +input[type="file"]:focus, +input[type="radio"]:focus, +input[type="checkbox"]:focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +output { + display: block; + padding-top: 9px; + font-size: 13px; + line-height: 1.42857143; + color: #777777; +} +.form-control { + display: block; + width: 100%; + height: 36px; + padding: 8px 12px; + font-size: 13px; + line-height: 1.42857143; + color: #777777; + background-color: #ffffff; + background-image: none; + border: 1px solid #dddddd; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; +} +.form-control:focus { + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); +} +.form-control::-moz-placeholder { + color: #dddddd; + opacity: 1; +} +.form-control:-ms-input-placeholder { + color: #dddddd; +} +.form-control::-webkit-input-placeholder { + color: #dddddd; +} +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + background-color: #dddddd; + opacity: 1; +} +.form-control[disabled], +fieldset[disabled] .form-control { + cursor: not-allowed; +} +textarea.form-control { + height: auto; +} +input[type="search"] { + -webkit-appearance: none; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + input[type="date"], + input[type="time"], + input[type="datetime-local"], + input[type="month"] { + line-height: 36px; + } + input[type="date"].input-sm, + input[type="time"].input-sm, + input[type="datetime-local"].input-sm, + input[type="month"].input-sm, + .input-group-sm input[type="date"], + .input-group-sm input[type="time"], + .input-group-sm input[type="datetime-local"], + .input-group-sm input[type="month"] { + line-height: 30px; + } + input[type="date"].input-lg, + input[type="time"].input-lg, + input[type="datetime-local"].input-lg, + input[type="month"].input-lg, + .input-group-lg input[type="date"], + .input-group-lg input[type="time"], + .input-group-lg input[type="datetime-local"], + .input-group-lg input[type="month"] { + line-height: 53px; + } +} +.form-group { + margin-bottom: 15px; +} +.radio, +.checkbox { + position: relative; + display: block; + margin-top: 10px; + margin-bottom: 10px; +} +.radio label, +.checkbox label { + min-height: 18px; + padding-left: 20px; + margin-bottom: 0; + font-weight: normal; + cursor: pointer; +} +.radio input[type="radio"], +.radio-inline input[type="radio"], +.checkbox input[type="checkbox"], +.checkbox-inline input[type="checkbox"] { + position: absolute; + margin-left: -20px; + margin-top: 4px \9; +} +.radio + .radio, +.checkbox + .checkbox { + margin-top: -5px; +} +.radio-inline, +.checkbox-inline { + position: relative; + display: inline-block; + padding-left: 20px; + margin-bottom: 0; + vertical-align: middle; + font-weight: normal; + cursor: pointer; +} +.radio-inline + .radio-inline, +.checkbox-inline + .checkbox-inline { + margin-top: 0; + margin-left: 10px; +} +input[type="radio"][disabled], +input[type="checkbox"][disabled], +input[type="radio"].disabled, +input[type="checkbox"].disabled, +fieldset[disabled] input[type="radio"], +fieldset[disabled] input[type="checkbox"] { + cursor: not-allowed; +} +.radio-inline.disabled, +.checkbox-inline.disabled, +fieldset[disabled] .radio-inline, +fieldset[disabled] .checkbox-inline { + cursor: not-allowed; +} +.radio.disabled label, +.checkbox.disabled label, +fieldset[disabled] .radio label, +fieldset[disabled] .checkbox label { + cursor: not-allowed; +} +.form-control-static { + padding-top: 9px; + padding-bottom: 9px; + margin-bottom: 0; + min-height: 31px; +} +.form-control-static.input-lg, +.form-control-static.input-sm { + padding-left: 0; + padding-right: 0; +} +.input-sm { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-sm { + height: 30px; + line-height: 30px; +} +textarea.input-sm, +select[multiple].input-sm { + height: auto; +} +.form-group-sm .form-control { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.form-group-sm .form-control { + height: 30px; + line-height: 30px; +} +textarea.form-group-sm .form-control, +select[multiple].form-group-sm .form-control { + height: auto; +} +.form-group-sm .form-control-static { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + min-height: 30px; +} +.input-lg { + height: 53px; + padding: 14px 16px; + font-size: 17px; + line-height: 1.3333333; + border-radius: 6px; +} +select.input-lg { + height: 53px; + line-height: 53px; +} +textarea.input-lg, +select[multiple].input-lg { + height: auto; +} +.form-group-lg .form-control { + height: 53px; + padding: 14px 16px; + font-size: 17px; + line-height: 1.3333333; + border-radius: 6px; +} +select.form-group-lg .form-control { + height: 53px; + line-height: 53px; +} +textarea.form-group-lg .form-control, +select[multiple].form-group-lg .form-control { + height: auto; +} +.form-group-lg .form-control-static { + height: 53px; + padding: 14px 16px; + font-size: 17px; + line-height: 1.3333333; + min-height: 35px; +} +.has-feedback { + position: relative; +} +.has-feedback .form-control { + padding-right: 45px; +} +.form-control-feedback { + position: absolute; + top: 0; + right: 0; + z-index: 2; + display: block; + width: 36px; + height: 36px; + line-height: 36px; + text-align: center; + pointer-events: none; +} +.input-lg + .form-control-feedback { + width: 53px; + height: 53px; + line-height: 53px; +} +.input-sm + .form-control-feedback { + width: 30px; + height: 30px; + line-height: 30px; +} +.has-success .help-block, +.has-success .control-label, +.has-success .radio, +.has-success .checkbox, +.has-success .radio-inline, +.has-success .checkbox-inline, +.has-success.radio label, +.has-success.checkbox label, +.has-success.radio-inline label, +.has-success.checkbox-inline label { + color: #468847; +} +.has-success .form-control { + border-color: #468847; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-success .form-control:focus { + border-color: #356635; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b; +} +.has-success .input-group-addon { + color: #468847; + border-color: #468847; + background-color: #dff0d8; +} +.has-success .form-control-feedback { + color: #468847; +} +.has-warning .help-block, +.has-warning .control-label, +.has-warning .radio, +.has-warning .checkbox, +.has-warning .radio-inline, +.has-warning .checkbox-inline, +.has-warning.radio label, +.has-warning.checkbox label, +.has-warning.radio-inline label, +.has-warning.checkbox-inline label { + color: #c09853; +} +.has-warning .form-control { + border-color: #c09853; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-warning .form-control:focus { + border-color: #a47e3c; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e; +} +.has-warning .input-group-addon { + color: #c09853; + border-color: #c09853; + background-color: #fcf8e3; +} +.has-warning .form-control-feedback { + color: #c09853; +} +.has-error .help-block, +.has-error .control-label, +.has-error .radio, +.has-error .checkbox, +.has-error .radio-inline, +.has-error .checkbox-inline, +.has-error.radio label, +.has-error.checkbox label, +.has-error.radio-inline label, +.has-error.checkbox-inline label { + color: #b94a48; +} +.has-error .form-control { + border-color: #b94a48; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); +} +.has-error .form-control:focus { + border-color: #953b39; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392; +} +.has-error .input-group-addon { + color: #b94a48; + border-color: #b94a48; + background-color: #f2dede; +} +.has-error .form-control-feedback { + color: #b94a48; +} +.has-feedback label ~ .form-control-feedback { + top: 23px; +} +.has-feedback label.sr-only ~ .form-control-feedback { + top: 0; +} +.help-block { + display: block; + margin-top: 5px; + margin-bottom: 10px; + color: #b7b7b7; +} +@media (min-width: 768px) { + .form-inline .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .form-control-static { + display: inline-block; + } + .form-inline .input-group { + display: inline-table; + vertical-align: middle; + } + .form-inline .input-group .input-group-addon, + .form-inline .input-group .input-group-btn, + .form-inline .input-group .form-control { + width: auto; + } + .form-inline .input-group > .form-control { + width: 100%; + } + .form-inline .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio, + .form-inline .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .radio label, + .form-inline .checkbox label { + padding-left: 0; + } + .form-inline .radio input[type="radio"], + .form-inline .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} +.form-horizontal .radio, +.form-horizontal .checkbox, +.form-horizontal .radio-inline, +.form-horizontal .checkbox-inline { + margin-top: 0; + margin-bottom: 0; + padding-top: 9px; +} +.form-horizontal .radio, +.form-horizontal .checkbox { + min-height: 27px; +} +.form-horizontal .form-group { + margin-left: -15px; + margin-right: -15px; +} +@media (min-width: 768px) { + .form-horizontal .control-label { + text-align: right; + margin-bottom: 0; + padding-top: 9px; + } +} +.form-horizontal .has-feedback .form-control-feedback { + right: 15px; +} +@media (min-width: 768px) { + .form-horizontal .form-group-lg .control-label { + padding-top: 19.6666662px; + } +} +@media (min-width: 768px) { + .form-horizontal .form-group-sm .control-label { + padding-top: 6px; + } +} +.btn { + display: inline-block; + margin-bottom: 0; + font-weight: normal; + text-align: center; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + background-image: none; + border: 1px solid transparent; + white-space: nowrap; + padding: 8px 12px; + font-size: 13px; + line-height: 1.42857143; + border-radius: 4px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.btn:focus, +.btn:active:focus, +.btn.active:focus, +.btn.focus, +.btn:active.focus, +.btn.active.focus { + outline: thin dotted; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} +.btn:hover, +.btn:focus, +.btn.focus { + color: #ffffff; + text-decoration: none; +} +.btn:active, +.btn.active { + outline: 0; + background-image: none; + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn.disabled, +.btn[disabled], +fieldset[disabled] .btn { + cursor: not-allowed; + pointer-events: none; + opacity: 0.65; + filter: alpha(opacity=65); + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-default { + color: #ffffff; + background-color: #474949; + border-color: #474949; +} +.btn-default:hover, +.btn-default:focus, +.btn-default.focus, +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + color: #ffffff; + background-color: #2e2f2f; + border-color: #292a2a; +} +.btn-default:active, +.btn-default.active, +.open > .dropdown-toggle.btn-default { + background-image: none; +} +.btn-default.disabled, +.btn-default[disabled], +fieldset[disabled] .btn-default, +.btn-default.disabled:hover, +.btn-default[disabled]:hover, +fieldset[disabled] .btn-default:hover, +.btn-default.disabled:focus, +.btn-default[disabled]:focus, +fieldset[disabled] .btn-default:focus, +.btn-default.disabled.focus, +.btn-default[disabled].focus, +fieldset[disabled] .btn-default.focus, +.btn-default.disabled:active, +.btn-default[disabled]:active, +fieldset[disabled] .btn-default:active, +.btn-default.disabled.active, +.btn-default[disabled].active, +fieldset[disabled] .btn-default.active { + background-color: #474949; + border-color: #474949; +} +.btn-default .badge { + color: #474949; + background-color: #ffffff; +} +.btn-primary { + color: #ffffff; + background-color: #d9230f; + border-color: #d9230f; +} +.btn-primary:hover, +.btn-primary:focus, +.btn-primary.focus, +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + color: #ffffff; + background-color: #a91b0c; + border-color: #a01a0b; +} +.btn-primary:active, +.btn-primary.active, +.open > .dropdown-toggle.btn-primary { + background-image: none; +} +.btn-primary.disabled, +.btn-primary[disabled], +fieldset[disabled] .btn-primary, +.btn-primary.disabled:hover, +.btn-primary[disabled]:hover, +fieldset[disabled] .btn-primary:hover, +.btn-primary.disabled:focus, +.btn-primary[disabled]:focus, +fieldset[disabled] .btn-primary:focus, +.btn-primary.disabled.focus, +.btn-primary[disabled].focus, +fieldset[disabled] .btn-primary.focus, +.btn-primary.disabled:active, +.btn-primary[disabled]:active, +fieldset[disabled] .btn-primary:active, +.btn-primary.disabled.active, +.btn-primary[disabled].active, +fieldset[disabled] .btn-primary.active { + background-color: #d9230f; + border-color: #d9230f; +} +.btn-primary .badge { + color: #d9230f; + background-color: #ffffff; +} +.btn-success { + color: #ffffff; + background-color: #469408; + border-color: #469408; +} +.btn-success:hover, +.btn-success:focus, +.btn-success.focus, +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + color: #ffffff; + background-color: #2f6405; + border-color: #2b5a05; +} +.btn-success:active, +.btn-success.active, +.open > .dropdown-toggle.btn-success { + background-image: none; +} +.btn-success.disabled, +.btn-success[disabled], +fieldset[disabled] .btn-success, +.btn-success.disabled:hover, +.btn-success[disabled]:hover, +fieldset[disabled] .btn-success:hover, +.btn-success.disabled:focus, +.btn-success[disabled]:focus, +fieldset[disabled] .btn-success:focus, +.btn-success.disabled.focus, +.btn-success[disabled].focus, +fieldset[disabled] .btn-success.focus, +.btn-success.disabled:active, +.btn-success[disabled]:active, +fieldset[disabled] .btn-success:active, +.btn-success.disabled.active, +.btn-success[disabled].active, +fieldset[disabled] .btn-success.active { + background-color: #469408; + border-color: #469408; +} +.btn-success .badge { + color: #469408; + background-color: #ffffff; +} +.btn-info { + color: #ffffff; + background-color: #029acf; + border-color: #029acf; +} +.btn-info:hover, +.btn-info:focus, +.btn-info.focus, +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + color: #ffffff; + background-color: #02749c; + border-color: #016d92; +} +.btn-info:active, +.btn-info.active, +.open > .dropdown-toggle.btn-info { + background-image: none; +} +.btn-info.disabled, +.btn-info[disabled], +fieldset[disabled] .btn-info, +.btn-info.disabled:hover, +.btn-info[disabled]:hover, +fieldset[disabled] .btn-info:hover, +.btn-info.disabled:focus, +.btn-info[disabled]:focus, +fieldset[disabled] .btn-info:focus, +.btn-info.disabled.focus, +.btn-info[disabled].focus, +fieldset[disabled] .btn-info.focus, +.btn-info.disabled:active, +.btn-info[disabled]:active, +fieldset[disabled] .btn-info:active, +.btn-info.disabled.active, +.btn-info[disabled].active, +fieldset[disabled] .btn-info.active { + background-color: #029acf; + border-color: #029acf; +} +.btn-info .badge { + color: #029acf; + background-color: #ffffff; +} +.btn-warning { + color: #ffffff; + background-color: #9b479f; + border-color: #9b479f; +} +.btn-warning:hover, +.btn-warning:focus, +.btn-warning.focus, +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + color: #ffffff; + background-color: #79377c; + border-color: #723475; +} +.btn-warning:active, +.btn-warning.active, +.open > .dropdown-toggle.btn-warning { + background-image: none; +} +.btn-warning.disabled, +.btn-warning[disabled], +fieldset[disabled] .btn-warning, +.btn-warning.disabled:hover, +.btn-warning[disabled]:hover, +fieldset[disabled] .btn-warning:hover, +.btn-warning.disabled:focus, +.btn-warning[disabled]:focus, +fieldset[disabled] .btn-warning:focus, +.btn-warning.disabled.focus, +.btn-warning[disabled].focus, +fieldset[disabled] .btn-warning.focus, +.btn-warning.disabled:active, +.btn-warning[disabled]:active, +fieldset[disabled] .btn-warning:active, +.btn-warning.disabled.active, +.btn-warning[disabled].active, +fieldset[disabled] .btn-warning.active { + background-color: #9b479f; + border-color: #9b479f; +} +.btn-warning .badge { + color: #9b479f; + background-color: #ffffff; +} +.btn-danger { + color: #ffffff; + background-color: #d9831f; + border-color: #d9831f; +} +.btn-danger:hover, +.btn-danger:focus, +.btn-danger.focus, +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + color: #ffffff; + background-color: #ac6819; + border-color: #a36317; +} +.btn-danger:active, +.btn-danger.active, +.open > .dropdown-toggle.btn-danger { + background-image: none; +} +.btn-danger.disabled, +.btn-danger[disabled], +fieldset[disabled] .btn-danger, +.btn-danger.disabled:hover, +.btn-danger[disabled]:hover, +fieldset[disabled] .btn-danger:hover, +.btn-danger.disabled:focus, +.btn-danger[disabled]:focus, +fieldset[disabled] .btn-danger:focus, +.btn-danger.disabled.focus, +.btn-danger[disabled].focus, +fieldset[disabled] .btn-danger.focus, +.btn-danger.disabled:active, +.btn-danger[disabled]:active, +fieldset[disabled] .btn-danger:active, +.btn-danger.disabled.active, +.btn-danger[disabled].active, +fieldset[disabled] .btn-danger.active { + background-color: #d9831f; + border-color: #d9831f; +} +.btn-danger .badge { + color: #d9831f; + background-color: #ffffff; +} +.btn-link { + color: #d9230f; + font-weight: normal; + border-radius: 0; +} +.btn-link, +.btn-link:active, +.btn-link.active, +.btn-link[disabled], +fieldset[disabled] .btn-link { + background-color: transparent; + -webkit-box-shadow: none; + box-shadow: none; +} +.btn-link, +.btn-link:hover, +.btn-link:focus, +.btn-link:active { + border-color: transparent; +} +.btn-link:hover, +.btn-link:focus { + color: #91170a; + text-decoration: underline; + background-color: transparent; +} +.btn-link[disabled]:hover, +fieldset[disabled] .btn-link:hover, +.btn-link[disabled]:focus, +fieldset[disabled] .btn-link:focus { + color: #808080; + text-decoration: none; +} +.btn-lg, +.btn-group-lg > .btn { + padding: 14px 16px; + font-size: 17px; + line-height: 1.3333333; + border-radius: 6px; +} +.btn-sm, +.btn-group-sm > .btn { + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-xs, +.btn-group-xs > .btn { + padding: 1px 5px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +.btn-block { + display: block; + width: 100%; +} +.btn-block + .btn-block { + margin-top: 5px; +} +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} +.fade { + opacity: 0; + -webkit-transition: opacity 0.15s linear; + -o-transition: opacity 0.15s linear; + transition: opacity 0.15s linear; +} +.fade.in { + opacity: 1; +} +.collapse { + display: none; +} +.collapse.in { + display: block; +} +tr.collapse.in { + display: table-row; +} +tbody.collapse.in { + display: table-row-group; +} +.collapsing { + position: relative; + height: 0; + overflow: hidden; + -webkit-transition-property: height, visibility; + -o-transition-property: height, visibility; + transition-property: height, visibility; + -webkit-transition-duration: 0.35s; + -o-transition-duration: 0.35s; + transition-duration: 0.35s; + -webkit-transition-timing-function: ease; + -o-transition-timing-function: ease; + transition-timing-function: ease; +} +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px dashed; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} +.dropup, +.dropdown { + position: relative; +} +.dropdown-toggle:focus { + outline: 0; +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; + list-style: none; + font-size: 13px; + text-align: left; + background-color: #ffffff; + border: 1px solid #cccccc; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); + -webkit-background-clip: padding-box; + background-clip: padding-box; +} +.dropdown-menu.pull-right { + right: 0; + left: auto; +} +.dropdown-menu .divider { + height: 1px; + margin: 8px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.42857143; + color: #444444; + white-space: nowrap; +} +.dropdown-menu > li > a:hover, +.dropdown-menu > li > a:focus { + text-decoration: none; + color: #ffffff; + background-color: #d9230f; +} +.dropdown-menu > .active > a, +.dropdown-menu > .active > a:hover, +.dropdown-menu > .active > a:focus { + color: #ffffff; + text-decoration: none; + outline: 0; + background-color: #d9230f; +} +.dropdown-menu > .disabled > a, +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + color: #808080; +} +.dropdown-menu > .disabled > a:hover, +.dropdown-menu > .disabled > a:focus { + text-decoration: none; + background-color: transparent; + background-image: none; + filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); + cursor: not-allowed; +} +.open > .dropdown-menu { + display: block; +} +.open > a { + outline: 0; +} +.dropdown-menu-right { + left: auto; + right: 0; +} +.dropdown-menu-left { + left: 0; + right: auto; +} +.dropdown-header { + display: block; + padding: 3px 20px; + font-size: 12px; + line-height: 1.42857143; + color: #808080; + white-space: nowrap; +} +.dropdown-backdrop { + position: fixed; + left: 0; + right: 0; + bottom: 0; + top: 0; + z-index: 990; +} +.pull-right > .dropdown-menu { + right: 0; + left: auto; +} +.dropup .caret, +.navbar-fixed-bottom .dropdown .caret { + border-top: 0; + border-bottom: 4px solid; + content: ""; +} +.dropup .dropdown-menu, +.navbar-fixed-bottom .dropdown .dropdown-menu { + top: auto; + bottom: 100%; + margin-bottom: 2px; +} +@media (min-width: 768px) { + .navbar-right .dropdown-menu { + left: auto; + right: 0; + } + .navbar-right .dropdown-menu-left { + left: 0; + right: auto; + } +} +.btn-group, +.btn-group-vertical { + position: relative; + display: inline-block; + vertical-align: middle; +} +.btn-group > .btn, +.btn-group-vertical > .btn { + position: relative; + float: left; +} +.btn-group > .btn:hover, +.btn-group-vertical > .btn:hover, +.btn-group > .btn:focus, +.btn-group-vertical > .btn:focus, +.btn-group > .btn:active, +.btn-group-vertical > .btn:active, +.btn-group > .btn.active, +.btn-group-vertical > .btn.active { + z-index: 2; +} +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group { + margin-left: -1px; +} +.btn-toolbar { + margin-left: -5px; +} +.btn-toolbar .btn-group, +.btn-toolbar .input-group { + float: left; +} +.btn-toolbar > .btn, +.btn-toolbar > .btn-group, +.btn-toolbar > .input-group { + margin-left: 5px; +} +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} +.btn-group > .btn:first-child { + margin-left: 0; +} +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.btn-group > .btn-group { + float: left; +} +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.btn-group .dropdown-toggle:active, +.btn-group.open .dropdown-toggle { + outline: 0; +} +.btn-group > .btn + .dropdown-toggle { + padding-left: 8px; + padding-right: 8px; +} +.btn-group > .btn-lg + .dropdown-toggle { + padding-left: 12px; + padding-right: 12px; +} +.btn-group.open .dropdown-toggle { + -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} +.btn-group.open .dropdown-toggle.btn-link { + -webkit-box-shadow: none; + box-shadow: none; +} +.btn .caret { + margin-left: 0; +} +.btn-lg .caret { + border-width: 5px 5px 0; + border-bottom-width: 0; +} +.dropup .btn-lg .caret { + border-width: 0 5px 5px; +} +.btn-group-vertical > .btn, +.btn-group-vertical > .btn-group, +.btn-group-vertical > .btn-group > .btn { + display: block; + float: none; + width: 100%; + max-width: 100%; +} +.btn-group-vertical > .btn-group > .btn { + float: none; +} +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; +} +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-top-right-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-bottom-left-radius: 4px; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.btn-group-justified { + display: table; + width: 100%; + table-layout: fixed; + border-collapse: separate; +} +.btn-group-justified > .btn, +.btn-group-justified > .btn-group { + float: none; + display: table-cell; + width: 1%; +} +.btn-group-justified > .btn-group .btn { + width: 100%; +} +.btn-group-justified > .btn-group .dropdown-menu { + left: auto; +} +[data-toggle="buttons"] > .btn input[type="radio"], +[data-toggle="buttons"] > .btn-group > .btn input[type="radio"], +[data-toggle="buttons"] > .btn input[type="checkbox"], +[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none; +} +.input-group { + position: relative; + display: table; + border-collapse: separate; +} +.input-group[class*="col-"] { + float: none; + padding-left: 0; + padding-right: 0; +} +.input-group .form-control { + position: relative; + z-index: 2; + float: left; + width: 100%; + margin-bottom: 0; +} +.input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + height: 53px; + padding: 14px 16px; + font-size: 17px; + line-height: 1.3333333; + border-radius: 6px; +} +select.input-group-lg > .form-control, +select.input-group-lg > .input-group-addon, +select.input-group-lg > .input-group-btn > .btn { + height: 53px; + line-height: 53px; +} +textarea.input-group-lg > .form-control, +textarea.input-group-lg > .input-group-addon, +textarea.input-group-lg > .input-group-btn > .btn, +select[multiple].input-group-lg > .form-control, +select[multiple].input-group-lg > .input-group-addon, +select[multiple].input-group-lg > .input-group-btn > .btn { + height: auto; +} +.input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + height: 30px; + padding: 5px 10px; + font-size: 12px; + line-height: 1.5; + border-radius: 3px; +} +select.input-group-sm > .form-control, +select.input-group-sm > .input-group-addon, +select.input-group-sm > .input-group-btn > .btn { + height: 30px; + line-height: 30px; +} +textarea.input-group-sm > .form-control, +textarea.input-group-sm > .input-group-addon, +textarea.input-group-sm > .input-group-btn > .btn, +select[multiple].input-group-sm > .form-control, +select[multiple].input-group-sm > .input-group-addon, +select[multiple].input-group-sm > .input-group-btn > .btn { + height: auto; +} +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: table-cell; +} +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} +.input-group-addon, +.input-group-btn { + width: 1%; + white-space: nowrap; + vertical-align: middle; +} +.input-group-addon { + padding: 8px 12px; + font-size: 13px; + font-weight: normal; + line-height: 1; + color: #777777; + text-align: center; + background-color: #dddddd; + border: 1px solid #dddddd; + border-radius: 4px; +} +.input-group-addon.input-sm { + padding: 5px 10px; + font-size: 12px; + border-radius: 3px; +} +.input-group-addon.input-lg { + padding: 14px 16px; + font-size: 17px; + border-radius: 6px; +} +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} +.input-group .form-control:first-child, +.input-group-addon:first-child, +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group > .btn, +.input-group-btn:first-child > .dropdown-toggle, +.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:last-child > .btn-group:not(:last-child) > .btn { + border-bottom-right-radius: 0; + border-top-right-radius: 0; +} +.input-group-addon:first-child { + border-right: 0; +} +.input-group .form-control:last-child, +.input-group-addon:last-child, +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group > .btn, +.input-group-btn:last-child > .dropdown-toggle, +.input-group-btn:first-child > .btn:not(:first-child), +.input-group-btn:first-child > .btn-group:not(:first-child) > .btn { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} +.input-group-addon:last-child { + border-left: 0; +} +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} +.input-group-btn > .btn { + position: relative; +} +.input-group-btn > .btn + .btn { + margin-left: -1px; +} +.input-group-btn > .btn:hover, +.input-group-btn > .btn:focus, +.input-group-btn > .btn:active { + z-index: 2; +} +.input-group-btn:first-child > .btn, +.input-group-btn:first-child > .btn-group { + margin-right: -1px; +} +.input-group-btn:last-child > .btn, +.input-group-btn:last-child > .btn-group { + margin-left: -1px; +} +.nav { + margin-bottom: 0; + padding-left: 0; + list-style: none; +} +.nav > li { + position: relative; + display: block; +} +.nav > li > a { + position: relative; + display: block; + padding: 10px 15px; +} +.nav > li > a:hover, +.nav > li > a:focus { + text-decoration: none; + background-color: #dddddd; +} +.nav > li.disabled > a { + color: #808080; +} +.nav > li.disabled > a:hover, +.nav > li.disabled > a:focus { + color: #808080; + text-decoration: none; + background-color: transparent; + cursor: not-allowed; +} +.nav .open > a, +.nav .open > a:hover, +.nav .open > a:focus { + background-color: #dddddd; + border-color: #d9230f; +} +.nav .nav-divider { + height: 1px; + margin: 8px 0; + overflow: hidden; + background-color: #e5e5e5; +} +.nav > li > a > img { + max-width: none; +} +.nav-tabs { + border-bottom: 1px solid #dddddd; +} +.nav-tabs > li { + float: left; + margin-bottom: -1px; +} +.nav-tabs > li > a { + margin-right: 2px; + line-height: 1.42857143; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; +} +.nav-tabs > li > a:hover { + border-color: #dddddd #dddddd #dddddd; +} +.nav-tabs > li.active > a, +.nav-tabs > li.active > a:hover, +.nav-tabs > li.active > a:focus { + color: #777777; + background-color: #fcfcfc; + border: 1px solid #dddddd; + border-bottom-color: transparent; + cursor: default; +} +.nav-tabs.nav-justified { + width: 100%; + border-bottom: 0; +} +.nav-tabs.nav-justified > li { + float: none; +} +.nav-tabs.nav-justified > li > a { + text-align: center; + margin-bottom: 5px; +} +.nav-tabs.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-tabs.nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs.nav-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs.nav-justified > .active > a, +.nav-tabs.nav-justified > .active > a:hover, +.nav-tabs.nav-justified > .active > a:focus { + border: 1px solid #dddddd; +} +@media (min-width: 768px) { + .nav-tabs.nav-justified > li > a { + border-bottom: 1px solid #dddddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs.nav-justified > .active > a, + .nav-tabs.nav-justified > .active > a:hover, + .nav-tabs.nav-justified > .active > a:focus { + border-bottom-color: #fcfcfc; + } +} +.nav-pills > li { + float: left; +} +.nav-pills > li > a { + border-radius: 4px; +} +.nav-pills > li + li { + margin-left: 2px; +} +.nav-pills > li.active > a, +.nav-pills > li.active > a:hover, +.nav-pills > li.active > a:focus { + color: #ffffff; + background-color: #d9230f; +} +.nav-stacked > li { + float: none; +} +.nav-stacked > li + li { + margin-top: 2px; + margin-left: 0; +} +.nav-justified { + width: 100%; +} +.nav-justified > li { + float: none; +} +.nav-justified > li > a { + text-align: center; + margin-bottom: 5px; +} +.nav-justified > .dropdown .dropdown-menu { + top: auto; + left: auto; +} +@media (min-width: 768px) { + .nav-justified > li { + display: table-cell; + width: 1%; + } + .nav-justified > li > a { + margin-bottom: 0; + } +} +.nav-tabs-justified { + border-bottom: 0; +} +.nav-tabs-justified > li > a { + margin-right: 0; + border-radius: 4px; +} +.nav-tabs-justified > .active > a, +.nav-tabs-justified > .active > a:hover, +.nav-tabs-justified > .active > a:focus { + border: 1px solid #dddddd; +} +@media (min-width: 768px) { + .nav-tabs-justified > li > a { + border-bottom: 1px solid #dddddd; + border-radius: 4px 4px 0 0; + } + .nav-tabs-justified > .active > a, + .nav-tabs-justified > .active > a:hover, + .nav-tabs-justified > .active > a:focus { + border-bottom-color: #fcfcfc; + } +} +.tab-content > .tab-pane { + display: none; +} +.tab-content > .active { + display: block; +} +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.navbar { + position: relative; + min-height: 40px; + margin-bottom: 18px; + border: 1px solid transparent; +} +@media (min-width: 768px) { + .navbar { + border-radius: 4px; + } +} +@media (min-width: 768px) { + .navbar-header { + float: left; + } +} +.navbar-collapse { + overflow-x: visible; + padding-right: 15px; + padding-left: 15px; + border-top: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); + -webkit-overflow-scrolling: touch; +} +.navbar-collapse.in { + overflow-y: auto; +} +@media (min-width: 768px) { + .navbar-collapse { + width: auto; + border-top: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-collapse.collapse { + display: block !important; + height: auto !important; + padding-bottom: 0; + overflow: visible !important; + } + .navbar-collapse.in { + overflow-y: visible; + } + .navbar-fixed-top .navbar-collapse, + .navbar-static-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + padding-left: 0; + padding-right: 0; + } +} +.navbar-fixed-top .navbar-collapse, +.navbar-fixed-bottom .navbar-collapse { + max-height: 340px; +} +@media (max-device-width: 480px) and (orientation: landscape) { + .navbar-fixed-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + max-height: 200px; + } +} +.container > .navbar-header, +.container-fluid > .navbar-header, +.container > .navbar-collapse, +.container-fluid > .navbar-collapse { + margin-right: -15px; + margin-left: -15px; +} +@media (min-width: 768px) { + .container > .navbar-header, + .container-fluid > .navbar-header, + .container > .navbar-collapse, + .container-fluid > .navbar-collapse { + margin-right: 0; + margin-left: 0; + } +} +.navbar-static-top { + z-index: 1000; + border-width: 0 0 1px; +} +@media (min-width: 768px) { + .navbar-static-top { + border-radius: 0; + } +} +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; +} +@media (min-width: 768px) { + .navbar-fixed-top, + .navbar-fixed-bottom { + border-radius: 0; + } +} +.navbar-fixed-top { + top: 0; + border-width: 0 0 1px; +} +.navbar-fixed-bottom { + bottom: 0; + margin-bottom: 0; + border-width: 1px 0 0; +} +.navbar-brand { + float: left; + padding: 11px 15px; + font-size: 17px; + line-height: 18px; + height: 40px; +} +.navbar-brand:hover, +.navbar-brand:focus { + text-decoration: none; +} +.navbar-brand > img { + display: block; +} +@media (min-width: 768px) { + .navbar > .container .navbar-brand, + .navbar > .container-fluid .navbar-brand { + margin-left: -15px; + } +} +.navbar-toggle { + position: relative; + float: right; + margin-right: 15px; + padding: 9px 10px; + margin-top: 3px; + margin-bottom: 3px; + background-color: transparent; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; +} +.navbar-toggle:focus { + outline: 0; +} +.navbar-toggle .icon-bar { + display: block; + width: 22px; + height: 2px; + border-radius: 1px; +} +.navbar-toggle .icon-bar + .icon-bar { + margin-top: 4px; +} +@media (min-width: 768px) { + .navbar-toggle { + display: none; + } +} +.navbar-nav { + margin: 5.5px -15px; +} +.navbar-nav > li > a { + padding-top: 10px; + padding-bottom: 10px; + line-height: 18px; +} +@media (max-width: 767px) { + .navbar-nav .open .dropdown-menu { + position: static; + float: none; + width: auto; + margin-top: 0; + background-color: transparent; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + } + .navbar-nav .open .dropdown-menu > li > a, + .navbar-nav .open .dropdown-menu .dropdown-header { + padding: 5px 15px 5px 25px; + } + .navbar-nav .open .dropdown-menu > li > a { + line-height: 18px; + } + .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-nav .open .dropdown-menu > li > a:focus { + background-image: none; + } +} +@media (min-width: 768px) { + .navbar-nav { + float: left; + margin: 0; + } + .navbar-nav > li { + float: left; + } + .navbar-nav > li > a { + padding-top: 11px; + padding-bottom: 11px; + } +} +.navbar-form { + margin-left: -15px; + margin-right: -15px; + padding: 10px 15px; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); + margin-top: 2px; + margin-bottom: 2px; +} +@media (min-width: 768px) { + .navbar-form .form-group { + display: inline-block; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .navbar-form .form-control-static { + display: inline-block; + } + .navbar-form .input-group { + display: inline-table; + vertical-align: middle; + } + .navbar-form .input-group .input-group-addon, + .navbar-form .input-group .input-group-btn, + .navbar-form .input-group .form-control { + width: auto; + } + .navbar-form .input-group > .form-control { + width: 100%; + } + .navbar-form .control-label { + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio, + .navbar-form .checkbox { + display: inline-block; + margin-top: 0; + margin-bottom: 0; + vertical-align: middle; + } + .navbar-form .radio label, + .navbar-form .checkbox label { + padding-left: 0; + } + .navbar-form .radio input[type="radio"], + .navbar-form .checkbox input[type="checkbox"] { + position: relative; + margin-left: 0; + } + .navbar-form .has-feedback .form-control-feedback { + top: 0; + } +} +@media (max-width: 767px) { + .navbar-form .form-group { + margin-bottom: 5px; + } + .navbar-form .form-group:last-child { + margin-bottom: 0; + } +} +@media (min-width: 768px) { + .navbar-form { + width: auto; + border: 0; + margin-left: 0; + margin-right: 0; + padding-top: 0; + padding-bottom: 0; + -webkit-box-shadow: none; + box-shadow: none; + } +} +.navbar-nav > li > .dropdown-menu { + margin-top: 0; + border-top-right-radius: 0; + border-top-left-radius: 0; +} +.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu { + margin-bottom: 0; + border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} +.navbar-btn { + margin-top: 2px; + margin-bottom: 2px; +} +.navbar-btn.btn-sm { + margin-top: 5px; + margin-bottom: 5px; +} +.navbar-btn.btn-xs { + margin-top: 9px; + margin-bottom: 9px; +} +.navbar-text { + margin-top: 11px; + margin-bottom: 11px; +} +@media (min-width: 768px) { + .navbar-text { + float: left; + margin-left: 15px; + margin-right: 15px; + } +} +@media (min-width: 768px) { + .navbar-left { + float: left !important; + } + .navbar-right { + float: right !important; + margin-right: -15px; + } + .navbar-right ~ .navbar-right { + margin-right: 0; + } +} +.navbar-default { + background-color: #ffffff; + border-color: #eeeeee; +} +.navbar-default .navbar-brand { + color: #777777; +} +.navbar-default .navbar-brand:hover, +.navbar-default .navbar-brand:focus { + color: #d9230f; + background-color: transparent; +} +.navbar-default .navbar-text { + color: #777777; +} +.navbar-default .navbar-nav > li > a { + color: #777777; +} +.navbar-default .navbar-nav > li > a:hover, +.navbar-default .navbar-nav > li > a:focus { + color: #d9230f; + background-color: transparent; +} +.navbar-default .navbar-nav > .active > a, +.navbar-default .navbar-nav > .active > a:hover, +.navbar-default .navbar-nav > .active > a:focus { + color: #d9230f; + background-color: transparent; +} +.navbar-default .navbar-nav > .disabled > a, +.navbar-default .navbar-nav > .disabled > a:hover, +.navbar-default .navbar-nav > .disabled > a:focus { + color: #444444; + background-color: transparent; +} +.navbar-default .navbar-toggle { + border-color: #dddddd; +} +.navbar-default .navbar-toggle:hover, +.navbar-default .navbar-toggle:focus { + background-color: #dddddd; +} +.navbar-default .navbar-toggle .icon-bar { + background-color: #cccccc; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #eeeeee; +} +.navbar-default .navbar-nav > .open > a, +.navbar-default .navbar-nav > .open > a:hover, +.navbar-default .navbar-nav > .open > a:focus { + background-color: transparent; + color: #d9230f; +} +@media (max-width: 767px) { + .navbar-default .navbar-nav .open .dropdown-menu > li > a { + color: #777777; + } + .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { + color: #d9230f; + background-color: transparent; + } + .navbar-default .navbar-nav .open .dropdown-menu > .active > a, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #d9230f; + background-color: transparent; + } + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #444444; + background-color: transparent; + } +} +.navbar-default .navbar-link { + color: #777777; +} +.navbar-default .navbar-link:hover { + color: #d9230f; +} +.navbar-default .btn-link { + color: #777777; +} +.navbar-default .btn-link:hover, +.navbar-default .btn-link:focus { + color: #d9230f; +} +.navbar-default .btn-link[disabled]:hover, +fieldset[disabled] .navbar-default .btn-link:hover, +.navbar-default .btn-link[disabled]:focus, +fieldset[disabled] .navbar-default .btn-link:focus { + color: #444444; +} +.navbar-inverse { + background-color: #d9230f; + border-color: #a91b0c; +} +.navbar-inverse .navbar-brand { + color: #fac0ba; +} +.navbar-inverse .navbar-brand:hover, +.navbar-inverse .navbar-brand:focus { + color: #ffffff; + background-color: transparent; +} +.navbar-inverse .navbar-text { + color: #fac0ba; +} +.navbar-inverse .navbar-nav > li > a { + color: #fac0ba; +} +.navbar-inverse .navbar-nav > li > a:hover, +.navbar-inverse .navbar-nav > li > a:focus { + color: #ffffff; + background-color: transparent; +} +.navbar-inverse .navbar-nav > .active > a, +.navbar-inverse .navbar-nav > .active > a:hover, +.navbar-inverse .navbar-nav > .active > a:focus { + color: #ffffff; + background-color: transparent; +} +.navbar-inverse .navbar-nav > .disabled > a, +.navbar-inverse .navbar-nav > .disabled > a:hover, +.navbar-inverse .navbar-nav > .disabled > a:focus { + color: #cccccc; + background-color: transparent; +} +.navbar-inverse .navbar-toggle { + border-color: #a91b0c; +} +.navbar-inverse .navbar-toggle:hover, +.navbar-inverse .navbar-toggle:focus { + background-color: #a91b0c; +} +.navbar-inverse .navbar-toggle .icon-bar { + background-color: #ffffff; +} +.navbar-inverse .navbar-collapse, +.navbar-inverse .navbar-form { + border-color: #b81e0d; +} +.navbar-inverse .navbar-nav > .open > a, +.navbar-inverse .navbar-nav > .open > a:hover, +.navbar-inverse .navbar-nav > .open > a:focus { + background-color: transparent; + color: #ffffff; +} +@media (max-width: 767px) { + .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { + border-color: #a91b0c; + } + .navbar-inverse .navbar-nav .open .dropdown-menu .divider { + background-color: #a91b0c; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { + color: #fac0ba; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { + color: #ffffff; + background-color: transparent; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { + color: #ffffff; + background-color: transparent; + } + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, + .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { + color: #cccccc; + background-color: transparent; + } +} +.navbar-inverse .navbar-link { + color: #fac0ba; +} +.navbar-inverse .navbar-link:hover { + color: #ffffff; +} +.navbar-inverse .btn-link { + color: #fac0ba; +} +.navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link:focus { + color: #ffffff; +} +.navbar-inverse .btn-link[disabled]:hover, +fieldset[disabled] .navbar-inverse .btn-link:hover, +.navbar-inverse .btn-link[disabled]:focus, +fieldset[disabled] .navbar-inverse .btn-link:focus { + color: #cccccc; +} +.breadcrumb { + padding: 8px 15px; + margin-bottom: 18px; + list-style: none; + background-color: transparent; + border-radius: 4px; +} +.breadcrumb > li { + display: inline-block; +} +.breadcrumb > li + li:before { + content: "/\00a0"; + padding: 0 5px; + color: #cccccc; +} +.breadcrumb > .active { + color: #808080; +} +.pagination { + display: inline-block; + padding-left: 0; + margin: 18px 0; + border-radius: 4px; +} +.pagination > li { + display: inline; +} +.pagination > li > a, +.pagination > li > span { + position: relative; + float: left; + padding: 8px 12px; + line-height: 1.42857143; + text-decoration: none; + color: #444444; + background-color: #ffffff; + border: 1px solid #dddddd; + margin-left: -1px; +} +.pagination > li:first-child > a, +.pagination > li:first-child > span { + margin-left: 0; + border-bottom-left-radius: 4px; + border-top-left-radius: 4px; +} +.pagination > li:last-child > a, +.pagination > li:last-child > span { + border-bottom-right-radius: 4px; + border-top-right-radius: 4px; +} +.pagination > li > a:hover, +.pagination > li > span:hover, +.pagination > li > a:focus, +.pagination > li > span:focus { + color: #ffffff; + background-color: #d9230f; + border-color: #d9230f; +} +.pagination > .active > a, +.pagination > .active > span, +.pagination > .active > a:hover, +.pagination > .active > span:hover, +.pagination > .active > a:focus, +.pagination > .active > span:focus { + z-index: 2; + color: #ffffff; + background-color: #d9230f; + border-color: #d9230f; + cursor: default; +} +.pagination > .disabled > span, +.pagination > .disabled > span:hover, +.pagination > .disabled > span:focus, +.pagination > .disabled > a, +.pagination > .disabled > a:hover, +.pagination > .disabled > a:focus { + color: #dddddd; + background-color: #ffffff; + border-color: #dddddd; + cursor: not-allowed; +} +.pagination-lg > li > a, +.pagination-lg > li > span { + padding: 14px 16px; + font-size: 17px; +} +.pagination-lg > li:first-child > a, +.pagination-lg > li:first-child > span { + border-bottom-left-radius: 6px; + border-top-left-radius: 6px; +} +.pagination-lg > li:last-child > a, +.pagination-lg > li:last-child > span { + border-bottom-right-radius: 6px; + border-top-right-radius: 6px; +} +.pagination-sm > li > a, +.pagination-sm > li > span { + padding: 5px 10px; + font-size: 12px; +} +.pagination-sm > li:first-child > a, +.pagination-sm > li:first-child > span { + border-bottom-left-radius: 3px; + border-top-left-radius: 3px; +} +.pagination-sm > li:last-child > a, +.pagination-sm > li:last-child > span { + border-bottom-right-radius: 3px; + border-top-right-radius: 3px; +} +.pager { + padding-left: 0; + margin: 18px 0; + list-style: none; + text-align: center; +} +.pager li { + display: inline; +} +.pager li > a, +.pager li > span { + display: inline-block; + padding: 5px 14px; + background-color: #ffffff; + border: 1px solid #dddddd; + border-radius: 15px; +} +.pager li > a:hover, +.pager li > a:focus { + text-decoration: none; + background-color: #d9230f; +} +.pager .next > a, +.pager .next > span { + float: right; +} +.pager .previous > a, +.pager .previous > span { + float: left; +} +.pager .disabled > a, +.pager .disabled > a:hover, +.pager .disabled > a:focus, +.pager .disabled > span { + color: #dddddd; + background-color: #ffffff; + cursor: not-allowed; +} +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: #ffffff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; +} +a.label:hover, +a.label:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +.label:empty { + display: none; +} +.btn .label { + position: relative; + top: -1px; +} +.label-default { + background-color: #474949; +} +.label-default[href]:hover, +.label-default[href]:focus { + background-color: #2e2f2f; +} +.label-primary { + background-color: #d9230f; +} +.label-primary[href]:hover, +.label-primary[href]:focus { + background-color: #a91b0c; +} +.label-success { + background-color: #469408; +} +.label-success[href]:hover, +.label-success[href]:focus { + background-color: #2f6405; +} +.label-info { + background-color: #029acf; +} +.label-info[href]:hover, +.label-info[href]:focus { + background-color: #02749c; +} +.label-warning { + background-color: #9b479f; +} +.label-warning[href]:hover, +.label-warning[href]:focus { + background-color: #79377c; +} +.label-danger { + background-color: #d9831f; +} +.label-danger[href]:hover, +.label-danger[href]:focus { + background-color: #ac6819; +} +.badge { + display: inline-block; + min-width: 10px; + padding: 3px 7px; + font-size: 12px; + font-weight: bold; + color: #ffffff; + line-height: 1; + vertical-align: baseline; + white-space: nowrap; + text-align: center; + background-color: #d9230f; + border-radius: 10px; +} +.badge:empty { + display: none; +} +.btn .badge { + position: relative; + top: -1px; +} +.btn-xs .badge, +.btn-group-xs > .btn .badge { + top: 0; + padding: 1px 5px; +} +a.badge:hover, +a.badge:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} +.list-group-item.active > .badge, +.nav-pills > .active > a > .badge { + color: #d9230f; + background-color: #ffffff; +} +.list-group-item > .badge { + float: right; +} +.list-group-item > .badge + .badge { + margin-right: 5px; +} +.nav-pills > li > a > .badge { + margin-left: 3px; +} +.jumbotron { + padding: 30px 15px; + margin-bottom: 30px; + color: inherit; + background-color: #f4f4f4; +} +.jumbotron h1, +.jumbotron .h1 { + color: inherit; +} +.jumbotron p { + margin-bottom: 15px; + font-size: 20px; + font-weight: 200; +} +.jumbotron > hr { + border-top-color: #dbdbdb; +} +.container .jumbotron, +.container-fluid .jumbotron { + border-radius: 6px; +} +.jumbotron .container { + max-width: 100%; +} +@media screen and (min-width: 768px) { + .jumbotron { + padding: 48px 0; + } + .container .jumbotron, + .container-fluid .jumbotron { + padding-left: 60px; + padding-right: 60px; + } + .jumbotron h1, + .jumbotron .h1 { + font-size: 58.5px; + } +} +.thumbnail { + display: block; + padding: 4px; + margin-bottom: 18px; + line-height: 1.42857143; + background-color: #fcfcfc; + border: 1px solid #dddddd; + border-radius: 4px; + -webkit-transition: border 0.2s ease-in-out; + -o-transition: border 0.2s ease-in-out; + transition: border 0.2s ease-in-out; +} +.thumbnail > img, +.thumbnail a > img { + margin-left: auto; + margin-right: auto; +} +a.thumbnail:hover, +a.thumbnail:focus, +a.thumbnail.active { + border-color: #d9230f; +} +.thumbnail .caption { + padding: 9px; + color: #777777; +} +.alert { + padding: 15px; + margin-bottom: 18px; + border: 1px solid transparent; + border-radius: 4px; +} +.alert h4 { + margin-top: 0; + color: inherit; +} +.alert .alert-link { + font-weight: bold; +} +.alert > p, +.alert > ul { + margin-bottom: 0; +} +.alert > p + p { + margin-top: 5px; +} +.alert-dismissable, +.alert-dismissible { + padding-right: 35px; +} +.alert-dismissable .close, +.alert-dismissible .close { + position: relative; + top: -2px; + right: -21px; + color: inherit; +} +.alert-success { + background-color: #dff0d8; + border-color: #d6e9c6; + color: #468847; +} +.alert-success hr { + border-top-color: #c9e2b3; +} +.alert-success .alert-link { + color: #356635; +} +.alert-info { + background-color: #d9edf7; + border-color: #bce8f1; + color: #3a87ad; +} +.alert-info hr { + border-top-color: #a6e1ec; +} +.alert-info .alert-link { + color: #2d6987; +} +.alert-warning { + background-color: #fcf8e3; + border-color: #fbeed5; + color: #c09853; +} +.alert-warning hr { + border-top-color: #f8e5be; +} +.alert-warning .alert-link { + color: #a47e3c; +} +.alert-danger { + background-color: #f2dede; + border-color: #eed3d7; + color: #b94a48; +} +.alert-danger hr { + border-top-color: #e6c1c7; +} +.alert-danger .alert-link { + color: #953b39; +} +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@-o-keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +@keyframes progress-bar-stripes { + from { + background-position: 40px 0; + } + to { + background-position: 0 0; + } +} +.progress { + overflow: hidden; + height: 18px; + margin-bottom: 18px; + background-color: #f5f5f5; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); +} +.progress-bar { + float: left; + width: 0%; + height: 100%; + font-size: 12px; + line-height: 18px; + color: #ffffff; + text-align: center; + background-color: #d9230f; + -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); + -webkit-transition: width 0.6s ease; + -o-transition: width 0.6s ease; + transition: width 0.6s ease; +} +.progress-striped .progress-bar, +.progress-bar-striped { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + -webkit-background-size: 40px 40px; + background-size: 40px 40px; +} +.progress.active .progress-bar, +.progress-bar.active { + -webkit-animation: progress-bar-stripes 2s linear infinite; + -o-animation: progress-bar-stripes 2s linear infinite; + animation: progress-bar-stripes 2s linear infinite; +} +.progress-bar-success { + background-color: #469408; +} +.progress-striped .progress-bar-success { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-info { + background-color: #029acf; +} +.progress-striped .progress-bar-info { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-warning { + background-color: #9b479f; +} +.progress-striped .progress-bar-warning { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.progress-bar-danger { + background-color: #d9831f; +} +.progress-striped .progress-bar-danger { + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); +} +.media { + margin-top: 15px; +} +.media:first-child { + margin-top: 0; +} +.media, +.media-body { + zoom: 1; + overflow: hidden; +} +.media-body { + width: 10000px; +} +.media-object { + display: block; +} +.media-right, +.media > .pull-right { + padding-left: 10px; +} +.media-left, +.media > .pull-left { + padding-right: 10px; +} +.media-left, +.media-right, +.media-body { + display: table-cell; + vertical-align: top; +} +.media-middle { + vertical-align: middle; +} +.media-bottom { + vertical-align: bottom; +} +.media-heading { + margin-top: 0; + margin-bottom: 5px; +} +.media-list { + padding-left: 0; + list-style: none; +} +.list-group { + margin-bottom: 20px; + padding-left: 0; +} +.list-group-item { + position: relative; + display: block; + padding: 10px 15px; + margin-bottom: -1px; + background-color: #ffffff; + border: 1px solid #dddddd; +} +.list-group-item:first-child { + border-top-right-radius: 4px; + border-top-left-radius: 4px; +} +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 4px; + border-bottom-left-radius: 4px; +} +a.list-group-item { + color: #555555; +} +a.list-group-item .list-group-item-heading { + color: #333333; +} +a.list-group-item:hover, +a.list-group-item:focus { + text-decoration: none; + color: #555555; + background-color: #f5f5f5; +} +.list-group-item.disabled, +.list-group-item.disabled:hover, +.list-group-item.disabled:focus { + background-color: #dddddd; + color: #808080; + cursor: not-allowed; +} +.list-group-item.disabled .list-group-item-heading, +.list-group-item.disabled:hover .list-group-item-heading, +.list-group-item.disabled:focus .list-group-item-heading { + color: inherit; +} +.list-group-item.disabled .list-group-item-text, +.list-group-item.disabled:hover .list-group-item-text, +.list-group-item.disabled:focus .list-group-item-text { + color: #808080; +} +.list-group-item.active, +.list-group-item.active:hover, +.list-group-item.active:focus { + z-index: 2; + color: #ffffff; + background-color: #d9230f; + border-color: #d9230f; +} +.list-group-item.active .list-group-item-heading, +.list-group-item.active:hover .list-group-item-heading, +.list-group-item.active:focus .list-group-item-heading, +.list-group-item.active .list-group-item-heading > small, +.list-group-item.active:hover .list-group-item-heading > small, +.list-group-item.active:focus .list-group-item-heading > small, +.list-group-item.active .list-group-item-heading > .small, +.list-group-item.active:hover .list-group-item-heading > .small, +.list-group-item.active:focus .list-group-item-heading > .small { + color: inherit; +} +.list-group-item.active .list-group-item-text, +.list-group-item.active:hover .list-group-item-text, +.list-group-item.active:focus .list-group-item-text { + color: #fac0ba; +} +.list-group-item-success { + color: #468847; + background-color: #dff0d8; +} +a.list-group-item-success { + color: #468847; +} +a.list-group-item-success .list-group-item-heading { + color: inherit; +} +a.list-group-item-success:hover, +a.list-group-item-success:focus { + color: #468847; + background-color: #d0e9c6; +} +a.list-group-item-success.active, +a.list-group-item-success.active:hover, +a.list-group-item-success.active:focus { + color: #fff; + background-color: #468847; + border-color: #468847; +} +.list-group-item-info { + color: #3a87ad; + background-color: #d9edf7; +} +a.list-group-item-info { + color: #3a87ad; +} +a.list-group-item-info .list-group-item-heading { + color: inherit; +} +a.list-group-item-info:hover, +a.list-group-item-info:focus { + color: #3a87ad; + background-color: #c4e3f3; +} +a.list-group-item-info.active, +a.list-group-item-info.active:hover, +a.list-group-item-info.active:focus { + color: #fff; + background-color: #3a87ad; + border-color: #3a87ad; +} +.list-group-item-warning { + color: #c09853; + background-color: #fcf8e3; +} +a.list-group-item-warning { + color: #c09853; +} +a.list-group-item-warning .list-group-item-heading { + color: inherit; +} +a.list-group-item-warning:hover, +a.list-group-item-warning:focus { + color: #c09853; + background-color: #faf2cc; +} +a.list-group-item-warning.active, +a.list-group-item-warning.active:hover, +a.list-group-item-warning.active:focus { + color: #fff; + background-color: #c09853; + border-color: #c09853; +} +.list-group-item-danger { + color: #b94a48; + background-color: #f2dede; +} +a.list-group-item-danger { + color: #b94a48; +} +a.list-group-item-danger .list-group-item-heading { + color: inherit; +} +a.list-group-item-danger:hover, +a.list-group-item-danger:focus { + color: #b94a48; + background-color: #ebcccc; +} +a.list-group-item-danger.active, +a.list-group-item-danger.active:hover, +a.list-group-item-danger.active:focus { + color: #fff; + background-color: #b94a48; + border-color: #b94a48; +} +.list-group-item-heading { + margin-top: 0; + margin-bottom: 5px; +} +.list-group-item-text { + margin-bottom: 0; + line-height: 1.3; +} +.panel { + margin-bottom: 18px; + background-color: #ffffff; + border: 1px solid transparent; + border-radius: 4px; + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); +} +.panel-body { + padding: 15px; +} +.panel-heading { + padding: 10px 15px; + border-bottom: 1px solid transparent; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel-heading > .dropdown .dropdown-toggle { + color: inherit; +} +.panel-title { + margin-top: 0; + margin-bottom: 0; + font-size: 15px; + color: inherit; +} +.panel-title > a, +.panel-title > small, +.panel-title > .small, +.panel-title > small > a, +.panel-title > .small > a { + color: inherit; +} +.panel-footer { + padding: 10px 15px; + background-color: #fcfcfc; + border-top: 1px solid #dddddd; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .list-group, +.panel > .panel-collapse > .list-group { + margin-bottom: 0; +} +.panel > .list-group .list-group-item, +.panel > .panel-collapse > .list-group .list-group-item { + border-width: 1px 0; + border-radius: 0; +} +.panel > .list-group:first-child .list-group-item:first-child, +.panel > .panel-collapse > .list-group:first-child .list-group-item:first-child { + border-top: 0; + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .list-group:last-child .list-group-item:last-child, +.panel > .panel-collapse > .list-group:last-child .list-group-item:last-child { + border-bottom: 0; + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel-heading + .list-group .list-group-item:first-child { + border-top-width: 0; +} +.list-group + .panel-footer { + border-top-width: 0; +} +.panel > .table, +.panel > .table-responsive > .table, +.panel > .panel-collapse > .table { + margin-bottom: 0; +} +.panel > .table caption, +.panel > .table-responsive > .table caption, +.panel > .panel-collapse > .table caption { + padding-left: 15px; + padding-right: 15px; +} +.panel > .table:first-child, +.panel > .table-responsive:first-child > .table:first-child { + border-top-right-radius: 3px; + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child { + border-top-left-radius: 3px; + border-top-right-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { + border-top-left-radius: 3px; +} +.panel > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, +.panel > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, +.panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, +.panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { + border-top-right-radius: 3px; +} +.panel > .table:last-child, +.panel > .table-responsive:last-child > .table:last-child { + border-bottom-right-radius: 3px; + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child { + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { + border-bottom-left-radius: 3px; +} +.panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, +.panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, +.panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, +.panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { + border-bottom-right-radius: 3px; +} +.panel > .panel-body + .table, +.panel > .panel-body + .table-responsive, +.panel > .table + .panel-body, +.panel > .table-responsive + .panel-body { + border-top: 1px solid #dddddd; +} +.panel > .table > tbody:first-child > tr:first-child th, +.panel > .table > tbody:first-child > tr:first-child td { + border-top: 0; +} +.panel > .table-bordered, +.panel > .table-responsive > .table-bordered { + border: 0; +} +.panel > .table-bordered > thead > tr > th:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:first-child, +.panel > .table-bordered > tbody > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, +.panel > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, +.panel > .table-bordered > thead > tr > td:first-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:first-child, +.panel > .table-bordered > tbody > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, +.panel > .table-bordered > tfoot > tr > td:first-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { + border-left: 0; +} +.panel > .table-bordered > thead > tr > th:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > th:last-child, +.panel > .table-bordered > tbody > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, +.panel > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, +.panel > .table-bordered > thead > tr > td:last-child, +.panel > .table-responsive > .table-bordered > thead > tr > td:last-child, +.panel > .table-bordered > tbody > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, +.panel > .table-bordered > tfoot > tr > td:last-child, +.panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { + border-right: 0; +} +.panel > .table-bordered > thead > tr:first-child > td, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > td, +.panel > .table-bordered > tbody > tr:first-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, +.panel > .table-bordered > thead > tr:first-child > th, +.panel > .table-responsive > .table-bordered > thead > tr:first-child > th, +.panel > .table-bordered > tbody > tr:first-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { + border-bottom: 0; +} +.panel > .table-bordered > tbody > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, +.panel > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, +.panel > .table-bordered > tbody > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, +.panel > .table-bordered > tfoot > tr:last-child > th, +.panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { + border-bottom: 0; +} +.panel > .table-responsive { + border: 0; + margin-bottom: 0; +} +.panel-group { + margin-bottom: 18px; +} +.panel-group .panel { + margin-bottom: 0; + border-radius: 4px; +} +.panel-group .panel + .panel { + margin-top: 5px; +} +.panel-group .panel-heading { + border-bottom: 0; +} +.panel-group .panel-heading + .panel-collapse > .panel-body, +.panel-group .panel-heading + .panel-collapse > .list-group { + border-top: 1px solid #dddddd; +} +.panel-group .panel-footer { + border-top: 0; +} +.panel-group .panel-footer + .panel-collapse .panel-body { + border-bottom: 1px solid #dddddd; +} +.panel-default { + border-color: #dddddd; +} +.panel-default > .panel-heading { + color: #444444; + background-color: #fcfcfc; + border-color: #dddddd; +} +.panel-default > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #dddddd; +} +.panel-default > .panel-heading .badge { + color: #fcfcfc; + background-color: #444444; +} +.panel-default > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #dddddd; +} +.panel-primary { + border-color: #d9230f; +} +.panel-primary > .panel-heading { + color: #ffffff; + background-color: #d9230f; + border-color: #d9230f; +} +.panel-primary > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #d9230f; +} +.panel-primary > .panel-heading .badge { + color: #d9230f; + background-color: #ffffff; +} +.panel-primary > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #d9230f; +} +.panel-success { + border-color: #469408; +} +.panel-success > .panel-heading { + color: #ffffff; + background-color: #469408; + border-color: #469408; +} +.panel-success > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #469408; +} +.panel-success > .panel-heading .badge { + color: #469408; + background-color: #ffffff; +} +.panel-success > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #469408; +} +.panel-info { + border-color: #029acf; +} +.panel-info > .panel-heading { + color: #ffffff; + background-color: #029acf; + border-color: #029acf; +} +.panel-info > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #029acf; +} +.panel-info > .panel-heading .badge { + color: #029acf; + background-color: #ffffff; +} +.panel-info > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #029acf; +} +.panel-warning { + border-color: #9b479f; +} +.panel-warning > .panel-heading { + color: #ffffff; + background-color: #9b479f; + border-color: #9b479f; +} +.panel-warning > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #9b479f; +} +.panel-warning > .panel-heading .badge { + color: #9b479f; + background-color: #ffffff; +} +.panel-warning > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #9b479f; +} +.panel-danger { + border-color: #d9831f; +} +.panel-danger > .panel-heading { + color: #ffffff; + background-color: #d9831f; + border-color: #d9831f; +} +.panel-danger > .panel-heading + .panel-collapse > .panel-body { + border-top-color: #d9831f; +} +.panel-danger > .panel-heading .badge { + color: #d9831f; + background-color: #ffffff; +} +.panel-danger > .panel-footer + .panel-collapse > .panel-body { + border-bottom-color: #d9831f; +} +.embed-responsive { + position: relative; + display: block; + height: 0; + padding: 0; + overflow: hidden; +} +.embed-responsive .embed-responsive-item, +.embed-responsive iframe, +.embed-responsive embed, +.embed-responsive object, +.embed-responsive video { + position: absolute; + top: 0; + left: 0; + bottom: 0; + height: 100%; + width: 100%; + border: 0; +} +.embed-responsive-16by9 { + padding-bottom: 56.25%; +} +.embed-responsive-4by3 { + padding-bottom: 75%; +} +.well { + min-height: 20px; + padding: 19px; + margin-bottom: 20px; + background-color: #f4f4f4; + border: 1px solid #e3e3e3; + border-radius: 4px; + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); +} +.well blockquote { + border-color: #ddd; + border-color: rgba(0, 0, 0, 0.15); +} +.well-lg { + padding: 24px; + border-radius: 6px; +} +.well-sm { + padding: 9px; + border-radius: 3px; +} +.close { + float: right; + font-size: 19.5px; + font-weight: bold; + line-height: 1; + color: #000000; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.close:hover, +.close:focus { + color: #000000; + text-decoration: none; + cursor: pointer; + opacity: 0.5; + filter: alpha(opacity=50); +} +button.close { + padding: 0; + cursor: pointer; + background: transparent; + border: 0; + -webkit-appearance: none; +} +.modal-open { + overflow: hidden; +} +.modal { + display: none; + overflow: hidden; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + -webkit-overflow-scrolling: touch; + outline: 0; +} +.modal.fade .modal-dialog { + -webkit-transform: translate(0, -25%); + -ms-transform: translate(0, -25%); + -o-transform: translate(0, -25%); + transform: translate(0, -25%); + -webkit-transition: -webkit-transform 0.3s ease-out; + -o-transition: -o-transform 0.3s ease-out; + transition: transform 0.3s ease-out; +} +.modal.in .modal-dialog { + -webkit-transform: translate(0, 0); + -ms-transform: translate(0, 0); + -o-transform: translate(0, 0); + transform: translate(0, 0); +} +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} +.modal-content { + position: relative; + background-color: #ffffff; + border: 1px solid #999999; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); + -webkit-background-clip: padding-box; + background-clip: padding-box; + outline: 0; +} +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000000; +} +.modal-backdrop.fade { + opacity: 0; + filter: alpha(opacity=0); +} +.modal-backdrop.in { + opacity: 0.5; + filter: alpha(opacity=50); +} +.modal-header { + padding: 15px; + border-bottom: 1px solid #e5e5e5; + min-height: 16.42857143px; +} +.modal-header .close { + margin-top: -2px; +} +.modal-title { + margin: 0; + line-height: 1.42857143; +} +.modal-body { + position: relative; + padding: 20px; +} +.modal-footer { + padding: 20px; + text-align: right; + border-top: 1px solid #e5e5e5; +} +.modal-footer .btn + .btn { + margin-left: 5px; + margin-bottom: 0; +} +.modal-footer .btn-group .btn + .btn { + margin-left: -1px; +} +.modal-footer .btn-block + .btn-block { + margin-left: 0; +} +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} +@media (min-width: 768px) { + .modal-dialog { + width: 600px; + margin: 30px auto; + } + .modal-content { + -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); + } + .modal-sm { + width: 300px; + } +} +@media (min-width: 992px) { + .modal-lg { + width: 900px; + } +} +.tooltip { + position: absolute; + z-index: 1070; + display: block; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 12px; + font-weight: normal; + line-height: 1.4; + opacity: 0; + filter: alpha(opacity=0); +} +.tooltip.in { + opacity: 0.9; + filter: alpha(opacity=90); +} +.tooltip.top { + margin-top: -3px; + padding: 5px 0; +} +.tooltip.right { + margin-left: 3px; + padding: 0 5px; +} +.tooltip.bottom { + margin-top: 3px; + padding: 5px 0; +} +.tooltip.left { + margin-left: -3px; + padding: 0 5px; +} +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #ffffff; + text-align: center; + text-decoration: none; + background-color: #000000; + border-radius: 4px; +} +.tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.tooltip.top .tooltip-arrow { + bottom: 0; + left: 50%; + margin-left: -5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-left .tooltip-arrow { + bottom: 0; + right: 5px; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.top-right .tooltip-arrow { + bottom: 0; + left: 5px; + margin-bottom: -5px; + border-width: 5px 5px 0; + border-top-color: #000000; +} +.tooltip.right .tooltip-arrow { + top: 50%; + left: 0; + margin-top: -5px; + border-width: 5px 5px 5px 0; + border-right-color: #000000; +} +.tooltip.left .tooltip-arrow { + top: 50%; + right: 0; + margin-top: -5px; + border-width: 5px 0 5px 5px; + border-left-color: #000000; +} +.tooltip.bottom .tooltip-arrow { + top: 0; + left: 50%; + margin-left: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-left .tooltip-arrow { + top: 0; + right: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.tooltip.bottom-right .tooltip-arrow { + top: 0; + left: 5px; + margin-top: -5px; + border-width: 0 5px 5px; + border-bottom-color: #000000; +} +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1060; + display: none; + max-width: 276px; + padding: 1px; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 13px; + font-weight: normal; + line-height: 1.42857143; + text-align: left; + background-color: #ffffff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #cccccc; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 6px; + -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); + white-space: normal; +} +.popover.top { + margin-top: -10px; +} +.popover.right { + margin-left: 10px; +} +.popover.bottom { + margin-top: 10px; +} +.popover.left { + margin-left: -10px; +} +.popover-title { + margin: 0; + padding: 8px 14px; + font-size: 13px; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-radius: 5px 5px 0 0; +} +.popover-content { + padding: 9px 14px; +} +.popover > .arrow, +.popover > .arrow:after { + position: absolute; + display: block; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.popover > .arrow { + border-width: 11px; +} +.popover > .arrow:after { + border-width: 10px; + content: ""; +} +.popover.top > .arrow { + left: 50%; + margin-left: -11px; + border-bottom-width: 0; + border-top-color: #999999; + border-top-color: rgba(0, 0, 0, 0.25); + bottom: -11px; +} +.popover.top > .arrow:after { + content: " "; + bottom: 1px; + margin-left: -10px; + border-bottom-width: 0; + border-top-color: #ffffff; +} +.popover.right > .arrow { + top: 50%; + left: -11px; + margin-top: -11px; + border-left-width: 0; + border-right-color: #999999; + border-right-color: rgba(0, 0, 0, 0.25); +} +.popover.right > .arrow:after { + content: " "; + left: 1px; + bottom: -10px; + border-left-width: 0; + border-right-color: #ffffff; +} +.popover.bottom > .arrow { + left: 50%; + margin-left: -11px; + border-top-width: 0; + border-bottom-color: #999999; + border-bottom-color: rgba(0, 0, 0, 0.25); + top: -11px; +} +.popover.bottom > .arrow:after { + content: " "; + top: 1px; + margin-left: -10px; + border-top-width: 0; + border-bottom-color: #ffffff; +} +.popover.left > .arrow { + top: 50%; + right: -11px; + margin-top: -11px; + border-right-width: 0; + border-left-color: #999999; + border-left-color: rgba(0, 0, 0, 0.25); +} +.popover.left > .arrow:after { + content: " "; + right: 1px; + border-right-width: 0; + border-left-color: #ffffff; + bottom: -10px; +} +.carousel { + position: relative; +} +.carousel-inner { + position: relative; + overflow: hidden; + width: 100%; +} +.carousel-inner > .item { + display: none; + position: relative; + -webkit-transition: 0.6s ease-in-out left; + -o-transition: 0.6s ease-in-out left; + transition: 0.6s ease-in-out left; +} +.carousel-inner > .item > img, +.carousel-inner > .item > a > img { + line-height: 1; +} +@media all and (transform-3d), (-webkit-transform-3d) { + .carousel-inner > .item { + -webkit-transition: -webkit-transform 0.6s ease-in-out; + -o-transition: -o-transform 0.6s ease-in-out; + transition: transform 0.6s ease-in-out; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000; + perspective: 1000; + } + .carousel-inner > .item.next, + .carousel-inner > .item.active.right { + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + left: 0; + } + .carousel-inner > .item.prev, + .carousel-inner > .item.active.left { + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + left: 0; + } + .carousel-inner > .item.next.left, + .carousel-inner > .item.prev.right, + .carousel-inner > .item.active { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + left: 0; + } +} +.carousel-inner > .active, +.carousel-inner > .next, +.carousel-inner > .prev { + display: block; +} +.carousel-inner > .active { + left: 0; +} +.carousel-inner > .next, +.carousel-inner > .prev { + position: absolute; + top: 0; + width: 100%; +} +.carousel-inner > .next { + left: 100%; +} +.carousel-inner > .prev { + left: -100%; +} +.carousel-inner > .next.left, +.carousel-inner > .prev.right { + left: 0; +} +.carousel-inner > .active.left { + left: -100%; +} +.carousel-inner > .active.right { + left: 100%; +} +.carousel-control { + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: 15%; + opacity: 0.5; + filter: alpha(opacity=50); + font-size: 20px; + color: #ffffff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} +.carousel-control.left { + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.0001))); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.0001) 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1); +} +.carousel-control.right { + left: auto; + right: 0; + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.0001)), to(rgba(0, 0, 0, 0.5))); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0%, rgba(0, 0, 0, 0.5) 100%); + background-repeat: repeat-x; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1); +} +.carousel-control:hover, +.carousel-control:focus { + outline: 0; + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); +} +.carousel-control .icon-prev, +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-left, +.carousel-control .glyphicon-chevron-right { + position: absolute; + top: 50%; + z-index: 5; + display: inline-block; +} +.carousel-control .icon-prev, +.carousel-control .glyphicon-chevron-left { + left: 50%; + margin-left: -10px; +} +.carousel-control .icon-next, +.carousel-control .glyphicon-chevron-right { + right: 50%; + margin-right: -10px; +} +.carousel-control .icon-prev, +.carousel-control .icon-next { + width: 20px; + height: 20px; + margin-top: -10px; + line-height: 1; + font-family: serif; +} +.carousel-control .icon-prev:before { + content: '\2039'; +} +.carousel-control .icon-next:before { + content: '\203a'; +} +.carousel-indicators { + position: absolute; + bottom: 10px; + left: 50%; + z-index: 15; + width: 60%; + margin-left: -30%; + padding-left: 0; + list-style: none; + text-align: center; +} +.carousel-indicators li { + display: inline-block; + width: 10px; + height: 10px; + margin: 1px; + text-indent: -999px; + border: 1px solid #ffffff; + border-radius: 10px; + cursor: pointer; + background-color: #000 \9; + background-color: rgba(0, 0, 0, 0); +} +.carousel-indicators .active { + margin: 0; + width: 12px; + height: 12px; + background-color: #ffffff; +} +.carousel-caption { + position: absolute; + left: 15%; + right: 15%; + bottom: 20px; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #ffffff; + text-align: center; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); +} +.carousel-caption .btn { + text-shadow: none; +} +@media screen and (min-width: 768px) { + .carousel-control .glyphicon-chevron-left, + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-prev, + .carousel-control .icon-next { + width: 30px; + height: 30px; + margin-top: -15px; + font-size: 30px; + } + .carousel-control .glyphicon-chevron-left, + .carousel-control .icon-prev { + margin-left: -15px; + } + .carousel-control .glyphicon-chevron-right, + .carousel-control .icon-next { + margin-right: -15px; + } + .carousel-caption { + left: 20%; + right: 20%; + padding-bottom: 30px; + } + .carousel-indicators { + bottom: 20px; + } +} +.clearfix:before, +.clearfix:after, +.dl-horizontal dd:before, +.dl-horizontal dd:after, +.container:before, +.container:after, +.container-fluid:before, +.container-fluid:after, +.row:before, +.row:after, +.form-horizontal .form-group:before, +.form-horizontal .form-group:after, +.btn-toolbar:before, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:before, +.btn-group-vertical > .btn-group:after, +.nav:before, +.nav:after, +.navbar:before, +.navbar:after, +.navbar-header:before, +.navbar-header:after, +.navbar-collapse:before, +.navbar-collapse:after, +.pager:before, +.pager:after, +.panel-body:before, +.panel-body:after, +.modal-footer:before, +.modal-footer:after { + content: " "; + display: table; +} +.clearfix:after, +.dl-horizontal dd:after, +.container:after, +.container-fluid:after, +.row:after, +.form-horizontal .form-group:after, +.btn-toolbar:after, +.btn-group-vertical > .btn-group:after, +.nav:after, +.navbar:after, +.navbar-header:after, +.navbar-collapse:after, +.pager:after, +.panel-body:after, +.modal-footer:after { + clear: both; +} +.center-block { + display: block; + margin-left: auto; + margin-right: auto; +} +.pull-right { + float: right !important; +} +.pull-left { + float: left !important; +} +.hide { + display: none !important; +} +.show { + display: block !important; +} +.invisible { + visibility: hidden; +} +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} +.hidden { + display: none !important; +} +.affix { + position: fixed; +} +@-ms-viewport { + width: device-width; +} +.visible-xs, +.visible-sm, +.visible-md, +.visible-lg { + display: none !important; +} +.visible-xs-block, +.visible-xs-inline, +.visible-xs-inline-block, +.visible-sm-block, +.visible-sm-inline, +.visible-sm-inline-block, +.visible-md-block, +.visible-md-inline, +.visible-md-inline-block, +.visible-lg-block, +.visible-lg-inline, +.visible-lg-inline-block { + display: none !important; +} +@media (max-width: 767px) { + .visible-xs { + display: block !important; + } + table.visible-xs { + display: table; + } + tr.visible-xs { + display: table-row !important; + } + th.visible-xs, + td.visible-xs { + display: table-cell !important; + } +} +@media (max-width: 767px) { + .visible-xs-block { + display: block !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline { + display: inline !important; + } +} +@media (max-width: 767px) { + .visible-xs-inline-block { + display: inline-block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm { + display: block !important; + } + table.visible-sm { + display: table; + } + tr.visible-sm { + display: table-row !important; + } + th.visible-sm, + td.visible-sm { + display: table-cell !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-block { + display: block !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline { + display: inline !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .visible-sm-inline-block { + display: inline-block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md { + display: block !important; + } + table.visible-md { + display: table; + } + tr.visible-md { + display: table-row !important; + } + th.visible-md, + td.visible-md { + display: table-cell !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-block { + display: block !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline { + display: inline !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .visible-md-inline-block { + display: inline-block !important; + } +} +@media (min-width: 1200px) { + .visible-lg { + display: block !important; + } + table.visible-lg { + display: table; + } + tr.visible-lg { + display: table-row !important; + } + th.visible-lg, + td.visible-lg { + display: table-cell !important; + } +} +@media (min-width: 1200px) { + .visible-lg-block { + display: block !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline { + display: inline !important; + } +} +@media (min-width: 1200px) { + .visible-lg-inline-block { + display: inline-block !important; + } +} +@media (max-width: 767px) { + .hidden-xs { + display: none !important; + } +} +@media (min-width: 768px) and (max-width: 991px) { + .hidden-sm { + display: none !important; + } +} +@media (min-width: 992px) and (max-width: 1199px) { + .hidden-md { + display: none !important; + } +} +@media (min-width: 1200px) { + .hidden-lg { + display: none !important; + } +} +.visible-print { + display: none !important; +} +@media print { + .visible-print { + display: block !important; + } + table.visible-print { + display: table; + } + tr.visible-print { + display: table-row !important; + } + th.visible-print, + td.visible-print { + display: table-cell !important; + } +} +.visible-print-block { + display: none !important; +} +@media print { + .visible-print-block { + display: block !important; + } +} +.visible-print-inline { + display: none !important; +} +@media print { + .visible-print-inline { + display: inline !important; + } +} +.visible-print-inline-block { + display: none !important; +} +@media print { + .visible-print-inline-block { + display: inline-block !important; + } +} +@media print { + .hidden-print { + display: none !important; + } +} +.navbar-inverse .badge { + background-color: #fff; + color: #d9230f; +} +.btn { + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; +} +.btn-default, +.btn-default:hover { + background-image: -webkit-linear-gradient(#4f5151, #474949 6%, #3f4141); + background-image: -o-linear-gradient(#4f5151, #474949 6%, #3f4141); + background-image: -webkit-gradient(linear, left top, left bottom, from(#4f5151), color-stop(6%, #474949), to(#3f4141)); + background-image: linear-gradient(#4f5151, #474949 6%, #3f4141); + background-repeat: no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff4f5151', endColorstr='#ff3f4141', GradientType=0); + -webkit-filter: none; + filter: none; + border: 1px solid #2e2f2f; +} +.btn-primary, +.btn-primary:hover { + background-image: -webkit-linear-gradient(#e72510, #d9230f 6%, #cb210e); + background-image: -o-linear-gradient(#e72510, #d9230f 6%, #cb210e); + background-image: -webkit-gradient(linear, left top, left bottom, from(#e72510), color-stop(6%, #d9230f), to(#cb210e)); + background-image: linear-gradient(#e72510, #d9230f 6%, #cb210e); + background-repeat: no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe72510', endColorstr='#ffcb210e', GradientType=0); + -webkit-filter: none; + filter: none; + border: 1px solid #a91b0c; +} +.btn-success, +.btn-success:hover { + background-image: -webkit-linear-gradient(#4da309, #469408 6%, #3f8507); + background-image: -o-linear-gradient(#4da309, #469408 6%, #3f8507); + background-image: -webkit-gradient(linear, left top, left bottom, from(#4da309), color-stop(6%, #469408), to(#3f8507)); + background-image: linear-gradient(#4da309, #469408 6%, #3f8507); + background-repeat: no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff4da309', endColorstr='#ff3f8507', GradientType=0); + -webkit-filter: none; + filter: none; + border: 1px solid #2f6405; +} +.btn-info, +.btn-info:hover { + background-image: -webkit-linear-gradient(#02a5de, #029acf 6%, #028fc0); + background-image: -o-linear-gradient(#02a5de, #029acf 6%, #028fc0); + background-image: -webkit-gradient(linear, left top, left bottom, from(#02a5de), color-stop(6%, #029acf), to(#028fc0)); + background-image: linear-gradient(#02a5de, #029acf 6%, #028fc0); + background-repeat: no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff02a5de', endColorstr='#ff028fc0', GradientType=0); + -webkit-filter: none; + filter: none; + border: 1px solid #02749c; +} +.btn-warning, +.btn-warning:hover { + background-image: -webkit-linear-gradient(#a54caa, #9b479f 6%, #914294); + background-image: -o-linear-gradient(#a54caa, #9b479f 6%, #914294); + background-image: -webkit-gradient(linear, left top, left bottom, from(#a54caa), color-stop(6%, #9b479f), to(#914294)); + background-image: linear-gradient(#a54caa, #9b479f 6%, #914294); + background-repeat: no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffa54caa', endColorstr='#ff914294', GradientType=0); + -webkit-filter: none; + filter: none; + border: 1px solid #79377c; +} +.btn-danger, +.btn-danger:hover { + background-image: -webkit-linear-gradient(#e08b27, #d9831f 6%, #cc7b1d); + background-image: -o-linear-gradient(#e08b27, #d9831f 6%, #cc7b1d); + background-image: -webkit-gradient(linear, left top, left bottom, from(#e08b27), color-stop(6%, #d9831f), to(#cc7b1d)); + background-image: linear-gradient(#e08b27, #d9831f 6%, #cc7b1d); + background-repeat: no-repeat; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe08b27', endColorstr='#ffcc7b1d', GradientType=0); + -webkit-filter: none; + filter: none; + border: 1px solid #ac6819; +} +body { + font-weight: 200; +} +th { + color: #444444; +} +legend { + color: #444444; +} +label { + font-weight: normal; +} +.has-warning .help-block, +.has-warning .control-label { + color: #d9831f; +} +.has-warning .form-control, +.has-warning .form-control:focus { + border-color: #d9831f; +} +.has-error .help-block, +.has-error .control-label { + color: #d9230f; +} +.has-error .form-control, +.has-error .form-control:focus { + border-color: #d9230f; +} +.has-success .help-block, +.has-success .control-label { + color: #469408; +} +.has-success .form-control, +.has-success .form-control:focus { + border-color: #469408; +} +.pager a { + color: #444444; +} +.pager a:hover, +.pager .active > a { + border-color: #d9230f; + color: #fff; +} +.pager .disabled > a { + border-color: #dddddd; +}
\ No newline at end of file diff --git a/website/resources/css/custom.css b/website/resources/css/custom.css new file mode 100644 index 00000000..f81a3dd9 --- /dev/null +++ b/website/resources/css/custom.css @@ -0,0 +1,355 @@ +#clickForVideo { + padding: 20px 30px; + background-color: #DDD; + cursor: pointer; + margin-left: auto; + margin-right: auto; + 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; + padding: 20px; + background-color: #EEE; + text-align: center; +} + +.noSupportersBox { + font-size: 1.2em; + padding: 20px; + background-color: #EEE; + text-align: center; +} + +.spinner { + display: block; + margin-left: auto; + margin-right: auto; + width: 16px; + height: 16px; +} + +#companyLogo { + margin-right: 8px; +} + +html { + position: relative; + min-height: 100%; +} + +body { + margin-bottom: 60px; + overflow-y: scroll; +} + +ul.dropdown-menu .header { + padding-left: 10px; +} + +div.snippet code { + padding: 0; +} + +.fork-me { + position: fixed; + width: 150px; + height: 150px; + top: 0; + right: 0; + z-index: 2000; +} + +.video { + padding-top: 4%; +} + +.name { + font-weight: bold; +} + +.bs-callout { + padding: 10px; + margin: 20px 0; + border: 1px solid #eee; + border-left-width: 5px; + border-radius: 3px; +} + +.bs-callout h4 { + margin-top: 0; + margin-bottom: 5px; +} + +.bs-callout p:last-child { + margin-bottom: 0; +} + +.bs-callout code { + border-radius: 3px; +} + +.bs-callout + .bs-callout { + margin-top: -5px; +} + +.bs-callout-danger { + border-left-color: #ce4844; +} + +.bs-callout-danger h4 { + color: #ce4844; +} + +.bs-callout-warning { + border-left-color: #aa6708; +} + +.bs-callout-warning h4 { + color: #aa6708; +} + +.bs-callout-info { + border-left-color: #1b809e; +} + +.bs-callout-info h4 { + color: #1b809e; +} + +.color-swatches { + margin: 0 -5px; + overflow: hidden; +} + +.footer { + position: absolute; + bottom: 0; + height: 60px; + border-top: 1px solid #eee; + padding-top: 15px; +} + +h1, h2, h3 { + padding: 12px 40px; + text-align: center; +} + +.page-center { + padding-top: 10%; + padding-bottom: 19%; +} + +.page-header { + border-bottom: 0; +} + +.header-group > h1, h2, h3 { + padding: 5px; +} + +.snippet { + overflow: auto; + padding: 4px; + border: 1px dotted #888; + text-align: left; +} + +.snippet font { + white-space: pre; +} + +.snippet code { + font-size: 14px; + background-color: transparent; +} + +.snippet.example { + margin: 8px 16px 8px 16px; +} + +.snippet-col { + position: relative; + min-height: 1px; + padding-left: 15px; + padding-right: 15px; +} + +@media (min-width: 769px) { + .snippet-col { + margin-left: -60px; + margin-right: -60px; + } +} + +@media (min-width: 1000px) { + .snippet-col { + margin-left: -120px; + margin-right: -120px; + } +} + +a { + cursor: pointer; +} + +.main-section { + padding-left: 100px; + padding-right: 100px; + max-width: 900px; +} + +.changelog li { + text-align: left; +} + +@media (max-width: 767px) { + .fork-me { + display: none; + } + + h1 { + font-size: 20px; + } + + h2 { + font-size: 18px; + } + + h3 { + font-size: 16px; + } + + .main-section { + padding-left: 30px; + padding-right: 30px; + } + + video { + width: 100%; + height: auto; + } + + .smallOnly { + display: block !important; + } + + .wideOnly { + display: none !important; + } +} + +@media (min-width: 768px) { + .smallOnly { + display: none !important; + } + + .wideOnly { + display: block !important; + } +} + +img { + max-width: 100%; + height: auto; +} + +h3.listHeader { + text-align: left; +} diff --git a/website/setup/pom.xml b/website/resources/files/pom.xml index 6562afe8..6562afe8 100644 --- a/website/setup/pom.xml +++ b/website/resources/files/pom.xml 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/eclipse-about.png b/website/resources/img/eclipse-about.png Binary files differnew file mode 100644 index 00000000..71b18e99 --- /dev/null +++ b/website/resources/img/eclipse-about.png diff --git a/website/resources/img/lombok-installer.png b/website/resources/img/lombok-installer.png Binary files differnew file mode 100644 index 00000000..d71148f5 --- /dev/null +++ b/website/resources/img/lombok-installer.png diff --git a/website/setup/netbeans-enable-annotation-processing-in-editor.png b/website/resources/img/netbeans-enable-annotation-processing-in-editor.png Binary files differindex d8a6b4c3..d8a6b4c3 100644 --- a/website/setup/netbeans-enable-annotation-processing-in-editor.png +++ b/website/resources/img/netbeans-enable-annotation-processing-in-editor.png diff --git a/website/resources/img/poster.png b/website/resources/img/poster.png Binary files differnew file mode 100644 index 00000000..36c1a843 --- /dev/null +++ b/website/resources/img/poster.png diff --git a/website/reinier.jpg b/website/resources/img/reinier.jpg Binary files differindex dcb09700..dcb09700 100644 --- a/website/reinier.jpg +++ b/website/resources/img/reinier.jpg diff --git a/website/roel.jpg b/website/resources/img/roel.jpg Binary files differindex e5ce02ce..e5ce02ce 100644 --- a/website/roel.jpg +++ b/website/resources/img/roel.jpg diff --git a/website/resources/img/spinner.gif b/website/resources/img/spinner.gif Binary files differnew file mode 100644 index 00000000..f627b993 --- /dev/null +++ b/website/resources/img/spinner.gif diff --git a/website/resources/js/history.js b/website/resources/js/history.js new file mode 100644 index 00000000..9e18d9ee --- /dev/null +++ b/website/resources/js/history.js @@ -0,0 +1 @@ +typeof JSON!="object"&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n<s;n+=1)u[n]=str(n,a)||"null";return i=u.length===0?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+o+"]":"["+u.join(",")+"]",gap=o,i}if(rep&&typeof rep=="object"){s=rep.length;for(n=0;n<s;n+=1)typeof rep[n]=="string"&&(r=rep[n],i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i))}else for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i=str(r,a),i&&u.push(quote(r)+(gap?": ":":")+i));return i=u.length===0?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+o+"}":"{"+u.join(",")+"}",gap=o,i}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(e){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(e,t,n){var r;gap="",indent="";if(typeof n=="number")for(r=0;r<n;r+=1)indent+=" ";else typeof n=="string"&&(indent=n);rep=t;if(!t||typeof t=="function"||typeof t=="object"&&typeof t.length=="number")return str("",{"":e});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&typeof i=="object")for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r=walk(i,n),r!==undefined?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),function(e,t){"use strict";var n=e.History=e.History||{},r=e.jQuery;if(typeof n.Adapter!="undefined")throw new Error("History.js Adapter has already been loaded...");n.Adapter={bind:function(e,t,n){r(e).bind(t,n)},trigger:function(e,t,n){r(e).trigger(t,n)},extractEventData:function(e,n,r){var i=n&&n.originalEvent&&n.originalEvent[e]||r&&r[e]||t;return i},onDomLoad:function(e){r(e)}},typeof n.init!="undefined"&&n.init()}(window),function(e,t){"use strict";var n=e.document,r=e.setTimeout||r,i=e.clearTimeout||i,s=e.setInterval||s,o=e.History=e.History||{};if(typeof o.initHtml4!="undefined")throw new Error("History.js HTML4 Support has already been loaded...");o.initHtml4=function(){if(typeof o.initHtml4.initialized!="undefined")return!1;o.initHtml4.initialized=!0,o.enabled=!0,o.savedHashes=[],o.isLastHash=function(e){var t=o.getHashByIndex(),n;return n=e===t,n},o.isHashEqual=function(e,t){return e=encodeURIComponent(e).replace(/%25/g,"%"),t=encodeURIComponent(t).replace(/%25/g,"%"),e===t},o.saveHash=function(e){return o.isLastHash(e)?!1:(o.savedHashes.push(e),!0)},o.getHashByIndex=function(e){var t=null;return typeof e=="undefined"?t=o.savedHashes[o.savedHashes.length-1]:e<0?t=o.savedHashes[o.savedHashes.length+e]:t=o.savedHashes[e],t},o.discardedHashes={},o.discardedStates={},o.discardState=function(e,t,n){var r=o.getHashByState(e),i;return i={discardedState:e,backState:n,forwardState:t},o.discardedStates[r]=i,!0},o.discardHash=function(e,t,n){var r={discardedHash:e,backState:n,forwardState:t};return o.discardedHashes[e]=r,!0},o.discardedState=function(e){var t=o.getHashByState(e),n;return n=o.discardedStates[t]||!1,n},o.discardedHash=function(e){var t=o.discardedHashes[e]||!1;return t},o.recycleState=function(e){var t=o.getHashByState(e);return o.discardedState(e)&&delete o.discardedStates[t],!0},o.emulated.hashChange&&(o.hashChangeInit=function(){o.checkerFunction=null;var t="",r,i,u,a,f=Boolean(o.getHash());return o.isInternetExplorer()?(r="historyjs-iframe",i=n.createElement("iframe"),i.setAttribute("id",r),i.setAttribute("src","#"),i.style.display="none",n.body.appendChild(i),i.contentWindow.document.open(),i.contentWindow.document.close(),u="",a=!1,o.checkerFunction=function(){if(a)return!1;a=!0;var n=o.getHash(),r=o.getHash(i.contentWindow.document);return n!==t?(t=n,r!==n&&(u=r=n,i.contentWindow.document.open(),i.contentWindow.document.close(),i.contentWindow.document.location.hash=o.escapeHash(n)),o.Adapter.trigger(e,"hashchange")):r!==u&&(u=r,f&&r===""?o.back():o.setHash(r,!1)),a=!1,!0}):o.checkerFunction=function(){var n=o.getHash()||"";return n!==t&&(t=n,o.Adapter.trigger(e,"hashchange")),!0},o.intervalList.push(s(o.checkerFunction,o.options.hashChangeInterval)),!0},o.Adapter.onDomLoad(o.hashChangeInit)),o.emulated.pushState&&(o.onHashChange=function(t){var n=t&&t.newURL||o.getLocationHref(),r=o.getHashByUrl(n),i=null,s=null,u=null,a;return o.isLastHash(r)?(o.busy(!1),!1):(o.doubleCheckComplete(),o.saveHash(r),r&&o.isTraditionalAnchor(r)?(o.Adapter.trigger(e,"anchorchange"),o.busy(!1),!1):(i=o.extractState(o.getFullUrl(r||o.getLocationHref()),!0),o.isLastSavedState(i)?(o.busy(!1),!1):(s=o.getHashByState(i),a=o.discardedState(i),a?(o.getHashByIndex(-2)===o.getHashByState(a.forwardState)?o.back(!1):o.forward(!1),!1):(o.pushState(i.data,i.title,encodeURI(i.url),!1),!0))))},o.Adapter.bind(e,"hashchange",o.onHashChange),o.pushState=function(t,n,r,i){r=encodeURI(r).replace(/%25/g,"%");if(o.getHashByUrl(r))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(i!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.pushState,args:arguments,queue:i}),!1;o.busy(!0);var s=o.createStateObject(t,n,r),u=o.getHashByState(s),a=o.getState(!1),f=o.getHashByState(a),l=o.getHash(),c=o.expectedStateId==s.id;return o.storeState(s),o.expectedStateId=s.id,o.recycleState(s),o.setTitle(s),u===f?(o.busy(!1),!1):(o.saveState(s),c||o.Adapter.trigger(e,"statechange"),!o.isHashEqual(u,l)&&!o.isHashEqual(u,o.getShortUrl(o.getLocationHref()))&&o.setHash(u,!1),o.busy(!1),!0)},o.replaceState=function(t,n,r,i){r=encodeURI(r).replace(/%25/g,"%");if(o.getHashByUrl(r))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(i!==!1&&o.busy())return o.pushQueue({scope:o,callback:o.replaceState,args:arguments,queue:i}),!1;o.busy(!0);var s=o.createStateObject(t,n,r),u=o.getHashByState(s),a=o.getState(!1),f=o.getHashByState(a),l=o.getStateByIndex(-2);return o.discardState(a,s,l),u===f?(o.storeState(s),o.expectedStateId=s.id,o.recycleState(s),o.setTitle(s),o.saveState(s),o.Adapter.trigger(e,"statechange"),o.busy(!1)):o.pushState(s.data,s.title,s.url,!1),!0}),o.emulated.pushState&&o.getHash()&&!o.emulated.hashChange&&o.Adapter.onDomLoad(function(){o.Adapter.trigger(e,"hashchange")})},typeof o.init!="undefined"&&o.init()}(window),function(e,t){"use strict";var n=e.console||t,r=e.document,i=e.navigator,s=!1,o=e.setTimeout,u=e.clearTimeout,a=e.setInterval,f=e.clearInterval,l=e.JSON,c=e.alert,h=e.History=e.History||{},p=e.history;try{s=e.sessionStorage,s.setItem("TEST","1"),s.removeItem("TEST")}catch(d){s=!1}l.stringify=l.stringify||l.encode,l.parse=l.parse||l.decode;if(typeof h.init!="undefined")throw new Error("History.js Core has already been loaded...");h.init=function(e){return typeof h.Adapter=="undefined"?!1:(typeof h.initCore!="undefined"&&h.initCore(),typeof h.initHtml4!="undefined"&&h.initHtml4(),!0)},h.initCore=function(d){if(typeof h.initCore.initialized!="undefined")return!1;h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.disableSuid=h.options.disableSuid||!1,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||r.title,h.options.html4Mode=h.options.html4Mode||!1,h.options.delayInit=h.options.delayInit||!1,h.intervalList=[],h.clearAllIntervals=function(){var e,t=h.intervalList;if(typeof t!="undefined"&&t!==null){for(e=0;e<t.length;e++)f(t[e]);h.intervalList=null}},h.debug=function(){(h.options.debug||!1)&&h.log.apply(h,arguments)},h.log=function(){var e=typeof n!="undefined"&&typeof n.log!="undefined"&&typeof n.log.apply!="undefined",t=r.getElementById("log"),i,s,o,u,a;e?(u=Array.prototype.slice.call(arguments),i=u.shift(),typeof n.debug!="undefined"?n.debug.apply(n,[i,u]):n.log.apply(n,[i,u])):i="\n"+arguments[0]+"\n";for(s=1,o=arguments.length;s<o;++s){a=arguments[s];if(typeof a=="object"&&typeof l!="undefined")try{a=l.stringify(a)}catch(f){}i+="\n"+a+"\n"}return t?(t.value+=i+"\n-----\n",t.scrollTop=t.scrollHeight-t.clientHeight):e||c(i),!0},h.getInternetExplorerMajorVersion=function(){var e=h.getInternetExplorerMajorVersion.cached=typeof h.getInternetExplorerMajorVersion.cached!="undefined"?h.getInternetExplorerMajorVersion.cached:function(){var e=3,t=r.createElement("div"),n=t.getElementsByTagName("i");while((t.innerHTML="<!--[if gt IE "+ ++e+"]><i></i><![endif]-->")&&n[0]);return e>4?e:!1}();return e},h.isInternetExplorer=function(){var e=h.isInternetExplorer.cached=typeof h.isInternetExplorer.cached!="undefined"?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return e},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(e.history&&e.history.pushState&&e.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(i.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(i.userAgent)),hashChange:Boolean(!("onhashchange"in e||"onhashchange"in r)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&i.vendor==="Apple Computer, Inc."&&/AppleWebKit\/5([0-2]|3[0-3])/.test(i.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},h.cloneObject=function(e){var t,n;return e?(t=l.stringify(e),n=l.parse(t)):n={},n},h.getRootUrl=function(){var e=r.location.protocol+"//"+(r.location.hostname||r.location.host);if(r.location.port||!1)e+=":"+r.location.port;return e+="/",e},h.getBaseHref=function(){var e=r.getElementsByTagName("base"),t=null,n="";return e.length===1&&(t=e[0],n=t.href.replace(/[^\/]+$/,"")),n=n.replace(/\/+$/,""),n&&(n+="/"),n},h.getBaseUrl=function(){var e=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return e},h.getPageUrl=function(){var e=h.getState(!1,!1),t=(e||{}).url||h.getLocationHref(),n;return n=t.replace(/\/+$/,"").replace(/[^\/]+$/,function(e,t,n){return/\./.test(e)?e:e+"/"}),n},h.getBasePageUrl=function(){var e=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(e,t,n){return/[^\/]$/.test(e)?"":e}).replace(/\/+$/,"")+"/";return e},h.getFullUrl=function(e,t){var n=e,r=e.substring(0,1);return t=typeof t=="undefined"?!0:t,/[a-z]+\:\/\//.test(e)||(r==="/"?n=h.getRootUrl()+e.replace(/^\/+/,""):r==="#"?n=h.getPageUrl().replace(/#.*/,"")+e:r==="?"?n=h.getPageUrl().replace(/[\?#].*/,"")+e:t?n=h.getBaseUrl()+e.replace(/^(\.\/)+/,""):n=h.getBasePageUrl()+e.replace(/^(\.\/)+/,"")),n.replace(/\#$/,"")},h.getShortUrl=function(e){var t=e,n=h.getBaseUrl(),r=h.getRootUrl();return h.emulated.pushState&&(t=t.replace(n,"")),t=t.replace(r,"/"),h.isTraditionalAnchor(t)&&(t="./"+t),t=t.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),t},h.getLocationHref=function(e){return e=e||r,e.URL===e.location.href?e.location.href:e.location.href===decodeURIComponent(e.URL)?e.URL:e.location.hash&&decodeURIComponent(e.location.href.replace(/^[^#]+/,""))===e.location.hash?e.location.href:e.URL.indexOf("#")==-1&&e.location.href.indexOf("#")!=-1?e.location.href:e.URL||e.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(e,t){typeof e=="undefined"&&(e=!0),typeof t=="undefined"&&(t=!0);var n=h.getLastSavedState();return!n&&t&&(n=h.createStateObject()),e&&(n=h.cloneObject(n),n.url=n.cleanUrl||n.url),n},h.getIdByState=function(e){var t=h.extractId(e.url),n;if(!t){n=h.getStateString(e);if(typeof h.stateToId[n]!="undefined")t=h.stateToId[n];else if(typeof h.store.stateToId[n]!="undefined")t=h.store.stateToId[n];else{for(;;){t=(new Date).getTime()+String(Math.random()).replace(/\D/g,"");if(typeof h.idToState[t]=="undefined"&&typeof h.store.idToState[t]=="undefined")break}h.stateToId[n]=t,h.idToState[t]=e}}return t},h.normalizeState=function(e){var t,n;if(!e||typeof e!="object")e={};if(typeof e.normalized!="undefined")return e;if(!e.data||typeof e.data!="object")e.data={};return t={},t.normalized=!0,t.title=e.title||"",t.url=h.getFullUrl(e.url?e.url:h.getLocationHref()),t.hash=h.getShortUrl(t.url),t.data=h.cloneObject(e.data),t.id=h.getIdByState(t),t.cleanUrl=t.url.replace(/\??\&_suid.*/,""),t.url=t.cleanUrl,n=!h.isEmptyObject(t.data),(t.title||n)&&h.options.disableSuid!==!0&&(t.hash=h.getShortUrl(t.url).replace(/\??\&_suid.*/,""),/\?/.test(t.hash)||(t.hash+="?"),t.hash+="&_suid="+t.id),t.hashedUrl=h.getFullUrl(t.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(t)&&(t.url=t.hashedUrl),t},h.createStateObject=function(e,t,n){var r={data:e,title:t,url:n};return r=h.normalizeState(r),r},h.getStateById=function(e){e=String(e);var n=h.idToState[e]||h.store.idToState[e]||t;return n},h.getStateString=function(e){var t,n,r;return t=h.normalizeState(e),n={data:t.data,title:e.title,url:e.url},r=l.stringify(n),r},h.getStateId=function(e){var t,n;return t=h.normalizeState(e),n=t.id,n},h.getHashByState=function(e){var t,n;return t=h.normalizeState(e),n=t.hash,n},h.extractId=function(e){var t,n,r,i;return e.indexOf("#")!=-1?i=e.split("#")[0]:i=e,n=/(.*)\&_suid=([0-9]+)$/.exec(i),r=n?n[1]||e:e,t=n?String(n[2]||""):"",t||!1},h.isTraditionalAnchor=function(e){var t=!/[\/\?\.]/.test(e);return t},h.extractState=function(e,t){var n=null,r,i;return t=t||!1,r=h.extractId(e),r&&(n=h.getStateById(r)),n||(i=h.getFullUrl(e),r=h.getIdByUrl(i)||!1,r&&(n=h.getStateById(r)),!n&&t&&!h.isTraditionalAnchor(e)&&(n=h.createStateObject(null,null,i))),n},h.getIdByUrl=function(e){var n=h.urlToId[e]||h.store.urlToId[e]||t;return n},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||t},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||t},h.hasUrlDuplicate=function(e){var t=!1,n;return n=h.extractState(e.url),t=n&&n.id!==e.id,t},h.storeState=function(e){return h.urlToId[e.url]=e.id,h.storedStates.push(h.cloneObject(e)),e},h.isLastSavedState=function(e){var t=!1,n,r,i;return h.savedStates.length&&(n=e.id,r=h.getLastSavedState(),i=r.id,t=n===i),t},h.saveState=function(e){return h.isLastSavedState(e)?!1:(h.savedStates.push(h.cloneObject(e)),!0)},h.getStateByIndex=function(e){var t=null;return typeof e=="undefined"?t=h.savedStates[h.savedStates.length-1]:e<0?t=h.savedStates[h.savedStates.length+e]:t=h.savedStates[e],t},h.getCurrentIndex=function(){var e=null;return h.savedStates.length<1?e=0:e=h.savedStates.length-1,e},h.getHash=function(e){var t=h.getLocationHref(e),n;return n=h.getHashByUrl(t),n},h.unescapeHash=function(e){var t=h.normalizeHash(e);return t=decodeURIComponent(t),t},h.normalizeHash=function(e){var t=e.replace(/[^#]*#/,"").replace(/#.*/,"");return t},h.setHash=function(e,t){var n,i;return t!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:t}),!1):(h.busy(!0),n=h.extractState(e,!0),n&&!h.emulated.pushState?h.pushState(n.data,n.title,n.url,!1):h.getHash()!==e&&(h.bugs.setHash?(i=h.getPageUrl(),h.pushState(null,null,i+"#"+e,!1)):r.location.hash=e),h)},h.escapeHash=function(t){var n=h.normalizeHash(t);return n=e.encodeURIComponent(n),h.bugs.hashEscape||(n=n.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),n},h.getHashByUrl=function(e){var t=String(e).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return t=h.unescapeHash(t),t},h.setTitle=function(e){var t=e.title,n;t||(n=h.getStateByIndex(0),n&&n.url===e.url&&(t=n.title||h.options.initialTitle));try{r.getElementsByTagName("title")[0].innerHTML=t.replace("<","<").replace(">",">").replace(" & "," & ")}catch(i){}return r.title=t,h},h.queues=[],h.busy=function(e){typeof e!="undefined"?h.busy.flag=e:typeof h.busy.flag=="undefined"&&(h.busy.flag=!1);if(!h.busy.flag){u(h.busy.timeout);var t=function(){var e,n,r;if(h.busy.flag)return;for(e=h.queues.length-1;e>=0;--e){n=h.queues[e];if(n.length===0)continue;r=n.shift(),h.fireQueueItem(r),h.busy.timeout=o(t,h.options.busyDelay)}};h.busy.timeout=o(t,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(e){return e.callback.apply(e.scope||h,e.args||[])},h.pushQueue=function(e){return h.queues[e.queue||0]=h.queues[e.queue||0]||[],h.queues[e.queue||0].push(e),h},h.queue=function(e,t){return typeof e=="function"&&(e={callback:e}),typeof t!="undefined"&&(e.queue=t),h.busy()?h.pushQueue(e):h.fireQueueItem(e),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(u(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(e){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=o(function(){return h.doubleCheckClear(),h.stateChanged||e(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var t=h.extractState(h.getLocationHref()),n;if(!h.isLastSavedState(t))return n=t,n||(n=h.createStateObject()),h.Adapter.trigger(e,"popstate"),h;return},h.back=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),p.go(-1),!0)},h.forward=function(e){return e!==!1&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:e}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),p.go(1),!0)},h.go=function(e,t){var n;if(e>0)for(n=1;n<=e;++n)h.forward(t);else{if(!(e<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(n=-1;n>=e;--n)h.back(t)}return h};if(h.emulated.pushState){var v=function(){};h.pushState=h.pushState||v,h.replaceState=h.replaceState||v}else h.onPopState=function(t,n){var r=!1,i=!1,s,o;return h.doubleCheckComplete(),s=h.getHash(),s?(o=h.extractState(s||h.getLocationHref(),!0),o?h.replaceState(o.data,o.title,o.url,!1):(h.Adapter.trigger(e,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",t,n)||!1,r?i=h.getStateById(r):h.expectedStateId?i=h.getStateById(h.expectedStateId):i=h.extractState(h.getLocationHref()),i||(i=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(i)?(h.busy(!1),!1):(h.storeState(i),h.saveState(i),h.setTitle(i),h.Adapter.trigger(e,"statechange"),h.busy(!1),!0))},h.Adapter.bind(e,"popstate",h.onPopState),h.pushState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.pushState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0},h.replaceState=function(t,n,r,i){if(h.getHashByUrl(r)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(i!==!1&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:i}),!1;h.busy(!0);var s=h.createStateObject(t,n,r);return h.isLastSavedState(s)?h.busy(!1):(h.storeState(s),h.expectedStateId=s.id,p.replaceState(s.id,s.title,s.url),h.Adapter.trigger(e,"popstate")),!0};if(s){try{h.store=l.parse(s.getItem("History.store"))||{}}catch(m){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(e,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),s&&(h.onUnload=function(){var e,t,n;try{e=l.parse(s.getItem("History.store"))||{}}catch(r){e={}}e.idToState=e.idToState||{},e.urlToId=e.urlToId||{},e.stateToId=e.stateToId||{};for(t in h.idToState){if(!h.idToState.hasOwnProperty(t))continue;e.idToState[t]=h.idToState[t]}for(t in h.urlToId){if(!h.urlToId.hasOwnProperty(t))continue;e.urlToId[t]=h.urlToId[t]}for(t in h.stateToId){if(!h.stateToId.hasOwnProperty(t))continue;e.stateToId[t]=h.stateToId[t]}h.store=e,h.normalizeStore(),n=l.stringify(e);try{s.setItem("History.store",n)}catch(i){if(i.code!==DOMException.QUOTA_EXCEEDED_ERR)throw i;s.length&&(s.removeItem("History.store"),s.setItem("History.store",n))}},h.intervalList.push(a(h.onUnload,h.options.storeInterval)),h.Adapter.bind(e,"beforeunload",h.onUnload),h.Adapter.bind(e,"unload",h.onUnload));if(!h.emulated.pushState){h.bugs.safariPoll&&h.intervalList.push(a(h.safariStatePoll,h.options.safariPollInterval));if(i.vendor==="Apple Computer, Inc."||(i.appCodeName||"")==="Mozilla")h.Adapter.bind(e,"hashchange",function(){h.Adapter.trigger(e,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(e,"hashchange")})}},(!h.options||!h.options.delayInit)&&h.init()}(window)
\ No newline at end of file diff --git a/website/resources/js/main.js b/website/resources/js/main.js new file mode 100644 index 00000000..f07da70d --- /dev/null +++ b/website/resources/js/main.js @@ -0,0 +1,100 @@ +"use strict"; + +(function($) { + function clickToTap() { + if (matchMedia && matchMedia('(hover: none)').matches) $(".clickToTap").each(function() { + var x = $(this); + if (x.text() === "Click") x.text("Tap"); + else x.text("tap"); + }); + } + + function clickForVideo() { + var cfv = $("#clickForVideo"); + var f = function() { + if (!cfv.is(":visible")) return; + cfv.hide(); + $("#demoVideo").show().get(0).play(); + }; + + cfv.css("cursor", "pointer").on("click", f).on("touchstart", function() { + $(this).data("moved", 0); + }).on("touchmove", function() { + $(this).data("moved", 1); + }).on("touchend", function() { + if ($(this).data("moved") === 0) f(); + }); + } + + function toKey(href) { + var lnk = "__savedContent_" + href.replace(/\//g, '_'); + if (lnk.substring(lnk.length - 5) === ".html") lnk = lnk.substring(0, lnk.length - 5); + return lnk; + } + + function captureLinkClick() { + var self = $(this); + if (self.data("clc")) return; + var href = self.attr("href"); + self.data("clc", true); + 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) { + evt.preventDefault(); + var key = toKey(window.location.pathname); + if ($("#" + key).length < 1) { + var d = $("<div />").attr("id", key).append($("#main-section").contents()).hide(); + $("body").append(d); + } + History.pushState({urlPath: href}, self.text(), href); + }); + } + + function collapseMenu() { + if ($(".navbar-collapse").is(".in")) $(".navbar-toggle").click(); + } + + function ajaxFeaturePages() { + if (!History.enabled) return; + History.replaceState({urlPath: window.location.pathname}, $("title").text(), History.getState().urlpath); + + $("a").each(captureLinkClick); + + $(window).on("statechange", function() { + var hs = History.getState(); + var u = hs.data.urlPath; + if (u === "/" || u === "") u = "/main.html"; + if (u.substring(u.length - 5) !== ".html") u += ".html"; + if (u.substring(u.length - 8) === "all.html") u = u.substring(0, u.length - 8) + "index.html"; + var key = toKey(u); + var sc = $("#" + key); + if (sc.length > 0) { + var a = $("#main-section"); + sc.show().attr("id", "main-section").attr("class", "container-fluid main-section"); + a.replaceWith(sc); + collapseMenu(); + } else { + $.ajax({ + url: u, + success: function(response) { + var x = '<div class="container-fluid main-section" id="main-section">'; + var y = '<footer'; + var start = response.indexOf(x); + var end = response.indexOf(y); + var newH = $(response.substr(start, end - start)); + $("#main-section").replaceWith(newH); + collapseMenu(); + $("a").each(captureLinkClick); + }, error: function() { + window.location = u; + } + }); + } + }); + } + + $(ajaxFeaturePages); + $(clickToTap); + $(clickForVideo); +})($); 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 = $("<img>").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 = $("<div>").addClass("formSubmitOk").html("Thank you for ordering a Project Lombok license! We'll send your bill via email. If you have any further questions please contact us at <a href=\"mailto:orders@projectlombok.org\"><code>orders@projectlombok.org</code></a>."); + spinner.replaceWith(okMsg); + }; + + var onFailure = function() { + $("#orderHelp").hide(); + var errMsg = $("<div>").addClass("formSubmitFail").html("Our order form appears to be broken. Could you do us a favour and contact us at <a href=\"mailto:orders@projectlombok.org\"><code>orders@projectlombok.org</code></a>? 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 />"); + 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..07319226 --- /dev/null +++ b/website/resources/js/supporters.js @@ -0,0 +1,223 @@ +"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 = $("<div />").addClass("supportItem").addClass(this.type); + var a = d; + if (this.url) { + a = $("<a />").attr("href", this.url).attr("rel", "noopener").attr("target", "_blank"); + d.append(a); + } + var n = $("<span />").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 = $("<div />").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 = $("<img />").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($("<div />").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; + if (!len) return; + + var pos = 0; + var c = [], cd = []; + for (var i = 0; i < supPerBar; i++) { + c[i] = null; + cd[i] = $("<div />").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 = $("<div />").addClass("row"); + var h = $("<h2 />").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 = $("<div />").addClass("noSupportersBox").html( + "We don't have any supporters yet this month.<br /><a href=\"https://patreon.com/lombok\" rel=\"noopener\">Become a patron</a> " + + "or <a href=\"/order-license-info\">order a professional or enterprise license</a> today!"); + s.append(x); + } + } + + $(applySupporters); +})($);
\ No newline at end of file diff --git a/website/resources/robots.txt b/website/resources/robots.txt new file mode 100644 index 00000000..af2eebd5 --- /dev/null +++ b/website/resources/robots.txt @@ -0,0 +1,2 @@ +User-Agent: * +Disallow: /tmp/ diff --git a/website/robbertjan.jpg b/website/robbertjan.jpg Binary files differdeleted file mode 100644 index a0839e6c..00000000 --- a/website/robbertjan.jpg +++ /dev/null diff --git a/website/sander.jpg b/website/sander.jpg Binary files differdeleted file mode 100644 index f3be1b28..00000000 --- a/website/sander.jpg +++ /dev/null diff --git a/website/setup/android.html b/website/setup/android.html deleted file mode 100644 index 9edb9c95..00000000 --- a/website/setup/android.html +++ /dev/null @@ -1,131 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <script src="../logi/jQuery-all.js" type="text/javascript"></script> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../index.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok</title> - <!--[if lt IE 7]><script type="text/javascript" src="../logi/iepngfix_tilebg.js"></script><![endif]--> -</head><body> - <a id="forkMe" href="https://github.com/rzwitserloot/lombok"><img style="position: absolute; top: 0; right: 0; border: 0;" src="//s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a> - <div class="meat"> - <h1><a href="/">Project Lombok</a> - android instructions</h1> - <div id="buttonBar" class="buttonBar"> - <a class="button" href="../features/index.html"> - <img src="../icon_overview.png" /> - <span>Feature Overview</span> - </a> - <a class="button" href="https://groups.google.com/group/project-lombok"> - <img src="../icon_discussion.png" /> - <span>Discuss / Help</span> - </a> - <a class="button" href="https://wiki.github.com/rzwitserloot/lombok/contributing"> - <img src="../icon_contribute.png" /> - <span>Contribute</span> - </a> - <a class="button" href="https://github.com/rzwitserloot/lombok/issues"> - <img src="../icon_bugs.png" /> - <span>Report an issue</span> - </a> - <div class="downloadContainer"> - <a class="downloadLink" id="downloadLink" href="../download.html"> - <img src="../icon_download.png" /> - <span>Download!</span> - </a> - <div class="versionInfo"> - Version: @VERSION@ | <a href="../changelog.html">changelog</a> - </div> - </div> - </div> - <div class="downloadHelp"> - <p> - Android development with lombok is possible. Lombok should be a compile-time only dependency, as otherwise - the entirety of lombok will end up in your DEX files, wasting precious space on android devices. Also, errors will occur due - to the native libraries present in lombok.jar itself. Unfortunately, android does not (yet) understand the concept of a - compile-time-only dependency, so you need to mess with your build files to make it work. - </p><p> - Android also does not have a complete JRE library stack; in particular, it does not have the <code>@java.beans.ConstructorProperties</code> annotation, therefore you have to stop lombok from generating these: - <ul> - <li>The <code>suppressConstructorProperties</code> property can be set to <code>false</code> when using <a href="/features/Constructor.html">@XArgsConstructor Annotations</a>.</li> - <li>Starting with Lombok <code>>= 1.14.0</code> you can instead a <code>lombok.config</code> file to the root of your project to disable <code>ConstructorProperties</code> project wide. Add the following line to <code>lombok.config</code>:<br /> - <pre>lombok.anyConstructor.suppressConstructorProperties = true</pre><br /> - See the <a href="/features/configuration.html">configuration</a> documentation for more information on how to set up your project with a lombok config file. - </ul> - </p><p> - The instructions listed below are excerpts from <a href="https://github.com/excilys/androidannotations/wiki/Cookbook">The - AndroidAnnotations project cookbook</a>. You may wish to refer to that documentation for complete instructions; lombok is just - the equivalent to <code>androidannotations-VERSION.jar</code>; there is no <code>-api</code> aspect. - </p> - <h3>Eclipse</h3> - <div> - In eclipse, create a 'lightweight' lombok jar that contains only the annotations by running:<br /><br /> - <pre> -java -jar lombok.jar publicApi</pre> - Then, add the <code>lombok-api.jar</code> file created by running this command - to your android project instead of the complete <code>lombok.jar</code>, and, - as usual, install lombok into eclipse by double-clicking <code>lombok.jar</code>. - </div> - <h3>Ant</h3> - <div> - <ul> - <li>Find <code>build.xml</code> in <code>${ANDROID_SDK_ROOT}/tools/ant/build.xml</code> and copy the <code>-compile</code> target into the paste buffer. - <li>Copy this to the <code>build.xml</code> of your own project, right before the <code><import file="${sdk.dir}/tools/ant/build.xml"></code> line. - <li>Create a <code>compile-libs</code> directory in your own project and copy the complete <code>lombok.jar</code> to it. - <li>Now modify the <code><classpath></code> entry inside the <code><javac></code> task in the <code>-compile</code> target you just copied:<br /> - add <code><fileset dir="compile-libs" includes="*.jar" /></code> to it. - </ul> - </div> - <h3>Maven</h3> - <div> - You should be able to just follow the normal <a href="../mavenrepo/index.html">lombok with maven instructions</a>.<br /> - Note that if you use android, eclipse, and maven together you may have to replace <code>lombok.jar</code> in your eclipse android project's build path - (which you can modify in that project's properties page) with <code>lombok-api.jar</code>, as produced in the procedure explained for <em>Eclipse</em>, - above. - </div> - <h3>Gradle</h3> - <div> - <ul> - <li>Make sure that the version of your android plugin is <code>>= 0.4.3</code></li> - <li>Add Lombok to your application's <code>dependencies</code> block:<br /><br /> -<pre> - provided "org.projectlombok:lombok:1.12.6" -</pre> - </li> - <li>When using <a href="https://bitbucket.org/hvisser/android-apt">android-apt</a>, you also have to specify Lombok as an annotation processor (with the <code>apt</code> directive) in the <code>dependencies</code> block:<br /><br /> -<pre> - provided "org.projectlombok:lombok:1.12.6" - apt "org.projectlombok:lombok:1.12.6" -</pre> - </li> - </ul> - </div> - <h3>Android Studio</h3> - <div> - Follow the previous instructions (<em>Gradle</em>). In addition to setting up your gradle project correctly, you need to add the <a href="https://plugins.jetbrains.com/plugin/6317">Lombok IntelliJ plugin</a> to add lombok support to Android Studio: - <ul> - <li>Go to <code>File > Settings > Plugins</code></li> - <li>Click on <code>Browse repositories...</code></li> - <li>Search for <code>Lombok Plugin</code></li> - <li>Click on <code>Install plugin</code></li> - <li>Restart Android Studio</li> - </ul> - </div> - <div class="endBar"> - </div> - <div class="footer"> - <a href="../credits.html" class="creditsLink">credits</a> | Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>. - </div> - </div> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> -</body></html> diff --git a/website/setup/ecj.html b/website/setup/ecj.html deleted file mode 100644 index cc70c566..00000000 --- a/website/setup/ecj.html +++ /dev/null @@ -1,89 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <script src="../logi/jQuery-all.js" type="text/javascript"></script> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../index.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok</title> - <!--[if lt IE 7]><script type="text/javascript" src="../logi/iepngfix_tilebg.js"></script><![endif]--> -</head><body> - <a id="forkMe" href="https://github.com/rzwitserloot/lombok"><img style="position: absolute; top: 0; right: 0; border: 0;" src="//s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a> - <div class="meat"> - <h1><a href="/">Project Lombok</a> - ecj instructions</h1> - <div id="buttonBar" class="buttonBar"> - <a class="button" href="../features/index.html"> - <img src="../icon_overview.png" /> - <span>Feature Overview</span> - </a> - <a class="button" href="https://groups.google.com/group/project-lombok"> - <img src="../icon_discussion.png" /> - <span>Discuss / Help</span> - </a> - <a class="button" href="https://wiki.github.com/rzwitserloot/lombok/contributing"> - <img src="../icon_contribute.png" /> - <span>Contribute</span> - </a> - <a class="button" href="https://github.com/rzwitserloot/lombok/issues"> - <img src="../icon_bugs.png" /> - <span>Report an issue</span> - </a> - <div class="downloadContainer"> - <a class="downloadLink" id="downloadLink" href="../download.html"> - <img src="../icon_download.png" /> - <span>Download!</span> - </a> - <div class="versionInfo"> - Version: @VERSION@ | <a href="../changelog.html">changelog</a> - </div> - </div> - </div> - <div class="downloadHelp"> - ecj (the eclipse standalone compiler) is compatible with lombok. Use the following command line to enable lombok with ecj: - <p> - <pre>java <strong>-javaagent:lombok.jar=ECJ</strong> -jar ecj.jar -cp lombok.jar -source 1.8 <em class="note">(rest of arguments)</em></pre> - <p> - You may have to add the following VM argument, if you're using an older version of lombok or java: - <pre><strong>-Xbootclasspath/p:lombok.jar</strong></pre> - <p> - If you're using a tool based on ecj, adding these VM arguments and adding lombok.jar to the classpath should work. - </div> - <div class="separator"> - </div> - <div class="downloadHelp"> - <h3>Using ecj with Maven</h3> - <p> - It is possible to <a href="pom.xml">configure</a> <code>maven-compiler-plugin</code> with <code>maven-dependency-plugin</code> and <code>plexus-compiler-eclipse</code>. - </p> - <p> - Before the <code>compile</code> phase, you will have to set your <code>MAVEN_OPTS</code> environment variable to include the <code>javaagent</code> argument. - In the example below, <code>target</code> is your <code>${project.build.directory}</code>. - </p> - <p> - Use the following commands in sequence to enable lombok with ecj in your Maven build: -<pre> -mvn clean <strong>dependency:copy@get-lombok</strong> -set MAVEN_OPTS=<strong>-javaagent:target/lombok.jar=ECJ</strong> <em class="note">(or your OS's equivalent)</em> -mvn install -set MAVEN_OPTS= <em class="note">(or your OS's equivalent)</em> -</pre> - </p> - </div> - <div class="endBar"> - </div> - <div class="footer"> - <a href="../credits.html" class="creditsLink">credits</a> | Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>. - </div> - </div> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> -</body></html> diff --git a/website/setup/gwt.html b/website/setup/gwt.html deleted file mode 100644 index d7bcad56..00000000 --- a/website/setup/gwt.html +++ /dev/null @@ -1,68 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <script src="../logi/jQuery-all.js" type="text/javascript"></script> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../index.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok</title> - <!--[if lt IE 7]><script type="text/javascript" src="../logi/iepngfix_tilebg.js"></script><![endif]--> -</head><body> - <a id="forkMe" href="https://github.com/rzwitserloot/lombok"><img style="position: absolute; top: 0; right: 0; border: 0;" src="//s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a> - <div class="meat"> - <h1><a href="/">Project Lombok</a> - gwt instructions</h1> - <div id="buttonBar" class="buttonBar"> - <a class="button" href="../features/index.html"> - <img src="../icon_overview.png" /> - <span>Feature Overview</span> - </a> - <a class="button" href="https://groups.google.com/group/project-lombok"> - <img src="../icon_discussion.png" /> - <span>Discuss / Help</span> - </a> - <a class="button" href="https://wiki.github.com/rzwitserloot/lombok/contributing"> - <img src="../icon_contribute.png" /> - <span>Contribute</span> - </a> - <a class="button" href="https://github.com/rzwitserloot/lombok/issues"> - <img src="../icon_bugs.png" /> - <span>Report an issue</span> - </a> - <div class="downloadContainer"> - <a class="downloadLink" id="downloadLink" href="../download.html"> - <img src="../icon_download.png" /> - <span>Download!</span> - </a> - <div class="versionInfo"> - Version: @VERSION@ | <a href="../changelog.html">changelog</a> - </div> - </div> - </div> - <div class="downloadHelp"> - gwt (Google Web Toolkit) is compatible with lombok. - <p> - Edit your proj-debug and proj-compile batch scripts to add the following VM arguments: - <pre> -java <strong>-javaagent:lombok.jar=ECJ</strong> <em>(rest of arguments)</em> - </pre> - <p> - Thanks to Stephen Haberman for figuring this out. - </div> - <div class="endBar"> - </div> - <div class="footer"> - <a href="../credits.html" class="creditsLink">credits</a> | Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>. - </div> - </div> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> -</body></html> diff --git a/website/setup/netbeans.html b/website/setup/netbeans.html deleted file mode 100644 index 4ef1d392..00000000 --- a/website/setup/netbeans.html +++ /dev/null @@ -1,65 +0,0 @@ -<!DOCTYPE html> -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <script src="../logi/jQuery-all.js" type="text/javascript"></script> - <link rel="stylesheet" type="text/css" href="../logi/reset.css" /> - <link rel="stylesheet" type="text/css" href="../index.css" /> - <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" /> - <meta name="description" content="Spice up your java" /> - <title>Project Lombok</title> - <!--[if lt IE 7]><script type="text/javascript" src="../logi/iepngfix_tilebg.js"></script><![endif]--> -</head><body> - <a id="forkMe" href="https://github.com/rzwitserloot/lombok"><img style="position: absolute; top: 0; right: 0; border: 0;" src="//s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a> - <div class="meat"> - <h1><a href="/">Project Lombok</a> - NetBeans instructions</h1> - <div id="buttonBar" class="buttonBar"> - <a class="button" href="../features/index.html"> - <img src="../icon_overview.png" /> - <span>Feature Overview</span> - </a> - <a class="button" href="https://groups.google.com/group/project-lombok"> - <img src="../icon_discussion.png" /> - <span>Discuss / Help</span> - </a> - <a class="button" href="https://wiki.github.com/rzwitserloot/lombok/contributing"> - <img src="../icon_contribute.png" /> - <span>Contribute</span> - </a> - <a class="button" href="https://github.com/rzwitserloot/lombok/issues"> - <img src="../icon_bugs.png" /> - <span>Report an issue</span> - </a> - <div class="downloadContainer"> - <a class="downloadLink" id="downloadLink" href="../download.html"> - <img src="../icon_download.png" /> - <span>Download!</span> - </a> - <div class="versionInfo"> - Version: @VERSION@ | <a href="../changelog.html">changelog</a> - </div> - </div> - </div> - <div class="downloadHelp"> - <ol> - <li>Add <code>lombok.jar</code> to the project Libraries.</li> - <li>In the project Properties, in the section Build – Compiling, check the 'Enable Annotation Processing in Editor' checkbox.</li> - </ol> - <img src="netbeans-enable-annotation-processing-in-editor.png" /> - </div> - <div class="endBar"> - </div> - <div class="footer"> - <a href="../credits.html" class="creditsLink">credits</a> | Copyright © 2009-2016 The Project Lombok Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT license</a>. - </div> - </div> - <script type="text/javascript"> - var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); - document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); - </script> - <script type="text/javascript"> - try { - var pageTracker = _gat._getTracker("UA-9884254-1"); - pageTracker._trackPageview(); - } catch(err) {} - </script> -</body></html> diff --git a/website/templates/_download-edge.html b/website/templates/_download-edge.html new file mode 100644 index 00000000..e7eb856c --- /dev/null +++ b/website/templates/_download-edge.html @@ -0,0 +1,18 @@ +<#import "/_scaffold.html" as main> +<@main.scaffold title="snapshot"> + <div class="page-header top5"> + <div class="row text-center versionInfo"> + <@main.h1 title="Download 'Edgy Guinea Pig' - the Lombok Cutting Edge build" /> + </div><div class="row versionInfo"> + version: ${version} (${timestampString}) + </div><div class="row" id="changelog"> + ${changelogEdge?no_esc} + </div><div class="row text-center"> + <h2><a href="/lombok-edge.jar" id="downloadLink">Download edge release now!</a></h2> + </div><div class="row text-center"> + <p> + Cutting edge a bit too gutsy for you? You can grab the <a href="download.html">stable release</a> instead. + </p> + </div> + </div> +</@main.scaffold> diff --git a/website/templates/_scaffold.html b/website/templates/_scaffold.html new file mode 100644 index 00000000..8bb22635 --- /dev/null +++ b/website/templates/_scaffold.html @@ -0,0 +1,156 @@ +<#macro feature title href> + <div class="bs-callout bs-callout-danger"> + <h4><a href="${href}"><code>${title}</code></a></h4> + <p><#nested></p> + </div> +</#macro> + +<#assign setupTargets = { + "Compilers": { + "Javac": "javac", + "ECJ": "ecj" + }, + "Build tools": { + "maven": "maven", + "gradle": "gradle", + "ant": "ant", + "kobalt": "kobalt" + }, + "IDEs": { + "Eclipse": "eclipse", + "IntelliJ IDEA": "intellij", + "Netbeans": "netbeans", + "MyEclipse": "eclipse", + "Spring Tool Suite": "eclipse", + "JBoss Developer Studio": "eclipse", + "Visual Studio Code": "vscode" + }, + "Platforms": { + "Android": "android", + "GWT": "gwt" + } +}> + +<#macro scaffold load=[] title='Project Lombok'> + <!DOCTYPE html> + <html lang="en"> + <head> + <meta charset="utf-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> + <meta name="google-site-verification" content="uCgX3Or3kDRGpbJ6JCsQc3Ub4JsnR5-p0itfsKAYZ_U" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <link href="/favicon.ico" rel="icon" type="image/x-icon" /> + + <title>${title}</title> + + <script src="//cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script> + + <link href="/css/bootstrap.css" rel="stylesheet" /> + <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" /> + + <link href="/css/custom.css" rel="stylesheet" /> + + <#list load as ld> + <#if ld?ends_with(".css")> + <link href="${ld?url_path}" rel="stylesheet" /> + </#if> + </#list> + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> + <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.2.0/js/bootstrap.min.js"></script> + + <script src="/js/history.js"></script> + <script src="/js/main.js"></script> + <#list load as ld> + <#if ld?ends_with(".js")> + <script src="${ld?url_path}"></script> + </#if> + </#list> + </head><body> + <script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ +(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), +m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) +})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); +ga('create', 'UA-9884254-1', 'auto'); +ga('send', 'pageview'); + </script> + <div class="navbar navbar-default navbar-fixed-top"> + <div class="container"> + <div class="navbar-header"> + <a href="/" class="navbar-brand">Lombok Project</a> + <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + </div> + <div class="navbar-collapse collapse" id="navbar-main"> + <ul class="nav navbar-nav"> + <li class="dropdown"> + <a class="dropdown-toggle pointer" data-toggle="dropdown">Features<span class="caret"></span></a> + <ul class="dropdown-menu" aria-labelledby="themes"> + <li><a href="/features/all">Stable</a></li> + <li><a href="/features/experimental/all">Experimental</a></li> + </ul> + </li> + <li class="dropdown"> + <a class="dropdown-toggle pointer" data-toggle="dropdown">Community<span class="caret"></span></a> + <ul class="dropdown-menu" aria-labelledby="themes"> + <li><a href="https://groups.google.com/group/project-lombok" rel="noopener">Discuss / Help</a></li> + <li><a href="https://github.com/rzwitserloot/lombok/issues" rel="noopener">Issues</a></li> + <li><a href="/contributing">Contribute</a></li> + </ul> + </li> + <li> + <a href="/order-license-info"> + <span>Order / Donate</span> + </a> + </li> + <li class="dropdown"> + <a href="/setup/overview" class="smallOnly"><span>Install</span></a> + <a class="dropdown-toggle pointer wideOnly" data-toggle="dropdown">Install<span class="caret"></span></a> + <ul class="dropdown-menu" aria-labelledby="themes"> + <#list setupTargets as cat, tgtList> + <li class="header">${cat}</li> + <#list tgtList as name, url> + <li class="target"><a href="/setup/${url}">${name}</a></li> + </#list> + <#sep><li class="divider"></li></#sep> + </#list> + </ul> + </li> + <li><a href="/download">Download</a></li> + </ul> + </div> + </div> + </div> + <div class="container-fluid main-section" id="main-section"> + <#nested> + </div> + <footer class="container"> + <footer class="footer text-center"> + <div class="container"> + <a href="/credits">credits</a> | Copyright © 2009-${year} The Project Lombok + Authors, licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT + license</a>. + </div> + </footer> + </footer> + </body> +</html> +</#macro> + +<#macro h1 title class=""> +<#assign idvalue="*"?no_esc + "${title}"/> +<h1 class="${class}" id="${idvalue?markup_string?replace("[ _]", "-", "r")?lower_case?replace("[^a-zA-Z0-9-]", "", "r")}">${title}</h1> +</#macro> + +<#macro h2 title class=""> +<#assign idvalue="*"?no_esc + "${title}"/> +<h2 class="${class}" id="${idvalue?markup_string?replace("[ _]", "-", "r")?lower_case?replace("[^a-zA-Z0-9-]", "", "r")}">${title}</h2> +</#macro> + +<#macro h3 title class=""> +<#assign idvalue="*"?no_esc + "${title}"/> +<h3 class="${class}" id="${idvalue?markup_string?replace("[ _]", "-", "r")?lower_case?replace("[^a-zA-Z0-9-]", "", "r")}">${title}</h3> +</#macro> diff --git a/website/templates/all-versions.html b/website/templates/all-versions.html new file mode 100644 index 00000000..0207b351 --- /dev/null +++ b/website/templates/all-versions.html @@ -0,0 +1,31 @@ +<#import "/_scaffold.html" as main> +<@main.scaffold title="older versions"> + <div class="page-header top5"> + <div> + <div> + <h1 class="text-center"> + <div class="row"> + <icon class="fa fa-download"></icon> + <a class="currentVersion" href="downloads/lombok.jar"> + ${version} [Current Version] + </a> + </div> + </h1> + </div> + <#list linksToVersions as lnk> + <div class="row"> + <icon class="fa fa-download"></icon> + <a class="oldVersion" href="${lnk[0]}">${lnk[1]}</a> + </div> + </#list> + <div class="row"> + <div class="text-center"> + <h3> + Feeling adventurous? Download the latest <a href="/download-edge">snapshot</a> + release. + </h3> + </div> + </div> + </div> + </div> +</@main.scaffold> diff --git a/website/templates/changelog.html b/website/templates/changelog.html new file mode 100644 index 00000000..79ba7b2a --- /dev/null +++ b/website/templates/changelog.html @@ -0,0 +1,8 @@ +<#import "/_scaffold.html" as main> +<@main.scaffold title="changelog"> + <div class="page-header top5"> + <div class="row text-center changelog"> + ${changelog?no_esc} + </div> + </div> +</@main.scaffold> diff --git a/website/templates/contributing.html b/website/templates/contributing.html new file mode 100644 index 00000000..16d68f32 --- /dev/null +++ b/website/templates/contributing.html @@ -0,0 +1,40 @@ +<#import "/_scaffold.html" as main> + +<@main.scaffold title="Contribute"> + <div class="page-header top5"> + <div class="row text-center"> + <@main.h1 title="Contributing to Project Lombok's development" /> + </div><div class="row"> + You can choose to <a href="/order-license-info">become a project lombok licensee or support us on patreon</a>. + </div> + <div class="row text-center"> + <@main.h1 title="How to work on Project Lombok yourself" /> + </div><div class="row"> + Project Lombok is being developed via the <a href="https://github.com/rzwitserloot/lombok">lombok git repository on github</a>. + </div><div class="row"> + <p> + If you want to start development on lombok, clone the repository and run <code>ant eclipse</code> or <code>ant intellij</code>, then open the working directory as a project in eclipse / intellij. Because the main contributors of lombok all use eclipse, that'll probably work a little more smoothly. + </p><p> + To produce a lombok jar, run <code>ant dist</code>; in general run <code>ant -p</code>; there's lots of stuff there, including downloading various versions of java runtimes to run the test suite against, and building this website. + </p> + </div><div class="row text-center"> + <@main.h2 title="Adding your own handlers and annotations to Lombok" /> + </div><div class="row"> + <p> + If you want to extend lombok, we advise that you fork lombok and add handlers directly into the same place and package that lombok's handlers are in (<code>lombok.javac.handlers</code> and <code>lombok.eclipse.handlers</code>) – lombok does some fancy footwork to ensure various modular class loading systems don't interface with finding the lombok classes, but that system is not (currently) easily expanded to include separate jars. + </p> + </div><div class="row text-center"> + <@main.h2 title="Contributing to Project Lombok" /> + </div><div class="row"> + <p> + To create new features and add them to project lombok itself, send us pull requests via github. However, before you start, discuss the feature or fix you'd like to contribute, preferably via the <a href="https://groups.google.com/forum/#!forum/project-lombok">Project Lombok Forum</a>. If you're going to add a new feature, make sure to post 2 snippets (one with the annotation, the other with what that would generate), similar to how the feature pages list 'with lombok' and 'without lombok' variants. + </p><p> + We've considered many designs and features amongst ourselves and with the community, and often there are complications or interesting design choices that have already been mentioned. We'd like to share them with you before you set out. + </p><p> + Pull requests for new features that haven't been discussed are unlikely to be accepted. Of course, if you've already built a proof of concept implementation prior to bringing a new idea to the forum, we'll take it that much more seriously. + </p><p> + Happy coding! + </p> + </div> + </div> +</@main.scaffold> diff --git a/website/templates/credits.html b/website/templates/credits.html new file mode 100644 index 00000000..3390d762 --- /dev/null +++ b/website/templates/credits.html @@ -0,0 +1,50 @@ +<#import "/_scaffold.html" as main> + +<@main.scaffold title="Credits"> + <div class="page-header top5"> + <div class="row text-center"> + <@main.h1 title="Project Lombok - About the authors and everyone that's helped us create Project Lombok." /> + </div> + <div class="row"> + <div class="credits"> + <div class="committers personList"> + <@main.h3 title="Regular contributors to Project Lombok:" /> + + <div class="row text-center"> + <div class="person col-md-2"> + <div class="imgCt"><img class="reinierImg" src="/img/reinier.jpg" /></div> + <span class="name">Reinier Zwitserloot</span> + </div> + <div class="person col-md-2"> + <div class="imgCt"><img class="roelImg" src="/img/roel.jpg" /></div> + <span class="name">Roel Spilker</span> + </div> + </div> + </div> + <div class="thanks"> + We'd like to thank: + <ul> + <li> + <strong>Perry Nguyen</strong> (pfn on ##java on freenode) for creating the inspiration for project lombok. + </li><li> + <strong>Tor Norbye</strong>, <strong>Jan Lahoda</strong>, and <strong>Petr Jiricka</strong> for helping out with Netbeans internals and/or javac. + </li><li> + All contributors who submitted patches or helped answering questions!</li> + </ul> + + as well as the authors of the following tools that we use: + + <ul> + <li> + <a href="https://github.com/">Github</a> for hosting lombok's repository and issue tracker. + </li><li> + The <a href="http://asm.ow2.org/index.html">ASM team</a> at ObjectWeb for creating an excellent class file editing tool. Lombok uses ASM to interact with Eclipse. + </li><li> + <strong>Markus Gebhard</strong> for creating <a href="http://java2html.de/">java2html</a> which we use for the example code snippets on the features pages. + </li> + </ul> + </div> + </div> + </div> + </div> +</@main.scaffold> diff --git a/website/templates/disable-checked-exceptions.html b/website/templates/disable-checked-exceptions.html new file mode 100644 index 00000000..4a758b11 --- /dev/null +++ b/website/templates/disable-checked-exceptions.html @@ -0,0 +1,28 @@ +<#import "/_scaffold.html" as main> + +<@main.scaffold title="Disable Checked Exceptions"> + <div class="page-header top5"> + <div class="row text-center"> + <h1 class="text-center">Tired of checked exceptions?</h1> + </div> + <div class="row"> + <p> + This lombok spinoff project consists of a hack that only works in javac - not eclipse or any other IDE.<br /> + It will completely disable the notion of checked exceptions. You may throw any exception anywhere, and you may also catch any exception anywhere. In standard javac, you may not catch a checked exception that is not declared as thrown by at least 1 statement in your try block, unless it is <code>Exception</code> or <code>Throwable</code>.<br /> + This restriction is lifted as well. + </p> + </div> + <div class="row"> + <h2 class="text-center">Usage</h2> + + <p> + Just make sure <code>disableCheckedExceptions-alpha.jar</code> is on the classpath as you compile. For example:<br /> + <code>javac -cp disableCheckedExceptions-alpha.jar MySource.java</code> + </p><p> + Ready to try it out? download it here: <a href="/downloads/disableCheckedExceptions-alpha.jar">disableCheckedExceptions-alpha.jar</a> + </p><p> + Want to know how its done? Grab the lombok repository <a href="https://github.com/rzwitserloot/lombok/tree/disableCheckedExceptions">here on github</a>, and look in the <code>experimental</code> directory. + </p> + </div> + </div> +</@main.scaffold> diff --git a/website/templates/download-edge.html b/website/templates/download-edge.html new file mode 100644 index 00000000..22044842 --- /dev/null +++ b/website/templates/download-edge.html @@ -0,0 +1,8 @@ +<#import "/_scaffold.html" as main> +<@main.scaffold title="snapshot"> + <div class="page-header top5"> + <div class="row text-center versionInfo"> + No edge build has been released since the last <a href="/download">stable release</a> of lombok. + </div> + </div> +</@main.scaffold> diff --git a/website/templates/download.html b/website/templates/download.html new file mode 100644 index 00000000..3eb5787b --- /dev/null +++ b/website/templates/download.html @@ -0,0 +1,38 @@ +<#import "/_scaffold.html" as main> +<@main.scaffold title="Download"> + <div class="page-header top5"> + <div> + <div class="row page-center"> + <div> + <h1 class="text-center"> + <div class="row"> + <icon class="fa fa-download"></icon> + <a href="/downloads/lombok.jar"> + Download <span id="currentVersion">${version}</span> + <span id="currentVersionFull" style="display: none;">${fullVersion}</span> + </a> + </div> + </h1> + </div> + <div class="row"> + <a href="/changelog"> + changelog + </a> + </div> + <div class="row"> + <a href="/all-versions"> + older versions + </a> + </div> + </div> + <div class="row"> + <div class="text-center"> + <h3> + Feeling adventurous? Download the latest <a href="/download-edge">snapshot</a> + release. + </h3> + </div> + </div> + </div> + </div> +</@main.scaffold> diff --git a/website/templates/features/Builder.html b/website/templates/features/Builder.html new file mode 100644 index 00000000..96a30d99 --- /dev/null +++ b/website/templates/features/Builder.html @@ -0,0 +1,163 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@Builder" logline="... and Bob's your uncle: No-hassle fancy-pants APIs for object creation!"> + <@f.history> + <p> + <code>@Builder</code> was introduced as experimental feature in lombok v0.12.0. + </p><p> + <code>@Builder</code> gained <code>@Singular</code> support and was promoted to the main <code>lombok</code> package since lombok v1.16.0. + </p><p> + <code>@Builder</code> with <code>@Singular</code> adds a clear method since lombok v1.16.8. + </p><p> + <code>@Builder.Default</code> functionality was added in lombok v1.16.16. + </p> + </@f.history> + + <@f.overview> + <p> + The <code>@Builder</code> annotation produces complex builder APIs for your classes. + </p><p> + <code>@Builder</code> lets you automatically produce the code required to have your class be instantiable with code such as:<br /> + <code>Person.builder().name("Adam Savage").city("San Francisco").job("Mythbusters").job("Unchained Reaction").build();</code> + </p><p> + <code>@Builder</code> can be placed on a class, or on a constructor, or on a method. While the "on a class" and "on a constructor" mode are the most common use-case, <code>@Builder</code> is most easily explained with the "method" use-case. + </p><p> + A method annotated with <code>@Builder</code> (from now on called the <em>target</em>) causes the following 7 things to be generated: + <ul> + <li> + An inner static class named <code><em>Foo</em>Builder</code>, with the same type arguments as the static method (called the <em>builder</em>). + </li><li> + In the <em>builder</em>: One private non-static non-final field for each parameter of the <em>target</em>. + </li><li> + In the <em>builder</em>: A package private no-args empty constructor. + </li><li> + In the <em>builder</em>: A 'setter'-like method for each parameter of the <em>target</em>: It has the same type as that parameter and the same name. It returns the builder itself, so that the setter calls can be chained, as in the above example. + </li><li> + In the <em>builder</em>: A <code>build()</code> method which calls the method, passing in each field. It returns the same type that the <em>target</em> returns. + </li><li> + In the <em>builder</em>: A sensible <code>toString()</code> implementation. + </li><li> + In the class containing the <em>target</em>: A <code>builder()</code> method, which creates a new instance of the <em>builder</em>. + </li> + </ul> + Each listed generated element will be silently skipped if that element already exists (disregarding parameter counts and looking only at names). This includes the <em>builder</em> itself: If that class already exists, lombok will simply start injecting fields and methods inside this already existing class, unless of course the fields / methods to be injected already exist. You may not put any other method (or constructor) generating lombok annotation on a builder class though; for example, you can not put <code>@EqualsAndHashCode</code> on the builder class. + </p><p> + <code>@Builder</code> can generate so-called 'singular' methods for collection parameters/fields. These take 1 element instead of an entire list, and add the element to the list. For example: <code>Person.builder().job("Mythbusters").job("Unchained Reaction").build();</code> would result in the <code>List<String> jobs</code> field to have 2 strings in it. To get this behaviour, the field/parameter needs to be annotated with <code>@Singular</code>. The feature has <a href="#singular">its own documentation</a>. + </p><p> + Now that the "method" mode is clear, putting a <code>@Builder</code> annotation on a constructor functions similarly; effectively, constructors are just static methods that have a special syntax to invoke them: Their 'return type' is the class they construct, and their type parameters are the same as the type parameters of the class itself. + </p><p> + Finally, applying <code>@Builder</code> to a class is as if you added <code>@AllArgsConstructor(access = AccessLevel.PACKAGE)</code> to the class and applied the <code>@Builder</code> annotation to this all-args-constructor. This only works if you haven't written any explicit constructors yourself. If you do have an explicit constructor, put the <code>@Builder</code> annotation on the constructor instead of on the class. + </p><p> + If using <code>@Builder</code> to generate builders to produce instances of your own class (this is always the case unless adding <code>@Builder</code> to a method that doesn't return your own type), you can use <code>@Builder(toBuilder = true)</code> to also generate an instance method in your class called <code>toBuilder()</code>; it creates a new builder that starts out with all the values of this instance. You can put the <code>@Builder.ObtainVia</code> annotation on the parameters (in case of a constructor or method) or fields (in case of <code>@Builder</code> on a type) to indicate alternative means by which the value for that field/parameter is obtained from this instance. For example, you can specify a method to be invoked: <code>@Builder.ObtainVia(method = "calculateFoo")</code>. + </p><p> + The name of the builder class is <code><em>Foobar</em>Builder</code>, where <em>Foobar</em> is the simplified, title-cased form of the return type of the <em>target</em> - that is, the name of your type for <code>@Builder</code> on constructors and types, and the name of the return type for <code>@Builder</code> on methods. For example, if <code>@Builder</code> is applied to a class named <code>com.yoyodyne.FancyList<T></code>, then the builder name will be <code>FancyListBuilder<T></code>. If <code>@Builder</code> is applied to a method that returns <code>void</code>, the builder will be named <code>VoidBuilder</code>. + </p><p> + The configurable aspects of builder are: + <ul> + <li> + The <em>builder's class name</em> (default: return type + 'Builder') + </li><li> + The <em>build()</em> method's name (default: <code>"build"</code>) + </li><li> + The <em>builder()</em> method's name (default: <code>"builder"</code>) + </li><li> + If you want <code>toBuilder()</code> (default: no) + </li> + </ul> + Example usage where all options are changed from their defaults:<br /> + <code>@Builder(builderClassName = "HelloWorldBuilder", buildMethodName = "execute", builderMethodName = "helloWorld", toBuilder = true)</code><br /> + </p> + </@f.overview> + + <@f.featureSection> + <h3 id="builderdefault"><a name="builderdefault">@Builder.Default</a></h3> + + <p> + If a certain field/parameter is never set during a build session, then it always gets 0 / <code>null</code> / false. If you've put <code>@Builder</code> on a class (and not a method or constructor) you can instead specify the default directly on the field, and annotate the field with <code>@Builder.Default</code>:<br /> + <code>@Builder.Default private final long created = System.currentTimeMillis();</code> + </p> + </@f.featureSection> + + <@f.featureSection> + <h3 id="singular"><a name="singular">@Singular</a></h3> + + <p> + By annotating one of the parameters (if annotating a method or constructor with <code>@Builder</code>) or fields (if annotating a class with <code>@Builder</code>) with the <code>@Singular</code> annotation, lombok will treat that builder node as a collection, and it generates 2 'adder' methods instead of a 'setter' method. One which adds a single element to the collection, and one which adds all elements of another collection to the collection. No setter to just set the collection (replacing whatever was already added) will be generated. A 'clear' method is also generated. These 'singular' builders are very complicated in order to guarantee the following properties: + <ul> + <li> + When invoking <code>build()</code>, the produced collection will be immutable. + </li><li> + Calling one of the 'adder' methods, or the 'clear' method, after invoking <code>build()</code> does not modify any already generated objects, and, if <code>build()</code> is later called again, another collection with all the elements added since the creation of the builder is generated. + </li><li> + The produced collection will be compacted to the smallest feasible format while remaining efficient. + </li> + </ul> + </p><p> + <code>@Singular</code> can only be applied to collection types known to lombok. Currently, the supported types are: + <ul> + <li> + <a href="https://docs.oracle.com/javase/8/docs/api/java/util/package-summary.html"><code>java.util</code></a>: + <ul> + <li> + <code>Iterable</code>, <code>Collection</code>, and <code>List</code> (backed by a compacted unmodifiable <code>ArrayList</code> in the general case). + </li><li> + <code>Set</code>, <code>SortedSet</code>, and <code>NavigableSet</code> (backed by a smartly sized unmodifiable <code>HashSet</code> or <code>TreeSet</code> in the general case). + </li><li> + <code>Map</code>, <code>SortedMap</code>, and <code>NavigableMap</code> (backed by a smartly sized unmodifiable <code>HashMap</code> or <code>TreeMap</code> in the general case). + </li> + </ul> + </li><li> + <a href="https://github.com/google/guava">Guava</a>'s <code>com.google.common.collect</code>: + <ul> + <li> + <code>ImmutableCollection</code> and <code>ImmutableList</code> (backed by the builder feature of <code>ImmutableList</code>). + </li><li> + <code>ImmutableSet</code> and <code>ImmutableSortedSet</code> (backed by the builder feature of those types). + </li><li> + <code>ImmutableMap</code>, <code>ImmutableBiMap</code>, and <code>ImmutableSortedMap</code> (backed by the builder feature of those types). + </li><li> + <code>ImmutableTable</code> (backed by the builder feature of <code>ImmutableTable</code>). + </li> + </ul> + </li> + </ul> + </p><p> + If your identifiers are written in common english, lombok assumes that the name of any collection with <code>@Singular</code> on it is an english plural and will attempt to automatically singularize that name. If this is possible, the add-one method will use this name. For example, if your collection is called <code>statuses</code>, then the add-one method will automatically be called <code>status</code>. You can also specify the singular form of your identifier explictly by passing the singular form as argument to the annotation like so: <code>@Singular("axis") List<Line> axes;</code>.<br /> + If lombok cannot singularize your identifier, or it is ambiguous, lombok will generate an error and force you to explicitly specify the singular name. + </p><p> + The snippet below does not show what lombok generates for a <code>@Singular</code> field/parameter because it is rather complicated. You can view a snippet <a href="builderSingular">here</a>. + </p> + </@f.featureSection> + + <@f.snippets name="Builder" /> + + <@f.confKeys> + <dt> + <code>lombok.builder.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@Builder</code> as a warning or error if configured. + </dd><dt> + <code>lombok.singular.useGuava</code> = [<code>true</code> | <code>false</code>] (default: false) + </dt><dd> + If <code>true</code>, lombok will use guava's <code>ImmutableXxx</code> builders and types to implement <code>java.util</code> collection interfaces, instead of creating implementations based on <code>Collections.unmodifiableXxx</code>. You must ensure that guava is actually available on the classpath and buildpath if you use this setting. Guava is used automatically if your field/parameter has one of the guava <code>ImmutableXxx</code> types. + </dd><dt> + <code>lombok.singular.auto</code> = [<code>true</code> | <code>false</code>] (default: true) + </dt><dd> + If <code>true</code> (which is the default), lombok automatically tries to singularize your identifier name by assuming that it is a common english plural. If <code>false</code>, you must always explicitly specify the singular name, and lombok will generate an error if you don't (useful if you write your code in a language other than english). + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + @Singular support for <code>java.util.NavigableMap/Set</code> only works if you are compiling with JDK1.8 or higher. + </p><p> + You cannot manually provide some or all parts of a <code>@Singular</code> node; the code lombok generates is too complex for this. If you want to manually control (part of) the builder code associated with some field or parameter, don't use <code>@Singular</code> and add everything you need manually. + </p><p> + The sorted collections (java.util: <code>SortedSet</code>, <code>NavigableSet</code>, <code>SortedMap</code>, <code>NavigableMap</code> and guava: <code>ImmutableSortedSet</code>, <code>ImmutableSortedMap</code>) require that the type argument of the collection has natural order (implements <code>java.util.Comparable</code>). There is no way to pass an explicit <code>Comparator</code> to use in the builder. + </p><p> + An <code>ArrayList</code> is used to store added elements as call methods of a <code>@Singular</code> marked field, if the target collection is from the <code>java.util</code> package, <em>even if the collection is a set or map</em>. Because lombok ensures that generated collections are compacted, a new backing instance of a set or map must be constructed anyway, and storing the data as an <code>ArrayList</code> during the build process is more efficient that storing it as a map or set. This behaviour is not externally visible, an implementation detail of the current implementation of the <code>java.util</code> recipes for <code>@Singular @Builder</code>. + </p><p> + With <code>toBuilder = true</code> applied to methods, any type parameter of the annotated method itself must also show up in the return type. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/BuilderSingular.html b/website/templates/features/BuilderSingular.html new file mode 100644 index 00000000..10253365 --- /dev/null +++ b/website/templates/features/BuilderSingular.html @@ -0,0 +1,5 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@Builder @Singular" logline="... and Bob's your uncle: No-hassle fancy-pants APIs for object creation!"> + <@f.snippets name="Singular-snippet" /> +</@f.scaffold> diff --git a/website/templates/features/Cleanup.html b/website/templates/features/Cleanup.html new file mode 100644 index 00000000..e868c40d --- /dev/null +++ b/website/templates/features/Cleanup.html @@ -0,0 +1,35 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@Cleanup" logline="Automatic resource management: Call your <code>close()</code> methods safely with no hassle."> + <@f.overview> + <p> + You can use <code>@Cleanup</code> to ensure a given resource is automatically cleaned up before the code execution path exits your current scope. You do this by annotating any local variable declaration with the <code>@Cleanup</code> annotation like so:<br /> + <code>@Cleanup InputStream in = new FileInputStream("some/file");</code><br /> + As a result, at the end of the scope you're in, <code>in.close()</code> is called. This call is guaranteed to run by way of a try/finally construct. Look at the example below to see how this works. + </p><p> + If the type of object you'd like to cleanup does not have a <code>close()</code> method, but some other no-argument method, you can specify the name of this method like so:<br /> + <code>@Cleanup("dispose") org.eclipse.swt.widgets.CoolBar bar = new CoolBar(parent, 0);</code><br /> + By default, the cleanup method is presumed to be <code>close()</code>. A cleanup method that takes 1 or more arguments cannot be called via <code>@Cleanup</code>. + </p> + </@f.overview> + + <@f.snippets name="Cleanup" /> + + <@f.confKeys> + <dt> + <code>lombok.cleanup.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt></dd> + Lombok will flag any usage of <code>@Cleanup</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + In the finally block, the cleanup method is only called if the given resource is not <code>null</code>. However, if you use <code>delombok</code> on the code, a call to <code>lombok.Lombok.preventNullAnalysis(Object o)</code> is inserted to prevent warnings if static code analysis could determine that a null-check would not be needed. Compilation with <code>lombok.jar</code> on the classpath removes that method call, so there is no runtime dependency. + </p><p> + If your code throws an exception, and the cleanup method call that is then triggered also throws an exception, then the original exception is hidden by the exception thrown by the cleanup call. You should <em>not</em> rely on this 'feature'. Preferably, lombok would like to generate code so that, if the main body has thrown an exception, any exception thrown by the close call is silently swallowed (but if the main body exited in any other way, exceptions by the close call will not be swallowed). The authors of lombok do not currently know of a feasible way to implement this scheme, but if java updates allow it, or we find a way, we'll fix it. + </p><p> + You do still need to handle any exception that the cleanup method can generate! + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/Data.html b/website/templates/features/Data.html new file mode 100644 index 00000000..59370cc8 --- /dev/null +++ b/website/templates/features/Data.html @@ -0,0 +1,41 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@Data" + logline="All together now: A shortcut for <code>@ToString</code>, <code>@EqualsAndHashCode</code>, <code>@Getter</code> on all fields, <code>@Setter</code> on all non-final fields, and <code>@RequiredArgsConstructor</code>!"> + + <@f.overview> + <p> + <code>@Data</code> is a convenient shortcut annotation that bundles the features of <a href="/features/ToString"><code>@ToString</code></a>, <a href="/features/EqualsAndHashCode"><code>@EqualsAndHashCode</code></a>, <a href="/features/GetterSetter"><code>@Getter</code> / <code>@Setter</code></a> and <a href="/features/constructor"><code>@RequiredArgsConstructor</code></a> together: In other words, <code>@Data</code> generates <em>all</em> the boilerplate that is normally associated with simple POJOs (Plain Old Java Objects) and beans: getters for all fields, setters for all non-final fields, and appropriate <code>toString</code>, <code>equals</code> and <code>hashCode</code> implementations that involve the fields of the class, and a constructor that initializes all final fields, as well as all non-final fields with no initializer that have been marked with <code>@NonNull</code>, in order to ensure the field is never null. + </p><p> + <code>@Data</code> is like having implicit <code>@Getter</code>, <code>@Setter</code>, <code>@ToString</code>, <code>@EqualsAndHashCode</code> and <code>@RequiredArgsConstructor</code> annotations on the class (except that no constructor will be generated if any explicitly written constructors already exist). However, the parameters of these annotations (such as <code>callSuper</code>, <code>includeFieldNames</code> and <code>exclude</code>) cannot be set with <code>@Data</code>. If you need to set non-default values for any of these parameters, just add those annotations explicitly; <code>@Data</code> is smart enough to defer to those annotations. + </p><p> + All generated getters and setters will be <code>public</code>. To override the access level, annotate the field or class with an explicit <code>@Setter</code> and/or <code>@Getter</code> annotation. You can also use this annotation (by combining it with <code>AccessLevel.NONE</code>) to suppress generating a getter and/or setter altogether. + </p><p> + All fields marked as <code>transient</code> will not be considered for <code>hashCode</code> and <code>equals</code>. All static fields will be skipped entirely (not considered for any of the generated methods, and no setter/getter will be made for them). + </p><p> + If the class already contains a method with the same name and parameter count as any method that would normally be generated, that method is not generated, and no warning or error is emitted. For example, if you already have a method with signature <code>equals(AnyType param)</code>, no <code>equals</code> method will be generated, even though technically it might be an entirely different method due to having different parameter types. The same rule applies to the constructor (any explicit constructor will prevent <code>@Data</code> from generating one), as well as <code>toString</code>, <code>equals</code>, and all getters and setters. You can mark any constructor or method with <code>@lombok.experimental.Tolerate</code> to hide them from lombok. + </p><p> + <code>@Data</code> can handle generics parameters for fields just fine. In order to reduce the boilerplate when constructing objects for classes with generics, you can use the <code>staticConstructor</code> parameter to generate a private constructor, as well as a static method that returns a new instance. This way, javac will infer the variable name. Thus, by declaring like so: <code>@Data(staticConstructor="of") class Foo<T> { private T x;}</code> you can create new instances of <code>Foo</code> by writing: <code>Foo.of(5);</code> instead of having to write: <code>new Foo<Integer>(5);</code>. + </p> + </@f.overview> + + <@f.snippets name="Data" /> + + <@f.confKeys> + <dt> + <code>lombok.data.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@Data</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + See the small print of <a href="/features/ToString"><code>@ToString</code></a>, <a href="/features/EqualsAndHashCode"><code>@EqualsAndHashCode</code></a>, <a href="/features/GetterSetter"><code>@Getter / @Setter</code></a> and <a href="/features/constructor">@RequiredArgsConstructor</a>. + </p><p> + Any annotations named <code>@NonNull</code> (case insensitive) on a field are interpreted as: This field must not ever hold <em>null</em>. Therefore, these annotations result in an explicit null check in the generated constructor for the provided field. Also, these annotations (as well as any annotation named <code>@Nullable</code>) are copied to the constructor parameter, in both the true constructor and any static constructor. The same principle applies to generated getters and setters (see the documentation for <a href="/features/GetterSetter">@Getter / @Setter</a>) + </p><p> + By default, any variables that start with a $ symbol are excluded automatically. You can include them by specifying an explicit annotation (<code>@Getter</code> or <code>@ToString</code>, for example) and using the 'of' parameter. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/EqualsAndHashCode.html b/website/templates/features/EqualsAndHashCode.html new file mode 100644 index 00000000..3c11367f --- /dev/null +++ b/website/templates/features/EqualsAndHashCode.html @@ -0,0 +1,56 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@EqualsAndHashCode" logline="Equality made easy: Generates <code>hashCode</code> and <code>equals</code> implementations from the fields of your object."> + <@f.overview> + <p> + Any class definition may be annotated with <code>@EqualsAndHashCode</code> to let lombok generate implementations of the <code>equals(Object other)</code> and <code>hashCode()</code> methods. By default, it'll use all non-static, non-transient fields, but you can exclude more fields by naming them in the optional <code>exclude</code> parameter to the annotation. Alternatively, you can specify exactly which fields you wish to be used by naming them in the <code>of</code> parameter. + </p><p> + If applying <code>@EqualsAndHashCode</code> to a class that extends another, this feature gets a bit trickier. Normally, auto-generating an <code>equals</code> and <code>hashCode</code> method for such classes is a bad idea, as the superclass also defines fields, which also need equals/hashCode code but this code will not be generated. By setting <code>callSuper</code> to <em>true</em>, you can include the <code>equals</code> and <code>hashCode</code> methods of your superclass in the generated methods. For <code>hashCode</code>, the result of <code>super.hashCode()</code> is included in the hash algorithm, and for<code>equals</code>, the generated method will return false if the super implementation thinks it is not equal to the passed in object. Be aware that not all <code>equals</code> implementations handle this situation properly. However, lombok-generated <code>equals</code> implementations <strong>do</strong> handle this situation properly, so you can safely call your superclass equals if it, too, has a lombok-generated <code>equals</code> method. If you have an explicit superclass you are forced to supply some value for <code>callSuper</code> to acknowledge that you've considered it; failure to do so results in a warning. + </p><p> + Setting <code>callSuper</code> to <em>true</em> when you don't extend anything (you extend <code>java.lang.Object</code>) is a compile-time error, because it would turn the generated <code>equals()</code> and <code>hashCode()</code> implementations into having the same behaviour as simply inheriting these methods from <code>java.lang.Object</code>: only the same object will be equal to each other and will have the same hashCode. Not setting <code>callSuper</code> to <em>true</em> when you extend another class generates a warning, because unless the superclass has no (equality-important) fields, lombok cannot generate an implementation for you that takes into account the fields declared by your superclasses. You'll need to write your own implementations, or rely on the <code>callSuper</code> chaining facility. You can also use the <code>lombok.equalsAndHashCode.callSuper</code> config key. + </p><p> + <em>NEW in Lombok 0.10: </em>Unless your class is <code>final</code> and extends <code>java.lang.Object</code>, lombok generates a <code>canEqual</code> method which means JPA proxies can still be equal to their base class, but subclasses that add new state don't break the equals contract. The complicated reasons for why such a method is necessary are explained in this paper: <a href="https://www.artima.com/lejava/articles/equality.html">How to Write an Equality Method in Java</a>. If all classes in a hierarchy are a mix of scala case classes and classes with lombok-generated equals methods, all equality will 'just work'. If you need to write your own equals methods, you should always override <code>canEqual</code> if you change <code>equals</code> and <code>hashCode</code>. + </p><p> + <em>NEW in Lombok 1.14.0: </em>To put annotations on the <code>other</code> parameter of the <code>equals</code> (and, if relevant, <code>canEqual</code>) method, you can use <code>onParam=@__({@AnnotationsHere})</code>. Be careful though! This is an experimental feature. For more details see the documentation on the <a ng-click="toFeature('on-x')">onX</a> feature. + </p> + </@f.overview> + + <@f.snippets name="EqualsAndHashCode" /> + + <@f.confKeys> + <dt> + <code>lombok.equalsAndHashCode.doNotUseGetters</code> = [<code>true</code> | <code>false</code>] (default: false) + </dt><dd> + If set to <code>true</code>, lombok will access fields directly instead of using getters (if available) when generating <code>equals</code> and <code>hashCode</code> methods. The annotation parameter '<code>doNotUseGetters</code>', if explicitly specified, takes precedence over this setting. + </dd><dt> + <code>lombok.equalsAndHashCode.callSuper</code> = [<code>call</code> | <code>skip</code> | <code>warn</code>] (default: warn) + </dt><dd> + If set to <code>call</code>, lombok will generate calls to the superclass implementation of <code>hashCode</code> and <code>equals</code> if your class extends something. If set to <code>skip</code> no such calls are generated. The default behaviour is like <code>skip</code>, with an additional warning. + </dd><dt> + <code>lombok.equalsAndHashCode.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@EqualsAndHashCode</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + Arrays are 'deep' compared/hashCoded, which means that arrays that contain themselves will result in <code>StackOverflowError</code>s. However, this behaviour is no different from e.g. <code>ArrayList</code>. + </p><p> + You may safely presume that the hashCode implementation used will not change between versions of lombok, however this guarantee is not set in stone; if there's a significant performance improvement to be gained from using an alternate hash algorithm, that will be substituted in a future version. + </p><p> + For the purposes of equality, 2 <code>NaN</code> (not a number) values for floats and doubles are considered equal, eventhough 'NaN == NaN' would return false. This is analogous to <code>java.lang.Double</code>'s equals method, and is in fact required to ensure that comparing an object to an exact copy of itself returns <code>true</code> for equality. + </p><p> + If there is <em>any</em> method named either <code>hashCode</code> or <code>equals</code>, regardless of return type, no methods will be generated, and a warning is emitted instead. These 2 methods need to be in sync with each other, which lombok cannot guarantee unless it generates all the methods, hence you always get a warning if one <em>or</em> both of the methods already exist. You can mark any method with <code>@lombok.experimental.Tolerate</code> to hide them from lombok. + </p><p> + Attempting to exclude fields that don't exist or would have been excluded anyway (because they are static or transient) results in warnings on the named fields. You therefore don't have to worry about typos. + </p><p> + Having both <code>exclude</code> and <code>of</code> generates a warning; the <code>exclude</code> parameter will be ignored in that case. + </p><p> + By default, any variables that start with a $ symbol are excluded automatically. You can onlyinclude them by using the 'of' parameter. + </p><p> + If a getter exists for a field to be included, it is called instead of using a direct field reference. This behaviour can be suppressed:<br /> + <code>@EqualsAndHashCode(doNotUseGetters = true)</code> + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/GetterLazy.html b/website/templates/features/GetterLazy.html new file mode 100644 index 00000000..b1f374a8 --- /dev/null +++ b/website/templates/features/GetterLazy.html @@ -0,0 +1,31 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@Getter(lazy=true)" logline="Laziness is a virtue!"> + <@f.history> + <code>@Getter(lazy=true)</code> was introduced in Lombok v0.10. + </@f.history> + + <@f.overview> + <p> + You can let lombok generate a getter which will calculate a value once, the first time this getter is called, and cache it from then on. This can be useful if calculating the value takes a lot of CPU, or the value takes a lot of memory. To use this feature, create a <code>private final</code> variable, initialize it with the expression that's expensive to run, and annotate your field with <code>@Getter(lazy=true)</code>. The field will be hidden from the rest of your code, and the expression will be evaluated no more than once, when the getter is first called. There are no magic marker values (i.e. even if the result of your expensive calculation is <code>null</code>, the result is cached) and your expensive calculation need not be thread-safe, as lombok takes care of locking. + </p> + </@f.overview> + + <@f.snippets name="GetterLazy" /> + + <@f.confKeys> + <dt> + <code>lombok.getter.lazy.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@Getter(lazy=true)</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + You should never refer to the field directly, always use the getter generated by lombok, because the type of the field will be mangled into an <code>AtomicReference</code>. Do not try to directly access this <code>AtomicReference</code>; if it points to itself, the value has been calculated, and it is <code>null</code>. If the reference points to <code>null</code>, then the value has not been calculated. This behaviour may change in future versions. Therefore, <em>always</em> use the generated getter to access your field! + </p><p> + Other Lombok annotations such as <code>@ToString</code> always call the getter even if you use <code>doNotUseGetters=true</code>. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/GetterSetter.html b/website/templates/features/GetterSetter.html new file mode 100644 index 00000000..1baa5bd0 --- /dev/null +++ b/website/templates/features/GetterSetter.html @@ -0,0 +1,70 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@Getter and @Setter" logline="Never write <code>public int getFoo() {return foo;}</code> again."> + <@f.overview> + <p> + You can annotate any field with <code>@Getter</code> and/or <code>@Setter</code>, to let lombok generate the default getter/setter automatically.<br /> + A default getter simply returns the field, and is named <code>getFoo</code> if the field is called <code>foo</code> (or <code>isFoo</code> if the field's type is <code>boolean</code>). A default setter is named <code>setFoo</code> if the field is called <code>foo</code>, returns <code>void</code>, and takes 1 parameter of the same type as the field. It simply sets the field to this value. + </p><p> + The generated getter/setter method will be <code>public</code> unless you explicitly specify an <code>AccessLevel</code>, as shown in the example below. Legal access levels are <code>PUBLIC</code>, <code>PROTECTED</code>, <code>PACKAGE</code>, and <code>PRIVATE</code>. + </p><p> + You can also put a <code>@Getter</code> and/or <code>@Setter</code> annotation on a class. In that case, it's as if you annotate all the non-static fields in that class with the annotation. + </p><p> + You can always manually disable getter/setter generation for any field by using the special <code>AccessLevel.NONE</code> access level. This lets you override the behaviour of a <code>@Getter</code>, <code>@Setter</code> or <code>@Data</code> annotation on a class. + </p><p> + To put annotations on the generated method, you can use <code>onMethod=@__({@AnnotationsHere})</code>; to put annotations on the only parameter of a generated setter method, you can use <code>onParam=@__({@AnnotationsHere})</code>. Be careful though! This is an experimental feature. For more details see the documentation on the <a href="/features/experimental/onX">onX</a> feature. + </p><p> + <em>NEW in lombok v1.12.0:</em> javadoc on the field will now be copied to generated getters and setters. Normally, all text is copied, and <code>@return</code> is <em>moved</em> to the getter, whilst <code>@param</code> lines are <em>moved</em> to the setter. Moved means: Deleted from the field's javadoc. It is also possible to define unique text for each getter/setter. To do that, you create a 'section' named <code>GETTER</code> and/or <code>SETTER</code>. A section is a line in your javadoc containing 2 or more dashes, then the text 'GETTER' or 'SETTER', followed by 2 or more dashes, and nothing else on the line. If you use sections, <code>@return</code> and <code>@param</code> stripping for that section is no longer done (move the <code>@return</code> or <code>@param</code> line into the section). + </p> + </@f.overview> + + <@f.snippets name="GetterSetter" /> + + <@f.confKeys> + <dt> + <code>lombok.accessors.chain</code> = [<code>true</code> | <code>false</code>] (default: false) + </dt><dd> + If set to <code>true</code>, generated setters will return <code>this</code> (instead of <code>void</code>). An explicitly configured <code>chain</code> parameter of an <a href="/features/experimental/Accessors"><code>@Accessors</code></a> annotation takes precedence over this setting. + </dd><dt> + <code>lombok.accessors.fluent</code> = [<code>true</code> | <code>false</code>] (default: false) + </dt><dd> + If set to <code>true</code>, generated getters and setters will not be prefixed with the bean-standard '<code>get</code>, <code>is</code> or <code>set</code>; instead, the methods will use the same name as the field (minus prefixes). An explicitly configured <code>chain</code> parameter of an <a href="/features/experimental/Accessors"><code>@Accessors</code></a> annotation takes precedence over this setting. + </dd><dt> + <code>lombok.accessors.prefix</code> += <em>a field prefix</em> (default: empty list) + </dt><dd> + This is a list property; entries can be added with the <code>+=</code> operator. Inherited prefixes from parent config files can be removed with the <code>-=</code> operator. Lombok will strip any matching field prefix from the name of a field in order to determine the name of the getter/setter to generate. For example, if <code>m</code> is one of the prefixes listed in this setting, then a field named <code>mFoobar</code> will result in a getter named <code>getFoobar()</code>, not <code>getMFoobar()</code>. An explicitly configured <code>prefix</code> parameter of an <a href="/features/experimental/Accessors"><code>@Accessors</code></a> annotation takes precedence over this setting. + </dd><dt> + <code>lombok.getter.noIsPrefix</code> = [<code>true</code> | <code>false</code>] (default: false) + </dt><dd> + If set to <code>true</code>, getters generated for <code>boolean</code> fields will use the <code>get</code> prefix instead of the default<code>is</code> prefix, and any generated code that calls getters, such as <code>@ToString</code>, will also use <code>get</code> instead of <code>is</code> + </dd><dt> + <code>lombok.setter.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@Setter</code> as a warning or error if configured. + </dd><dt> + <code>lombok.getter.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@Getter</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + For generating the method names, the first character of the field, if it is a lowercase character, is title-cased, otherwise, it is left unmodified. Then, get/set/is is prefixed. + </p><p> + No method is generated if any method already exists with the same name (case insensitive) and same parameter count. For example, <code>getFoo()</code> will not be generated if there's already a method <code>getFoo(String... x)</code> even though it is technically possible to make the method. This caveat exists to prevent confusion. If the generation of a method is skipped for this reason, a warning is emitted instead. Varargs count as 0 to N parameters. You can mark any method with <code>@lombok.experimental.Tolerate</code> to hide them from lombok. + </p><p> + For <code>boolean</code> fields that start with <code>is</code> immediately followed by a title-case letter, nothing is prefixed to generate the getter name. + </p><p> + Any variation on <code>boolean</code> will <em>not</em> result in using the <code>is</code> prefix instead of the <code>get</code> prefix; for example, returning <code>java.lang.Boolean</code> results in a <code>get</code> prefix, not an <code>is</code> prefix. + </p><p> + Any annotations named <code>@NonNull</code> (case insensitive) on the field are interpreted as: This field must not ever hold <em>null</em>. Therefore, these annotations result in an explicit null check in the generated setter. Also, these annotations (as well as any annotation named <code>@Nullable</code> or <code>@CheckForNull</code>) are copied to setter parameter and getter method. + </p><p> + You can annotate a class with a <code>@Getter</code> or <code>@Setter</code> annotation. Doing so is equivalent to annotating all non-static fields in that class with that annotation. <code>@Getter</code>/<code>@Setter</code> annotations on fields take precedence over the ones on classes. + </p><p> + Using the <code>AccessLevel.NONE</code> access level simply generates nothing. It's useful only in combination with <a href="/features/Data"><code>@Data</code></a> or a class-wide <code>@Getter</code> or <code>@Setter</code>. + </p><p> + <code>@Getter</code> can also be used on enums. <code>@Setter</code> can't, not for a technical reason, but for a pragmatic one: Setters on enums are an extremely bad idea. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/NonNull.html b/website/templates/features/NonNull.html new file mode 100644 index 00000000..28d083d0 --- /dev/null +++ b/website/templates/features/NonNull.html @@ -0,0 +1,45 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@NonNull" logline="or: How I learned to stop worrying and love the NullPointerException."> + <@f.history> + <code>@NonNull</code> was introduced in lombok v0.11.10. + </@f.history> + + <@f.overview> + <p> + You can use <code>@NonNull</code> on the parameter of a method or constructor to have lombok generate a null-check statement for you. + </p><p> + Lombok has always treated any annotation named <code>@NonNull</code> on a field as a signal to generate a null-check if lombok generates an entire method or constructor for you, via for example <a href="/features/Data"><code>@Data</code></a>. Now, however, using lombok's own <code>@lombok.NonNull</code> on a parameter results in the insertion of just the null-check statement inside your own method or constructor. + </p><p> + The null-check looks like <code>if (param == null) throw new NullPointerException("param");</code> and will be inserted at the very top of your method. For constructors, the null-check will be inserted immediately following any explicit <code>this()</code> or <code>super()</code> calls. + </p><p> + If a null-check is already present at the top, no additional null-check will be generated. + </p> + </@f.overview> + + <@f.snippets name="NonNull" /> + + <@f.confKeys> + <dt> + <code>lombok.nonNull.exceptionType</code> = [<code>NullPointerException</code> | <code>IllegalArgumentException</code>] (default: <code>NullPointerException</code>). + </dt><dd> + When lombok generates a null-check <code>if</code> statement, by default, a <code>java.lang.NullPointerException</code> will be thrown with the field name as the exception message. However, you can use <code>IllegalArgumentException</code> in this configuration key to have lombok throw that exception, with '<em>fieldName</em> is null' as exception message. + </dd><dt> + <code>lombok.nonNull.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@NonNull</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + Lombok's detection scheme for already existing null-checks consists of scanning for if statements that look just like lombok's own. Any 'throws' statement as the 'then' part of the if statement, whether in braces or not, counts. The conditional of the if statement <em>must</em> look exactly like <code>PARAMNAME == null</code>. The first statement in your method that is not such a null-check stops the process of inspecting for null-checks. + </p><p> + While <code>@Data</code> and other method-generating lombok annotations will trigger on any annotation named <code>@NonNull</code> regardless of casing or package name, this feature only triggers on lombok's own <code>@NonNull</code> annotation from the <code>lombok</code> package. + </p><p> + A <code>@NonNull</code> on a primitive parameter results in a warning. No null-check will be generated. + </p><p> + A <code>@NonNull</code> on a parameter of an abstract method used to generate a warning; starting with version 1.16.8, this is no longer the case, to acknowledge the notion that <code>@NonNull</code> also has a documentary role. For the same reason, you can annotate a method as <code>@NonNull</code>; this is allowed, generates no warning, and does not generate any code. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/SneakyThrows.html b/website/templates/features/SneakyThrows.html new file mode 100644 index 00000000..5a2d5bbd --- /dev/null +++ b/website/templates/features/SneakyThrows.html @@ -0,0 +1,44 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@SneakyThrows" logline="To boldly throw checked exceptions where no one has thrown them before!"> + <@f.overview> + <p> + <code>@SneakyThrows</code> can be used to sneakily throw checked exceptions without actually declaring this in your method's <code>throws</code> clause. This somewhat contentious ability should be used carefully, of course. The code generated by lombok will not ignore, wrap, replace, or otherwise modify the thrown checked exception; it simply fakes out the compiler. On the JVM (class file) level, all exceptions, checked or not, can be thrown regardless of the <code>throws</code> clause of your methods, which is why this works. + </p><p> + Common use cases for when you want to opt out of the checked exception mechanism center around 2 situations:<br /> + <ul> + <li> + A needlessly strict interface, such as <code>Runnable</code> - whatever exception propagates out of your <code>run()</code> method, checked or not, it will be passed to the <code>Thread</code>'s unhandled exception handler. Catching a checked exception and wrapping it in some sort of <code>RuntimeException</code> is only obscuring the real cause of the issue. + </li><li> + An 'impossible' exception. For example, <code>new String(someByteArray, "UTF-8");</code> declares that it can throw an <code>UnsupportedEncodingException</code> but according to the JVM specification, UTF-8 <em>must</em> always be available. An <code>UnsupportedEncodingException</code> here is about as likely as a <code>ClassNotFoundError</code> when you use a String object, and you don't catch those either! + </li> + </ul> + </p><p> + Be aware that it is <em>impossible</em> to catch sneakily thrown checked types directly, as javac will not let you write a catch block for an exception type that no method call in the try body declares as thrown. This problem is not relevant in either of the use cases listed above, so let this serve as a warning that you should not use the <code>@SneakyThrows</code> mechanism without some deliberation! + </p><p> + You can pass any number of exceptions to the <code>@SneakyThrows</code> annotation. If you pass no exceptions, you may throw any exception sneakily. + </p> + </@f.overview> + + <@f.snippets name="SneakyThrows" /> + + <@f.confKeys> + <dt> + <code>lombok.sneakyThrows.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@SneakyThrows</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + Because <code>@SneakyThrows</code> is an implementation detail and not part of your method signature, it is an error if you try to declare a checked exception as sneakily thrown when you don't call any methods that throw this exception. (Doing so is perfectly legal for <code>throws</code> statements to accommodate subclasses). Similarly, <code>@SneakyThrows</code> does not inherit. + </p><p> + For the nay-sayers in the crowd: Out of the box, Eclipse will offer a 'quick-fix' for uncaught exceptions that wraps the offending statement in a try/catch block with just <code>e.printStackTrace()</code> in the catch block. This is so spectacularly non-productive compared to just sneakily throwing the exception onwards, that Roel and Reinier feel more than justified in claiming that the checked exception system is far from perfect, and thus an opt-out mechanism is warranted. + </p><p> + If you put <code>@SneakyThrows</code> on a constructor, any call to a sibling or super constructor is <em>excluded</em> from the <code>@SneakyThrows</code> treatment. This is a java restriction we cannot work around: Calls to sibling/super constructors MUST be the first statement in the constructor; they cannot be placed inside try/catch blocks. + </p><p> + <code>@SneakyThrows</code> on an empty method, or a constructor that is empty or only has a call to a sibling / super constructor results in no try/catch block and a warning. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/Synchronized.html b/website/templates/features/Synchronized.html new file mode 100644 index 00000000..113add0e --- /dev/null +++ b/website/templates/features/Synchronized.html @@ -0,0 +1,34 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@Synchronized" logline="<code>synchronized</code> done right: Don't expose your locks."> + <@f.overview> + <p> + <code>@Synchronized</code> is a safer variant of the <code>synchronized</code> method modifier. Like <code>synchronized</code>, the annotation can be used on static and instance methods only. It operates similarly to the <code>synchronized</code> keyword, but it locks on different objects. The keyword locks on <code>this</code>, but the annotation locks on a field named <code>$lock</code>, which is private.<br /> + If the field does not exist, it is created for you. If you annotate a <code>static</code> method, the annotation locks on a static field named <code>$LOCK</code> instead. + </p><p> + If you want, you can create these locks yourself. The <code>$lock</code> and <code>$LOCK</code> fields will of course not be generated if you already created them yourself. You can also choose to lock on another field, by specifying it as parameter to the <code>@Synchronized</code> annotation. In this usage variant, the fields will not be created automatically, and you must explicitly create them yourself, or an error will be emitted. + </p><p> + Locking on <code>this</code> or your own class object can have unfortunate side-effects, as other code not under your control can lock on these objects as well, which can cause race conditions and other nasty threading-related bugs. + </p> + </@f.overview> + + <@f.snippets name="Synchronized" /> + + <@f.confKeys> + <dt> + <code>lombok.synchronized.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@Synchronized</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + If <code>$lock</code> and/or <code>$LOCK</code> are auto-generated, the fields are initialized with an empty <code>Object[]</code> array, and not just a <code>new Object()</code> as most snippets showing this pattern in action use. Lombok does this because a new object is <em>NOT</em> serializable, but 0-size array is. Therefore, using <code>@Synchronized</code> will not prevent your object from being serialized. + </p><p> + Having at least one <code>@Synchronized</code> method in your class means there will be a lock field, but if you later remove all such methods, there will no longer be a lock field. That means your predetermined <code>serialVersionUID</code> changes. We suggest you <em>always</em> add a <code>serialVersionUID</code> to your classes if you intend to store them long-term via java's serialization mechanism. If you do so, removing all <code>@Synchronized</code> annotations from your method will not break serialization. + </p><p> + If you'd like to know why a field is not automatically generated when you choose your own name for the lock object: Because otherwise making a typo in the field name will result in a <em>very</em> hard to find bug! + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/ToString.html b/website/templates/features/ToString.html new file mode 100644 index 00000000..6f230561 --- /dev/null +++ b/website/templates/features/ToString.html @@ -0,0 +1,54 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@ToString" logline="No need to start a debugger to see your fields: Just let lombok generate a <code>toString</code> for you!"> + <@f.overview> + <p> + Any class definition may be annotated with <code>@ToString</code> to let lombok generate an implementation of the <code>toString()</code> method. By default, it'll print your class name, along with each field, in order, separated by commas. + </p><p> + By setting the <code>includeFieldNames</code> parameter to <em>true</em> you can add some clarity (but also quite some length) to the output of the <code>toString()</code> method. + </p><p> + By default, all non-static fields will be printed. If you want to skip some fields, you can name them in the <code>exclude</code> parameter; each named field will not be printed at all. Alternatively, you can specify exactly which fields you wish to be used by naming them in the <code>of</code> parameter. + </p><p> + By setting <code>callSuper</code> to <em>true</em>, you can include the output of the superclass implementation of <code>toString</code> to the output. Be aware that the default implementation of <code>toString()</code> in <code>java.lang.Object</code> is pretty much meaningless, so you probably don't want to do this unless you are extending another class. + </p> + </@f.overview> + + <@f.snippets name="ToString" /> + + <@f.confKeys> + <dt> + <code>lombok.toString.includeFieldNames</code> = [<code>true</code> | <code>false</code>] (default: true) + </dt><dd> + Normally lombok generates a fragment of the toString response for each field in the form of <code>fieldName = fieldValue</code>. If this setting is set to <code>false</code>, lombok will omit the name of the field and simply deploy a comma-separated list of all the field values. The annotation parameter '<code>includeFieldNames</code>', if explicitly specified, takes precedence over this setting. + </dd><dt> + <code>lombok.toString.doNotUseGetters</code> = [<code>true</code> | <code>false</code>] (default: false) + </dt><dd> + If set to <code>true</code>, lombok will access fields directly instead of using getters (if available) when generating <code>toString</code> methods. The annotation parameter '<code>doNotUseGetters</code>', if explicitly specified, takes precedence over this setting. + </dd><dt> + <code>lombok.toString.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@ToString</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + If there is <em>any</em> method named <code>toString</code> with no arguments, regardless of return type, no method will be generated, and instead a warning is emitted explaining that your <code>@ToString</code> annotation is doing nothing. You can mark any method with <code>@lombok.experimental.Tolerate</code> to hide them from lombok. + </p><p> + Arrays are printed via <code>Arrays.deepToString</code>, which means that arrays that contain themselves will result in <code>StackOverflowError</code>s. However, this behaviour is no different from e.g. <code>ArrayList</code>. + </p><p> + Attempting to exclude fields that don't exist or would have been excluded anyway (because they are static) results in warnings on the named fields. You therefore don't have to worry about typos. + </p><p> + Having both <code>exclude</code> and <code>of</code> generates a warning; the <code>exclude</code> parameter will be ignored in that case. + </p><p> + We don't promise to keep the output of the generated <code>toString()</code> methods the same between lombok versions. You should never design your API so that other code is forced to parse your <code>toString()</code> output anyway! + </p><p> + By default, any variables that start with a $ symbol are excluded automatically. You can only include them by using the 'of' parameter. + </p><p> + If a getter exists for a field to be included, it is called instead of using a direct field reference. This behaviour can be suppressed:<br /> + <code>@ToString(doNotUseGetters = true)</code> + </p><p> + <code>@ToString</code> can also be used on an enum definition. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/Value.html b/website/templates/features/Value.html new file mode 100644 index 00000000..fdad0e12 --- /dev/null +++ b/website/templates/features/Value.html @@ -0,0 +1,50 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@Value" logline="Immutable classes made very easy."> + <@f.history> + <p> + <code>@Value</code> was introduced as experimental feature in lombok v0.11.4. + </p><p> + <code>@Value</code> no longer implies <code>@Wither</code> since lombok v0.11.8. + </p><p> + <code>@Value</code> promoted to the main <code>lombok</code> package since lombok v0.12.0. + </p> + </@f.history> + + <@f.overview> + <p> + <code>@Value</code> is the immutable variant of <a href="/features/Data"><code>@Data</code></a>; all fields are made <code>private</code> and <code>final</code> by default, and setters are not generated. The class itself is also made <code>final</code> by default, because immutability is not something that can be forced onto a subclass. Like <code>@Data</code>, useful <code>toString()</code>, <code>equals()</code> and <code>hashCode()</code> methods are also generated, each field gets a getter method, and a constructor that covers every argument (except <code>final</code> fields that are initialized in the field declaration) is also generated. + </p><p> + In practice, <code>@Value</code> is shorthand for: <code>final @ToString @EqualsAndHashCode @AllArgsConstructor @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @Getter</code>, except that explicitly including an implementation of any of the relevant methods simply means that part won't be generated and no warning will be emitted. For example, if you write your own <code>toString</code>, no error occurs, and lombok will not generate a <code>toString</code>. Also, <em>any</em> explicit constructor, no matter the arguments list, implies lombok will not generate a constructor. If you do want lombok to generate the all-args constructor, add <code>@AllArgsConstructor</code> to the class. You can mark any constructor or method with <code>@lombok.experimental.Tolerate</code> to hide them from lombok. + </p><p> + It is possible to override the final-by-default and private-by-default behavior using either an explicit access level on a field, or by using the <code>@NonFinal</code> or <code>@PackagePrivate</code> annotations.<br /> + It is possible to override any default behavior for any of the 'parts' that make up <code>@Value</code> by explicitly using that annotation. + </p> + </@f.overview> + + <@f.snippets name="Value" /> + + <@f.confKeys> + <dt> + <code>lombok.value.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@Value</code> as a warning or error if configured. + </dd><dt> + <code>lombok.val.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>val</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + Look for the documentation on the 'parts' of <code>@Value</code>: <a href="/features/ToString"><code>@ToString</code></a>, <a href="/features/EqualsAndHashCode"><code>@EqualsAndHashCode</code></a>, <a href="/features/Constructor"><code>@AllArgsConstructor</code></a>, <a href="/features/experimental/FieldDefaults"><code>@FieldDefaults</code></a>, and <a href="/features/GetterSetter"><code>@Getter</code></a>. + </p><p> + For classes with generics, it's useful to have a static method which serves as a constructor, because inference of generic parameters via static methods works in java6 and avoids having to use the diamond operator. While you can force this by applying an explicit <code>@AllArgsConstructor(staticConstructor="of")</code> annotation, there's also the <code>@Value(staticConstructor="of")</code> feature, which will make the generated all-arguments constructor private, and generates a public static method named <code>of</code> which is a wrapper around this private constructor. + </p><p> + <code>@Value</code> was an experimental feature from v0.11.4 to v0.11.9 (as <code>@lombok.experimental.Value</code>). It has since been moved into the core package. The old annotation is still around (and is an alias). It will eventually be removed in a future version, though. + </p><p> + It is not possible to use <code>@FieldDefaults</code> to 'undo' the private-by-default and final-by-default aspect of fields in the annotated class. Use <code>@NonFinal</code> and <code>@PackagePrivate</code> on the fields in the class to override this behaviour. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/_features.html b/website/templates/features/_features.html new file mode 100644 index 00000000..f602b95b --- /dev/null +++ b/website/templates/features/_features.html @@ -0,0 +1,79 @@ +<#import "/_scaffold.html" as main> + +<#macro featureSection> + <div class="row"> + <#nested> + </div> +</#macro> + +<#macro history> + <div class="row"> + <#nested> + </div> +</#macro> + +<#macro overview> + <div class="row"> + <@main.h3 title="Overview" /> + <#nested> + </div> +</#macro> + +<#macro experimental> + <div class="row"> + <@main.h3 title="Experimental" /> + + Experimental because: + <#nested> + </div> +</#macro> + +<#macro snippets name> + <div class="row container-fluid"> + <div class="snippet-col first-snippet"> + <@main.h3 title="With Lombok" /> + + <div class="snippet">${usages.pre(name)?no_esc}</div> + </div> + <div class="sep"></div> + <div class="snippet-col second-snippet"> + <@main.h3 title="Vanilla Java" /> + + <div class="snippet">${usages.post(name)?no_esc}</div> + </div> + </div> +</#macro> + +<#macro confKeys> + <div class="row"> + <@main.h3 title="Supported configuration keys:" /> + <dl> + <#nested> + </dl> + </div> +</#macro> + +<#macro smallPrint> + <div class="row"> + <@main.h3 title="Small print" /> + + <div class="smallprint"> + <#nested> + </div> + </div> +</#macro> + +<#macro scaffold title logline load=[]> + <@main.scaffold load title> + <div class="page-header top5" id="featureContent"> + <div class="row text-center"> + <div class="header-group"> + <@main.h1 title="${title}" /> + + <@main.h3 title="${logline?no_esc}" /> + </div> + </div> + <#nested> + </div> + </@main.scaffold> +</#macro> diff --git a/website/templates/features/configuration.html b/website/templates/features/configuration.html new file mode 100644 index 00000000..4f861287 --- /dev/null +++ b/website/templates/features/configuration.html @@ -0,0 +1,114 @@ +<#import "_features.html" as f> + +<@f.scaffold title="Configuration system" logline="Lombok, made to order: Configure lombok features in one place for your entire project or even your workspace."> + <@f.history> + The configuration system was introduced in lombok 1.14. + </@f.history> + + <@f.overview> + <p> + You can create <code>lombok.config</code> files in any directory and put configuration directives in it. These apply to all source files in this directory and all child directories.<br /> + The configuration system is particularly useful for configurable aspects of lombok which tend to be the same across an entire project, such as the name of your log variable. The configuration system can also be used to tell lombok to flag any usage of some lombok feature you don't like as a warning or even an error. + </p><p> + Usually, a user of lombok puts a <code>lombok.config</code> file with their preferences in a workspace or project root directory, with the special <code>config.stopBubbling = true</code> key to tell lombok this is your root directory. You can then create <code>lombok.config</code> files in any subdirectories (generally representing projects or source packages) with different settings. + </p><p> + An up to date list of all configuration keys supported by your version of lombok can be generated by running: + <div class="snippet example"> + <code>java -jar lombok.jar config -g --verbose</code> + </div> + The output of the <em>config</em> tool is itself a valid <code>lombok.config</code> file.<br /> + The <em>config</em> tool can also be used to display the complete lombok configuration used for any given directory or source file by supplying these as arguments. + </p><p> + A sample of available configuration options (see the feature pages of the lombok features for their related config keys, as well as <code>java -jar lombok.jar config -g</code> for the complete list): + <dl> + <dt> + <code>lombok.accessors.chain</code> + </dt><dd> + If set to <code>true</code>, generated setters will 'chain' by default (They will return <code>this</code> instead of having a <code>void</code> return type). + </dd><dt> + <code>lombok.accessors.fluent</code> + </dt><dd> + If set to <code>true</code>, generated setters and getters will simply be named the same as the field name, without a <code>get</code> or <code>set</code> prefix. + </dd><dt> + <code>lombok.anyConstructor.suppressConstructorProperties</code> + </dt><dd> + If <code>true</code>, lombok will not generate a <code>@java.beans.ConstructorProperties</code> annotation when generating constructors. This is particularly useful for GWT and Android development. + </dd><dt> + <code>lombok.log.fieldName</code> + </dt><dd> + The name of the generated log field (default: <code>log</code>). + </dd><dt> + <code>lombok.<em>(featureName)</em>.flagUsage</code> + </dt><dd> + Allows you to forcibly stop or discourage use of a lombok feature. Legal values for this key are <code>warning</code> or <code>error</code>. Some examples of values for <em>(featureName)</em> are: "<code>experimental</code>" (flags use of any of the <a href="/features/experimental">experimental</a> features)</li>, "<a href="/features/Builder"><code>builder</code></a>", "<a + href="/features/SneakyThrows"><code>sneakyThrows</code></a>", or "<a href="/features/experimental/ExtensionMethod"><code>extensionMethod</code></a>". + </dd> + </dl> + </p><p> + Configuration files are hierarchical: Any configuration setting applies to all source files in that directory, and all source files in subdirectories, but configuration settings closer to the source file take precedence. For example, if you have in <code>/Users/me/projects/lombok.config</code> the following: + <div class="snippet example"> + <code>lombok.log.fieldName = foobar</code> + </div> + and in <code>/Users/me/projects/MyProject/lombok.config</code> you have: + <div class="snippet example"> + <code>lombok.log.fieldName = xyzzy</code> + </div> + Then the various <a ng-click="toFeature('log')"><code>@Log</code></a> annotations will use <code>foobar</code> instead of the default <code>log</code> as a field name to generate in all your projects, except for your project in <code>/Users/me/projects/MyProject</code>, where <code>xyzzy</code> is used instead. + </p><p> + To restore a configuration key set by a parent config file back to the default, the <code>clear</code> option can be used. For example, if a parent configuration file has configured all use of <code>val</code> to emit a warning, you can turn off the warnings for a subdirectory by including in it a <code>lombok.config</code> file with: + <div class="snippet example"> + <code>clear lombok.val.flagUsage</code> + </div> + </p><p> + Some configuration keys take lists. For lists, use <code>+=</code> to add an entry. You can remove a single item from the list (useful to undo a parent configuration file's setting) with <code>-=</code>. For example: + <div class="snippet example"> + <code>lombok.accessors.prefix += m_</code> + </div> + </p><p> + Comments can be included in <code>lombok.config</code> files; any line that starts with <code>#</code> is considered a comment. + </p> + </@f.overview> + + <@f.featureSection> + <@f.main.h3 title="Global config keys" /> + + <p> + To stop lombok from looking at parent directories for more configuration files, the special key: + <div class="snippet example"> + <code>config.stopBubbling = true</code> + </div> + can be included. We suggest you put this in the root of your workspace directory. + </p><p> + Lombok can add <code>@javax.annotation.Generated</code> annotations to all generated nodes where possible. You can enable this with: + <div class="snippet example"> + <code>lombok.addJavaxGeneratedAnnotation = true</code> + </div> + We advise against this; JDK9 breaks this annotation, and it's unlikely to ever get fixed.<br /> + <em>NB:</em> Until Lombok v2.0.0, this setting defaulted to <code>true</code>. + </p><p> + Lombok can be configured to add <code>@lombok.Generated</code> annotations to all generated nodes where possible; useful for JaCoCo (which has built in support), + or other style checkers and code coverage tools: + <div class="snippet example"> + <code>lombok.addLombokGeneratedAnnotation = true</code> + </div> + </p><p> + Lombok can add the <code>@SuppressFBWarnings</code> annotation which is useful if you want to run <a href="http://findbugs.sourceforge.net/">FindBugs</a> on your class files. To enable this feature, make sure findbugs is on the classpath when you compile, and add the following config key: + <div class="snippet example"> + <code>lombok.extern.findbugs.addSuppressFBWarnings = true</code> + </div> + </p> + </@f.featureSection> + + <@f.featureSection> + <@f.main.h3 title="Config keys that can affect any source file" /> + + <p> + These config keys can make lombok affect source files even if they have 0 lombok annotations in them.<br /> + <div class="snippet example"> + <code>lombok.fieldDefaults.defaultPrivate = true</code><br /> + <code>lombok.fieldDefaults.defaultFinal = true</code> + </div> + Turning either of these options on means lombok will make <em>every</em> field in <em>every</em> source file final and/or private unless it has an explicit access modifier or annotation to suppress this. <a href="experimental/FieldDefaults">See the <code>@FieldDefaults</code> documentation for more</a>. + </p> + </@f.featureSection> +</@f.scaffold> diff --git a/website/templates/features/constructor.html b/website/templates/features/constructor.html new file mode 100644 index 00000000..716efe5a --- /dev/null +++ b/website/templates/features/constructor.html @@ -0,0 +1,57 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@NoArgsConstructor, @RequiredArgsConstructor, @AllArgsConstructor" + logline="Constructors made to order: Generates constructors that take no arguments, one argument per final / non-null field, or one argument for every field."> + + <@f.overview> + <p> + This set of 3 annotations generate a constructor that will accept 1 parameter for certain fields, and simply assigns this parameter to the field. + </p><p> + <code>@NoArgsConstructor</code> will generate a constructor with no parameters. If this is not possible (because of final fields), a compiler error will result instead, unless <code>@NoArgsConstructor(force = true)</code> is used, then all final fields are initialized with <code>0</code> / <code>false</code> / <code>null</code>. For fields with constraints, such as <code>@NonNull</code> fields, <em>no</em> check is generated,so be aware that these constraints will generally not be fulfilled until those fields are properly initialized later. Certain java constructs, such as hibernate and the Service Provider Interface require a no-args constructor. This annotation is useful primarily in combination with either <code>@Data</code> or one of the other constructor generating annotations. + </p><p> + <code>@RequiredArgsConstructor</code> generates a constructor with 1 parameter for each field that requires special handling. All non-initialized <code>final</code> fields get a parameter, as well as any fields that are marked as <code>@NonNull</code> that aren't initialized where they are declared. For those fields marked with <code>@NonNull</code>, an explicit null check is also generated. The constructor will throw a <code>NullPointerException</code> if any of the parameters intended for the fields marked with <code>@NonNull</code> contain <code>null</code>. The order of the parameters match the order in which the fields appear in your class. + </p><p> + <code>@AllArgsConstructor</code> generates a constructor with 1 parameter for each field in your class. Fields marked with <code>@NonNull</code> result in null checks on those parameters. + </p><p> + Each of these annotations allows an alternate form, where the generated constructor is always private, and an additional static factory method that wraps around the private constructor is generated. This mode is enabled by supplying the <code>staticName</code> value for the annotation, like so: <code>@RequiredArgsConstructor(staticName="of")</code>. Such a static factory method will infer generics, unlike a normal constructor. This means your API users get write <code>MapEntry.of("foo", 5)</code> instead of the much longer <code>new MapEntry<String, Integer>("foo", 5)</code>. + </p><p> + To put annotations on the generated constructor, you can use <code>onConstructor=@__({@AnnotationsHere})</code>, but be careful; this is an experimental feature. For more details see the documentation on the <a href="/features/experimental/onX">onX</a> feature. + </p><p> + Static fields are skipped by these annotations. Also, a <code>@java.beans.ConstructorProperties</code> annotation is added for all constructors with at least 1 argument, which allows bean editor tools to call the generated constructors. <code>@ConstructorProperties</code> is new in Java 1.6, which means that if your code is intended for compilation on Java 1.5, a compiler error will occur. <em>Running</em> on a JVM 1.5 should be no problem (the annotation will be ignored). To suppress the generation of the <code>@ConstructorProperties</code> annotation, add a parameter to your annotation: <code>@AllArgsConstructor(suppressConstructorProperties=true)</code>. However, as java 1.5, which has already been end-of-lifed, fades into obscurity, this parameter will eventually be removed. It has also been marked deprecated for this reason. + </p><p> + Unlike most other lombok annotations, the existence of an explicit constructor does not stop these annotations from generating their own constructor. This means you can write your own specialized constructor, and let lombok generate the boilerplate ones as well. If a conflict arises (one of your constructors ends up with the same signature as one that lombok generates), a compiler error will occur. + </p> + </@f.overview> + + <@f.snippets name="Constructor" /> + + <@f.confKeys> + <dt> + <code>lombok.anyConstructor.suppressConstructorProperties</code> = [<code>true</code> | <code>false</code>] (default: <code>false</code>) + </dt><dd> + If set to <code>true</code>, then lombok will skip adding a <code>@java.beans.ConstructorProperties</code> to generated constructors. This is useful in android and GWT development where that annotation is not usually available. + </dd><dt> + <code>lombok.</code>[<code>allArgsConstructor</code>|<code>requiredArgsConstructor</code>|<code>noArgsConstructor</code>]<code>.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of the relevant annotation (<code>@AllArgsConstructor</code>, <code>@RequiredArgsConstructor</code> or <code>@NoArgsConstructor</code>) as a warning or error if configured. + </dd><dt> + <code>lombok.anyConstructor.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of any of the 3 constructor-generating annotations as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + Even if a field is explicitly initialized with <code>null</code>, lombok will consider the requirement to avoid null as fulfilled, and will <em>NOT</em> consider the field as a 'required' argument. The assumption is that if you explicitly assign <code>null</code> to a field that you've also marked as <code>@NonNull</code> signals you must know what you're doing. + </p><p> + The <code>@java.beans.ConstructorProperties</code> annotation is never generated for a constructor with no arguments. This also explains why <code>@NoArgsConstructor</code> lacks the <code>suppressConstructorProperties</code> annotation method. The generated static factory methods also do not get <code>@ConstructorProperties</code>, as this annotation can only be added to real constructors. + </p><p> + <code>@XArgsConstructor</code> can also be used on an enum definition. The generated constructor will always be private, because non-private constructors aren't legal in enums. You don't have to specify <code>AccessLevel.PRIVATE</code>. + </p><p> + While <code>suppressConstructorProperties</code> has been marked deprecated in anticipation of a world where all java environments have the <code>@ConstructorProperties</code> annotation available, first GWT 2.2 and Android 2.3.3, which do not (yet) have this annotation, will have to be ancient history before this annotation parameter will be removed. + </p><p> + The <code>flagUsage</code> configuration keys do not trigger when a constructor is generated by <code>@Data</code>, <code>@Value</code> or any other lombok annotation. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/delombok.html b/website/templates/features/delombok.html new file mode 100644 index 00000000..6f41fc46 --- /dev/null +++ b/website/templates/features/delombok.html @@ -0,0 +1,61 @@ +<#import "_features.html" as f> + +<@f.scaffold title="Delombok" logline=""> + <@f.overview> + <p> + Normally, lombok adds support for all the lombok features directly to your IDE and compiler by plugging into them.<br /> + However, lombok doesn't cover all tools. For example, lombok cannot plug into javadoc, nor can it plug into the Google Widget Toolkit, both of which run on java sources. Delombok still allows you to use lombok with these tools by preprocessing your java code into java code with all of lombok's transformations already applied. + </p><p> + Delombok can of course also help understand what's happening with your source by letting you look at exactly what lombok is doing 'under the hood'. + </p><p> + Delombok's standard mode of operation is that it copies an entire directory into another directory, recursively, skipping class files, and applying lombok transformations to any java source files it encounters. + </p><p> + Delombok's output format can be configured with command line options (use <code>--format-help</code> for a complete list). A few such options are automatically scanned from input if possible (such as indent). If delombok's formatting is not conforming to your preferred code style, have a look! + </p> + + <@f.main.h3 title="Running delombok on the command line" /> + + <p> + Delombok is included in <code>lombok.jar</code>. To use it, all you need to run on the command line is: + <div class="snippet"> + <pre>java -jar lombok.jar delombok src -d src-delomboked</pre> + </div><br /> + Which will duplicate the contents of the <code>src</code> directory into the <code>src-delomboked</code> directory, which will be created if it doesn't already exist, but delomboked of course. Delombok on the command line has a few more options; use the <code>--help</code> parameter to see more options. + </p><p> + To let delombok print the transformation result of a single java file directly to standard output, you can use: + <div class="snippet"> + <pre>java -jar lombok.jar delombok -p MyJavaFile.java</pre> + </div> + </p> + + <@f.main.h3 title="Running delombok in ant" /> + + <p> + <code>lombok.jar</code> includes an ant task which can apply delombok for you. For example, to create javadoc for your project, your <code>build.xml</code> file would look something like: + <div class="snippet"><pre><target name="javadoc"> +<taskdef classname="lombok.delombok.ant.Tasks$Delombok" classpath="lib/lombok.jar" name="delombok" /> +<mkdir dir="build/src-delomboked" /> +<strong><delombok verbose="true" encoding="UTF-8" to="build/src-delomboked" from="src"></strong> + <strong><format value="suppressWarnings:skip" /></strong> +<strong></delombok></strong> +<mkdir dir="build/api" /> +<javadoc sourcepath="build/src-delomboked" defaultexcludes="yes" destdir="build/api" /> +</target></pre> + </div><br /> + Instead of a <code>from</code> attribute, you can also nest <code><fileset></code> nodes. + </p> + + <@f.main.h3 title="Running delombok in maven" /> + + <p> + Anthony Whitford has written a <a href="https://github.com/awhitford/lombok.maven">maven plugin</a> for delomboking your source code. + </p> + + <@f.main.h3 title="Limitations" /> + + <p> + Delombok tries to preserve your code as much as it can, but comments may move around a little bit, especially comments that are in the middle of a syntax node. For example, any comments appearing in the middle of a list of method modifiers, such as <code>public /*comment*/ static ...</code> will move towards the front of the list of modifiers. In practice, any java source parsing tool will not be affected.<br /> + To keep any changes to your code style to a minimum, delombok just copies a source file directly without changing any of it if the source file contains no lombok transformations. + </p> + </@f.overview> +</@f.scaffold> diff --git a/website/templates/features/experimental/Accessors.html b/website/templates/features/experimental/Accessors.html new file mode 100644 index 00000000..97017dc6 --- /dev/null +++ b/website/templates/features/experimental/Accessors.html @@ -0,0 +1,75 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="@Accessors" logline="A more fluent API for getters and setters."> + <@f.history> + <p> + <code>@Accessors</code> was introduced as experimental feature in lombok v0.11.0. + </p> + </@f.history> + + <@f.experimental> + <ul> + <li> + We may want to roll these features into a more complete property support concept. + </li><li> + New feature – community feedback requested. + </li> + </ul> + Current status: <em>positive</em> - Currently we feel this feature may move out of experimental status with no or minor changes soon. + </@f.experimental> + + <@f.overview> + <p> + The <code>@Accessors</code> annotation is used to configure how lombok generates and looks for getters and setters. + </p><p> + By default, lombok follows the <em>bean specification</em> for getters and setters: The getter for a field named <code>pepper</code> is <code>getPepper</code> for example. However, some might like to break with the <em>bean specification</em> in order to end up with nicer looking APIs. <code>@Accessors</code> lets you do this. + </p><p> + Some programmers like to use a prefix for their fields, i.e. they write <code>fPepper</code> instead of <code>pepper</code>. We <em>strongly</em> discourage doing this, as you can't unit test the validity of your prefixes, and refactor scripts may turn fields into local variables or method names. Furthermore, your tools (such as your editor) can take care of rendering the identifier in a certain way if you want this information to be instantly visible. Nevertheless, you can list the prefixes that your project uses via <code>@Accessors</code> as well. + </p><p> + <code>@Accessors</code> therefore has 3 options: + <ul> + <li> + <code>fluent</code> – A boolean. If <em>true</em>, the getter for <code>pepper</code> is just <code>pepper()</code>, and the setter is <code>pepper(T newValue)</code>. Furthermore, unless specified, <code>chain</code> defaults to <em>true</em>. <br /> + Default: <em>false</em>. + </li><li> + <code>chain</code> – A boolean. If <em>true</em>, generated setters return <code>this</code> instead of <code>void</code>.<br /> + Default: <em>false</em>, unless <code>fluent=true</code>, then Default: <em>true</em>. + </li><li> + <code>prefix</code> – A list of strings. If present, fields must be prefixed with any of these prefixes. Each field name is compared to each prefix in the list in turn, and if a match is found, the prefix is stripped out to create the base name for the field. It is legal to include an empty string in the list, which will always match. For characters which are letters, the character following the prefix must not be a lowercase letter, i.e. <code>pepper</code> is not a match even to prefix <code>p</code>, but <code>pEpper</code> would be (and would mean the base name of this field is <code>epper</code>). + </li> + </ul> + <p><p> + The <code>@Accessors</code> annotation is legal on types and fields; the annotation that applies is the one on the field if present, otherwise the one on the class. When a <code>@Accessors</code> annotation on a field is present, any <code>@Accessors</code> annotation also present on that field's type is ignored. + </p> + </@f.overview> + + <@f.snippets name="experimental/Accessors" /> + + <@f.confKeys> + <dt> + <code>lombok.accessors.chain</code> = [<code>true</code> | <code>false</code>] (default: false) + </dt><dd> + If set to <code>true</code>, any class that either doesn't have an <code>@Accessors</code> annotation, or it does, but that annotation does not have an explicit value for the <code>chain</code> parameter, will act as if <code>@Accessors(chain = true)</code> is present. + </dd><dt> + <code>lombok.accessors.fluent</code> = [<code>true</code> | <code>false</code>] (default: false) + </dt><dd> + If set to <code>true</code>, any class that either doesn't have an <code>@Accessors</code> annotation, or it does, but that annotation does not have an explicit value for the <code>fluent</code> parameter, will act as if <code>@Accessors(fluent = true)</code> is present. + </dd><dt> + <code>lombok.accessors.prefix</code> += <em>a field prefix</em> (default: empty list) + </dt><dd> + This is a list property; entries can be added with the <code>+=</code> operator. Inherited prefixes from parent config files can be removed with the <code>-=</code> operator. Any class that either doesn't have an <code>@Accessors</code> annotation, or it does, but that annotation does not have an explicit value for the <code>prefix</code> parameter, will act as if <code>@Accessors(prefix = {<em>prefixes listed in configuration</em>})</code> is present. + </dd><dt> + <code>lombok.accessors.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@Accessors</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + The nearest <code>@Accessors</code> annotation is also used for the various methods in lombok that look for getters, such as <code>@EqualsAndHashCode</code>. + </p><p> + If a prefix list is provided and a field does not start with one of them, that field is skipped entirely by lombok, and a warning will be generated. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/experimental/Delegate.html b/website/templates/features/experimental/Delegate.html new file mode 100644 index 00000000..265c754a --- /dev/null +++ b/website/templates/features/experimental/Delegate.html @@ -0,0 +1,59 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="@Delegate" logline="Don't lose your composition."> + <@f.history> + <p> + <code>@Delegate</code> was introduced as feature in lombok v0.10 (the experimental package did not exist yet).<br /> + It was moved to the experimental package in lombok v1.14; the old version from the main lombok package is now deprecated. + </p> + </@f.history> + + <@f.experimental> + <ul> + <li> + Not used that much. + </li><li> + Difficult to support for edge cases, such as recursive delegation. + </li><li> + API is rather unfriendly; it would be a lot nicer if you can simply implement some methods and let <code>@Delegate</code> generate delegates for whatever you didn't manually implement, but due to issues with generics erasure this also can't be made to work without caveats. + </li> + </ul> + Current status: <em>negative</em> - Currently we feel this feature will not move out of experimental status anytime soon, and support for this feature may be dropped if future versions of javac or ecj make it difficult to continue to maintain the feature. + </@f.experimental> + + <@f.overview> + <p> + Any field or no-argument method can be annotated with <code>@Delegate</code> to let lombok generate delegate methods that forward the call to this field (or the result of invoking this method). + </p><p> + Lombok delegates all <code>public</code> methods of the field's type (or method's return type), as well as those of its supertypes except for all methods declared in <code>java.lang.Object</code>. + </p><p> + You can pass any number of classes into the <code>@Delegate</code> annotation's <code>types</code> parameter. If you do that, then lombok will delegate all <code>public</code> methods in those types (and their supertypes, except <code>java.lang.Object</code>) instead of looking at the field/method's type. + </p><p> + All public non-<code>Object</code> methods that are part of the calculated type(s) are copied, whether or not you also wrote implementations for those methods. That would thus result in duplicate method errors. You can avoid these by using the <code>@Delegate(excludes=SomeType.class)</code> parameter to exclude all public methods in the excluded type(s), and their supertypes. + </p><p> + To have very precise control over what is delegated and what isn't, write private inner interfaces with method signatures, then specify these private inner interfaces as types in <code>@Delegate(types=PrivateInnerInterfaceWithIncludesList.class, excludes=SameForExcludes.class)</code>. + </p> + </@f.overview> + + <@f.snippets name="experimental/Delegate" /> + + <@f.confKeys> + <dt> + <code>lombok.delegate.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@Delegate</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + When passing classes to the annotation's <code>types</code> or <code>excludes</code> parameter, you cannot include generics. This is a limitation of java. Use private inner interfaces or classes that extend the intended type including the generics parameter to work around this problem. + </p><p> + When passing classes to the annotation, these classes do not need to be supertypes of the field. See the example. + </p><p> + <code>@Delegate</code> cannot be used on static fields or methods. + </p><p> + <code>@Delegate</code> cannot be used when the calculated type(s) to delegate / exclude themselves contain <code>@Delegate</code> annotations; in other words, <code>@Delegate</code> will error if you attempt to use it recursively. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/experimental/ExtensionMethod.html b/website/templates/features/experimental/ExtensionMethod.html new file mode 100644 index 00000000..f1d8b084 --- /dev/null +++ b/website/templates/features/experimental/ExtensionMethod.html @@ -0,0 +1,67 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="@ExtensionMethod" logline="Annoying API? Fix it yourself: Add new methods to existing types!"> + <@f.history> + <p> + <code>@ExtensionMethod</code> was introduced as experimental feature in lombok v0.11.2. + </p> + </@f.history> + + <@f.experimental> + <ul> + <li> + High-impact on code style. + </li><li> + Really would like to ship with utility methods to expand common classes, but so far lombok doesn't have a good distribution method for such runtime dependencies. + </li><li> + Affects quite a bit of eclipse, and auto-complete e.d. do not work yet in netbeans. + </li><li> + Should @ExtensionMethod be legal on methods? Should it be legal on packages? + </li><li> + This feature has more bugs associated with it than we would like, and it is a large maintenance burden. + </li> + </ul> + Current status: <em>hold</em> - Currently we feel this feature will not move out of experimental status anytime soon, but it will not significantly change and support for it is unlikely to be removed in future versions of lombok either. + </@f.experimental> + + <@f.overview> + <p> + You can make a class containing a bunch of <code>public</code>, <code>static</code> methods which all take at least 1 parameter. These methods will extend the type of the first parameter, as if they were instance methods, using the <code>@ExtensionMethod</code> feature. + </p><p> + For example, if you create <code>public static String toTitleCase(String in) { ... }</code>, you can use the <code>@ExtensionMethod</code> feature to make it look like the <code>java.lang.String</code> class has a method named <code>toTitleCase</code>, which has no arguments. The first argument of the static method fills the role of <code>this</code> in instance methods. + </p><p> + All methods that are <code>public</code>, <code>static</code>, and have at least 1 argument whose type is not primitive, are considered extension methods, and each will be injected into the namespace of the type of the first parameter as if they were instance methods. As in the above example, a call that looks like: <code>foo.toTitleCase()</code> is replaced with <code>ClassContainingYourExtensionMethod.toTitleCase(foo);</code>. Note that it is actually not an instant <code>NullPointerException</code> if <code>foo</code> is null - it is passed like any other parameter. + </p><p> + You can pass any number of classes to the <code>@ExtensionMethod</code> annotation; they will all be searched for extension methods. These extension methods apply for any code that is in the annotated class. + </p><p> + Lombok does not (currently) have any runtime dependencies which means lombok does not (currently) ship with any useful extension methods so you'll have to make your own. However, here's one that might spark your imagination: <br /> + <pre>public class ObjectExtensions { + public static <T> T or(T object, T ifNull) { + return object != null ? object : ifNull; + } +}</pre><br /> + With the above class, if you add <code>@ExtensionMethod(ObjectExtensions.class)</code> to your class definition, you can write:<br /> + <pre>String x = null; +System.out.println(x.or("Hello, World!"));</pre><br /> + The above code will not fail with a <code>NullPointerException</code>; it will actually output <code>Hello, World!</code> + </p> + </@f.overview> + + <@f.snippets name="experimental/ExtensionMethod" /> + + <@f.confKeys> + <dt> + <code>lombok.extensionMethod.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@ExtensionMethod</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + Calls are rewritten to a call to the extension method; the static method itself is not inlined. Therefore, the extension method must be present both at compile and at runtime. + </p><p> + Generics is fully applied to figure out extension methods. i.e. if the first parameter of your extension method is <code>List<? extends String></code>, then any expression that is compatible with that will have your extension method, but other kinds of lists won't. So, a <code>List<Object></code> won't get it, but a <code>List<String></code> will. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/experimental/FieldDefaults.html b/website/templates/features/experimental/FieldDefaults.html new file mode 100644 index 00000000..c0d3db96 --- /dev/null +++ b/website/templates/features/experimental/FieldDefaults.html @@ -0,0 +1,56 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="@FieldDefaults" logline="New default field modifiers for the 21st century."> + <@f.history> + <p> + @FieldDefaults was introduced as experimental feature in lombok v0.11.4. + </p> + </@f.history> + + <@f.experimental> + <ul> + <li> + New feature; unsure if this busts enough boilerplate. + </li><li> + Would be nice if you could stick this on the package-info.java package to set the default for all classes in that package. + </li><li> + Part of the work on @Value, which is experimental. + </li> + </ul> + Current status: <em>positive</em> - Currently we feel this feature may move out of experimental status with no or minor changes soon. + </@f.experimental> + + <@f.overview> + <p> + The <code>@FieldDefaults</code> annotation can add an access modifier (<code>public</code>, <code>private</code>, or <code>protected</code>) to each field in the annotated class or enum. It can also add <code>final</code> to each field in the annotated class or enum. + </p><p> + To add <code>final</code> to each (instance) field, use <code>@FieldDefaults(makeFinal=true)</code>. Any non-final field which must remain nonfinal can be annotated with <code>@NonFinal</code> (also in the <code>lombok.experimental</code> package). + </p><p> + To add an access modifier to each (instance) field, use <code>@FieldDefaults(level=AccessLevel.PRIVATE)</code>. Any field that does not already have an access modifier (i.e. any field that looks like package private access) is changed to have the appropriate access modifier. Any package private field which must remain package private can be annotated with <code>@PackagePrivate</code> (also in the <code>lombok.experimental</code> package). + </p> + </@f.overview> + + <@f.snippets name="experimental/FieldDefaults" /> + + <@f.confKeys> + <dt> + <code>lombok.fieldDefaults.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@FieldDefaults</code> as a warning or error if configured. + </dd><dt> + <code>lombok.fieldDefaults.defaultPrivate</code> = [<code>true</code> | <code>false</code>] (default: false) + </dt><dd> + (Since 1.16.8) If set to <code>true</code>, <em>every</em> field in <em>every</em> class or enum anywhere in the sources being compiled will be marked as <code>private</code> unless it has an explicit access modifier or the <code>@PackagePrivate</code> annotation, or an explicit <code>@FieldDefaults</code> annotation is present to override this config key. + </dd><dt> + <code>lombok.fieldDefaults.defaultFinal</code> = [<code>true</code> | <code>false</code>] (default: false) + </dt><dd> + (Since 1.16.8) If set to <code>true</code>, <em>every</em> field in <em>every</em> class or enum anywhere in the sources being compiled will be marked as <code>final</code> unless it has the <code>@NonFinal</code> annotation, or an explicit <code>@FieldDefaults</code> annotation is present to override this config key. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + Like other lombok handlers that touch fields, any field whose name starts with a dollar (<code>$</code>) symbol is skipped entirely. Such a field will not be modified at all. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/experimental/Helper.html b/website/templates/features/experimental/Helper.html new file mode 100644 index 00000000..93b6e2b4 --- /dev/null +++ b/website/templates/features/experimental/Helper.html @@ -0,0 +1,52 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="@Helper" logline="With a little help from my friends... Helper methods for java."> + <@f.history> + <p> + <code>@Helper</code> was introduced as an experimental feature in lombok v1.16.6. + </p> + </@f.history> + + <@f.experimental> + <ul> + <li> + Lambdas with general function types offer an alternative strategy. + </li><li> + Perhaps a way to make helper methods with less boilerplate is possible, making this feature obsolete. + </li> + </ul> + Current status: <em>unknown</em> - We don't have enough experience with this feature to make predictions on its future. + </@f.experimental> + + <@f.overview> + <p> + This annotation lets you put methods in methods. You might not know this, but you can declare classes inside methods, and the methods in this class can access any (effectively) final local variable or parameter defined and set before the declaration. Unfortunately, to actually call any methods you'd have to make an instance of this method local class first, but that's where <code>@Helper</code> comes in and helps you out! Annotate a method local class with <code>@Helper</code> and it's as if all the methods in that helper class are methods that you can call directly, just as if java had allowed methods to exist inside methods. + </p><p> + Normally you'd have to declare an instance of your helper, for example: <code>HelperClass h = new HelperClass();</code> directly after declaring your helper class, and then call methods in your helper class with <code>h.helperMethod();</code>. With <code>@Helper</code>, both of these things are no longer needed: You do not need to waste a line of code declaring an instance of the helper, and you don't need to prefix all your calls to helper methods with <code>nameOfHelperInstance.</code> + </p> + </@f.overview> + + <@f.snippets name="experimental/Helper" /> + + <@f.confKeys> + <dt> + <code>lombok.helper.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@Helper</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + <code>@Helper</code> requires that the helper class has a no-args constructor. A compiler error will be generated if this is not the case. + </p><p> + Currently, the instance of your helper that's made under the hood is called <code>$Foo</code>, where <code>Foo</code> is the name of your helper. We might change this in the future; please don't rely on this variable existing. We might even replace this later with a sibling method instead. + </p><p> + Please don't rely on <code>this</code> making any sense in the helper method code. You can refer to the real 'this' by using the syntax <code>NameOfMyClass.this</code>. + </p><p> + <em>ANY</em> unqualified method call in code that exists <em>below</em> the declaration of the helper method with the same name as any method in the helper is assumed to be a call to the helper. If the arguments don't end up being compatible, you get a compiler error. + </p><p> + Unless you're using JDK8 or higher (which introduced the concept of 'effectively final'), you'll have to declare local variables and parameters as <code>final</code> if you wish to refer to them in your method local class. This is a java limitation, not something specific to lombok's <code>@Helper</code>. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/experimental/UtilityClass.html b/website/templates/features/experimental/UtilityClass.html new file mode 100644 index 00000000..4cee3657 --- /dev/null +++ b/website/templates/features/experimental/UtilityClass.html @@ -0,0 +1,44 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="@UtilityClass" logline="Utility, metility, wetility! Utility classes for the masses."> + <@f.history> + <p> + <code>@UtilityClass</code> was introduced as an experimental feature in lombok v1.16.2. + </p> + </@f.history> + + <@f.experimental> + <ul> + <li> + Some debate as to whether its common enough to count as boilerplate. + </li> + </ul> + Current status: <em>positive</em> - Currently we feel this feature may move out of experimental status with no or minor changes soon. + </@f.experimental> + + <@f.overview> + <p> + A utility class is a class that is just a namespace for functions. No instances of it can exist, and all its members are static. For example, <code>java.lang.Math</code> and <code>java.util.Collections</code> are well known utility classes. This annotation automatically turns the annotated class into one. + </p><p> + A utility class cannot be instantiated. By marking your class with <code>@UtilityClass</code>, lombok will automatically generate a private constructor that throws an exception, flags as error any explicit constructors you add, and marks the class <code>final</code>. If the class is an inner class, the class is also marked <code>static</code>. + </p><p> + <em>All</em> members of a utility class are automatically marked as <code>static</code>. Even fields and inner classes. + </p> + </@f.overview> + + <@f.snippets name="experimental/UtilityClass" /> + + <@f.confKeys> + <dt> + <code>lombok.utilityClass.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@UtilityClass</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + There isn't currently any way to create non-static members, or to define your own constructor. If you want to instantiate the utility class, even only as an internal implementation detail, <code>@UtilityClass</code> cannot be used. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/experimental/Wither.html b/website/templates/features/experimental/Wither.html new file mode 100644 index 00000000..9642458b --- /dev/null +++ b/website/templates/features/experimental/Wither.html @@ -0,0 +1,66 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="@Wither" logline="Immutable 'setters' - methods that create a clone but with one changed field."> + <@f.history> + <p> + @Wither was introduced as experimental feature in lombok v0.11.4. + </p> + </@f.history> + + <@f.experimental> + <ul> + <li> + Still not sure that <code>@Wither</code> is an appropriate name for this feature. + </li><li> + Should there be an option to supply a way of cloning the input somehow? + </li><li> + Should the way that the clone is created by configurable? + </li><li> + Should we replace @Wither entirely with a builder class? + </li> + </ul> + Current status: <em>neutral</em> - More feedback requires on the items in the above list before promotion to the main package is warranted. + </@f.experimental> + + <@f.overview> + <p> + The next best alternative to a setter for an immutable property is to construct a clone of the object, but with a new value for this one field. A method to generate this clone is precisely what <code>@Wither</code> generates: a <code>withFieldName(newValue)</code> method which produces a clone except for the new value for the associated field. + </p><p> + For example, if you create <code>public class Point { private final int x, y; }</code>, setters make no sense because the fields are final. <code>@Wither</code> can generate a <code>withX(int newXValue)</code> method for you which will return a new point with the supplied value for <code>x</code> and the same value for <code>y</code>. + </p><p> + Like <a href="/features/GetterSetter"><code>@Setter</code></a>, you can specify an access level in case you want the generated wither to be something other than <code>public</code>:<br /> <code>@Wither(level = AccessLevel.PROTECTED)</code>. Also like <a href="/features/GetterSetter"><code>@Setter</code></a>, you can also put a <code>@Wither</code> annotation on a type, which means a 'wither' is generated for each field (even non-final fields). + </p><p> + To put annotations on the generated method, you can use <code>onMethod=@__({@AnnotationsHere})</code>; to put annotations on the only parameter of a generated wither method, you can use <code>onParam=@__({@AnnotationsHere})</code>. Be careful though! This is an experimental feature. For more details see the documentation on the <a href="/features/experimental/onX">onX</a> feature. + </p><p> + <em>NEW in lombok v1.12.0:</em> javadoc on the field will now be copied to generated withers. Normally, all text is copied, and <code>@param</code> is <em>moved</em> to the wither, whilst <code>@return</code> lines are stripped from the wither's javadoc. Moved means: Deleted from the field's javadoc. It is also possible to define unique text for the wither's javadoc. To do that, you create a 'section' named <code>WITHER</code>. A section is a line in your javadoc containing 2 or more dashes, then the text 'WITHER', followed by 2 or more dashes, and nothing else on the line. If you use sections, <code>@return</code> and <code>@param</code> stripping / copying for that section is no longer done (move the <code>@param</code> line into the section). + </p> + </@f.overview> + + <@f.snippets name="experimental/Wither" /> + + <@f.confKeys> + <dt> + <code>lombok.wither.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@Wither</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + Withers cannot be generated for static fields because that makes no sense. + </p><p> + Withers can be generated for abstract classes, but this generates an abstract method with the appropriate signature. + </p><p> + When applying <code>@Wither</code> to a type, static fields and fields whose name start with a $ are skipped. + </p><p> + For generating the method names, the first character of the field, if it is a lowercase character, is title-cased, otherwise, it is left unmodified. Then, <code>with</code> is prefixed. + </p><p> + No method is generated if any method already exists with the same name (case insensitive) and same parameter count. For example, <code>withX(int x)</code> will not be generated if there's already a method <code>withX(String... x)</code> even though it is technically possible to make the method. This caveat exists to prevent confusion. If the generation of a method is skipped for this reason, a warning is emitted instead. Varargs count as 0 to N parameters. + </p><p> + For <code>boolean</code> fields that start with <code>is</code> immediately followed by a title-case letter, nothing is prefixed to generate the wither name. + </p><p> + Any annotations named <code>@NonNull</code> (case insensitive) on the field are interpreted as: This field must not ever hold <em>null</em>. Therefore, these annotations result in an explicit null check in the generated wither. Also, these annotations (as well as any annotation named <code>@Nullable</code> or <code>@CheckForNull</code>) are copied to wither parameter. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/experimental/index.html b/website/templates/features/experimental/index.html new file mode 100644 index 00000000..21e8fceb --- /dev/null +++ b/website/templates/features/experimental/index.html @@ -0,0 +1,87 @@ +<#import "../../_scaffold.html" as main> +<#import "../_features.html" as f> + +<@main.scaffold title="Experimental"> + <div class="page-header top5"> + <div class="row text-center"> + <@main.h1 title="Lombok experimental features" /> + </div> + <div class="row"> + The <a href="/api/">Lombok javadoc</a> is available, but we advise these pages. + + <p> + Experimental features are available in your normal lombok installation, but are not as robustly supported as lombok's main features. In particular, experimental features: + <ul> + <li> + Are not tested as well as the core features. + </li><li> + Do not get bugs fixed as quickly as core features. + </li><li> + May have APIs that will change, possibly drastically if we find a different, better way to solve the same problem. + </li><li> + May disappear entirely if the feature is too difficult to support or doesn't bust enough boilerplate. + </li> + </ul> + </p><p> + Features that receive positive community feedback and which seem to produce clean, flexible code will eventually become accepted as a core feature and move out of the experimental package. + </p> + </div> + <div class="row"> + <@main.feature title="var" href="var"> + Modifiable local variables with a type inferred by assigning value. + </@main.feature> + + <@main.feature title="@Accessors" href="Accessors"> + A more fluent API for getters and setters. + </@main.feature> + + <@main.feature title="@ExtensionMethod" href="ExtensionMethod"> + Annoying API? Fix it yourself: Add new methods to existing types! + </@main.feature> + + <@main.feature title="@FieldDefaults" href="FieldDefaults"> + New default field modifiers for the 21st century. + </@main.feature> + + <@main.feature title="@Delegate" href="Delegate"> + Don't lose your composition. + </@main.feature> + + <@main.feature title="@Wither" href="Wither"> + Immutable 'setters' - methods that create a clone but with one changed field. + </@main.feature> + + <@main.feature title="onMethod= / onConstructor= / onParam=" href="onX"> + Sup dawg, we heard you like annotations, so we put annotations in your annotations so you can annotate while you're annotating. + </@main.feature> + + <@main.feature title="@UtilityClass" href="UtilityClass"> + Utility, metility, wetility! Utility classes for the masses. + </@main.feature> + + <@main.feature title="@Helper" href="Helper"> + With a little help from my friends... Helper methods for java. + </@main.feature> + </div> + + <@f.confKeys> + <dt> + <code>lombok.experimental.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of any of the features listed here as a warning or error if configured. + </dd> + </@f.confKeys> + + <div class="row"> + <h3 class="text-center">Putting the "Ex" in "Experimental": promoted or deleted experimental features.</h3> + <div class="row"> + <@main.feature title="@Value: promoted" href="/features/Value"> + <code>@Value</code> has proven its value and has been moved to the main package. + </@main.feature> + <@main.feature title="@Builder: promoted" href="/features/Builder"> + <code>@Builder</code> is a solid base to build APIs on, and has been moved to the main package. + </@main.feature> + </div> + </div> + </div> +</@main.scaffold> diff --git a/website/templates/features/experimental/onX.html b/website/templates/features/experimental/onX.html new file mode 100644 index 00000000..fd2e7b58 --- /dev/null +++ b/website/templates/features/experimental/onX.html @@ -0,0 +1,62 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="onX" logline="Sup dawg, we heard you like annotations, so we put annotations in your annotations so you can annotate while you're annotating."> + <@f.history> + <p> + onX was introduced as experimental feature in lombok v0.11.8. + </p> + </@f.history> + + <@f.experimental> + <ul> + <li> + Ugly syntax. The syntax of this feature is not optimal, but it is the least convoluted syntax that could possibly work (for now!) + </li><li> + Possibly java 9 will offer (much) better ways of supporting this feature. + </li><li> + Uncertainty: Future versions of javac may break this feature, and we may not be able to restore it. + </li> + </ul> + Current status: <em>uncertain</em> - Currently we feel this feature cannot move out of experimental status. + </@f.experimental> + + <@f.overview> + <p> + <strong>This feature is considered 'workaround status' - it exists in order to allow users of lombok that cannot work without this feature to have access to it anyway. If we find a better way to implement this feature, or some future java version introduces an alternative strategy, this feature can disappear without a reasonable deprecation period. Also, this feature may not work in future versions of javac. Use at your own discretion.</strong> + </p><p> + Most annotations that make lombok generate methods or constructors can be configured to also make lombok put custom annotations on elements in the generated code. + </p><p> + <code>@Getter</code>, <code>@Setter</code>, and <code>@Wither</code> support the <code>onMethod</code> option, which will put the listed annotations on the generated method. + </p><p> + <code>@AllArgsConstructor</code>, <code>@NoArgsConstructor</code>, and <code>@RequiredArgsConstructor</code> support the <code>onConstructor</code> option which will put the listed annotations on the generated constructor. + </p><p> + <code>@Setter</code> and <code>@Wither</code> support <code>onParam</code> in addition to <code>onMethod</code>; annotations listed will be put on the only parameter that the generated method has. <code>@EqualsAndHashCode</code> also supports <code>onParam</code>; the listed annotation(s) will be placed on the single parameter of the generated <code>equals</code> method, as well as any generated <code>canEqual</code> method. + </p><p> + The syntax is a little strange and depends on the javac you are using.<br /> + On javac7, to use any of the 3 <code>onX</code> features, you must wrap the annotations to be applied to the constructor / method / parameter in <code>@__(@AnnotationGoesHere)</code>. To apply multiple annotations, use <code>@__({@Annotation1, @Annotation2})</code>. The annotations can themselves obviously have parameters as well.<br /> + On javac8 and up, you add an underscore after <code>onMethod</code>, <code>onParam</code>, or <code>onConstructor</code>. + </p> + </@f.overview> + + <@f.snippets name="experimental/onX" /> + + <@f.confKeys> + <dt> + <code>lombok.onX.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>onX</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + The reason of the weird syntax is to make this feature work in javac 7 compilers; the <code>@__</code> type is an annotation reference to the annotation type <code>__</code> (double underscore) which doesn't actually exist; this makes javac 7 delay aborting the compilation process due to an error because it is possible an annotation processor will later create the <code>__</code> type. Instead, lombok applies the annotations and removes the references so that the error will never actually occur. The point is: The <code>__</code> type <em>must not exist</em>, otherwise the feature does not work. In the rare case that the <code>__</code> type does exist (and is imported or in the package), you can simply add more underscores. Technically any non-existent type would work, but to maintain consistency and readability and catch erroneous use, lombok considers it an error if the 'wrapper' annotation is anything but a series of underscores. + </p><p> + In javac8, the above feature should work but due to a bug in javac8 it does not. However, starting in javac8, if the parameter name does not exist in the annotation type, compilation proceeds to a phase where lombok can fix it. + </p><p> + To reiterate: This feature can disappear at any time; if you use this feature, be prepared to adjust your code when we find a nicer way of implementing this feature, or, if a future version of javac forces us to remove this feature entirely with no alternative. + </p><p> + The <code>onX</code> parameter is not legal on any type-wide variant. For example, a <code>@Getter</code> annotation on a class does not support <code>onMethod</code>. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/index.html b/website/templates/features/index.html new file mode 100644 index 00000000..cd4c9e26 --- /dev/null +++ b/website/templates/features/index.html @@ -0,0 +1,97 @@ +<#import "../_scaffold.html" as main> + +<@main.scaffold title="Stable"> + <div class="page-header top5"> + <div class="row text-center"> + <@main.h1 title="Lombok features" /> + </div> + <div class="row"> + The <a href="/api/">Lombok javadoc</a> is available, but we advise these pages. + + <@main.feature title="val" href="val"> + Finally! Hassle-free final local variables. + </@main.feature> + + <@main.feature title="var" href="var"> + Mutably! Hassle-free local variables. + </@main.feature> + + <@main.feature title="@NonNull" href="NonNull"> + or: How I learned to stop worrying and love the NullPointerException. + </@main.feature> + + <@main.feature title="@Cleanup" href="Cleanup"> + Automatic resource management: Call your <code>close()</code> methods safely with no hassle. + </@main.feature> + + <@main.feature title="@Getter/@Setter" href="GetterSetter"> + Never write <code>public int getFoo() {return foo;}</code> again. + </@main.feature> + + <@main.feature title="@ToString" href="ToString"> + No need to start a debugger to see your fields: Just let lombok generate a <code>toString</code> for + you! + </@main.feature> + + <@main.feature title="@EqualsAndHashCode" href="EqualsAndHashCode"> + Equality made easy: Generates <code>hashCode</code> and <code>equals</code> implementations from the + fields of your object.. + </@main.feature> + + <@main.feature title="@NoArgsConstructor, @RequiredArgsConstructor and @AllArgsConstructor" href="constructor"> + Constructors made to order: Generates constructors that take no arguments, one argument per final / + non-nullfield, or one argument for every field. + </@main.feature> + + <@main.feature title="@Data" href="Data"> + All together now: A shortcut for <code>@ToString</code>, <code>@EqualsAndHashCode</code>, + <code>@Getter</code> on all fields, and <code>@Setter</code> on all non-final fields, and + <code>@RequiredArgsConstructor</code>! + </@main.feature> + + <@main.feature title="@Value" href="Value"> + Immutable classes made very easy. + </@main.feature> + + <@main.feature title="@Builder" href="Builder"> + ... and Bob's your uncle: No-hassle fancy-pants APIs for object creation! + </@main.feature> + + <@main.feature title="@SneakyThrows" href="SneakyThrows"> + To boldly throw checked exceptions where no one has thrown them before! + </@main.feature> + + <@main.feature title="@Synchronized" href="Synchronized"> + <code>synchronized</code> done right: Don't expose your locks. + </@main.feature> + + <@main.feature title="@Getter(lazy=true)" href="GetterLazy"> + Laziness is a virtue! + </@main.feature> + + <@main.feature title="@Log" href="log"> + Captain's Log, stardate 24435.7: "What was that line again?" + </@main.feature> + + <@main.feature title="experimental" href="/features/experimental/all"> + Head to the lab: The new stuff we're working on. + </@main.feature> + </div> + + <div class="row"> + <@main.h1 title="Configuration system" /> + + <div class="text-center"> + Lombok, made to order: <a href="configuration">Configure lombok features</a> in one place for your entire project or even your workspace. + </div> + </div> + + <div class="row"> + <@main.h1 title="Running delombok" /> + + <div> + Delombok copies your source files to another directory, replacing all lombok annotations with their desugared form. So, it'll turn <code>@Getter</code> back into the actual getter. It then removes the annotation. This is useful for all sorts of reasons; you can check out what's happening under the hood, if the unthinkable happens and you want to stop using lombok, you can easily remove all traces of it in your source, and you can use delombok to preprocess your source files for source-level tools such as javadoc and GWT. More information about how to run delombok, including instructions for build tools can be found at the <a href="delombok">delombok page</a>. + </div> + </div> + </div> +</@main.scaffold> diff --git a/website/templates/features/log.html b/website/templates/features/log.html new file mode 100644 index 00000000..2854e896 --- /dev/null +++ b/website/templates/features/log.html @@ -0,0 +1,106 @@ +<#import "_features.html" as f> + +<@f.scaffold title="@Log (and friends)" logline="Captain's Log, stardate 24435.7: "What was that line again?""> + <@f.history> + <p> + The various <code>@Log</code> variants were added in lombok v0.10. + <em>NEW in lombok 0.10: </em>You can annotate any class with a log annotation to let lombok generate a logger field.<br/> + The logger is named <code>log</code> and the field's type depends on which logger you have selected. + </p> + </@f.history> + + <@f.overview> + <p> + You put the variant of <code>@Log</code> on your class (whichever one applies to the logging system you use); you then have a static final <code>log</code> field, initialized to the name of your class, which you can then use to write log statements. + </p><p> + There are several choices available:<br /> + <dl> + <dt> + <code>@CommonsLog</code> + </dt><dd> + Creates <code><span class="keyword">private static final </span><a href="https://commons.apache.org/logging/apidocs/org/apache/commons/logging/Log.html">org.apache.commons.logging.Log</a> <span class="staticfield">log</span> = <a href="https://commons.apache.org/logging/apidocs/org/apache/commons/logging/LogFactory.html#getLog(java.lang.Class)">org.apache.commons.logging.LogFactory.getLog</a>(LogExample.<span class="keyword">class</span>);</code> + </dd><dt> + <code>@JBossLog</code> + </dt><dd> + Creates <code><span class="keyword">private static final </span><a href="http://docs.jboss.org/jbosslogging/latest/org/jboss/logging/Logger.html">org.jboss.logging.Logger</a> <span class="staticfield">log</span> = <a href="http://docs.jboss.org/jbosslogging/latest/org/jboss/logging/Logger.html#getLogger(java.lang.Class)">org.jboss.logging.Logger.getLogger</a>(LogExample.<span class="keyword">class</span>);</code> + </dd><dt> + <code>@Log</code> + </dt><dd> + Creates <code><span class="keyword">private static final </span><a href="http://download.oracle.com/javase/6/docs/api/java/util/logging/Logger.html">java.util.logging.Logger</a> <span class="staticfield">log</span> = <a href="http://download.oracle.com/javase/6/docs/api/java/util/logging/Logger.html#getLogger(java.lang.String)">java.util.logging.Logger.getLogger</a>(LogExample.<span class="keyword">class</span>.getName());</code> + </dd><dt> + <code>@Log4j</code> + </dt><dd> + Creates <code><span class="keyword">private static final </span><a href="https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Logger.html">org.apache.log4j.Logger</a> <span class="staticfield">log</span> = <a href="https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Logger.html#getLogger(java.lang.Class)">org.apache.log4j.Logger.getLogger</a>(LogExample.<span class="keyword">class</span>);</code> + </dd><dt> + <code>@Log4j2</code> + </dt><dd> + Creates <code><span class="keyword">private static final </span><a href="https://logging.apache.org/log4j/2.0/log4j-api/apidocs/org/apache/logging/log4j/Logger.html">org.apache.logging.log4j.Logger</a> <span class="staticfield">log</span> = <a href="https://logging.apache.org/log4j/2.0/log4j-api/apidocs/org/apache/logging/log4j/LogManager.html#getLogger(java.lang.Class)">org.apache.logging.log4j.LogManager.getLogger</a>(LogExample.<span class="keyword">class</span>);</code> + </dd><dt> + <code>@Slf4j</code> + </dt><dd> + Creates <code><span class="keyword">private static final </span><a href="http://www.slf4j.org/api/org/slf4j/Logger.html">org.slf4j.Logger</a> <span class="staticfield">log</span> = <a href="http://www.slf4j.org/apidocs/org/slf4j/LoggerFactory.html#getLogger(java.lang.Class)">org.slf4j.LoggerFactory.getLogger</a>(LogExample.<span class="keyword">class</span>);</code> + </dd><dt> + <code>@XSlf4j</code> + </dt><dd> + Creates <code><span class="keyword">private static final </span><a href="http://www.slf4j.org/api/org/slf4j/ext/XLogger.html">org.slf4j.ext.XLogger</a> <span class="staticfield">log</span> = <a href="http://www.slf4j.org/apidocs/org/slf4j/ext/XLoggerFactory.html#getXLogger(java.lang.Class)">org.slf4j.ext.XLoggerFactory.getXLogger</a>(LogExample.<span class="keyword">class</span>);</code> + </dd> + </dl> + </p><p> + By default, the topic (or name) of the logger will be the class name of the class annotated with the <code>@Log</code> annotation. This can be customised by specifying the <code>topic</code> parameter. For example: <code>@XSlf4j(topic="reporting")</code>. + </p> + </@f.overview> + + <@f.snippets name="Log" /> + + <@f.confKeys> + <dt> + <code>lombok.log.fieldName</code> = <em>an identifier</em> (default: <code>log</code>). + </dt><dd> + The generated logger fieldname is by default '<code>log</code>', but you can change it to a different name with this setting. + </dd><dt> + <code>lombok.log.fieldIsStatic</code> = [<code>true</code> | <code>false</code>] (default: true) + </dt><dd> + Normally the generated logger is a <code>static</code> field. By setting this key to <code>false</code>, the generated field will be an instance field instead. + </dd><dt> + <code>lombok.log.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of any of the various log annotations as a warning or error if configured. + </dd><dt> + <code>lombok.log.apacheCommons.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@lombok.extern.apachecommons.CommonsLog</code> as a warning or error if configured. + </dd><dt> + <code>lombok.log.javaUtilLogging.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@lombok.extern.java.Log</code> as a warning or error if configured. + </dd><dt> + <code>lombok.log.jbosslog.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@lombok.extern.jbosslog.JBossLog</code> as a warning or error if configured. + </dd><dt> + <code>lombok.log.log4j.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@lombok.extern.log4j.Log4j</code> as a warning or error if configured. + </dd><dt> + <code>lombok.log.log4j2.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@lombok.extern.log4j.Log4j2</code> as a warning or error if configured. + </dd><dt> + <code>lombok.log.slf4j.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@lombok.extern.slf4j.Slf4j</code> as a warning or error if configured. + </dd><dt> + <code>lombok.log.xslf4j.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>@lombok.extern.slf4j.XSlf4j</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + If a field called <code>log</code> already exists, a warning will be emitted and no code will be generated. + </p><p> + A future feature of lombok's diverse log annotations is to find calls to the logger field and, if the chosen logging framework supports it and the log level can be compile-time determined from the log call, guard it with an <code>if</code> statement. This way if the log statement ends up being ignored, the potentially expensive calculation of the log string is avoided entirely. This does mean that you should <em>NOT</em> put any side-effects in the expression that you log. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/val.html b/website/templates/features/val.html new file mode 100644 index 00000000..32a8ffdf --- /dev/null +++ b/website/templates/features/val.html @@ -0,0 +1,36 @@ +<#import "_features.html" as f> + +<@f.scaffold title="val" logline="Finally! Hassle-free final local variables."> + <@f.history> + <p> + <code>val</code> was introduced in lombok 0.10. + </p> + </@f.history> + <@f.overview> + <p> + You can use <code>val</code> as the type of a local variable declaration instead of actually writing the type. When you do this, the type will be inferred from the initializer expression. The local variable will also be made final. This feature works on local variables and on foreach loops only, not on fields. The initializer expression is required. + </p><p> + <code>val</code> is actually a 'type' of sorts, and exists as a real class in the <code>lombok</code> package. You must import it for val to work (or use <code>lombok.val</code> as the type). The existence of this type on a local variable declaration triggers both the adding of the <code>final</code> keyword as well as copying the type of the initializing expression which overwrites the 'fake' <code>val</code> type. + </p><p> + <em>WARNING: This feature does not currently work in NetBeans.</em> + </p> + </@f.overview> + + <@f.snippets name="val" /> + + <@f.confKeys> + <dt> + <code>lombok.val.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>val</code> as a warning or error if configured. + </dd> + </@f.confKeys> + + <@f.smallPrint> + <p> + For compound types, the most common superclass is inferred, not any shared interfaces. For example, <code>bool ? new HashSet() : new ArrayList()</code> is an expression with a compound type: The result is both <code>AbstractCollection</code> as well as <code>Serializable</code>. The type inferred will be <code>AbstractCollection</code>, as that is a class, whereas <code>Serializable</code> is an interface. + </p><p> + In ambiguous cases, such as when the initializer expression is <code>null</code>, <code>java.lang.Object</code> is inferred. + </p> + </@f.smallPrint> +</@f.scaffold> diff --git a/website/templates/features/var.html b/website/templates/features/var.html new file mode 100644 index 00000000..60e24914 --- /dev/null +++ b/website/templates/features/var.html @@ -0,0 +1,27 @@ +<#import "_features.html" as f> + +<@f.scaffold title="var" logline="Mutably! Hassle-free local variables."> + <@f.history> + <p><ul> + <li><code>var</code> was promoted to the main package in lombok 2.0.0; given that <a href="http://openjdk.java.net/jeps/286">JEP 286</a> establishes expectations, and lombok's take on <code>var</code> follows these, we've decided to promote <code>var</code> eventhough the feature remains controversial.</li> + <li><code>var</code> was introduced in lombok 1.16.12 as experimental feature.</li> + </ul></p> + </@f.history> + + <@f.overview> + <p> + <code>var</code> works exactly like <a href="/features/val"><code>val</code></a>, except the local variable is <em>not</em> marked as <code>final</code>. + </p><p> + The type is still entirely derived from the mandatory initializer expression, and any further assignments, while now legal (because the variable is no longer <code>final</code>), aren't looked at to determine the appropriate type.<br /> + For example, <code>var x = "Hello"; x = Color.RED;</code> does <em>not</em> work; the type of x will be inferred to be <code>java.lang.String</code> and thus, the <code>x = Color.RED</code> assignment will fail. If the type of <code>x</code> was inferred to be <code>java.lang.Object</code> this code would have compiled, but that's not how<code>var</code> works. + </p> + </@f.overview> + + <@f.confKeys> + <dt> + <code>lombok.var.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set) + </dt><dd> + Lombok will flag any usage of <code>var</code> as a warning or error if configured. + </dd> + </@f.confKeys> +</@f.scaffold> diff --git a/website/templates/main.html b/website/templates/main.html new file mode 100644 index 00000000..25098758 --- /dev/null +++ b/website/templates/main.html @@ -0,0 +1,44 @@ +<#import "/_scaffold.html" as main> +<@main.scaffold load=["/js/supporters.js"]> + <div class="page-header top5"> + <div class="row text-center"> + <@main.h1 title="Project Lombok" /> + <p> + Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java.<br /> + Never write another getter or equals method again. Early access to future java features such as <code>val</code>, and much more. + </p> + </div> + <div class="video text-center"> + <div id="clickForVideo"><span class="clickToTap">Click</span> to watch a 4 minute demo to learn more.</div> + <video id="demoVideo" hidden="hidden" width="800" height="480" poster="/img/poster.png" controls="controls" preload="none"> + <source src="https://projectlombok.org/videos/lombok.ogv" type="video/ogg" /> + <source src="https://projectlombok.org/videos/lombok.mp4" type="video/mp4" /> + <source src="https://projectlombok.org/videos/lombok-iPhone.m4v" type="video/mp4" /> + <@main.h1 title="Can't watch the video?" /> + <p> + <a href="https://www.youtube.com/watch?v=y6zMyM-YTgg">See it on Youtube instead</a>. + </p><p> + Or, download the video:<br/> + <a href="/videos/lombok.mp4">MPEG4 / H.264 (Windows / Mac)</a> | + <a href="/videos/lombok.ogv">Ogg Theora & Vorbis ".ogv" (Linux)</a> + </p> + </video> + <div class="row"> + <div class="text-center"> + <a href="http://jnb.ociweb.com/jnb/jnbJan2010.html">Show me a text and images based explanation and tutorial instead!</a> + </div> + </div> + </div> + <div class="row text-center"> + <@main.h2 title="Upcoming presentations" /> + <p> + We're talking to NL-JUG to give a presentation soon in the The Hague (The Netherlands) area.<br /> + Want us to present at your JUG or conference? Feel free to contact us, via email (<code>info@</code>) or twitter: <a href="https://twitter.com/project_lombok">@project_lombok</a>. + </p> + </div> + <div class="row text-center supporterBar"> + <h2 class="introText" hidden="hidden">Project Lombok is <a href="/supporters">powered by</a>:</h2> + <div class="supporterFooter" hidden="hidden"><a class="buttonLike" href="/order-license-info">I want to support Project Lombok too!</a></div> + </div> + </div> +</@main.scaffold> diff --git a/website/templates/order-license-info.html b/website/templates/order-license-info.html new file mode 100644 index 00000000..3572ad0f --- /dev/null +++ b/website/templates/order-license-info.html @@ -0,0 +1,31 @@ +<#import "/_scaffold.html" as main> + +<@main.scaffold title="Order / Donate"> + <div class="page-header top5"> + <div class="row text-center"> + <h2>Order a professional or enterprise license</h2> + </div> + <div class="row"> + <p> + 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. + </p><p> + <a class="buttonLike orderButton" href="/order-license">Order a professional or enterprise license</a><br /> + <a class="buttonLike orderButton" href="https://www.patreon.com/lombok">For individuals: Become a patreon</a> + </p> + <div class="row text-center"> + <h2>Benefits of becoming a licensee</h2> + </div> + <p> + Lombok is and will remain a free, open source product. However, we ask you to consider becoming a licensee. Licensees will be <a href="/supporters">listed</a> on the <code>projectlombok.org</code> website, we'll send you some stickers, and an official license. You'll be supporting the development of Project Lombok. + </p> + <div class="row text-center"> + <h2>Small print</h2> + </div> + <p class="deemphasize"> + 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. + </p><p class="deemphasize"> + 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. + </p> + </div> + </div> +</@main.scaffold> diff --git a/website/templates/order-license.html b/website/templates/order-license.html new file mode 100644 index 00000000..818c27f3 --- /dev/null +++ b/website/templates/order-license.html @@ -0,0 +1,151 @@ +<#import "/_scaffold.html" as main> + +<@main.scaffold load=["/js/order-license.js"] title="Order a license"> + <div class="page-header top5 order-license"> + <div class="row text-center"> + <h2>Order a professional or enterprise license</h2> + </div> + <div class="row"> + <form> + <fieldset class="form-group"> + <legend>Basic information</legend> + <div class="form-group"> + <label for="companyName">Company name</label> + <input type="text" class="form-control" aria-describedby="companyNameHelp" id="companyName" placeholder="license holder name" /> + <div id="companyNameErr" class="formErr" hidden="hidden">Company name is a required field.</div> + <small id="companyNameHelp" class="form-text text-muted">If applying for an individual license, fill in your own name.</small> + </div> + <div class="form-group"> + <label for="email">Email</label> + <input type="email" class="form-control" aria-describedby="emailHelp" id="email" placeholder="email of contact / holder" /> + <div id="emailErr" class="formErr" hidden="hidden">Your email address is required; we will send the bill to this email address.</div> + <small id="emailHelp" class="form-text text-muted">We will never share this email with any third parties; we'll email you the invoice at this email address.</small> + </div> + </fieldset> + <fieldset class="form-group"> + <legend>Type of license</legend> + <div class="form-group"> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input licenseType" name="licenseType" value="professional" checked="checked" /> + Professional (€2,- per developer per month; ~ $2.50). + </label> + </div> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input licenseType" name="licenseType" value="enterprise" /> + Enterprise (€5,- per developer per month; ~ $6.10). + </label> + </div> + </div> + <div id="licenseTypeErr" class="formErr" hidden="hidden">License type is a required field.</div> + <div class="form-group"> + <label for="seats"># of developers using lombok</label> + <input type="number" placeholder="# of developers" class="form-control" id="seats" /> + <div id="seatsErr" class="formErr" hidden="hidden">We need to know the # of developers to determine the license price.</div> + </div> + </fieldset> + <fieldset class="form-group"> + <legend>Payment</legend> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input paymentType" name="paymentType" value="yearly" checked="checked" /> + Yearly + </label> + </div> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input paymentType" name="paymentType" value="monthly" /> + Monthly<span id="onlyYearlyWarning" hidden="hidden" class="warning">The total license cost is sufficiently low that we'll bill you yearly.</span> + </label> + </div> + <div id="paymentTypeErr" class="formErr" hidden="hidden">Payment type is a required field.</div> + <div class="form-group" hidden="hidden" id="costIndicator"> + </div> + </fieldset> + <fieldset class="form-group"> + <legend>Mention</legend> + <div class="form-check"> + <label class="form-check-label"> + <input type="checkbox" class="form-check-input" id="mentionMe" name="mentionMe" checked="checked" /> + Mention me on the <em>supporters / licensees</em> page. + </label> + </div> + <div class="form-group"> + <label for="companyUrl">Company URL (optional)</label> + <input type="url" class="form-control" id="companyUrl" placeholder="URL of your company website" /> + </div> + <div class="form-group"> + <label for="logo">Company Logo (optional)</label> + <input type="file" style="display: none;" id="logo" name="logo" /> + <button class="form-control" id="companyLogo">Upload a logo</button> + <div id="logoCnt" style="display: none;"></div> + <button class="form-control" id="deleteCompanyLogo" style="display: none;">Remove logo</button> + </div> + </fieldset> + <fieldset class="form-group"> + <legend>Location and VAT</legend> + <div class="form-group"> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input locationType" name="locationType" value="eu" checked="checked" /> + We are based in the Europe + </label> + </div> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input locationType" name="locationType" value="usa" /> + We are based in the USA + </label> + </div> + <div class="form-check"> + <label class="form-check-label"> + <input type="radio" class="form-check-input locationType" name="locationType" value="other" /> + We are based elsewhere + </label> + </div> + <div id="locationTypeErr" class="formErr" hidden="hidden">Location (continent) is a required field.</div> + </div> + <div class="form-group" id="locationType_eu"> + <label for="euVat">EU VAT number</label> + <input type="text" class="form-control" id="euVat" placeholder="EU VAT number" /> + <div id="euVatErr" class="formErr" hidden="hidden">EU VAT is a required field. If you are an individual and you have no EU VAT number, consider giving us a <a href="https://www.patreon.com/lombok">patreon</a> donation.</div> + </div> + <div class="form-group" hidden="hidden" id="locationType_usa"> + Please <a href="/W8BEN_lombok.pdf">download our W-8BEN form</a> for your tax records. + </div> + <div class="form-group" hidden="hidden" id="locationType_other"> + Please make sure you fulfill any local tax obligations for buying software from other countries. + </div> + </fieldset> + <fieldset class="form-group"> + <legend>Payment method</legend> + <div class="form-group"> + <div class="form-check" id="paymentMethod_iban"> + <label class="form-check-label"> + <input type="radio" class="form-check-input" name="paymentMethod" value="iban" checked="checked" /> + Pay via IBAN (european bank transfer) + </label> + </div> + <div class="form-check" hidden="hidden" id="paymentMethod_intl"> + <label class="form-check-label"> + <input type="radio" class="form-check-input" name="paymentMethod" value="intl" /> + Pay via international bank transfer + </label> + </div> + <div class="form-check"> + <label class="form-check-label" id="paymentMethod_payoneer"> + <input type="radio" class="form-check-input" name="paymentMethod" value="payoneer" /> + Pay with Payoneer + </label> + </div> + <div id="paymentMethodErr" class="formErr" hidden="hidden">Payment method is a required field.</div> + </div> + </fieldset> + <button type="submit" id="submit" class="btn btn-primary">Submit order</button> + <div id="orderHelp">If you run into issues with the order form, or you have any other questions, please send us an email at <a href="mailto:orders@projectlombok.org"><code>orders@projectlombok.org</code></a>. You can cancel your subscription at any time.</div> + <div class="orderDetails">Our EU VAT number: NL858105378B01</div> + </p> + </div> + </div> +</@main.scaffold> diff --git a/website/templates/setup/_setup.html b/website/templates/setup/_setup.html new file mode 100644 index 00000000..166891ce --- /dev/null +++ b/website/templates/setup/_setup.html @@ -0,0 +1,28 @@ +<#import "/_scaffold.html" as main> + +<#macro introduction> + <div class="row"> + <#nested> + </div> +</#macro> + +<#macro section title> + <div class="row"> + <@main.h3 title="${title}" /> + + <#nested> + </div> +</#macro> + +<#macro scaffold title load=[]> + <@main.scaffold load title> + <div class="page-header top5" id="featureContent"> + <div class="row text-center"> + <div class="header-group"> + <@main.h1 title="${title}" /> + </div> + </div> + <#nested> + </div> + </@main.scaffold> +</#macro> diff --git a/website/templates/setup/android.html b/website/templates/setup/android.html new file mode 100644 index 00000000..19e92a58 --- /dev/null +++ b/website/templates/setup/android.html @@ -0,0 +1,84 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Android"> + <@s.introduction> + <p> + Android development with lombok is easy and won't make your android application any 'heavier' because lombok is a compile-time only library. It is important to configure your android project properly to make sure lombok doesn't end up in your application and waste precious space on android devices. + </p><p> + The instructions listed below are excerpts from <a href="https://github.com/excilys/androidannotations/wiki/Cookbook">The + AndroidAnnotations project cookbook</a>. You may wish to refer to that documentation for complete instructions; lombok is just + the equivalent to <code>androidannotations-VERSION.jar</code>; there is no <code>-api</code> aspect. + </p> + </@s.introduction> + + <@s.section title="Gradle"> + <p> + <ul><li> + Make sure that the version of your android plugin is <code>>= 0.4.3</code> + </li><li> + Use the <a href="https://github.com/franzbecker/gradle-lombok">gradle-lombok</a> plugin. + </li><li> + If you don't want to use the plugin, add Lombok to your application's <code>dependencies</code> block (requires Gradle v2.12 or newer):<br /><br /> +<pre> +dependencies { + compileOnly "org.projectlombok:lombok:${version}" +}</pre> + </li></ul> + </p> + </@s.section> + + <@s.section title="Android Studio"> + <p> + Follow the previous instructions (<em>Gradle</em>). In addition to setting up your gradle project correctly, you need to add the <a href="https://plugins.jetbrains.com/plugin/6317">Lombok IntelliJ plugin</a> to add lombok support to Android Studio: + <ul><li> + Go to <code>File > Settings > Plugins</code> + </li><li> + Click on <code>Browse repositories...</code> + </li><li> + Search for <code>Lombok Plugin</code> + </li><li> + Click on <code>Install plugin</code> + </li><li> + Restart Android Studio + </li></ul> + </p> + <p> + Modify your application's <code>dependencies</code> block: +<pre> +dependencies { + compileOnly 'org.projectlombok:lombok:${version}' + annotationProcessor 'org.projectlombok:lombok:${version}' +}</pre> + </@s.section> + + <@s.section title="Eclipse"> + <p> + In eclipse, create a 'lightweight' lombok jar that contains only the annotations by running:<br /><br /> + <pre> +java -jar lombok.jar publicApi</pre> + Then, add the <code>lombok-api.jar</code> file created by running this command to your android project instead of the complete <code>lombok.jar</code>, and, as usual, install lombok into eclipse by double-clicking <code>lombok.jar</code>. + </p> + </@s.section> + + <@s.section title="Maven"> + <p> + You should be able to just follow the normal <a href="maven">integrate lombok with maven instructions</a>.<br /> + Note that if you use android, eclipse, and maven together you may have to replace <code>lombok.jar</code> in your eclipse android project's build path (which you can modify in that project's properties page) with <code>lombok-api.jar</code>, as produced in the procedure explained for <em>Eclipse</em>, above. + </p> + </@s.section> + + <@s.section title="Ant"> + <p> + <ul><li> + Find <code>build.xml</code> in <code>${r"${ANDROID_SDK_ROOT}"}/tools/ant/build.xml</code> and copy the <code>-compile</code> target into the paste buffer. + </li><li> + Copy this to the <code>build.xml</code> of your own project, right before the <code><import file="${r"${sdk.dir}"}/tools/ant/build.xml"></code> line. + </li><li> + Create a <code>compile-libs</code> directory in your own project and copy the complete <code>lombok.jar</code> to it. + </li><li> + Now modify the <code><classpath></code> entry inside the <code><javac></code> task in the <code>-compile</code> target you just copied:<br /> + add <code><fileset dir="compile-libs" includes="*.jar" /></code> to it. + </li></ul> + </p> + </@s.section> +</@s.scaffold> diff --git a/website/templates/setup/ant.html b/website/templates/setup/ant.html new file mode 100644 index 00000000..3781e01d --- /dev/null +++ b/website/templates/setup/ant.html @@ -0,0 +1,29 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Ant+ivy"> + <@s.introduction> + <p> + This page explains how to compile your code when you use the <a href="https://ant.apache.org/">Apache Ant</a> build tool. We suggest you use <a href="http://ant.apache.org/ivy/">ivy</a>, the ant add-on that lets you fetch dependencies from the internet automatically. + </p><p> + Lombok just needs to be on the classpath when you compile your code to do its work, so all you have to ensure, is that lombok is on the classpath in your <code><javac></code> task. + </p> + </@s.introduction> + + <@s.section title="Just ant"> + <p> + Assuming that you've put <code>lombok.jar</code> in a <code>lib</code> dir, your javac task would have to look like:<pre> +<javac srcdir="src" destdir="build" source="1.8"> + <classpath location="lib/lombok.jar" /> +</javac></pre> + </p> + </@s.section> + + <@s.section title="Ant with Ivy"> + <p> + Lombok is available in Maven Central, so you can tell ivy to fetch lombok like so (assuming you have a configuration named <code>build</code>:<pre> +<dependencies> + <dependency org="org.projectlombok" name="lombok" rev="${version}" conf="build->master" /> +</dependencies></pre> + </p> + </@s.section> +</@s.scaffold> diff --git a/website/templates/setup/ecj.html b/website/templates/setup/ecj.html new file mode 100644 index 00000000..9d56a085 --- /dev/null +++ b/website/templates/setup/ecj.html @@ -0,0 +1,31 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="ecj"> + <@s.introduction> + <p> + ecj (the eclipse standalone compiler) is compatible with lombok. Use the following command line to enable lombok with ecj: + <pre>java <strong>-javaagent:lombok.jar=ECJ</strong> -jar ecj.jar -cp lombok.jar -source 1.8 <em class="note">(rest of arguments)</em></pre> + </p><p> + You may have to add the following VM argument, if you're using an older version of lombok or java: + <pre><strong>-Xbootclasspath/p:lombok.jar</strong></pre> + </p><p> + If you're using a tool based on ecj, adding these VM arguments and adding lombok.jar to the classpath should work. + </p> + </@s.introduction> + + <@s.section title="Maven"> + <p> + It is possible to <a href="/files/pom.xml">configure</a> <code>maven-compiler-plugin</code> with <code>maven-dependency-plugin</code> and <code>plexus-compiler-eclipse</code>. + </p><p> + Before the <code>compile</code> phase, you will have to set your <code>MAVEN_OPTS</code> environment variable to include the <code>javaagent</code> argument. In the example below, <code>target</code> is your <code>${r"${project.build.directory}"}</code>. + </p><p> + Use the following commands in sequence to enable lombok with ecj in your Maven build: +<pre> +mvn clean <strong>dependency:copy@get-lombok</strong> +set MAVEN_OPTS=<strong>-javaagent:target/lombok.jar=ECJ</strong> <em class="note">(or your OS's equivalent)</em> +mvn install +set MAVEN_OPTS= <em class="note">(or your OS's equivalent)</em> +</pre> + </p> + </@s.section> +</@s.scaffold> diff --git a/website/templates/setup/eclipse.html b/website/templates/setup/eclipse.html new file mode 100644 index 00000000..85304c83 --- /dev/null +++ b/website/templates/setup/eclipse.html @@ -0,0 +1,26 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Eclipse, Spring Tool Suite, (Red Hat) JBoss Developer Studio, MyEclipse"> + <@s.introduction> + <p> + The <a href="https://eclipse.org/">Eclipse</a> editor is compatible with lombok. Eclipse offshoots are also compatible with lombok, specifically: + <ul><li> + <a href="https://www.genuitec.com/products/myeclipse/">MyEclipse</a> + </li><li> + <a href="https://developers.redhat.com/products/devstudio/overview/">Red Hat JBoss Developer Studio</a> + </li><li> + <a href="https://tools.jboss.org/downloads/devstudio/">JBoss Developer Studio (JBDS)</a> + </li><li> + <a href="https://spring.io/tools">Spring Tools Suite (STS)</a> + </li></ul> + </p><p> + Double-click lombok.jar (downloadable from this site, or from your maven repository; it's the same jar). This starts the eclipse installer which will find eclipse (and eclipse variants as listed above), and offers to install lombok into these eclipse installations. The same tool can also uninstall lombok: <br /> + + <img src="/img/lombok-installer.png" /> + </p><p> + You can check if your eclipse installation is lombok-enabled in eclipse's about dialog. The lombok version will be listed at the end of the copyright text:<br /><br /> + + <img src="/img/eclipse-about.png" /> + </p> + </@s.introduction> +</@s.scaffold> diff --git a/website/templates/setup/gradle.html b/website/templates/setup/gradle.html new file mode 100644 index 00000000..7cb4af0d --- /dev/null +++ b/website/templates/setup/gradle.html @@ -0,0 +1,65 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Gradle"> + <@s.introduction> + <p> + To set up lombok with any build tool, you have to specify that the lombok dependency is required to compile your source code, but does not need to be present when running/testing/jarring/otherwise deploying your code. Generally this is called a 'provided' dependency. This page explains how to integrate lombok with the <a href="https://gradle.org/">Gradle build tool</a>. + </p><p> + Lombok is available in maven central, so telling Gradle to download lombok is easy. + </p> + </@s.introduction> + + <@s.section title="The Lombok Gradle Plugin"> + <p> + There is a plugin for gradle that we recommend you use; it makes deployment a breeze, works around shortcomings of gradle prior to v2.12, and makes it easy to do additional tasks, such as running the lombok eclipse installer or delomboking. The plugin is open source. Read more <a href="https://github.com/franzbecker/gradle-lombok">about the gradle-lombok plugin</a>. + </p><p> + Note, to tell the <code>gradle-lombok</code> plugin to use the latest version of lombok, you need to explicitly tell it about the latest version number and the SHA-256. For our current latest version, put this in your <code>build.gradle</code> file:<pre> +lombok { + version = ${version} + sha256 = "" +}</pre> + </p> + </@s.section> + + <@s.section title="Gradle v2.12 and up"> + <p> + If you don't want to use the plugin, gradle has the built-in <code>compileOnly</code> scope, which can be used to tell gradle to add lombok only during compilation. Your <code>build.gradle</code> will look like:<pre> +repositories { + mavenCentral() +} + +plugins { + id 'net.ltgt.apt' version '0.10' +} + +dependencies { + compileOnly 'org.projectlombok:lombok:${version}' + + apt "org.projectlombok:lombok:${version}" +}</pre> + </p><p> + Remember that you still have to download <code>lombok.jar</code> (or find it in gradle's caches) and run it as a jarfile, if you wish to program in eclipse. The plugin makes that part easier. + </p> + </@s.section> + <@s.section title="Gradle prior to v2.12"> + <p> + If you don't want to use the plugin and you're on gradle prior to v2.12, there's a bit of problem: Gradle didn't introduce the 'provided' concept until v2.12. The concept is added by a few well known plugins: The gradle <code>war</code> plugin has the <code>providedCompile</code> scope, and the <a href="https://github.com/nebula-plugins/gradle-extra-configurations-plugin">Gradle Extra Configurations Plugin</a> supports the <code>provided</code> scope. With these plugins, your <code>build.gradle</code> file will look something like this:<pre> +apply plugin: 'java' +apply plugin: 'nebula.provided-base' + +repositories { + mavenCentral() +} + +dependencies { + provided 'org.projectlombok:lombok:${version}' +}</pre> + </p> + </@s.section> + + <@s.section title="Android development"> + <p> + Complete instructions for integrating lombok with your android development is available on our <a href="android">Using lombok for android development</a> page. + </p> + </@s.section> +</@s.scaffold> diff --git a/website/templates/setup/gwt.html b/website/templates/setup/gwt.html new file mode 100644 index 00000000..142362ac --- /dev/null +++ b/website/templates/setup/gwt.html @@ -0,0 +1,16 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="GWT"> + <@s.introduction> + <p> + <a href="http://www.gwtproject.org/">GWT (Google Web Toolkit)</a> is compatible with lombok. + </p><p> + Edit your <code>proj-debug</code> and <code>proj-compile</code> batch scripts to add the following VM arguments: +<pre> +java <strong>-javaagent:lombok.jar=ECJ</strong> <em>(rest of arguments)</em> +</pre> + </p><p> + Thanks to Stephen Haberman for figuring this out. + </p> + </@s.introduction> +</@s.scaffold> diff --git a/website/templates/setup/intellij.html b/website/templates/setup/intellij.html new file mode 100644 index 00000000..331a7bcd --- /dev/null +++ b/website/templates/setup/intellij.html @@ -0,0 +1,22 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="IntelliJ IDEA"> + <@s.introduction> + <p> + The <a href="https://www.jetbrains.com/idea/">Jetbrains IntelliJ IDEA</a> editor is compatible with lombok. + </p><p> + Add the <a href="https://plugins.jetbrains.com/plugin/6317">Lombok IntelliJ plugin</a> to add lombok support for IntelliJ: + <ul><li> + Go to <code>File > Settings > Plugins</code> + </li><li> + Click on <code>Browse repositories...</code> + </li><li> + Search for <code>Lombok Plugin</code> + </li><li> + Click on <code>Install plugin</code> + </li><li> + Restart IntelliJ IDEA + </li></ul> + </p> + </@s.introduction> +</@s.scaffold> diff --git a/website/templates/setup/javac.html b/website/templates/setup/javac.html new file mode 100644 index 00000000..48b0ebcf --- /dev/null +++ b/website/templates/setup/javac.html @@ -0,0 +1,25 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="JavaC"> + <@s.introduction> + <p> + Just put lombok on the classpath when compiling with any javac (version 1.6 - 1.8): <code>javac -cp lombok.jar ....</code> + </p> + </@s.introduction> + + <@s.section title="JDK 9"> + <p> + Support for JDK9, if you haven't modularized your own projects yet (no <code>module-info.java</code> yet), is included in lombok starting with version 1.16.20. Just use lombok as normal: <code> javac -cp lombok.jar ...</code> + </p><p> + Support for JDK9 if you did modularize your own projects (you've written a <code>module-info.java</code> file) is available in the <a href="/download-edge">edge release</a>. To use it: <code>javac -cp lombok.jar -p lombok.jar ...</code><br /> + Note that you will have to add lombok to your <code>module-info.java</code> file:<pre> +module <em>myapp</em> { + requires static lombok; +}</pre> + </p><p> + The 'static' part ensures that you won't need lombok to be present at runtime. + </p><p> + Feedback about JDK9 module-info support can be given at <a href="https://github.com/rzwitserloot/lombok/issues/985">github issue #985</a>. + </p> + </@s.section> +</@s.scaffold> diff --git a/website/templates/setup/kobalt.html b/website/templates/setup/kobalt.html new file mode 100644 index 00000000..26adf23d --- /dev/null +++ b/website/templates/setup/kobalt.html @@ -0,0 +1,20 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Kobalt"> + <@s.introduction> + <p> + To set up lombok with any build tool, you have to specify that the lombok dependency is required to compile your source code, but does not need to be present when running/testing/jarring/otherwise deploying your code. Generally this is called a 'provided' dependency. This page explains how to integrate lombok with the <a href="http://beust.com/kobalt/home/index.html">Kobalt</a> buid tool. + </p><p> + Lombok is available in maven central, so telling Kobalt to download lombok is easy. + </p> + </@s.introduction> + + <@s.section title="Configuring Kobalt"> + <p> + To add lombok as a 'provided' dependency to your project, write your <code>Built.kt</code> like so:<pre> +dependencies { + provided("org.projectlombok:lombok:${version}") +}</pre> + </p> + </@s.section> +</@s.scaffold> diff --git a/website/templates/setup/main.html b/website/templates/setup/main.html new file mode 100644 index 00000000..8c874a55 --- /dev/null +++ b/website/templates/setup/main.html @@ -0,0 +1,14 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Using lombok"> + <@s.introduction> + <#list s.main.setupTargets as cat, tgtList> + <h3 class="listHeader">${cat}</h3> + <ul> + <#list tgtList as name, url> + <li class="target"><a href="/setup/${url}">${name}</a></li> + </#list> + </ul> + </#list> + </@s.introduction> +</@s.scaffold> diff --git a/website/templates/setup/maven.html b/website/templates/setup/maven.html new file mode 100644 index 00000000..5ca09126 --- /dev/null +++ b/website/templates/setup/maven.html @@ -0,0 +1,32 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Maven"> + <@s.introduction> + <p> + To set up lombok with any build tool, you have to specify that the lombok dependency is required to compile your source code, but does not need to be present when running/testing/jarring/otherwise deploying your code. Generally this is called a 'provided' dependency. This page explains how to integrate lombok with the <a href="https://maven.apache.org/">Apache Maven</a> build tool. + </p><p> + Lombok is available in maven central, so telling Maven to download lombok is easy. + </p> + </@s.introduction> + + <@s.section title="Adding lombok to your pom file"> + <p> + To include lombok as a 'provided' dependency, add it to your <code><dependencies></code> block like so:<pre> +<dependencies> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>${version}</version> + <scope>provided</scope> + </dependency> +</dependencies> +</pre> + </p> + </@s.section> + + <@s.section title="Delomboking: The Lombok Maven Plugin"> + <p> + There is a plugin for Maven that we recommend you use if you want to delombok via maven. Useful if you want to run source analysis tools on your source <em>after</em> lombok has been applied, or if you want to generate javadoc. The plugin is open source. Read more <a href="http://awhitford.github.io/lombok.maven/lombok-maven-plugin/">about the lombok maven plugin</a>. + </p> + </@s.section> +</@s.scaffold> diff --git a/website/templates/setup/netbeans.html b/website/templates/setup/netbeans.html new file mode 100644 index 00000000..eccd9e93 --- /dev/null +++ b/website/templates/setup/netbeans.html @@ -0,0 +1,16 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Netbeans"> + <@s.introduction> + <p> + The <a href="https://netbeans.org/">Netbeans</a> editor is compatible with lombok. + <ol><li> + Add <code>lombok.jar</code> to the project libraries. + </li><li> + In the project properties, in the section <code>Build – Compiling</code>, check the <code>'Enable Annotation Processing in Editor'</code> checkbox. + </li></ol> + + <img src="/img/netbeans-enable-annotation-processing-in-editor.png" /> + </p> + </@s.introduction> +</@s.scaffold> diff --git a/website/templates/setup/vscode.html b/website/templates/setup/vscode.html new file mode 100644 index 00000000..bf9c3e58 --- /dev/null +++ b/website/templates/setup/vscode.html @@ -0,0 +1,18 @@ +<#import "_setup.html" as s> + +<@s.scaffold title="Microsoft Visual Studio Code"> + <@s.introduction> + <p> + The <a href="https://code.visualstudio.com/">Microsoft Visual Studio Code</a> editor is compatible with lombok. + </p><p> + Add the <a href="https://marketplace.visualstudio.com/items?itemName=GabrielBB.vscode-lombok">vscode-lombok</a> plugin to your Visual Studio Code IDE to add lombok support. + <ul><li> + press <code>Ctrl + Shift + X</code> to open the extension manager. + </li><li> + Type <code>lombok</code> to find the plugin, and click <code>install</code>. + </li><li> + Reload VS Code when asked. + </li></ul> + </p> + </@s.introduction> +</@s.scaffold> diff --git a/website/templates/supporters.html b/website/templates/supporters.html new file mode 100644 index 00000000..9facb090 --- /dev/null +++ b/website/templates/supporters.html @@ -0,0 +1,10 @@ +<#import "/_scaffold.html" as main> + +<@main.scaffold load=["js/supporters.js"] title="Supporters"> + <div class="page-header top5"> + <div class="row text-center"> + <h1>Project Lombok supporters</h1> + </div><div class="row supporters"> + </div> + </div> +</@main.scaffold> diff --git a/website/unknown_person.gif b/website/unknown_person.gif Binary files differdeleted file mode 100644 index c5ec6b89..00000000 --- a/website/unknown_person.gif +++ /dev/null diff --git a/website/usageExamples/BuilderExample_post.jpage b/website/usageExamples/BuilderExample_post.jpage new file mode 100644 index 00000000..54b064d7 --- /dev/null +++ b/website/usageExamples/BuilderExample_post.jpage @@ -0,0 +1,74 @@ +import java.util.Set; + +public class BuilderExample { + private String name; + private int age; + private Set<String> occupations; + + BuilderExample(String name, int age, Set<String> occupations) { + this.name = name; + this.age = age; + this.occupations = occupations; + } + + public static BuilderExampleBuilder builder() { + return new BuilderExampleBuilder(); + } + + public static class BuilderExampleBuilder { + private String name; + private int age; + private java.util.ArrayList<String> occupations; + + BuilderExampleBuilder() { + } + + public BuilderExampleBuilder name(String name) { + this.name = name; + return this; + } + + public BuilderExampleBuilder age(int age) { + this.age = age; + return this; + } + + public BuilderExampleBuilder occupation(String occupation) { + if (this.occupations == null) { + this.occupations = new java.util.ArrayList<String>(); + } + + this.occupations.add(occupation); + return this; + } + + public BuilderExampleBuilder occupations(Collection<? extends String> occupations) { + if (this.occupations == null) { + this.occupations = new java.util.ArrayList<String>(); + } + + this.occupations.addAll(occupations); + return this; + } + + public BuilderExampleBuilder clearOccupations() { + if (this.occupations != null) { + this.occupations.clear(); + } + + return this; + } + + public BuilderExample build() { + // complicated switch statement to produce a compact properly sized immutable set omitted. + // go to https://projectlombok.org/features/Singular-snippet.html to see it. + Set<String> occupations = ...; + return new BuilderExample(name, age, occupations); + } + + @java.lang.Override + public String toString() { + return "BuilderExample.BuilderExampleBuilder(name = " + this.name + ", age = " + this.age + ", occupations = " + this.occupations + ")"; + } + } +}
\ No newline at end of file diff --git a/website/usageExamples/BuilderExample_pre.jpage b/website/usageExamples/BuilderExample_pre.jpage new file mode 100644 index 00000000..1557fff4 --- /dev/null +++ b/website/usageExamples/BuilderExample_pre.jpage @@ -0,0 +1,10 @@ +import lombok.Builder; +import lombok.Singular; +import java.util.Set; + +@Builder +public class BuilderExample { + private String name; + private int age; + @Singular private Set<String> occupations; +} diff --git a/website/usageExamples/CleanupExample_post.jpage b/website/usageExamples/CleanupExample_post.jpage new file mode 100644 index 00000000..7e87c153 --- /dev/null +++ b/website/usageExamples/CleanupExample_post.jpage @@ -0,0 +1,26 @@ +import java.io.*; + +public class CleanupExample { + public static void main(String[] args) throws IOException { + InputStream in = new FileInputStream(args[0]); + try { + OutputStream out = new FileOutputStream(args[1]); + try { + byte[] b = new byte[10000]; + while (true) { + int r = in.read(b); + if (r == -1) break; + out.write(b, 0, r); + } + } finally { + if (out != null) { + out.close(); + } + } + } finally { + if (in != null) { + in.close(); + } + } + } +} diff --git a/website/usageExamples/CleanupExample_pre.jpage b/website/usageExamples/CleanupExample_pre.jpage new file mode 100644 index 00000000..9f639171 --- /dev/null +++ b/website/usageExamples/CleanupExample_pre.jpage @@ -0,0 +1,15 @@ +import lombok.Cleanup; +import java.io.*; + +public class CleanupExample { + public static void main(String[] args) throws IOException { + @Cleanup InputStream in = new FileInputStream(args[0]); + @Cleanup OutputStream out = new FileOutputStream(args[1]); + byte[] b = new byte[10000]; + while (true) { + int r = in.read(b); + if (r == -1) break; + out.write(b, 0, r); + } + } +} diff --git a/website/usageExamples/ConstructorExample_post.jpage b/website/usageExamples/ConstructorExample_post.jpage new file mode 100644 index 00000000..8a2d5069 --- /dev/null +++ b/website/usageExamples/ConstructorExample_post.jpage @@ -0,0 +1,28 @@ +public class ConstructorExample<T> { + private int x, y; + @NonNull private T description; + + private ConstructorExample(T description) { + if (description == null) throw new NullPointerException("description"); + this.description = description; + } + + public static <T> ConstructorExample<T> of(T description) { + return new ConstructorExample<T>(description); + } + + @java.beans.ConstructorProperties({"x", "y", "description"}) + protected ConstructorExample(int x, int y, T description) { + if (description == null) throw new NullPointerException("description"); + this.x = x; + this.y = y; + this.description = description; + } + + public static class NoArgsExample { + @NonNull private String field; + + public NoArgsExample() { + } + } +} diff --git a/website/usageExamples/ConstructorExample_pre.jpage b/website/usageExamples/ConstructorExample_pre.jpage new file mode 100644 index 00000000..ac0d3c28 --- /dev/null +++ b/website/usageExamples/ConstructorExample_pre.jpage @@ -0,0 +1,16 @@ +import lombok.AccessLevel; +import lombok.RequiredArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.NonNull; + +@RequiredArgsConstructor(staticName = "of") +@AllArgsConstructor(access = AccessLevel.PROTECTED) +public class ConstructorExample<T> { + private int x, y; + @NonNull private T description; + + @NoArgsConstructor + public static class NoArgsExample { + @NonNull private String field; + } +} diff --git a/website/usageExamples/DataExample_post.jpage b/website/usageExamples/DataExample_post.jpage new file mode 100644 index 00000000..bef0a0f1 --- /dev/null +++ b/website/usageExamples/DataExample_post.jpage @@ -0,0 +1,119 @@ +import java.util.Arrays; + +public class DataExample { + private final String name; + private int age; + private double score; + private String[] tags; + + public DataExample(String name) { + this.name = name; + } + + public String getName() { + return this.name; + } + + void setAge(int age) { + this.age = age; + } + + public int getAge() { + return this.age; + } + + public void setScore(double score) { + this.score = score; + } + + public double getScore() { + return this.score; + } + + public String[] getTags() { + return this.tags; + } + + public void setTags(String[] tags) { + this.tags = tags; + } + + @Override public String toString() { + return "DataExample(" + this.getName() + ", " + this.getAge() + ", " + this.getScore() + ", " + Arrays.deepToString(this.getTags()) + ")"; + } + + protected boolean canEqual(Object other) { + return other instanceof DataExample; + } + + @Override public boolean equals(Object o) { + if (o == this) return true; + if (!(o instanceof DataExample)) return false; + DataExample other = (DataExample) o; + if (!other.canEqual((Object)this)) return false; + if (this.getName() == null ? other.getName() != null : !this.getName().equals(other.getName())) return false; + if (this.getAge() != other.getAge()) return false; + if (Double.compare(this.getScore(), other.getScore()) != 0) return false; + if (!Arrays.deepEquals(this.getTags(), other.getTags())) return false; + return true; + } + + @Override public int hashCode() { + final int PRIME = 59; + int result = 1; + final long temp1 = Double.doubleToLongBits(this.getScore()); + result = (result*PRIME) + (this.getName() == null ? 43 : this.getName().hashCode()); + result = (result*PRIME) + this.getAge(); + result = (result*PRIME) + (int)(temp1 ^ (temp1 >>> 32)); + result = (result*PRIME) + Arrays.deepHashCode(this.getTags()); + return result; + } + + public static class Exercise<T> { + private final String name; + private final T value; + + private Exercise(String name, T value) { + this.name = name; + this.value = value; + } + + public static <T> Exercise<T> of(String name, T value) { + return new Exercise<T>(name, value); + } + + public String getName() { + return this.name; + } + + public T getValue() { + return this.value; + } + + @Override public String toString() { + return "Exercise(name=" + this.getName() + ", value=" + this.getValue() + ")"; + } + + protected boolean canEqual(Object other) { + return other instanceof Exercise; + } + + @Override public boolean equals(Object o) { + if (o == this) return true; + if (!(o instanceof Exercise)) return false; + Exercise<?> other = (Exercise<?>) o; + if (!other.canEqual((Object)this)) return false; + if (this.getName() == null ? other.getValue() != null : !this.getName().equals(other.getName())) return false; + if (this.getValue() == null ? other.getValue() != null : !this.getValue().equals(other.getValue())) return false; + return true; + } + + @Override public int hashCode() { + final int PRIME = 59; + int result = 1; + result = (result*PRIME) + (this.getName() == null ? 43 : this.getName().hashCode()); + result = (result*PRIME) + (this.getValue() == null ? 43 : this.getValue().hashCode()); + return result; + } + } +} diff --git a/website/usageExamples/DataExample_pre.jpage b/website/usageExamples/DataExample_pre.jpage new file mode 100644 index 00000000..404d3458 --- /dev/null +++ b/website/usageExamples/DataExample_pre.jpage @@ -0,0 +1,18 @@ +import lombok.AccessLevel; +import lombok.Setter; +import lombok.Data; +import lombok.ToString; + +@Data public class DataExample { + private final String name; + @Setter(AccessLevel.PACKAGE) private int age; + private double score; + private String[] tags; + + @ToString(includeFieldNames=true) + @Data(staticConstructor="of") + public static class Exercise<T> { + private final String name; + private final T value; + } +} diff --git a/website/usageExamples/EqualsAndHashCodeExample_post.jpage b/website/usageExamples/EqualsAndHashCodeExample_post.jpage new file mode 100644 index 00000000..91e78250 --- /dev/null +++ b/website/usageExamples/EqualsAndHashCodeExample_post.jpage @@ -0,0 +1,72 @@ +import java.util.Arrays; + +public class EqualsAndHashCodeExample { + private transient int transientVar = 10; + private String name; + private double score; + private Shape shape = new Square(5, 10); + private String[] tags; + private int id; + + public String getName() { + return this.name; + } + + @Override public boolean equals(Object o) { + if (o == this) return true; + if (!(o instanceof EqualsAndHashCodeExample)) return false; + EqualsAndHashCodeExample other = (EqualsAndHashCodeExample) o; + if (!other.canEqual((Object)this)) return false; + if (this.getName() == null ? other.getName() != null : !this.getName().equals(other.getName())) return false; + if (Double.compare(this.score, other.score) != 0) return false; + if (!Arrays.deepEquals(this.tags, other.tags)) return false; + return true; + } + + @Override public int hashCode() { + final int PRIME = 59; + int result = 1; + final long temp1 = Double.doubleToLongBits(this.score); + result = (result*PRIME) + (this.name == null ? 43 : this.name.hashCode()); + result = (result*PRIME) + (int)(temp1 ^ (temp1 >>> 32)); + result = (result*PRIME) + Arrays.deepHashCode(this.tags); + return result; + } + + protected boolean canEqual(Object other) { + return other instanceof EqualsAndHashCodeExample; + } + + public static class Square extends Shape { + private final int width, height; + + public Square(int width, int height) { + this.width = width; + this.height = height; + } + + @Override public boolean equals(Object o) { + if (o == this) return true; + if (!(o instanceof Square)) return false; + Square other = (Square) o; + if (!other.canEqual((Object)this)) return false; + if (!super.equals(o)) return false; + if (this.width != other.width) return false; + if (this.height != other.height) return false; + return true; + } + + @Override public int hashCode() { + final int PRIME = 59; + int result = 1; + result = (result*PRIME) + super.hashCode(); + result = (result*PRIME) + this.width; + result = (result*PRIME) + this.height; + return result; + } + + protected boolean canEqual(Object other) { + return other instanceof Square; + } + } +} diff --git a/website/usageExamples/EqualsAndHashCodeExample_pre.jpage b/website/usageExamples/EqualsAndHashCodeExample_pre.jpage new file mode 100644 index 00000000..64faf59f --- /dev/null +++ b/website/usageExamples/EqualsAndHashCodeExample_pre.jpage @@ -0,0 +1,25 @@ +import lombok.EqualsAndHashCode; + +@EqualsAndHashCode(exclude={"id", "shape"}) +public class EqualsAndHashCodeExample { + private transient int transientVar = 10; + private String name; + private double score; + private Shape shape = new Square(5, 10); + private String[] tags; + private int id; + + public String getName() { + return this.name; + } + + @EqualsAndHashCode(callSuper=true) + public static class Square extends Shape { + private final int width, height; + + public Square(int width, int height) { + this.width = width; + this.height = height; + } + } +} diff --git a/website/usageExamples/GetterLazyExample_post.jpage b/website/usageExamples/GetterLazyExample_post.jpage new file mode 100644 index 00000000..5f34c43e --- /dev/null +++ b/website/usageExamples/GetterLazyExample_post.jpage @@ -0,0 +1,26 @@ +public class GetterLazyExample { + private final java.util.concurrent.AtomicReference<java.lang.Object> cached = new java.util.concurrent.AtomicReference<java.lang.Object>(); + + public double[] getCached() { + java.lang.Object value = this.cached.get(); + if (value == null) { + synchronized(this.cached) { + value = this.cached.get(); + if (value == null) { + final double[] actualValue = expensive(); + value = actualValue == null ? this.cached : actualValue; + this.cached.set(value); + } + } + } + return (double[])(value == this.cached ? null : value); + } + + private double[] expensive() { + double[] result = new double[1000000]; + for (int i = 0; i < result.length; i++) { + result[i] = Math.asin(i); + } + return result; + } +} diff --git a/website/usageExamples/GetterLazyExample_pre.jpage b/website/usageExamples/GetterLazyExample_pre.jpage new file mode 100644 index 00000000..ca6c9d58 --- /dev/null +++ b/website/usageExamples/GetterLazyExample_pre.jpage @@ -0,0 +1,13 @@ +import lombok.Getter; + +public class GetterLazyExample { + @Getter(lazy=true) private final double[] cached = expensive(); + + private double[] expensive() { + double[] result = new double[1000000]; + for (int i = 0; i < result.length; i++) { + result[i] = Math.asin(i); + } + return result; + } +} diff --git a/website/usageExamples/GetterSetterExample_post.jpage b/website/usageExamples/GetterSetterExample_post.jpage new file mode 100644 index 00000000..241a3a4e --- /dev/null +++ b/website/usageExamples/GetterSetterExample_post.jpage @@ -0,0 +1,42 @@ +public class GetterSetterExample { + /** + * Age of the person. Water is wet. + */ + private int age = 10; + + /** + * Name of the person. + */ + private String name; + + @Override public String toString() { + return String.format("%s (age: %d)", name, age); + } + + /** + * Age of the person. Water is wet. + * + * @return The current value of this person's age. Circles are round. + */ + public int getAge() { + return age; + } + + /** + * Age of the person. Water is wet. + * + * @param age New value for this person's age. Sky is blue. + */ + public void setAge(int age) { + this.age = age; + } + + /** + * Changes the name of this person. + * + * @param name The new value. + */ + protected void setName(String name) { + this.name = name; + } +} diff --git a/website/usageExamples/GetterSetterExample_pre.jpage b/website/usageExamples/GetterSetterExample_pre.jpage new file mode 100644 index 00000000..4183aa5d --- /dev/null +++ b/website/usageExamples/GetterSetterExample_pre.jpage @@ -0,0 +1,26 @@ +import lombok.AccessLevel; +import lombok.Getter; +import lombok.Setter; + +public class GetterSetterExample { + /** + * Age of the person. Water is wet. + * + * @param age New value for this person's age. Sky is blue. + * @return The current value of this person's age. Circles are round. + */ + @Getter @Setter private int age = 10; + + /** + * Name of the person. + * -- SETTER -- + * Changes the name of this person. + * + * @param name The new value. + */ + @Setter(AccessLevel.PROTECTED) private String name; + + @Override public String toString() { + return String.format("%s (age: %d)", name, age); + } +} diff --git a/website/usageExamples/LogExample_post.jpage b/website/usageExamples/LogExample_post.jpage new file mode 100644 index 00000000..eab3b046 --- /dev/null +++ b/website/usageExamples/LogExample_post.jpage @@ -0,0 +1,23 @@ +public class LogExample { + private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LogExample.class.getName()); + + public static void main(String... args) { + log.error("Something's wrong here"); + } +} + +public class LogExampleOther { + private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LogExampleOther.class); + + public static void main(String... args) { + log.error("Something else is wrong here"); + } +} + +public class LogExampleCategory { + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog("CounterLog"); + + public static void main(String... args) { + log.error("Calling the 'CounterLog' with a message"); + } +} diff --git a/website/usageExamples/LogExample_pre.jpage b/website/usageExamples/LogExample_pre.jpage new file mode 100644 index 00000000..ba27dd27 --- /dev/null +++ b/website/usageExamples/LogExample_pre.jpage @@ -0,0 +1,26 @@ +import lombok.extern.java.Log; +import lombok.extern.slf4j.Slf4j; + +@Log +public class LogExample { + + public static void main(String... args) { + log.error("Something's wrong here"); + } +} + +@Slf4j +public class LogExampleOther { + + public static void main(String... args) { + log.error("Something else is wrong here"); + } +} + +@CommonsLog(topic="CounterLog") +public class LogExampleCategory { + + public static void main(String... args) { + log.error("Calling the 'CounterLog' with a message"); + } +} diff --git a/website/usageExamples/NonNullExample_post.jpage b/website/usageExamples/NonNullExample_post.jpage new file mode 100644 index 00000000..24175e06 --- /dev/null +++ b/website/usageExamples/NonNullExample_post.jpage @@ -0,0 +1,13 @@ +import lombok.NonNull; + +public class NonNullExample extends Something { + private String name; + + public NonNullExample(@NonNull Person person) { + super("Hello"); + if (person == null) { + throw new NullPointerException("person"); + } + this.name = person.getName(); + } +} diff --git a/website/usageExamples/NonNullExample_pre.jpage b/website/usageExamples/NonNullExample_pre.jpage new file mode 100644 index 00000000..47556ce7 --- /dev/null +++ b/website/usageExamples/NonNullExample_pre.jpage @@ -0,0 +1,10 @@ +import lombok.NonNull; + +public class NonNullExample extends Something { + private String name; + + public NonNullExample(@NonNull Person person) { + super("Hello"); + this.name = person.getName(); + } +} diff --git a/website/usageExamples/Singular-snippetExample_post.jpage b/website/usageExamples/Singular-snippetExample_post.jpage new file mode 100644 index 00000000..4e2b0460 --- /dev/null +++ b/website/usageExamples/Singular-snippetExample_post.jpage @@ -0,0 +1,160 @@ +import java.util.Collection; +import java.util.Set; +import java.util.SortedMap; +import com.google.common.collect.ImmutableList; + +public class SingularExample<T extends Number> { + private Set<String> occupations; + private ImmutableList<String> axes; + private SortedMap<Integer, T> elves; + private Collection<?> minutiae; + + SingularExample(Set<String> occupations, ImmutableList<String> axes, SortedMap<Integer, T> elves, Collection<?> minutiae) { + this.occupations = occupations; + this.axes = axes; + this.elves = elves; + this.minutiae = minutiae; + } + + public static class SingularExampleBuilder<T extends Number> { + private java.util.ArrayList<String> occupations; + private com.google.common.collect.ImmutableList.Builder<String> axes; + private java.util.ArrayList<Integer> elves$key; + private java.util.ArrayList<T> elves$value; + private java.util.ArrayList<java.lang.Object> minutiae; + + SingularExampleBuilder() { + } + + public SingularExampleBuilder<T> occupation(String occupation) { + if (this.occupations == null) { + this.occupations = new java.util.ArrayList<String>(); + } + + this.occupations.add(occupation); + return this; + } + + @java.lang.SuppressWarnings("all") + public SingularExampleBuilder<T> occupations(java.util.Collection<? extends String> occupations) { + if (this.occupations == null) { + this.occupations = new java.util.ArrayList<String>(); + } + + this.occupations.addAll(occupations); + return this; + } + + public SingularExampleBuilder<T> axis(String axis) { + if (this.axes == null) { + this.axes = com.google.common.collect.ImmutableList.builder(); + } + + this.axes.add(axis); + return this; + } + + public SingularExampleBuilder<T> axes(java.lang.Iterable<? extends String> axes) { + if (this.axes == null) { + this.axes = com.google.common.collect.ImmutableList.builder(); + } + + this.axes.addAll(axes); + return this; + } + + public SingularExampleBuilder<T> elf(Integer elfKey, T elfValue) { + if (this.elves$key == null) { + this.elves$key = new java.util.ArrayList<Integer>(); + this.elves$value = new java.util.ArrayList<T>(); + } + + this.elves$key.add(elfKey); + this.elves$value.add(elfValue); + return this; + } + + public SingularExampleBuilder<T> elves(java.util.Map<? extends Integer, ? extends T> elves) { + if (this.elves$key == null) { + this.elves$key = new java.util.ArrayList<Integer>(); + this.elves$value = new java.util.ArrayList<T>(); + } + + for (java.util.Map.Entry<? extends Integer, ? extends T> $lombokEntry : elves.entrySet()) { + this.elves$key.add($lombokEntry.getKey()); + this.elves$value.add($lombokEntry.getValue()); + } + return this; + } + + public SingularExampleBuilder<T> minutia(java.lang.Object minutia) { + if (this.minutiae == null) { + this.minutiae = new java.util.ArrayList<java.lang.Object>(); + } + + this.minutiae.add(minutia); + return this; + } + + public SingularExampleBuilder<T> minutiae(java.util.Collection<?> minutiae) { + if (this.minutiae == null) { + this.minutiae = new java.util.ArrayList<java.lang.Object>(); + } + + this.minutiae.addAll(minutiae); + return this; + } + + public SingularExample<T> build() { + java.util.Set<String> occupations; + switch (this.occupations == null ? 0 : this.occupations.size()) { + case 0: + occupations = java.util.Collections.emptySet(); + break; + + case 1: + occupations = java.util.Collections.singleton(this.occupations.get(0)); + break; + + default: + occupations = new java.util.LinkedHashSet<String>(this.occupations.size() < 1073741824 ? 1 + this.occupations.size() + (this.occupations.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); + occupations.addAll(this.occupations); + occupations = java.util.Collections.unmodifiableSet(occupations); + + } + + com.google.common.collect.ImmutableList<String> axes = this.axes == null ? com.google.common.collect.ImmutableList.<String>of() : this.axes.build(); + + java.util.SortedMap<Integer, T> elves = new java.util.TreeMap<Integer, T>(); + if (this.elves$key != null) for (int $i = 0; $i < (this.elves$key == null ? 0 : this.elves$key.size()); $i++) elves.put(this.elves$key.get($i), this.elves$value.get($i)); + elves = java.util.Collections.unmodifiableSortedMap(elves); + + java.util.Collection<java.lang.Object> minutiae; + switch (this.minutiae == null ? 0 : this.minutiae.size()) { + case 0: + minutiae = java.util.Collections.emptyList(); + break; + + case 1: + minutiae = java.util.Collections.singletonList(this.minutiae.get(0)); + break; + + default: + minutiae = java.util.Collections.unmodifiableList(new java.util.ArrayList<java.lang.Object>(this.minutiae)); + + } + + return new SingularExample<T>(occupations, axes, elves, minutiae); + } + + @java.lang.Override + public java.lang.String toString() { + return "SingularExample.SingularExampleBuilder(occupations=" + this.occupations + ", axes=" + this.axes + ", elves$key=" + this.elves$key + ", elves$value=" + this.elves$value + ", minutiae=" + this.minutiae + ")"; + } + } + + @java.lang.SuppressWarnings("all") + public static <T extends Number> SingularExampleBuilder<T> builder() { + return new SingularExampleBuilder<T>(); + } +} diff --git a/website/usageExamples/Singular-snippetExample_pre.jpage b/website/usageExamples/Singular-snippetExample_pre.jpage new file mode 100644 index 00000000..65f6bbc8 --- /dev/null +++ b/website/usageExamples/Singular-snippetExample_pre.jpage @@ -0,0 +1,14 @@ +import lombok.Builder; +import lombok.Singular; +import java.util.Collection; +import java.util.Set; +import java.util.SortedMap; +import com.google.common.collect.ImmutableList; + +@Builder +public class SingularExample<T extends Number> { + private @Singular Set<String> occupations; + private @Singular("axis") ImmutableList<String> axes; + private @Singular SortedMap<Integer, T> elves; + private @Singular Collection<?> minutiae; +} diff --git a/website/usageExamples/SneakyThrowsExample_post.jpage b/website/usageExamples/SneakyThrowsExample_post.jpage new file mode 100644 index 00000000..916d94f0 --- /dev/null +++ b/website/usageExamples/SneakyThrowsExample_post.jpage @@ -0,0 +1,19 @@ +import lombok.Lombok; + +public class SneakyThrowsExample implements Runnable { + public String utf8ToString(byte[] bytes) { + try { + return new String(bytes, "UTF-8"); + } catch (UnsupportedEncodingException e) { + throw Lombok.sneakyThrow(e); + } + } + + public void run() { + try { + throw new Throwable(); + } catch (Throwable t) { + throw Lombok.sneakyThrow(t); + } + } +} diff --git a/website/usageExamples/SneakyThrowsExample_pre.jpage b/website/usageExamples/SneakyThrowsExample_pre.jpage new file mode 100644 index 00000000..be6d72d5 --- /dev/null +++ b/website/usageExamples/SneakyThrowsExample_pre.jpage @@ -0,0 +1,13 @@ +import lombok.SneakyThrows; + +public class SneakyThrowsExample implements Runnable { + @SneakyThrows(UnsupportedEncodingException.class) + public String utf8ToString(byte[] bytes) { + return new String(bytes, "UTF-8"); + } + + @SneakyThrows + public void run() { + throw new Throwable(); + } +} diff --git a/website/usageExamples/SynchronizedExample_post.jpage b/website/usageExamples/SynchronizedExample_post.jpage new file mode 100644 index 00000000..219ab88a --- /dev/null +++ b/website/usageExamples/SynchronizedExample_post.jpage @@ -0,0 +1,23 @@ +public class SynchronizedExample { + private static final Object $LOCK = new Object[0]; + private final Object $lock = new Object[0]; + private final Object readLock = new Object(); + + public static void hello() { + synchronized($LOCK) { + System.out.println("world"); + } + } + + public int answerToLife() { + synchronized($lock) { + return 42; + } + } + + public void foo() { + synchronized(readLock) { + System.out.println("bar"); + } + } +} diff --git a/website/usageExamples/SynchronizedExample_pre.jpage b/website/usageExamples/SynchronizedExample_pre.jpage new file mode 100644 index 00000000..ace39f85 --- /dev/null +++ b/website/usageExamples/SynchronizedExample_pre.jpage @@ -0,0 +1,20 @@ +import lombok.Synchronized; + +public class SynchronizedExample { + private final Object readLock = new Object(); + + @Synchronized + public static void hello() { + System.out.println("world"); + } + + @Synchronized + public int answerToLife() { + return 42; + } + + @Synchronized("readLock") + public void foo() { + System.out.println("bar"); + } +} diff --git a/website/usageExamples/ToStringExample_post.jpage b/website/usageExamples/ToStringExample_post.jpage new file mode 100644 index 00000000..67e78f20 --- /dev/null +++ b/website/usageExamples/ToStringExample_post.jpage @@ -0,0 +1,30 @@ +import java.util.Arrays; + +public class ToStringExample { + private static final int STATIC_VAR = 10; + private String name; + private Shape shape = new Square(5, 10); + private String[] tags; + private int id; + + public String getName() { + return this.getName(); + } + + public static class Square extends Shape { + private final int width, height; + + public Square(int width, int height) { + this.width = width; + this.height = height; + } + + @Override public String toString() { + return "Square(super=" + super.toString() + ", width=" + this.width + ", height=" + this.height + ")"; + } + } + + @Override public String toString() { + return "ToStringExample(" + this.getName() + ", " + this.shape + ", " + Arrays.deepToString(this.tags) + ")"; + } +} diff --git a/website/usageExamples/ToStringExample_pre.jpage b/website/usageExamples/ToStringExample_pre.jpage new file mode 100644 index 00000000..a15fb944 --- /dev/null +++ b/website/usageExamples/ToStringExample_pre.jpage @@ -0,0 +1,24 @@ +import lombok.ToString; + +@ToString(exclude="id") +public class ToStringExample { + private static final int STATIC_VAR = 10; + private String name; + private Shape shape = new Square(5, 10); + private String[] tags; + private int id; + + public String getName() { + return this.getName(); + } + + @ToString(callSuper=true, includeFieldNames=true) + public static class Square extends Shape { + private final int width, height; + + public Square(int width, int height) { + this.width = width; + this.height = height; + } + } +} diff --git a/website/usageExamples/ValueExample_post.jpage b/website/usageExamples/ValueExample_post.jpage new file mode 100644 index 00000000..8a5d4836 --- /dev/null +++ b/website/usageExamples/ValueExample_post.jpage @@ -0,0 +1,120 @@ +import java.util.Arrays; + +public final class ValueExample { + private final String name; + private int age; + private final double score; + protected final String[] tags; + + @java.beans.ConstructorProperties({"name", "age", "score", "tags"}) + public ValueExample(String name, int age, double score, String[] tags) { + this.name = name; + this.age = age; + this.score = score; + this.tags = tags; + } + + public String getName() { + return this.name; + } + + public int getAge() { + return this.age; + } + + public double getScore() { + return this.score; + } + + public String[] getTags() { + return this.tags; + } + + @java.lang.Override + public boolean equals(Object o) { + if (o == this) return true; + if (!(o instanceof ValueExample)) return false; + final ValueExample other = (ValueExample)o; + final Object this$name = this.getName(); + final Object other$name = other.getName(); + if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false; + if (this.getAge() != other.getAge()) return false; + if (Double.compare(this.getScore(), other.getScore()) != 0) return false; + if (!Arrays.deepEquals(this.getTags(), other.getTags())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + final int PRIME = 59; + int result = 1; + final Object $name = this.getName(); + result = result * PRIME + ($name == null ? 43 : $name.hashCode()); + result = result * PRIME + this.getAge(); + final long $score = Double.doubleToLongBits(this.getScore()); + result = result * PRIME + (int)($score >>> 32 ^ $score); + result = result * PRIME + Arrays.deepHashCode(this.getTags()); + return result; + } + + @java.lang.Override + public String toString() { + return "ValueExample(name=" + getName() + ", age=" + getAge() + ", score=" + getScore() + ", tags=" + Arrays.deepToString(getTags()) + ")"; + } + + ValueExample withAge(int age) { + return this.age == age ? this : new ValueExample(name, age, score, tags); + } + + public static final class Exercise<T> { + private final String name; + private final T value; + + private Exercise(String name, T value) { + this.name = name; + this.value = value; + } + + public static <T> Exercise<T> of(String name, T value) { + return new Exercise<T>(name, value); + } + + public String getName() { + return this.name; + } + + public T getValue() { + return this.value; + } + + @java.lang.Override + public boolean equals(Object o) { + if (o == this) return true; + if (!(o instanceof ValueExample.Exercise)) return false; + final Exercise<?> other = (Exercise<?>)o; + final Object this$name = this.getName(); + final Object other$name = other.getName(); + if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false; + final Object this$value = this.getValue(); + final Object other$value = other.getValue(); + if (this$value == null ? other$value != null : !this$value.equals(other$value)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + final int PRIME = 59; + int result = 1; + final Object $name = this.getName(); + result = result * PRIME + ($name == null ? 43 : $name.hashCode()); + final Object $value = this.getValue(); + result = result * PRIME + ($value == null ? 43 : $value.hashCode()); + return result; + } + + @java.lang.Override + public String toString() { + return "ValueExample.Exercise(name=" + getName() + ", value=" + getValue() + ")"; + } + } +}
\ No newline at end of file diff --git a/website/usageExamples/ValueExample_pre.jpage b/website/usageExamples/ValueExample_pre.jpage new file mode 100644 index 00000000..d9550c25 --- /dev/null +++ b/website/usageExamples/ValueExample_pre.jpage @@ -0,0 +1,19 @@ +import lombok.AccessLevel; +import lombok.experimental.NonFinal; +import lombok.experimental.Value; +import lombok.experimental.Wither; +import lombok.ToString; + +@Value public class ValueExample { + String name; + @Wither(AccessLevel.PACKAGE) @NonFinal int age; + double score; + protected String[] tags; + + @ToString(includeFieldNames=true) + @Value(staticConstructor="of") + public static class Exercise<T> { + String name; + T value; + } +} diff --git a/website/usageExamples/experimental/AccessorsExample_post.jpage b/website/usageExamples/experimental/AccessorsExample_post.jpage new file mode 100644 index 00000000..ae5a39db --- /dev/null +++ b/website/usageExamples/experimental/AccessorsExample_post.jpage @@ -0,0 +1,20 @@ +public class AccessorsExample { + private int age = 10; + + public int age() { + return this.age; + } + + public AccessorsExample age(final int age) { + this.age = age; + return this; + } +} + +class PrefixExample { + private String fName = "Hello, World!"; + + public String getName() { + return this.fName; + } +} diff --git a/website/usageExamples/experimental/AccessorsExample_pre.jpage b/website/usageExamples/experimental/AccessorsExample_pre.jpage new file mode 100644 index 00000000..f1591aba --- /dev/null +++ b/website/usageExamples/experimental/AccessorsExample_pre.jpage @@ -0,0 +1,14 @@ +import lombok.experimental.Accessors; +import lombok.Getter; +import lombok.Setter; + +@Accessors(fluent = true) +public class AccessorsExample { + @Getter @Setter + private int age = 10; +} + +class PrefixExample { + @Accessors(prefix = "f") @Getter + private String fName = "Hello, World!"; +} diff --git a/website/usageExamples/experimental/DelegateExample_post.jpage b/website/usageExamples/experimental/DelegateExample_post.jpage new file mode 100644 index 00000000..1c5239f1 --- /dev/null +++ b/website/usageExamples/experimental/DelegateExample_post.jpage @@ -0,0 +1,97 @@ +import java.util.ArrayList; +import java.util.Collection; + +public class DelegationExample { + private interface SimpleCollection { + boolean add(String item); + boolean remove(Object item); + } + + private final Collection<String> collection = new ArrayList<String>(); + + @java.lang.SuppressWarnings("all") + public boolean add(final java.lang.String item) { + return this.collection.add(item); + } + + @java.lang.SuppressWarnings("all") + public boolean remove(final java.lang.Object item) { + return this.collection.remove(item); + } +} + +class ExcludesDelegateExample { + long counter = 0L; + + private interface Add { + boolean add(String x); + boolean addAll(Collection<? extends String> x); + } + + private final Collection<String> collection = new ArrayList<String>(); + + public boolean add(String item) { + counter++; + return collection.add(item); + } + + public boolean addAll(Collection<? extends String> col) { + counter += col.size(); + return collection.addAll(col); + } + + @java.lang.SuppressWarnings("all") + public int size() { + return this.collection.size(); + } + + @java.lang.SuppressWarnings("all") + public boolean isEmpty() { + return this.collection.isEmpty(); + } + + @java.lang.SuppressWarnings("all") + public boolean contains(final java.lang.Object arg0) { + return this.collection.contains(arg0); + } + + @java.lang.SuppressWarnings("all") + public java.util.Iterator<java.lang.String> iterator() { + return this.collection.iterator(); + } + + @java.lang.SuppressWarnings("all") + public java.lang.Object[] toArray() { + return this.collection.toArray(); + } + + @java.lang.SuppressWarnings("all") + public <T extends .java.lang.Object>T[] toArray(final T[] arg0) { + return this.collection.<T>toArray(arg0); + } + + @java.lang.SuppressWarnings("all") + public boolean remove(final java.lang.Object arg0) { + return this.collection.remove(arg0); + } + + @java.lang.SuppressWarnings("all") + public boolean containsAll(final java.util.Collection<?> arg0) { + return this.collection.containsAll(arg0); + } + + @java.lang.SuppressWarnings("all") + public boolean removeAll(final java.util.Collection<?> arg0) { + return this.collection.removeAll(arg0); + } + + @java.lang.SuppressWarnings("all") + public boolean retainAll(final java.util.Collection<?> arg0) { + return this.collection.retainAll(arg0); + } + + @java.lang.SuppressWarnings("all") + public void clear() { + this.collection.clear(); + } +} diff --git a/website/usageExamples/experimental/DelegateExample_pre.jpage b/website/usageExamples/experimental/DelegateExample_pre.jpage new file mode 100644 index 00000000..885ab3a8 --- /dev/null +++ b/website/usageExamples/experimental/DelegateExample_pre.jpage @@ -0,0 +1,37 @@ +import java.util.ArrayList; +import java.util.Collection; + +import lombok.experimental.Delegate; + +public class DelegationExample { + private interface SimpleCollection { + boolean add(String item); + boolean remove(Object item); + } + + @Delegate(types=SimpleCollection.class) + private final Collection<String> collection = new ArrayList<String>(); +} + + +class ExcludesDelegateExample { + long counter = 0L; + + private interface Add { + boolean add(String x); + boolean addAll(Collection<? extends String> x); + } + + @Delegate(excludes=Add.class) + private final Collection<String> collection = new ArrayList<String>(); + + public boolean add(String item) { + counter++; + return collection.add(item); + } + + public boolean addAll(Collection<? extends String> col) { + counter += col.size(); + return collection.addAll(col); + } +} diff --git a/website/usageExamples/experimental/ExtensionMethodExample_post.jpage b/website/usageExamples/experimental/ExtensionMethodExample_post.jpage new file mode 100644 index 00000000..de46d776 --- /dev/null +++ b/website/usageExamples/experimental/ExtensionMethodExample_post.jpage @@ -0,0 +1,21 @@ +public class ExtensionMethodExample { + public String test() { + int[] intArray = {5, 3, 8, 2}; + java.util.Arrays.sort(intArray); + + String iAmNull = null; + return Extensions.or(iAmNull, Extensions.toTitleCase("hELlO, WORlD!")); + } +} + +class Extensions { + public static <T> T or(T obj, T ifNull) { + return obj != null ? obj : ifNull; + } + + public static String toTitleCase(String in) { + if (in.isEmpty()) return in; + return "" + Character.toTitleCase(in.charAt(0)) + + in.substring(1).toLowerCase(); + } +} diff --git a/website/usageExamples/experimental/ExtensionMethodExample_pre.jpage b/website/usageExamples/experimental/ExtensionMethodExample_pre.jpage new file mode 100644 index 00000000..b3b9f1fa --- /dev/null +++ b/website/usageExamples/experimental/ExtensionMethodExample_pre.jpage @@ -0,0 +1,24 @@ +import lombok.experimental.ExtensionMethod; + +@ExtensionMethod({java.util.Arrays.class, Extensions.class}) +public class ExtensionMethodExample { + public String test() { + int[] intArray = {5, 3, 8, 2}; + intArray.sort(); + + String iAmNull = null; + return iAmNull.or("hELlO, WORlD!".toTitleCase()); + } +} + +class Extensions { + public static <T> T or(T obj, T ifNull) { + return obj != null ? obj : ifNull; + } + + public static String toTitleCase(String in) { + if (in.isEmpty()) return in; + return "" + Character.toTitleCase(in.charAt(0)) + + in.substring(1).toLowerCase(); + } +} diff --git a/website/usageExamples/experimental/FieldDefaultsExample_post.jpage b/website/usageExamples/experimental/FieldDefaultsExample_post.jpage new file mode 100644 index 00000000..95c17a4b --- /dev/null +++ b/website/usageExamples/experimental/FieldDefaultsExample_post.jpage @@ -0,0 +1,12 @@ +public class FieldDefaultsExample { + public final int a; + private final int b; + private int c; + final int d; + + FieldDefaultsExample() { + a = 0; + b = 0; + d = 0; + } +} diff --git a/website/usageExamples/experimental/FieldDefaultsExample_pre.jpage b/website/usageExamples/experimental/FieldDefaultsExample_pre.jpage new file mode 100644 index 00000000..c8335832 --- /dev/null +++ b/website/usageExamples/experimental/FieldDefaultsExample_pre.jpage @@ -0,0 +1,18 @@ +import lombok.AccessLevel; +import lombok.experimental.FieldDefaults; +import lombok.experimental.NonFinal; +import lombok.experimental.PackagePrivate; + +@FieldDefaults(makeFinal=true, level=AccessLevel.PRIVATE) +public class FieldDefaultsExample { + public final int a; + int b; + @NonFinal int c; + @PackagePrivate int d; + + FieldDefaultsExample() { + a = 0; + b = 0; + d = 0; + } +} diff --git a/website/usageExamples/experimental/HelperExample_post.jpage b/website/usageExamples/experimental/HelperExample_post.jpage new file mode 100644 index 00000000..04a97b9f --- /dev/null +++ b/website/usageExamples/experimental/HelperExample_post.jpage @@ -0,0 +1,14 @@ +public class HelperExample { + int someMethod(int arg1) { + int localVar = 5; + + class Helpers { + int helperMethod(int arg) { + return arg + localVar; + } + } + Helpers $Helpers = new Helpers(); + + return $Helpers.helperMethod(10); + } +} diff --git a/website/usageExamples/experimental/HelperExample_pre.jpage b/website/usageExamples/experimental/HelperExample_pre.jpage new file mode 100644 index 00000000..cd86ef3c --- /dev/null +++ b/website/usageExamples/experimental/HelperExample_pre.jpage @@ -0,0 +1,15 @@ +import lombok.experimental.Helper; + +public class HelperExample { + int someMethod(int arg1) { + int localVar = 5; + + @Helper class Helpers { + int helperMethod(int arg) { + return arg + localVar; + } + } + + return helperMethod(10); + } +} diff --git a/website/usageExamples/experimental/UtilityClassExample_post.jpage b/website/usageExamples/experimental/UtilityClassExample_post.jpage new file mode 100644 index 00000000..70810230 --- /dev/null +++ b/website/usageExamples/experimental/UtilityClassExample_post.jpage @@ -0,0 +1,11 @@ +public final class UtilityClassExample { + private static final int CONSTANT = 5; + + private UtilityClassExample() { + throw new java.lang.UnsupportedOperationException("This is a utility class and cannot be instantiated"); + } + + public static void addSomething(int in) { + return in + CONSTANT; + } +} diff --git a/website/usageExamples/experimental/UtilityClassExample_pre.jpage b/website/usageExamples/experimental/UtilityClassExample_pre.jpage new file mode 100644 index 00000000..85731b81 --- /dev/null +++ b/website/usageExamples/experimental/UtilityClassExample_pre.jpage @@ -0,0 +1,10 @@ +import lombok.experimental.UtilityClass; + +@UtilityClass +public class UtilityClassExample { + private final int CONSTANT = 5; + + public void addSomething(int in) { + return in + CONSTANT; + } +} diff --git a/website/usageExamples/experimental/WitherExample_post.jpage b/website/usageExamples/experimental/WitherExample_post.jpage new file mode 100644 index 00000000..3447192a --- /dev/null +++ b/website/usageExamples/experimental/WitherExample_post.jpage @@ -0,0 +1,21 @@ +import lombok.NonNull; + +public class WitherExample { + private final int age; + private @NonNull final String name; + + public WitherExample(String name, int age) { + if (name == null) throw new NullPointerException(); + this.name = name; + this.age = age; + } + + public WitherExample withAge(int age) { + return this.age == age ? this : new WitherExample(name, age); + } + + protected WitherExample withName(@NonNull String name) { + if (name == null) throw new java.lang.NullPointerException("name"); + return this.name == name ? this : new WitherExample(name, age); + } +}
\ No newline at end of file diff --git a/website/usageExamples/experimental/WitherExample_pre.jpage b/website/usageExamples/experimental/WitherExample_pre.jpage new file mode 100644 index 00000000..5db799fc --- /dev/null +++ b/website/usageExamples/experimental/WitherExample_pre.jpage @@ -0,0 +1,14 @@ +import lombok.AccessLevel; +import lombok.NonNull; +import lombok.experimental.Wither; + +public class WitherExample { + @Wither private final int age; + @Wither(AccessLevel.PROTECTED) @NonNull private final String name; + + public WitherExample(String name, int age) { + if (name == null) throw new NullPointerException(); + this.name = name; + this.age = age; + } +} diff --git a/website/usageExamples/experimental/onXExample_post.jpage b/website/usageExamples/experimental/onXExample_post.jpage new file mode 100644 index 00000000..1be94f2a --- /dev/null +++ b/website/usageExamples/experimental/onXExample_post.jpage @@ -0,0 +1,22 @@ +import javax.inject.Inject; +import javax.persistence.Id; +import javax.persistence.Column; +import javax.validation.constraints.Max; + +public class OnXExample { + private long unid; + + @Inject + public OnXExample(long unid) { + this.unid = unid; + } + + @Id @Column(name="unique-id") + public long getUnid() { + return unid; + } + + public void setUnid(@Max(10000) long unid) { + this.unid = unid; + } +} diff --git a/website/usageExamples/experimental/onXExample_pre.jpage b/website/usageExamples/experimental/onXExample_pre.jpage new file mode 100644 index 00000000..f8fcb435 --- /dev/null +++ b/website/usageExamples/experimental/onXExample_pre.jpage @@ -0,0 +1,15 @@ +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +import javax.inject.Inject; +import javax.persistence.Id; +import javax.persistence.Column; +import javax.validation.constraints.Max; + +@AllArgsConstructor(onConstructor=@__(@Inject)) +public class OnXExample { + @Getter(onMethod=@__({@Id, @Column(name="unique-id")})) + @Setter(onParam=@__(@Max(10000))) + private long unid; +} diff --git a/website/usageExamples/valExample_post.jpage b/website/usageExamples/valExample_post.jpage new file mode 100644 index 00000000..fa2e852e --- /dev/null +++ b/website/usageExamples/valExample_post.jpage @@ -0,0 +1,21 @@ +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +public class ValExample { + public String example() { + final ArrayList<String> example = new ArrayList<String>(); + example.add("Hello, World!"); + final String foo = example.get(0); + return foo.toLowerCase(); + } + + public void example2() { + final HashMap<Integer, String> map = new HashMap<Integer, String>(); + map.put(0, "zero"); + map.put(5, "five"); + for (final Map.Entry<Integer, String> entry : map.entrySet()) { + System.out.printf("%d: %s\n", entry.getKey(), entry.getValue()); + } + } +} diff --git a/website/usageExamples/valExample_pre.jpage b/website/usageExamples/valExample_pre.jpage new file mode 100644 index 00000000..a621640f --- /dev/null +++ b/website/usageExamples/valExample_pre.jpage @@ -0,0 +1,21 @@ +import java.util.ArrayList; +import java.util.HashMap; +import lombok.val; + +public class ValExample { + public String example() { + val example = new ArrayList<String>(); + example.add("Hello, World!"); + val foo = example.get(0); + return foo.toLowerCase(); + } + + public void example2() { + val map = new HashMap<Integer, String>(); + map.put(0, "zero"); + map.put(5, "five"); + for (val entry : map.entrySet()) { + System.out.printf("%d: %s\n", entry.getKey(), entry.getValue()); + } + } +} diff --git a/website/videos/expressInstall.swf b/website/videos/expressInstall.swf Binary files differdeleted file mode 100644 index 0fbf8fca..00000000 --- a/website/videos/expressInstall.swf +++ /dev/null diff --git a/website/videos/lombok-iPhone.m4v b/website/videos/lombok-iPhone.m4v Binary files differdeleted file mode 100644 index 19487ebd..00000000 --- a/website/videos/lombok-iPhone.m4v +++ /dev/null diff --git a/website/videos/lombok.mp4 b/website/videos/lombok.mp4 Binary files differdeleted file mode 100644 index b6f2107b..00000000 --- a/website/videos/lombok.mp4 +++ /dev/null diff --git a/website/videos/lombok.ogv b/website/videos/lombok.ogv Binary files differdeleted file mode 100644 index 70e20225..00000000 --- a/website/videos/lombok.ogv +++ /dev/null diff --git a/website/videos/player.swf b/website/videos/player.swf Binary files differdeleted file mode 100644 index 1f655a26..00000000 --- a/website/videos/player.swf +++ /dev/null diff --git a/website/videos/poster.png b/website/videos/poster.png Binary files differdeleted file mode 100644 index 4911408f..00000000 --- a/website/videos/poster.png +++ /dev/null diff --git a/website/videos/swfobject.js b/website/videos/swfobject.js deleted file mode 100644 index 8eafe9dd..00000000 --- a/website/videos/swfobject.js +++ /dev/null @@ -1,4 +0,0 @@ -/* SWFObject v2.2 <http://code.google.com/p/swfobject/> - is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> -*/ -var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
\ No newline at end of file |