text:
<!--
 Copyright (C) 2015 Jian Chen <jian@mobmead.com>.

 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.
-->

<!--
 Copyright (C) 2010-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.
-->
<project name="easympermission" default="dist" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus">
	<description>
This buildfile is part of projectlombok.org. It is the main entry point that contains
the common tasks and can be called on to run the main aspects of all the sub-scripts.
	</description>

	<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" />

	<path id="build.path">
		<fileset dir="lib/build">
			<include name="*.jar" />
		</fileset>
	</path>

	<path id="runtime.path">
		<fileset dir="lib/runtime">
			<include name="*.jar" />
		</fileset>
	</path>

	<path id="test.path">
		<fileset dir="lib/test">
			<include name="*.jar" />
		</fileset>
	</path>

	<path id="eclipseBuild.path">
		<fileset dir="lib/eclipseBuild">
			<include name="*.jar" />
		</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>

	<target name="distclean" depends="clean" description="Deletes everything that this build script has ever generated.">
		<delete dir="lib" quiet="true" />
		<delete dir="dist" quiet="true" />
		<delete file=".project" quiet="true" />
		<delete file=".classpath" quiet="true" />
		<delete dir=".settings" quiet="true" />
		<delete dir=".idea" quiet="true" />
		<delete file="lombok.iml" quiet="true" />
		<delete dir="ivyCache" quiet="true" />
	</target>

	<target name="download-ipp" unless="ivyplusplus.available">
		<mkdir dir="lib" />
		<get src="https://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" usetimestamp="true" />
	</target>

	<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" />
	</target>

	<target name="redownload-ipp" unless="ivyplusplus.minimumAvailable">
		<get src="https://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" />
		<fail>A new version of ivyplusplus was required and has been downloaded. Rerun the script to continue.</fail>
	</target>

	<target name="ensure-ipp" depends="load-ipp, redownload-ipp" />

	<target name="config-ivy" depends="ensure-ipp" unless="ivy.config">
		<ivy:configure file="buildScripts/ivysettings.xml" />
		<property name="ivy.config" value="true" />
	</target>

	<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:retrieve />
	</target>

	<target name="ensureBuildDeps" depends="config-ivy">
		<mkdir dir="lib/openJDK6Environment" />
		<get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk6.jar" dest="lib/openJDK6Environment/rt-openjdk6.jar" verbose="true" usetimestamp="true" />
		<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="build, javac7" />
		<ivy:retrieve />
	</target>

	<target name="ensureRuntimeDeps" depends="config-ivy">
		<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="runtime" />
		<ivy:retrieve />
	</target>

	<target name="ensureTestDeps" depends="config-ivy">
		<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="test, javac6, eclipseBuild" />
		<ivy:retrieve />
	</target>

	<target name="version" depends="ensure-ipp" 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" />
		<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>
		<!-- create EasyMPermission version -->
		<javac includeDestClasses="false" srcdir="src/core" debug="on" destdir="build/lombok" source="1.5" target="1.5" includes="com/mobmead/easympermission/javac/Version.java" includeantruntime="false" />
		<java
			classname="com.mobmead.easympermission.javac.Version"
			classpath="build/lombok"
			failonerror="true"
			output="build/easympermission-version.txt" />
		<ivy:loadversion property="easympermission.version" file="build/easympermission-version.txt" />
		<echo level="info">EasyMPermission version: ${easympermission.version}</echo>
	</target>

	<target name="-unpackLibs" depends="ensureRuntimeDeps">
		<ivy:cachedunjar dest="build/lombok" marker="build/unpackDeps.marker">
			<path refid="runtime.path" />
		</ivy:cachedunjar>
	</target>

	<target name="compile" depends="version, ensureBuildDeps, -unpackLibs" description="Compiles the code.">
		<!-- ant includes the destination dir on the classpath (and there are good reasons to do this), but that also means
		 the bleeding edge lombok from the previous build is run, which means if there are bugs in it, you can't compile
		anymore until you 'ant clean'. That's very much not desired, so we kill the processor, which stops lombok from running.
		We re-create the file at the end of this target. -->
		<delete file="build/lombok/META-INF/services/javax.annotation.processing.Processor" quiet="true" />
		<ivy:compile destdir="build/stubsstubs" source="1.5" target="1.5" includeantruntime="false">
			<compilerarg value="-Xbootclasspath/p:lib/openJDK6Environment/rt-openjdk6.jar" />
			<src path="src/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" />
			<src path="src/stubs" />
			<src path="src/javac-only-stubs" />
			<classpath location="build/stubsstubs" />
		</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" />
			<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">
			<compilerarg value="-Xbootclasspath/p:build/stubs${path.separator}lib/openJDK6Environment/rt-openjdk6.jar" />
			<src path="src/utils" />
			<include name="lombok/javac/**" />
			<classpath location="build/lombok-utils" />
			<classpath refid="build.path" />
		</ivy:compile>

		<copy todir="build/lombok">
			<fileset dir="build/lombok-utils" />
		</copy>

		<mkdir dir="build/transformedSources" />
		<copy todir="build/transformedSources">
			<fileset dir="src/eclipseAgent">
				<include name="**/*Transplants.java" />
			</fileset>
			<filterchain>
				<lineContainsRegExp negate="true">
					<regexp pattern="^\s*@SuppressWarnings.*$" />
				</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" />
			<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" />
			<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" />
			<src path="src/launch" />
			<src path="src/core" />
			<src path="src/installer" />
			<src path="src/eclipseAgent" />
			<exclude name="lombok/javac/**" />
			<exclude name="com/mobmead/easympermission/javac/**" />
			<exclude name="**/*Transplants.java" />
			<classpath location="build/lombok" />
			<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" />
			<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">
			<compilerarg value="-Xbootclasspath/p:build/stubs${path.separator}lib/openJDK6Environment/rt-openjdk6.jar" />
			<src path="src/core" />
			<src path="src/delombok" />
			<include name="lombok/javac/**" />
			<include name="com/mobmead/easympermission/javac/**" />
			<include name="lombok/delombok/**" />
			<classpath location="build/lombok" />
			<classpath refid="build.path" />
		</ivy:compile>
		<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</echo>
		<!-- add pom files -->
		<mkdir dir="build/lombok/META-INF/maven" />
		<mkdir dir="build/lombok/META-INF/maven/com.mobmead" />
		<mkdir dir="build/lombok/META-INF/maven/com.mobmead/easympermission" />
		<copy todir="build/lombok/META-INF/maven/com.mobmead/easympermission">
			<fileset dir="maven">
				<include name="**" />
			</fileset>
		</copy>
	</target>

	<target name="dist" description="Builds THE lombok.jar file which contains everything." depends="version, compile">
		<mkdir dir="dist" />
		<copy file="doc/changelog.markdown" tofile="build/changelog.txt" />
		<tstamp>
			<format property="releaseTimestamp" pattern="yyyy-MM-dd" />
		</tstamp>
		<echo file="release-timestamp.txt">${releaseTimestamp}</echo>
		<zip destfile="dist/easympermission-${easympermission.version}.jar">
			<fileset dir="build" includes="changelog.txt" />
			<fileset dir="." includes="LICENSE" />
			<fileset dir="." includes="AUTHORS" />
			<fileset dir="." includes="release-timestamp.txt" />
			<fileset dir="build/lombok">
				<include name="lombok/*.class" />
				<include name="lombok/experimental/**" />
				<include name="lombok/extern/**" />
				<include name="lombok/launch/**" />
				<include name="lombok/delombok/ant/Tasks*" />
				<include name="com/mobmead/easympermission/*.class" />
			</fileset>
			<fileset dir="META-INF/maven/com.mobmead/easympermission" includes="**" />
			<mappedresources>
				<fileset dir="build/lombok">
					<exclude name="com/sun/tools/javac/**" />
					<exclude name="lombok/*.class" />
					<exclude name="lombok/experimental/**" />
					<exclude name="lombok/extern/**" />
					<exclude name="lombok/launch/**" />
					<exclude name="lombok/delombok/ant/Tasks*" />
					<exclude name="com/mobmead/easympermission/*.class" />
				</fileset>
				<firstmatchmapper>
					<globmapper from="*.class" to="*.SCL.lombok" />
					<identitymapper />
				</firstmatchmapper>
			</mappedresources>
		</zip>
		<jar destfile="dist/easympermission-${easympermission.version}.jar" update="true">
			<manifest>
				<attribute name="Premain-Class" value="lombok.launch.Agent" />
				<attribute name="Agent-Class" value="lombok.launch.Agent" />
				<attribute name="Can-Redefine-Classes" value="true" />
				<attribute name="Main-Class" value="lombok.launch.Main" />
				<attribute name="Lombok-Version" value="${lombok.version}" />
				<attribute name="EasyMPermission-Version" value="${easympermission.version}" />
			</manifest>
		</jar>
		<delete file="release-timestamp.txt" />
		<copy file="dist/easympermission-${easympermission.version}.jar" tofile="dist/easympermission.jar" />
		<property name="lombok.dist.built" value="true" />
	</target>

	<target name="dist-utils" description="Builds lombok-utils.jar, which is a library used by i.e. lombok.ast project." depends="version, compile">
		<mkdir dir="dist" />
		<jar destfile="dist/lombok-utils-${lombok.version}.jar">
			<fileset dir="build/lombok-utils" />
			<fileset dir="." includes="LICENSE" />
			<fileset dir="." includes="AUTHORS" />
			<manifest>
				<attribute name="Lombok-Version" value="${lombok.version}" />
			</manifest>
		</jar>
		<copy file="dist/lombok-utils-${lombok.version}.jar" tofile="dist/lombok-utils.jar" />
	</target>

	<target name="intellij" depends="deps, contrib" description="Creates intellij project files and downloads all dependencies. Open this directory as a project in IntelliJ after running this target.">
		<ivy:intellijgen>
			<conf name="build" sources="contrib" />
			<conf name="test" sources="contrib" />
			<module name="lombok" depends="build, test">
				<srcdir dir="src/core" />
				<srcdir dir="src/launch" />
				<srcdir dir="src/utils" />
				<srcdir dir="src/eclipseAgent" />
				<srcdir dir="src/installer" />
				<srcdir dir="src/delombok" />
				<srcdir dir="src/stubs" />
				<srcdir dir="experimental/src" />
				<srcdir dir="test/transform/src" test="true" />
				<srcdir dir="test/core/src" test="true" />
				<srcdir dir="test/bytecode/src" test="true" />
				<srcdir dir="test/configuration/src" test="true" />
			</module>
			<settings>
				<url url="https://projectlombok.org/downloads/lombok.intellij.settings" />
			</settings>
			<apt enabled="true" />
		</ivy:intellijgen>
	</target>

	<target name="-skipEclipseDeps">
		<property name="eclipse.build.configname" value="buildWithoutEclipse" />
	</target>

	<target name="-addEclipseDeps">
		<property name="eclipse.build.configname" value="build" />
	</target>

	<target name="eclipse" depends="-addEclipseDeps, deps, contrib" description="Creates eclipse project files and downloads all dependencies. Open this directory as project in eclipse after running this target. This will NOT let you start a debug session for eclipse; use target 'eclipseForDebugging' instead to do that.">
		<ivy:eclipsegen source="1.6">
			<srcdir dir="src/core" />
			<srcdir dir="src/launch" />
			<srcdir dir="src/utils" />
			<srcdir dir="src/eclipseAgent" />
			<srcdir dir="src/installer" />
			<srcdir dir="src/delombok" />
			<srcdir dir="src/stubs" />
			<srcdir dir="experimental/src" />
			<srcdir dir="test/transform/src" />
			<srcdir dir="test/core/src" />
			<srcdir dir="test/bytecode/src" />
			<srcdir dir="test/configuration/src" />
			<conf name="${eclipse.build.configname}" sources="contrib" />
			<conf name="test" sources="contrib" />
			<local org="org.projectlombok" name="lombok.patcher" dir="../lombok.patcher" />
			<settings>
				<url url="https://projectlombok.org/downloads/lombok.eclipse.settings" />
			</settings>
			<apt location="lib/build/projectlombok.org-spi.jar" />
		</ivy:eclipsegen>
	</target>

	<target name="ensureEcjDebugDeps" depends="config-ivy">
		<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="buildWithoutEclipse" />
		<ivy:retrieve />
	</target>

	<target name="loadEclipseLocation">
		<loadfile property="eclipse.location" srcFile="eclipse.location" encoding="UTF-8" quiet="true" />
	</target>

	<target name="setupEclipseLocation" depends="loadEclipseLocation" unless="eclipse.location">
		<echo>To add your eclipse installation's own plugins as dependencies, the build script needs to know where your eclipse is installed. Please enter this now (it's saved for future executions of this task). For example:

	/Applications/eclipse
	C:\Program Files\eclipse
</echo>
		<input message="Path to eclipse: " addproperty="eclipse.location" />
		<available property="eclipse.found" file="${eclipse.location}/plugins" />
		<fail unless="eclipse.found">Eclipse can't be found in this location; I expect that directory to contain a subdirectory called 'plugins'.</fail>
		<echo file="eclipse.location" message="${eclipse.location}" />
	</target>

	<target name="eclipseForDebugging" depends="-skipEclipseDeps, ensureEcjDebugDeps, eclipse, setupEclipseLocation" description="Creates eclipse project files and downloads all dependencies, but borrows all eclipse dependencies (and more) from your existing eclipse installation. This is very useful if you wish to start a debugging eclipse from inside eclipse, and then breakpoint eclipse code itself. Because the deps are inherited, line numbers will line up and such.">
		<copy
				file="buildScripts/eclipse-debug-target.template"
				tofile="LombokizedEclipse.launch"
				preservelastmodified="true"
				overwrite="true">
		</copy>

		<!-- These are dependencies -->
		<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.core.runtime" /></antcall>
		<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.equinox.common" /></antcall>
		<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.osgi" /></antcall>
		<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.jdt.core" /></antcall>
		<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.jdt.ui" /></antcall>
		<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.jface.text" /></antcall>
		<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.core.resources" /></antcall>
		<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.core.jobs" /></antcall>

		<!-- These are merely useful -->
		<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.text" /></antcall>
		<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.ltk.core.refactoring" /></antcall>
	</target>

	<target name="-augmentClasspath">
		<pathconvert property="augment.bin" setonempty="false" pathsep="  ::  ">
			<fileset dir="${eclipse.location}/plugins" includes="${pluginName}_*" />
		</pathconvert>

		<fail unless="augment.bin">
			You do not have the eclipse plugin '${pluginName}'. I expected it to be in your eclipse plugins directory (followed by an underscore and a version number).
		</fail>

		<condition property="multiples">
			<contains string="${augment.bin}" substring="  ::  " />
		</condition>

		<condition property="augment.jar" value="${augment.bin}">
			<not><isset property="multiples" /></not>
		</condition>

		<input message="You have multiple versions of the same plugin. These are: ${augment.bin}. Please copy/paste the complete path to the one you want to use, press enter to abort:" addproperty="augment.jar" />

		<condition property="emptyTarget">
			<equals arg1="${augment.jar}" arg2="" />
		</condition>

		<fail>
			<condition>
				<equals arg1="${augment.jar}" arg2="" />
			</condition>
		</fail>

		<pathconvert property="augment.src">
			<map from="${eclipse.location}/plugins/${pluginName}_" to="${eclipse.location}/plugins/${pluginName}.source_" />
			<fileset file="${augment.jar}" />
		</pathconvert>

		<available property="sourceAddition" file="${augment.src}" value=" sourcepath="${augment.src}"" />
		<property name="sourceAddition" value="" />

		<condition property="sourceWarning" value="WARNING: No source available for this plugin!">
			<equals arg1="${sourceAddition}" arg2="" />
		</condition>
		<property name="sourceWarning" value="" />

		<replaceregexp file=".classpath" flags="is" encoding="UTF-8">
			<regexp pattern="^(.*?)(.)(<classpathentry kind=.lib. path=)(.*)$" />
			<substitution expression="\1\2<classpathentry kind="lib" path="____AUGMENT_BIN____"____AUGMENT_SRC____/>\${line.separator}\2\3\4" />
		</replaceregexp>
		<replace file=".classpath" token="____AUGMENT_BIN____" value="${augment.jar}" />
		<replace file=".classpath" token="____AUGMENT_SRC____" value="${sourceAddition}" />
		<echo>Added to project classpath from your eclipse installation: ${pluginName}.
${sourceWarning}</echo>
	</target>

	<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">
			<classpath refid="test.path" />
			<classpath refid="build.path" />
			<classpath path="build/lombok" />
			<src path="test/core/src" />
			<src path="test/transform/src" />
			<src path="test/bytecode/src" />
			<src path="test/configuration/src" />
		</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">
			<jvmarg value="-javaagent:dist/lombok.jar=ecj" />
			<arg value="-source" />
			<arg value="1.6" />
			<arg value="-target" />
			<arg value="1.6" />
			<arg value="test/ecj/SimpleTest.java" />
		</java>
	</target>

	<target name="-loadTestEnvironmentProperties">
		<property file="testenvironment.properties" />
		<available file=".project" property="isEclipseProject" />
	</target>

	<target name="-createEclipseLaunchForTestEnvironmentIfEclipseProject" depends="-loadTestEnvironmentProperties" if="isEclipseProject">
		<antcall target="createEclipseLaunchForTestEnvironment" />
	</target>

	<target name="createEclipseLaunchForTestEnvironment" depends="-loadTestEnvironmentProperties, -failIfNoTestEnvironmentProperties" description="Creates an eclipse launch target for the current test environment.">
		<copy
				file="buildScripts/eclipse-run-tests.template"
				tofile="RunLombokTests ${test.location.name}.launch"
				preservelastmodified="true"
				overwrite="true">
			<filterset>
				<filter token="JAVAC_LOCATION" value="${test.location.javac}" />
				<filter token="ECJ_LOCATION" value="${test.location.ecj}" />
				<filter token="RT_LOCATION" value="${test.location.bootclasspath}" />
				<filter token="JAVA_VERSION" value="${test.javaversion}" />
			</filterset>
		</copy>
		<echo>WARNING: If you wish to test JDK8 features in eclipse, there must be a JDK8 installation configured in your eclipse, and it must be called 'JavaSE-1.8'.</echo>
	</target>

	<target name="setupJavaOpenJDK6TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against OpenJDK6.">
		<mkdir dir="lib/openJDK6Environment" />
		<get src="https://projectlombok.org/ivyrepo/langtools/javac-1.6.0.18.jar" dest="lib/openJDK6Environment/javac6.jar" verbose="true" usetimestamp="true" />
		<get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk6.jar" dest="lib/openJDK6Environment/rt-openjdk6.jar" verbose="true" usetimestamp="true" />
		<propertyfile file="testenvironment.properties">
			<entry key="test.location.javac" value="lib/openJDK6Environment/javac6.jar" />
			<entry key="test.location.ecj" value="lib/ecj7/org.eclipse.custom-ecj.jar" />
			<entry key="test.location.bootclasspath" value="lib/openJDK6Environment/rt-openjdk6.jar" />
			<entry key="test.location.name" value="OpenJDK6" />
			<entry key="test.javaversion" value="6" />
		</propertyfile>
		<echo>Tests will now run against OpenJDK6</echo>
		<antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" />
	</target>

	<target name="setupJavaOpenJDK7TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against OpenJDK7.">
		<mkdir dir="lib/openJDK7Environment" />
		<get src="https://projectlombok.org/ivyrepo/langtools/javac-1.7.0.jar" dest="lib/openJDK7Environment/javac7.jar" verbose="true" usetimestamp="true" />
		<get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk7.jar" dest="lib/openJDK7Environment/rt-openjdk7.jar" verbose="true" usetimestamp="true" />
		<propertyfile file="testenvironment.properties">
			<entry key="test.location.javac" value="lib/openJDK7Environment/javac7.jar" />
			<entry key="test.location.ecj" value="lib/ecj7/org.eclipse.custom-ecj.jar" />
			<entry key="test.location.bootclasspath" value="lib/openJDK7Environment/rt-openjdk7.jar" />
			<entry key="test.location.name" value="OpenJDK7" />
			<entry key="test.javaversion" value="7" />
		</propertyfile>
		<echo>Tests will now run against OpenJDK7</echo>
		<antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" />
	</target>

	<target name="setupJavaOracle7TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against OpenJDK7.">
		<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" />
		<propertyfile file="testenvironment.properties">
			<entry key="test.location.javac" value="lib/oracleJDK7Environment/tools.jar" />
			<entry key="test.location.ecj" value="lib/ecj7/org.eclipse.custom-ecj.jar" />
			<entry key="test.location.bootclasspath" value="lib/oracleJDK7Environment/rt.jar" />
			<entry key="test.location.name" value="OracleJDK7" />
			<entry key="test.javaversion" value="7" />
		</propertyfile>
		<echo>Tests will now run against Oracle JDK7</echo>
		<antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" />
	</target>

	<target name="setupJavaOracle8TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against OpenJDK8.">
		<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" />
		<get src="https://projectlombok.org/ivyrepo/langtools/jdk8-javac-sources.zip" dest="lib/oracleJDK8Environment/javac8-sources.zip" verbose="true" usetimestamp="true" />
		<propertyfile file="testenvironment.properties">
			<entry key="test.location.javac" value="lib/oracleJDK8Environment/javac8.jar" />
			<entry key="test.location.ecj" value="lib/ecj8/org.eclipse.custom-ecj.jar" />
			<entry key="test.location.bootclasspath" value="lib/oracleJDK8Environment/rt.jar" />
			<entry key="test.location.name" value="OracleJDK8" />
			<entry key="test.javaversion" value="8" />
		</propertyfile>
		<echo>Tests will now run against Oracle JDK8</echo>
		<antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" />
	</target>

	<target name="-failIfNoTestEnvironmentProperties" unless="test.javaversion">
		<fail>ERROR: No test environment set up.

You need to set up a test environment, which consists of a version of javac, and a JRE runtime classpath ('rt.jar').
Eventually, this environment concept will be extended to also include an ecj and/or eclipse to test against.

You can let this ant script set them up for you:

* ant setupJavaOpenJDK6TestEnvironment
* ant setupJavaOpenJDK7TestEnvironment
* ant setupJavaOracle7TestEnvironment
* ant setupJavaOracle8TestEnvironment

These will set up test environments based on OpenJDK6 and OpenJDK7, and download all required files automatically. This will be a relatively large download. You can switch by running this command again; the downloads are cached so switching is fast.

You can also create your own by writing a 'testenvironment.properties' file. The relevant properties are:

* test.location.javac = /path/to/javac6.jar
* test.location.ecj = /path/to/ecj6.jar
* test.location.bootclasspath = /path/to/rt.jar
* test.location.name = RandomUsefulNameToIdentifyThisSetup
* test.javaversion = 6
</fail>
	</target>

	<target name="test" depends="-loadTestEnvironmentProperties, -failIfNoTestEnvironmentProperties, -test-compile, dist, test-ecj" unless="tests.skip" description="Runs the tests.">
		<junit haltonfailure="no" fork="true">
			<jvmarg value="-javaagent:dist/lombok.jar" />
			<jvmarg value="-Ddelombok.bootclasspath=${test.location.bootclasspath}" />
			<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>
		<echo level="info">All tests successful.</echo>
	</target>

	<target name="utils-javadoc" depends="compile">
		<mkdir dir="build/utils-api" />
		<javadoc sourcepath="src/utils" defaultexcludes="yes" destdir="build/utils-api" windowtitle="Lombok Utils">
			<classpath refid="build.path" />
			<link href="http://download.oracle.com/javase/6/docs/api/" />
			<header><![CDATA[<a href='https://projectlombok.org/' target='_blank'>Lombok</a> - ]]>v${lombok.version}</header>
			<bottom><![CDATA[<i>Copyright © 2011-2015 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. -->
		<replaceregexp match="\?is-external=true#" replace="#" flags="gi">
			<fileset dir="build/utils-api" includes="**/*.html" />
		</replaceregexp>
	</target>

	<target name="utils-maven" depends="version, dist-utils, test, utils-javadoc" description="Build a maven artifact bundle for lombok-utils.">
		<jar destfile="dist/lombok-utils-${lombok.version}-javadoc.jar">
			<fileset dir="build/utils-api" />
		</jar>
		<jar destfile="dist/lombok-utils-${lombok.version}-sources.jar">
			<fileset dir="src/utils" />
		</jar>
		<mkdir dir="build/utils-mavenPublish" />
		<copy tofile="build/utils-mavenPublish/pom.xml" overwrite="true" file="doc/utils-maven-pom.xml">
			<filterchain>
				<replacetokens>
					<token key="VERSION" value="${lombok.version}" />
				</replacetokens>
			</filterchain>
		</copy>
		<tar destfile="build/utils-mavenPublish/utils-mavenPublish.tar.bz2" compression="bzip2">
			<tarfileset dir="dist">
				<include name="lombok-utils-${lombok.version}.jar" />
				<include name="lombok-utils-${lombok.version}-sources.jar" />
				<include name="lombok-utils-${lombok.version}-javadoc.jar" />
			</tarfileset>
			<tarfileset dir="build/utils-mavenPublish" includes="pom.xml" />
		</tar>
	</target>

	<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}" />
		</ant>
	</target>

	<target name="maven" depends="version, dist, test, javadoc" description="Build a maven artifact bundle.">
		<jar destfile="dist/lombok-${lombok.version}-javadoc.jar">
			<fileset dir="doc/api" />
		</jar>
		<jar destfile="dist/lombok-${lombok.version}-sources.jar">
			<fileset dir="src/core" />
			<fileset dir="src/launch" />
			<fileset dir="src/utils" />
			<fileset dir="src/eclipseAgent" />
			<fileset dir="src/installer" />
			<fileset dir="src/delombok" />
			<fileset dir="test/transform/src" />
			<fileset dir="test/core/src" />
		</jar>
		<mkdir dir="build/mavenPublish" />
		<copy tofile="build/mavenPublish/pom.xml" overwrite="true" file="doc/maven-pom.xml">
			<filterchain>
				<replacetokens>
					<token key="VERSION" value="${lombok.version}" />
				</replacetokens>
			</filterchain>
		</copy>
		<tar destfile="build/mavenPublish/mavenPublish.tar.bz2" compression="bzip2">
			<tarfileset dir="dist">
				<include name="lombok-${lombok.version}.jar" />
				<include name="lombok-${lombok.version}-sources.jar" />
				<include name="lombok-${lombok.version}-javadoc.jar" />
			</tarfileset>
			<tarfileset dir="build/mavenPublish" includes="pom.xml" />
		</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"
			username="${ssh.username}"
			keyfile="${ssh.keyfile}" passphrase=""
			trust="true" command="/data/lombok/stagingCmd/publishToMavenCentral" />
		<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"
			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"
			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"
			username="${ssh.username}"
			keyfile="${ssh.keyfile}" passphrase=""
			trust="true" command="/data/lombok/stagingCmd/deployLombok '${lombok.version}'" />
	</target>

	<target name="publish-all" depends="clean, version, website-publish, maven-publish, publish"
		description="Publishes lombok itself, updates the maven repository and the website." />

	<target name="edge-release" depends="config-ssh, clean, version, dist"
		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="ssh.username" value="${ssh.username}" />
			<property name="ssh.keyfile" value="${ssh.keyfile}" />
		</ant>
	</target>

	<property file="ssh.configuration" />

	<target name="config-ssh" unless="ssh.username">
		<input message="What is your SSH username on the projectlombok.org server? (Enter to abort)." addproperty="ssh.username" />
		<condition property="ssh.usernameBlank"><equals arg1="${ssh.username}" arg2="" trim="true" /></condition>
		<fail if="ssh.usernameBlank">Aborted.</fail>
		<input message="Where is your ssh keyfile located?" addproperty="ssh.keyfile" defaultvalue="${user.home}/.ssh/id_rsa" />
		<input message="SSH configuration saved as 'ssh.configuration'. Delete this file to reconfigure. Press enter to continue." />
		<propertyfile file="ssh.configuration">
			<entry key="ssh.username" value="${ssh.username}" />
			<entry key="ssh.keyfile" value="${ssh.keyfile}" />
		</propertyfile>
	</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}" />
		</ant>
	</target>

	<target name="website-publish" depends="config-ssh, clean, version"
			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="ssh.username" value="${ssh.username}" />
			<property name="ssh.keyfile" value="${ssh.keyfile}" />
		</ant>
	</target>
</project>


text:
<?php

namespace Aisel\OrderBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;

/**
 * Frontend REST API for Order entities
 *
 * @author Ivan Proskoryakov <volgodark@gmail.com>
 */
class ApiCheckoutController extends Controller
{

    /**
     * /%website_api%/{locale}/order/checkout/init.json
     *
     * @return JsonResponse $response
     */
    public function initAction()
    {
        $response = array();

        /**
         * Payment methods
         */
        $config = $this->container->get("aisel.settings.manager")->getConfig('en');
        $general = (array) json_decode($config['config_general']);

        foreach ($general['paymentMethods'] as $m) {
            if ($method = $this->container->getParameter('aisel_order.payment_methods')[$m]) {
                $response['payment']['methods'][$m] = $method;
            }
        }

        return $response;
    }

}

redpajama_set_name: RedPajamaGithub


text:
package org.pixmob.freemobile.netstat.feature;

import android.content.SharedPreferences.Editor;

/**
 * Legacy {@link SharedPreferencesSaverFeature} implementation.
 * @author Pixmob
 */
class LegacySharedPreferencesSaverFeature implements
        SharedPreferencesSaverFeature {
    @Override
    public void save(Editor prefsEditor) {
        prefsEditor.commit();
    }
}


text: A repository for my sklearn experimental notebooks.


text:
'use strict';
var assert = require('assert');
var util = require('util');
var _ = require('lodash'); // for _.find. Can't use ES6 yet.
var cp = require('child_process');
var semver = require('semver');
var promisifyAll = require('@google-cloud/common').util.promisifyAll;
var Debug = require('../src/debug.js');
var Debugger = require('../test/debugger.js');

var CLUSTER_WORKERS = 3;

var FILENAME = 'test/fixtures/fib.js';

var delay = function(delayTimeMS) {
  return new Promise(function(resolve, reject) {
    setTimeout(resolve, delayTimeMS);
  });
};

// This test could take up to 70 seconds.
describe('@google-cloud/debug end-to-end behavior', function () {
  var api;

  var debuggeeId;
  var projectId;
  var children = [];

  before(function() {
    promisifyAll(Debugger);
    api = new Debugger(new Debug({}));
  });

  beforeEach(function() {
    this.timeout(10 * 1000);
    return new Promise(function(resolve, reject) {
      var numChildrenReady = 0;

      // Process a status message sent from a child process.
      var handler = function(c) {
        console.log(c);
        if (c.error) {
          reject(new Error('A child reported the following error: ' + c.error));
          return;
        }
        if (!debuggeeId) {
          // Cache the needed info from the first worker.
          debuggeeId = c.debuggeeId;
          projectId = c.projectId;
        } else {
          // Make sure all other workers are consistent.
          if (debuggeeId !== c.debuggeeId || projectId !== c.projectId) {
            reject(new Error('Child debuggee ID and/or project ID' +
                             'is not consistent with previous child'));
            return;
          }
        }
        numChildrenReady++;
        if (numChildrenReady === CLUSTER_WORKERS) {
          resolve();
        }
      };

      // Handle stdout/stderr output from a child process. More specifically,
      // write the child process's output to a transcript.
      // Each child has its own transcript.
      var stdoutHandler = function(index) {
        return function(chunk) {
          children[index].transcript += chunk;
        };
      };

      for (var i = 0; i < CLUSTER_WORKERS; i++) {
        // Fork child processes that sned messages to this process with IPC.
        var child = { transcript: '' };
        child.process = cp.fork(FILENAME, {
          execArgv: [],
          env: process.env,
          silent: true
        });
        child.process.on('message', handler);

        children.push(child);

        child.process.stdout.on('data', stdoutHandler(i));
        child.process.stderr.on('data', stdoutHandler(i));
      }
    });
  });

  afterEach(function() {
    this.timeout(5 * 1000);
    // Create a promise for each child that resolves when that child exits.
    var childExitPromises = children.map(function (child) {
      console.log(child.transcript);
      child.process.kill();
      return new Promise(function(resolve, reject) {
        var timeout = setTimeout(function() {
          reject(new Error('A child process failed to exit.'));
        }, 3000);
        child.process.on('exit', function() {
          clearTimeout(timeout);
          resolve();
        });
      });
    });
    // Wait until all children exit, then reset test state.
    return Promise.all(childExitPromises).then(function() {
      debuggeeId = null;
      projectId = null;
      children = [];
    });
  });

  it('should set breakpoints correctly', function() {
    this.timeout(25 * 1000);
    // Kick off promise chain by getting a list of debuggees
    return api.listDebuggees(projectId).then(function(results) {
      // Check that the debuggee created in this test is among the list of
      // debuggees, then list its breakpoints

      var debuggees = results[0];

      console.log('-- List of debuggees\n',
        util.inspect(debuggees, { depth: null}));
      assert.ok(debuggees, 'should get a valid ListDebuggees response');
      var result = _.find(debuggees, function(d) {
        return d.id === debuggeeId;
      });
      assert.ok(result, 'should find the debuggee we just registered');
      return api.listBreakpoints(debuggeeId);
    }).then(function(results) {
      // Delete every breakpoint

      var breakpoints = results[0];

      console.log('-- List of breakpoints\n', breakpoints);

      var promises = breakpoints.map(function(breakpoint) {
        return api.deleteBreakpoint(debuggeeId, breakpoint.id);
      });

      return Promise.all(promises);
    }).then(function(results) {
      // Set a breakpoint at which the debugger should write to a log

      results.map(function(result) {
        assert.equal(result, '');
      });
      console.log('-- deleted');

      console.log('-- setting a logpoint');
      return api.setBreakpoint(debuggeeId, {
        id: 'breakpoint-1',
        location: {path: FILENAME, line: 5},
        condition: 'n === 10',
        action: 'LOG',
        expressions: ['o'],
        log_message_format: 'o is: $0'
      });
    }).then(function(results) {
      // Check that the breakpoint was set, and then wait for the log to be
      // written to

      var breakpoint = results[0];

      assert.ok(breakpoint, 'should have set a breakpoint');
      assert.ok(breakpoint.id, 'breakpoint should have an id');
      assert.ok(breakpoint.location, 'breakpoint should have a location');
      assert.strictEqual(breakpoint.location.path, FILENAME);

      console.log('-- waiting before checking if the log was written');
      return Promise.all([breakpoint, delay(10 * 1000)]);
    }).then(function(results) {
      // Check the contents of the log, and then delete the breakpoint

      var breakpoint = results[0];

      children.forEach(function(child, index) {
        assert(child.transcript.indexOf('o is: {"a":[1,"hi",true]}') !== -1,
          'transcript in child ' + index + ' should contain value of o: ' +
          child.transcript);
      });
      return api.deleteBreakpoint(debuggeeId, breakpoint.id);
    }).then(function() {
      // Set another breakpoint at the same location

      console.log('-- setting a breakpoint');
      return api.setBreakpoint(debuggeeId, {
        id: 'breakpoint-1',
        location: {path: FILENAME, line: 5},
        expressions: ['process'], // Process for large variable
        condition: 'n === 10'
      });
    }).then(function(results) {
      // Check that the breakpoint was set, and then wait for the breakpoint to
      // be hit

      var breakpoint = results[0];

      console.log('-- resolution of setBreakpoint', breakpoint);
      assert.ok(breakpoint, 'should have set a breakpoint');
      assert.ok(breakpoint.id, 'breakpoint should have an id');
      assert.ok(breakpoint.location, 'breakpoint should have a location');
      assert.strictEqual(breakpoint.location.path, FILENAME);

      console.log('-- waiting before checking if breakpoint was hit');
      return Promise.all([breakpoint, delay(10 * 1000)]);
    }).then(function(results) {
      // Get the breakpoint

      var breakpoint = results[0];

      console.log('-- now checking if the breakpoint was hit');
      return api.getBreakpoint(debuggeeId, breakpoint.id);
    }).then(function(results) {
      // Check that the breakpoint was hit and contains the correct information,
      // which ends the test

      var breakpoint = results[0];

      var arg;
      console.log('-- results of get breakpoint\n', breakpoint);
      assert.ok(breakpoint, 'should have a breakpoint in the response');
      assert.ok(breakpoint.isFinalState, 'breakpoint should have been hit');
      assert.ok(Array.isArray(breakpoint.stackFrames), 'should have stack ');
      var top = breakpoint.stackFrames[0];
      assert.ok(top, 'should have a top entry');
      assert.ok(top.function, 'frame should have a function property');
      assert.strictEqual(top.function, 'fib');

      if (semver.satisfies(process.version, '>=4.0')) {
        arg = _.find(top.locals, {name: 'n'});
      } else {
        arg = _.find(top.arguments, {name: 'n'});
      }
      assert.ok(arg, 'should find the n argument');
      assert.strictEqual(arg.value, '10');
      console.log('-- checking log point was hit again');
      children.forEach(function(child) {
        assert.ok(child.transcript
          .split('LOGPOINT: o is: {"a":[1,"hi",true]}').length > 4);
      });

      return api.deleteBreakpoint(debuggeeId, breakpoint.id);
    }).then(function() {
      console.log('-- test passed');
      return Promise.resolve();
    });
  });

  it('should throttle logs correctly', function() {
    this.timeout(15 * 1000);
    // Kick off promise chain by getting a list of debuggees
    return api.listDebuggees(projectId).then(function(results) {
      // Check that the debuggee created in this test is among the list of
      // debuggees, then list its breakpoints

      var debuggees = results[0];

      console.log('-- List of debuggees\n',
        util.inspect(debuggees, { depth: null}));
      assert.ok(debuggees, 'should get a valid ListDebuggees response');
      var result = _.find(debuggees, function(d) {
        return d.id === debuggeeId;
      });
      assert.ok(result, 'should find the debuggee we just registered');

      return api.listBreakpoints(debuggeeId);
    }).then(function(results) {
      // Delete every breakpoint

      var breakpoints = results[0];

      console.log('-- List of breakpoints\n', breakpoints);

      var promises = breakpoints.map(function(breakpoint) {
        return api.deleteBreakpoint(debuggeeId, breakpoint.id);
      });

      return Promise.all(promises);
    }).then(function(results) {
      // Set a breakpoint at which the debugger should write to a log

      results.map(function(result) {
        assert.equal(result, '');
      });
      console.log('-- deleted');

      console.log('-- setting a logpoint');
      return api.setBreakpoint(debuggeeId, {
        id: 'breakpoint-1',
        location: {path: FILENAME, line: 5},
        condition: 'n === 10',
        action: 'LOG',
        expressions: ['o'],
        log_message_format: 'o is: $0'
      });
    }).then(function(results) {
      // Check that the breakpoint was set, and then wait for the log to be
      // written to
      var breakpoint = results[0];

      assert.ok(breakpoint, 'should have set a breakpoint');
      assert.ok(breakpoint.id, 'breakpoint should have an id');
      assert.ok(breakpoint.location, 'breakpoint should have a location');
      assert.strictEqual(breakpoint.location.path, FILENAME);

      console.log('-- waiting before checking if the log was written');
      return Promise.all([breakpoint, delay(10 * 1000)]);
    }).then(function(results) {
      // Check that the contents of the log is correct

      var breakpoint = results[0];

      // If no throttling occurs, we expect ~20 logs since we are logging
      // 2x per second over a 10 second period.
      children.forEach(function(child) {
        var logCount = child.transcript
          .split('LOGPOINT: o is: {"a":[1,"hi",true]}').length - 1;
        // A log count of greater than 10 indicates that we did not successfully
        // pause when the rate of `maxLogsPerSecond` was reached.
        assert(logCount <= 10, 'log count is greater than 10: ' + logCount);
        // A log count of less than 3 indicates that we did not successfully
        // resume logging after `logDelaySeconds` have passed.
        assert(logCount > 2, 'log count is not greater than 2: ' + logCount);
      });

      return api.deleteBreakpoint(debuggeeId, breakpoint.id);
    }).then(function() {
      console.log('-- test passed');
      return Promise.resolve();
    });
  });
});


text:
package expression

import (
	"github.com/pingcap/tidb/parser/ast"
	"github.com/pingcap/tidb/parser/mysql"
	"github.com/pingcap/tidb/types"
	"github.com/pingcap/tidb/util/chunk"
	"github.com/pingcap/tidb/util/logutil"
	"go.uber.org/zap"
)

// specialFoldHandler stores functions for special UDF to constant fold
var specialFoldHandler = map[string]func(*ScalarFunction) (Expression, bool){}

func init() {
	specialFoldHandler = map[string]func(*ScalarFunction) (Expression, bool){
		ast.If:     ifFoldHandler,
		ast.Ifnull: ifNullFoldHandler,
		ast.Case:   caseWhenHandler,
		ast.IsNull: isNullHandler,
	}
}

// FoldConstant does constant folding optimization on an expression excluding deferred ones.
func FoldConstant(expr Expression) Expression {
	e, _ := foldConstant(expr)
	// keep the original coercibility, charset, collation and repertoire values after folding
	e.SetCoercibility(expr.Coercibility())
	e.GetType().Charset, e.GetType().Collate = expr.GetType().Charset, expr.GetType().Collate
	e.SetRepertoire(expr.Repertoire())
	return e
}

func isNullHandler(expr *ScalarFunction) (Expression, bool) {
	arg0 := expr.GetArgs()[0]
	if constArg, isConst := arg0.(*Constant); isConst {
		isDeferredConst := constArg.DeferredExpr != nil || constArg.ParamMarker != nil
		value, err := expr.Eval(chunk.Row{})
		if err != nil {
			// Failed to fold this expr to a constant, print the DEBUG log and
			// return the original expression to let the error to be evaluated
			// again, in that time, the error is returned to the client.
			logutil.BgLogger().Debug("fold expression to constant", zap.String("expression", expr.ExplainInfo()), zap.Error(err))
			return expr, isDeferredConst
		}
		if isDeferredConst {
			return &Constant{Value: value, RetType: expr.RetType, DeferredExpr: expr}, true
		}
		return &Constant{Value: value, RetType: expr.RetType}, false
	}
	if mysql.HasNotNullFlag(arg0.GetType().Flag) {
		return NewZero(), false
	}
	return expr, false
}

func ifFoldHandler(expr *ScalarFunction) (Expression, bool) {
	args := expr.GetArgs()
	foldedArg0, _ := foldConstant(args[0])
	if constArg, isConst := foldedArg0.(*Constant); isConst {
		arg0, isNull0, err := constArg.EvalInt(expr.Function.getCtx(), chunk.Row{})
		if err != nil {
			// Failed to fold this expr to a constant, print the DEBUG log and
			// return the original expression to let the error to be evaluated
			// again, in that time, the error is returned to the client.
			logutil.BgLogger().Debug("fold expression to constant", zap.String("expression", expr.ExplainInfo()), zap.Error(err))
			return expr, false
		}
		if !isNull0 && arg0 != 0 {
			return foldConstant(args[1])
		}
		return foldConstant(args[2])
	}
	// if the condition is not const, which branch is unknown to run, so directly return.
	return expr, false
}

func ifNullFoldHandler(expr *ScalarFunction) (Expression, bool) {
	args := expr.GetArgs()
	foldedArg0, isDeferred := foldConstant(args[0])
	if constArg, isConst := foldedArg0.(*Constant); isConst {
		// Only check constArg.Value here. Because deferred expression is
		// evaluated to constArg.Value after foldConstant(args[0]), it's not
		// needed to be checked.
		if constArg.Value.IsNull() {
			return foldConstant(args[1])
		}
		return constArg, isDeferred
	}
	// if the condition is not const, which branch is unknown to run, so directly return.
	return expr, false
}

func caseWhenHandler(expr *ScalarFunction) (Expression, bool) {
	args, l := expr.GetArgs(), len(expr.GetArgs())
	var isDeferred, isDeferredConst bool
	for i := 0; i < l-1; i += 2 {
		expr.GetArgs()[i], isDeferred = foldConstant(args[i])
		isDeferredConst = isDeferredConst || isDeferred
		if _, isConst := expr.GetArgs()[i].(*Constant); isConst {
			// If the condition is const and true, and the previous conditions
			// has no expr, then the folded execution body is returned, otherwise
			// the arguments of the casewhen are folded and replaced.
			val, isNull, err := args[i].EvalInt(expr.GetCtx(), chunk.Row{})
			if err != nil {
				return expr, false
			}
			if val != 0 && !isNull {
				foldedExpr, isDeferred := foldConstant(args[i+1])
				isDeferredConst = isDeferredConst || isDeferred
				if _, isConst := foldedExpr.(*Constant); isConst {
					foldedExpr.GetType().Decimal = expr.GetType().Decimal
					return foldedExpr, isDeferredConst
				}
				return foldedExpr, isDeferredConst
			}
		} else {
			// for no-const, here should return directly, because the following branches are unknown to be run or not
			return expr, false
		}
	}
	// If the number of arguments in casewhen is odd, and the previous conditions
	// is false, then the folded else execution body is returned. otherwise
	// the execution body of the else are folded and replaced.
	if l%2 == 1 {
		foldedExpr, isDeferred := foldConstant(args[l-1])
		isDeferredConst = isDeferredConst || isDeferred
		if _, isConst := foldedExpr.(*Constant); isConst {
			foldedExpr.GetType().Decimal = expr.GetType().Decimal
			return foldedExpr, isDeferredConst
		}
		return BuildCastFunction(expr.GetCtx(), foldedExpr, foldedExpr.GetType()), isDeferredConst
	}
	return expr, isDeferredConst
}

func foldConstant(expr Expression) (Expression, bool) {
	switch x := expr.(type) {
	case *ScalarFunction:
		if _, ok := unFoldableFunctions[x.FuncName.L]; ok {
			return expr, false
		}
		if function := specialFoldHandler[x.FuncName.L]; function != nil && !MaybeOverOptimized4PlanCache(x.GetCtx(), []Expression{expr}) {
			return function(x)
		}

		args := x.GetArgs()
		sc := x.GetCtx().GetSessionVars().StmtCtx
		argIsConst := make([]bool, len(args))
		hasNullArg := false
		allConstArg := true
		isDeferredConst := false
		for i := 0; i < len(args); i++ {
			switch x := args[i].(type) {
			case *Constant:
				isDeferredConst = isDeferredConst || x.DeferredExpr != nil || x.ParamMarker != nil
				argIsConst[i] = true
				hasNullArg = hasNullArg || x.Value.IsNull()
			default:
				allConstArg = false
			}
		}
		if !allConstArg {
			if !hasNullArg || !sc.InNullRejectCheck || x.FuncName.L == ast.NullEQ {
				return expr, isDeferredConst
			}
			constArgs := make([]Expression, len(args))
			for i, arg := range args {
				if argIsConst[i] {
					constArgs[i] = arg
				} else {
					constArgs[i] = NewOne()
				}
			}
			dummyScalarFunc, err := NewFunctionBase(x.GetCtx(), x.FuncName.L, x.GetType(), constArgs...)
			if err != nil {
				return expr, isDeferredConst
			}
			value, err := dummyScalarFunc.Eval(chunk.Row{})
			if err != nil {
				return expr, isDeferredConst
			}
			if value.IsNull() {
				// This Constant is created to compose the result expression of EvaluateExprWithNull when InNullRejectCheck
				// is true. We just check whether the result expression is null or false and then let it die. Basically,
				// the constant is used once briefly and will not be retained for a long time. Hence setting DeferredExpr
				// of Constant to nil is ok.
				return &Constant{Value: value, RetType: x.RetType}, false
			}
			if isTrue, err := value.ToBool(sc); err == nil && isTrue == 0 {
				// This Constant is created to compose the result expression of EvaluateExprWithNull when InNullRejectCheck
				// is true. We just check whether the result expression is null or false and then let it die. Basically,
				// the constant is used once briefly and will not be retained for a long time. Hence setting DeferredExpr
				// of Constant to nil is ok.
				return &Constant{Value: value, RetType: x.RetType}, false
			}
			return expr, isDeferredConst
		}
		value, err := x.Eval(chunk.Row{})
		retType := x.RetType.Clone()
		if !hasNullArg {
			// set right not null flag for constant value
			switch value.Kind() {
			case types.KindNull:
				retType.Flag &= ^mysql.NotNullFlag
			default:
				retType.Flag |= mysql.NotNullFlag
			}
		}
		if err != nil {
			logutil.BgLogger().Debug("fold expression to constant", zap.String("expression", x.ExplainInfo()), zap.Error(err))
			return expr, isDeferredConst
		}
		if isDeferredConst {
			return &Constant{Value: value, RetType: retType, DeferredExpr: x}, true
		}
		return &Constant{Value: value, RetType: retType}, false
	case *Constant:
		if x.ParamMarker != nil {
			return &Constant{
				Value:        x.ParamMarker.GetUserVar(),
				RetType:      x.RetType,
				DeferredExpr: x.DeferredExpr,
				ParamMarker:  x.ParamMarker,
			}, true
		} else if x.DeferredExpr != nil {
			value, err := x.DeferredExpr.Eval(chunk.Row{})
			if err != nil {
				logutil.BgLogger().Debug("fold expression to constant", zap.String("expression", x.ExplainInfo()), zap.Error(err))
				return expr, true
			}
			return &Constant{Value: value, RetType: x.RetType, DeferredExpr: x.DeferredExpr}, true
		}
	}
	return expr, false
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using BlueSheep.Common.Protocol.Types;
using BlueSheep.Common.IO;
using BlueSheep.Engine.Types;

namespace BlueSheep.Common.Protocol.Messages
{
    public class GuildChangeMemberParametersMessage : Message
    {
        public new const uint ID =5549;
        public override uint ProtocolID
        {
            get { return ID; }
        }

        public int memberId;
        public short rank;
        public sbyte experienceGivenPercent;
        public int rights;

        public GuildChangeMemberParametersMessage()
        {
        }

        public GuildChangeMemberParametersMessage(int memberId, short rank, sbyte experienceGivenPercent, int rights)
        {
            this.memberId = memberId;
            this.rank = rank;
            this.experienceGivenPercent = experienceGivenPercent;
            this.rights = rights;
        }

        public override void Serialize(BigEndianWriter writer)
        {
            writer.WriteVarInt(memberId);
            writer.WriteVarShort(rank);
            writer.WriteSByte(experienceGivenPercent);
            writer.WriteVarInt(rights);
        }

        public override void Deserialize(BigEndianReader reader)
        {
            memberId = reader.ReadVarInt();
            if (memberId < 0)
                throw new Exception("Forbidden value on memberId = " + memberId + ", it doesn't respect the following condition : memberId < 0");
            rank = reader.ReadVarShort();
            if (rank < 0)
                throw new Exception("Forbidden value on rank = " + rank + ", it doesn't respect the following condition : rank < 0");
            experienceGivenPercent = reader.ReadSByte();
            if (experienceGivenPercent < 0 || experienceGivenPercent > 100)
                throw new Exception("Forbidden value on experienceGivenPercent = " + experienceGivenPercent + ", it doesn't respect the following condition : experienceGivenPercent < 0 || experienceGivenPercent > 100");
            rights = reader.ReadVarInt();
            if (rights < 0)
                throw new Exception("Forbidden value on rights = " + rights + ", it doesn't respect the following condition : rights < 0");
        }

    }

}


text:
. "$IMAGEDIR/config.sh"
RELNAME=unstable
BASEURL=http://ftp.cz.debian.org/debian

. "$INCLUDE/debian.sh"

bootstrap

configure-common
configure-debian

cat > "$INSTALL/etc/apt/sources.list" <<SOURCES
deb $BASEURL $RELNAME main
deb-src $BASEURL $RELNAME main

deb $BASEURL $RELNAME-updates main
deb-src $BASEURL $RELNAME-updates main
SOURCES

configure-append <<EOF
sed -i 's/^#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
EOF

run-configure


text:
#include <zephyr.h>
#include <sys/printk.h>
#include <board.h>
#include <drivers/gpio.h>
#include <drivers/pwm.h>
#include <device.h>

#include <display/mb_display.h>

#define BUZZER_PIN     EXT_P0_GPIO_PIN

#define PERIOD_MIN     50
#define PERIOD_MAX     3900
#define PERIOD_INIT    1500

#define BEEP_DURATION  K_MSEC(60)

#define US_TO_HZ(_us)  (USEC_PER_SEC / (_us))

static const struct device *pwm;
static const struct device *gpio;
static uint32_t period = PERIOD_INIT;
static struct k_work beep_work;
static volatile bool beep_active;

static void beep(struct k_work *work)
{
	/* The "period / 2" pulse duration gives 50% duty cycle, which
	 * should result in the maximum sound volume.
	 */
	pwm_pin_set_usec(pwm, BUZZER_PIN, period, period / 2U, 0);
	k_sleep(BEEP_DURATION);

	/* Disable the PWM */
	pwm_pin_set_usec(pwm, BUZZER_PIN, 0, 0, 0);

	/* Ensure there's a clear silent period between two tones */
	k_sleep(K_MSEC(50));
	beep_active = false;
}

static void button_pressed(const struct device *dev, struct gpio_callback *cb,
			   uint32_t pins)
{
	struct mb_display *disp;

	if (beep_active) {
		printk("Button press while beeping\n");
		return;
	}

	beep_active = true;

	if (pins & BIT(DT_GPIO_PIN(DT_ALIAS(sw0), gpios))) {
		printk("A pressed\n");
		if (period < PERIOD_MAX) {
			period += 50U;
		}
	} else {
		printk("B pressed\n");
		if (period > PERIOD_MIN) {
			period -= 50U;
		}
	}

	printk("Period is %u us (%u Hz)\n", period, US_TO_HZ(period));

	disp = mb_display_get();
	mb_display_print(disp, MB_DISPLAY_MODE_DEFAULT, 500, "%uHz",
			 US_TO_HZ(period));

	k_work_submit(&beep_work);
}

void main(void)
{
	static struct gpio_callback button_cb_data;

	gpio = device_get_binding(DT_GPIO_LABEL(DT_ALIAS(sw0), gpios));

	gpio_pin_configure(gpio, DT_GPIO_PIN(DT_ALIAS(sw0), gpios),
			   DT_GPIO_FLAGS(DT_ALIAS(sw0), gpios) | GPIO_INPUT);
	gpio_pin_configure(gpio, DT_GPIO_PIN(DT_ALIAS(sw1), gpios),
			   DT_GPIO_FLAGS(DT_ALIAS(sw1), gpios) | GPIO_INPUT);

	gpio_pin_interrupt_configure(gpio, DT_GPIO_PIN(DT_ALIAS(sw0), gpios),
				     GPIO_INT_EDGE_TO_ACTIVE);

	gpio_pin_interrupt_configure(gpio, DT_GPIO_PIN(DT_ALIAS(sw1), gpios),
				     GPIO_INT_EDGE_TO_ACTIVE);

	gpio_init_callback(&button_cb_data, button_pressed,
			   BIT(DT_GPIO_PIN(DT_ALIAS(sw0), gpios)) |
			   BIT(DT_GPIO_PIN(DT_ALIAS(sw1), gpios)));

	pwm = device_get_binding(DT_LABEL(DT_INST(0, nordic_nrf_sw_pwm)));

	k_work_init(&beep_work, beep);
	/* Notify with a beep that we've started */
	k_work_submit(&beep_work);

	gpio_add_callback(gpio, &button_cb_data);
}


text:
.panel-body{
    width:500px;
}
.reject-result-panel{
    margin-left:5px;
}

.reject-result-panel .result-heading{
    -webkit-align-content: center;
    align-content: center;
        text-align: center;
}

.reject-result-panel .sub-heading{
    font-size: 16px;
    color: red;
    text-align: center;

}
.reject-result-panel>h1{
      text-align: center;
      color:red;
}
.reject-text{
    width:100px;
    margin-bottom:5px;
      text-align: justify;
       white-space: nowrap;
}
.reject-text>span{
    vertical-align: top;

}