text:
<?php
namespace Neos\Flow\Tests\Unit\Reflection;

use Doctrine\Common\Annotations\Reader;
use Neos\Flow\Reflection\Exception\ClassLoadingForReflectionFailedException;
use Neos\Flow\Reflection\ReflectionService;
use Neos\Flow\Tests\UnitTestCase;

/**
 * Testcase for the ReflectionService
 *
 */
class ReflectionServiceTest extends UnitTestCase
{
    /**
     * @var ReflectionService
     */
    protected $reflectionService;

    /**
     * @var Reader|\PHPUnit\Framework\MockObject\MockObject
     */
    protected $mockAnnotationReader;

    protected function setUp(): void
    {
        $this->reflectionService = $this->getAccessibleMock(ReflectionService::class, null);

        $this->mockAnnotationReader = $this->getMockBuilder('Doctrine\Common\Annotations\Reader')->disableOriginalConstructor()->getMock();
        $this->mockAnnotationReader->method('getClassAnnotations')->willReturn([]);
        $this->mockAnnotationReader->method('getMethodAnnotations')->willReturn([]);
        $this->inject($this->reflectionService, 'annotationReader', $this->mockAnnotationReader);
        $this->reflectionService->_set('initialized', true);
    }

    /**
     * @test
     */
    public function reflectClassThrowsExceptionForNonExistingClasses()
    {
        $this->expectException(ClassLoadingForReflectionFailedException::class);
        $this->reflectionService->_call('reflectClass', 'Non\Existing\Class');
    }

    /**
     * @test
     */
    public function reflectClassThrowsExceptionForFilesWithNoClass()
    {
        $this->expectException(ClassLoadingForReflectionFailedException::class);
        $this->reflectionService->_call('reflectClass', Fixture\FileWithNoClass::class);
    }

    /**
     * @test
     */
    public function reflectClassThrowsExceptionForClassesWithNoMatchingFilename()
    {
        $this->expectException(ClassLoadingForReflectionFailedException::class);
        $this->reflectionService->_call('reflectClass', Fixture\ClassWithDifferentNameDifferent::class);
    }

    /**
     * @test
     */
    public function getMethodParametersReturnsCorrectTypeForAliasedClass()
    {
        $this->reflectionService->_call('reflectClass', Fixture\ClassWithAliasDependency::class);
        $parameters = $this->reflectionService->getMethodParameters(Fixture\ClassWithAliasDependency::class, 'injectDependency');
        $this->assertEquals(Fixture\AliasedClass::class, array_pop($parameters)['class']);
    }

    /**
     * @test
     */
    public function isTagIgnoredReturnsTrueForIgnoredTags()
    {
        $settings = ['reflection' => ['ignoredTags' => ['ignored' => true]]];
        $this->reflectionService->injectSettings($settings);

        self::assertTrue($this->reflectionService->_call('isTagIgnored', 'ignored'));
    }

    /**
     * @test
     */
    public function isTagIgnoredReturnsFalseForTagsThatAreNotIgnored()
    {
        $settings = ['reflection' => ['ignoredTags' => ['notignored' => false]]];
        $this->reflectionService->injectSettings($settings);

        self::assertFalse($this->reflectionService->_call('isTagIgnored', 'notignored'));
    }

    /**
     * @test
     */
    public function isTagIgnoredReturnsFalseForTagsThatAreNotConfigured()
    {
        $settings = ['reflection' => ['ignoredTags' => ['ignored' => true, 'notignored' => false]]];
        $this->reflectionService->injectSettings($settings);

        self::assertFalse($this->reflectionService->_call('isTagIgnored', 'notconfigured'));
    }

    /**
     * @test
     */
    public function isTagIgnoredWorksWithOldConfiguration()
    {
        $settings = ['reflection' => ['ignoredTags' => ['ignored']]];
        $this->reflectionService->injectSettings($settings);

        self::assertTrue($this->reflectionService->_call('isTagIgnored', 'ignored'));
        self::assertFalse($this->reflectionService->_call('isTagIgnored', 'notignored'));
    }
}


text:
package net.engio.mbassy.dispatch;

import net.engio.mbassy.bus.error.IPublicationErrorHandler;
import net.engio.mbassy.bus.error.PublicationError;
import net.engio.mbassy.subscription.AbstractSubscriptionContextAware;
import net.engio.mbassy.subscription.SubscriptionContext;

import java.util.Collection;

/**
 * This is the base class for handler invocations that already implements all context related methods only leaving the implementation of the actual invocation mechanism to the concrete subclass.
 *
 * @author bennidi
 *         Date: 3/29/13
 */
public abstract class HandlerInvocation<HANDLER, MESSAGE> extends AbstractSubscriptionContextAware implements IHandlerInvocation<HANDLER, MESSAGE>{

    private final Collection<IPublicationErrorHandler> errorHandlers;

    public HandlerInvocation(SubscriptionContext context) {
        super(context);
        errorHandlers = context.getErrorHandlers();
    }

    protected void handlePublicationError(PublicationError error){
        for(IPublicationErrorHandler handler : errorHandlers)
            handler.handleError(error);
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.raistlic.common.reflection;

import org.raistlic.common.precondition.Precondition;

import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Executable;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Parameter;
import java.util.Arrays;
import java.util.function.Predicate;

/**
 * The class holds a collections of static factory methods that export different types of
 * {@link Predicate} implementations for the reflection utility types.
 *
 * @deprecated will be removed in 2.0, this one went too far.
 */
@Deprecated
public final class ReflectionPredicates {

  // Member ----------------------------------------------------------------------------------------

  /**
   * Returns the {@link Predicate} to test whether an {@link Member} instance is static.
   * @return the {@link Predicate} to test whether an {@link Member} instance is static.
   */
  public static Predicate<Member> memberIsStatic() {

    return MemberPredicates.IS_STATIC;
  }

  /**
   * Returns the {@link Predicate} to test whether an {@link Member} instance is not static.
   * @return the {@link Predicate} to test whether an {@link Member} instance is not static.
   */
  public static Predicate<Member> memberIsNotStatic() {

    return MemberPredicates.IS_NOT_STATIC;
  }

  /**
   * Returns the {@link Predicate} to test whether an {@link Member} instance is public.
   * @return the {@link Predicate} to test whether an {@link Member} instance is public.
   */
  public static Predicate<Member> memberIsPublic() {

    return MemberPredicates.IS_PUBLIC;
  }

  /**
   * Returns the {@link Predicate} to test whether an {@link Member} instance is protected.
   * @return the {@link Predicate} to test whether an {@link Member} instance is protected.
   */
  public static Predicate<Member> memberIsProtected() {

    return MemberPredicates.IS_PROTECTED;
  }

  /**
   * Returns the {@link Predicate} to test whether an {@link Member} instance is public or protected.
   * @return the {@link Predicate} to test whether an {@link Member} instance is public or protected.
   */
  public static Predicate<Member> memberIsPublicOrProtected(){

    return MemberPredicates.IS_PUBLIC_OR_PROTECTED;
  }

  /**
   * Returns the {@link Predicate} to test whether an {@link Member} instance is private.
   * @return the {@link Predicate} to test whether an {@link Member} instance is private.
   */
  public static Predicate<Member> memberIsPrivate() {

    return MemberPredicates.IS_PRIVATE;
  }

  public static Predicate<Member> memberIsPackagePrivate() {

    return MemberPredicates.IS_PACKAGE_PRIVATE;
  }

  public static Predicate<Member> memberIsPrivateOrPackagePrivate() {

    return MemberPredicates.IS_PRIVATE_OR_PACKAGE_PRIVATE;
  }

  public static Predicate<Member> memberIsFinal() {

    return MemberPredicates.IS_FINAL;
  }

  public static Predicate<Member> memberIsNative() {

    return MemberPredicates.IS_NATIVE;
  }

  public static Predicate<Member> memberIsAbstract() {

    return MemberPredicates.IS_ABSTRACT;
  }

  private enum MemberPredicates implements Predicate<Member> {

    IS_STATIC ("member is static") {
      @Override
      public boolean test(Member member) {
        return Modifier.isStatic(member.getModifiers());
      }
    },
    IS_NOT_STATIC ("member is not static") {
      @Override
      public boolean test(Member member) {
        return !Modifier.isStatic(member.getModifiers());
      }
    },
    IS_PUBLIC ("member is public") {
      @Override
      public boolean test(Member member) {
        return Modifier.isPublic(member.getModifiers());
      }
    },
    IS_PROTECTED ("member is protected") {
      @Override
      public boolean test(Member member) {
        return Modifier.isProtected(member.getModifiers());
      }
    },
    IS_PUBLIC_OR_PROTECTED ("member is public or protected") {
      @Override
      public boolean test(Member member) {
        int modifiers = member.getModifiers();
        return Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers);
      }
    },
    IS_PRIVATE ("member is private") {
      @Override
      public boolean test(Member member) {
        return Modifier.isPrivate(member.getModifiers());
      }
    },
    IS_PACKAGE_PRIVATE ("member is package private") {
      @Override
      public boolean test(Member member) {
        return (member.getModifiers() & (Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE)) == 0;
      }
    },
    IS_PRIVATE_OR_PACKAGE_PRIVATE ("member is private or package private") {
      @Override
      public boolean test(Member member) {
        int modifiers = member.getModifiers();
        return Modifier.isPrivate(modifiers) || (modifiers & (Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE)) == 0;
      }
    },
    IS_FINAL ("member is final") {
      @Override
      public boolean test(Member member) {
        return Modifier.isFinal(member.getModifiers());
      }
    },
    IS_NATIVE ("member is native") {
      @Override
      public boolean test(Member member) {
        return Modifier.isNative(member.getModifiers());
      }
    },
    IS_ABSTRACT ("member is abstract") {
      @Override
      public boolean test(Member member) {
        return Modifier.isAbstract(member.getModifiers());
      }
    };

    private final String description;

    MemberPredicates(String description) {

      this.description = description;
    }

    @Override
    public String toString() {

      return description;
    }
  }

  // Executable ------------------------------------------------------------------------------------

  public static Predicate<Executable> executableWithParameterCount(int parametersCount) {

    Precondition.param(parametersCount).greaterThanOrEqualTo(0);

    if (parametersCount == 0) {
      return ExecutableWithParametersCountPredicate.WITH_ZERO;
    }
    if (parametersCount == 1) {
      return ExecutableWithParametersCountPredicate.WITH_ONE;
    }
    return new ExecutableWithParametersCountPredicate(parametersCount);
  }

  public static Predicate<Executable> executableWithNoParameter() {

    return executableWithParameterCount(0);
  }

  public static Predicate<Executable> executableWithOneParameter() {

    return executableWithParameterCount(1);
  }

  public static Predicate<Executable> executableWithParameterTypes(Class<?>... parameterTypes) {

    return new ExecutableWithParameterTypes(parameterTypes);
  }

  public static Predicate<Executable> executableWithAllParametersMatch(
          Predicate<? super Parameter> parameterPredicate) {

    Precondition.param(parameterPredicate).isNotNull();
    return new ExecutableWithAllParametersMatchPredicate(parameterPredicate);
  }

  public static Predicate<Executable> executableWithAnyParameterMatches(
          Predicate<? super Parameter> parameterPredicate) {

    Precondition.param(parameterPredicate).isNotNull();
    return new ExecutableWithAnyParameterMatchesPredicate(parameterPredicate);
  }

  private static final class ExecutableWithParametersCountPredicate implements Predicate<Executable> {

    private static final ExecutableWithParametersCountPredicate WITH_ZERO = new ExecutableWithParametersCountPredicate(0);
    private static final ExecutableWithParametersCountPredicate WITH_ONE = new ExecutableWithParametersCountPredicate(1);

    private final int count;

    private ExecutableWithParametersCountPredicate(int count) {

      this.count = count;
    }

    @Override
    public boolean test(Executable executable) {

      return executable != null && executable.getParameterCount() == count;
    }
  }

  private static final class ExecutableWithParameterTypes implements Predicate<Executable> {

    private final Class<?>[] parameterTypes;

    private ExecutableWithParameterTypes(Class<?>[] parameterTypes) {

      this.parameterTypes = parameterTypes;
    }

    @Override
    public boolean test(Executable executable) {

      if (executable == null) {
        return false;
      }
      return Arrays.equals(executable.getParameterTypes(), parameterTypes);
    }
  }

  private static final class ExecutableWithAllParametersMatchPredicate implements Predicate<Executable> {

    private final Predicate<? super Parameter> parameterPredicate;

    private ExecutableWithAllParametersMatchPredicate(Predicate<? super Parameter> parameterPredicate) {

      this.parameterPredicate = parameterPredicate;
    }

    @Override
    public boolean test(Executable executable) {

      for (Parameter parameter : executable.getParameters()) {
        if (!parameterPredicate.test(parameter)) {
          return false;
        }
      }
      return true;
    }
  }

  private static final class ExecutableWithAnyParameterMatchesPredicate implements Predicate<Executable> {

    private final Predicate<? super Parameter> parameterPredicate;

    private ExecutableWithAnyParameterMatchesPredicate(Predicate<? super Parameter> parameterPredicate) {

      this.parameterPredicate = parameterPredicate;
    }

    @Override
    public boolean test(Executable executable) {

      for (Parameter parameter : executable.getParameters()) {
        if (parameterPredicate.test(parameter)) {
          return true;
        }
      }
      return false;
    }
  }

  // AnnotatedElement ------------------------------------------------------------------------------

  public static Predicate<AnnotatedElement> elementAnnotatedWith(Class<? extends Annotation> annotationType) {

    Precondition.param(annotationType).isNotNull();
    return new AnnotatedElementAnnotatedWithTypePredicate(annotationType);
  }

  public static <A extends Annotation> Predicate<AnnotatedElement> elementAnnotatedWith(
          Class<A> annotationType, Predicate<? super A> annotationPredicate) {

    Precondition.param(annotationType).isNotNull();
    Precondition.param(annotationPredicate).isNotNull();
    return new AnnotatedElementAnnotatedWithSpecificPredicate<>(annotationType, annotationPredicate);
  }

  private static final class AnnotatedElementAnnotatedWithTypePredicate implements Predicate<AnnotatedElement> {

    private final Class<? extends Annotation> annotationType;

    private AnnotatedElementAnnotatedWithTypePredicate(Class<? extends Annotation> annotationType) {

      this.annotationType = annotationType;
    }

    @Override
    public boolean test(AnnotatedElement annotatedElement) {

      return annotatedElement != null && annotatedElement.getAnnotation(annotationType) != null;
    }
  }

  private static final class AnnotatedElementAnnotatedWithSpecificPredicate<A extends Annotation>
          implements Predicate<AnnotatedElement> {

    private final Class<A> annotationType;

    private final Predicate<? super A> annotationPredicate;

    private AnnotatedElementAnnotatedWithSpecificPredicate(Class<A> annotationType,
                                                           Predicate<? super A> annotationPredicate) {

      this.annotationType = annotationType;
      this.annotationPredicate = annotationPredicate;
    }

    @Override
    public boolean test(AnnotatedElement annotatedElement) {

      if (annotatedElement == null) {
        return false;
      }
      A annotation = annotatedElement.getAnnotation(annotationType);
      return (annotation != null) && annotationPredicate.test(annotation);
    }
  }

  // Method ----------------------------------------------------------------------------------------

  public static Predicate<Method> methodNameMatches(Predicate<? super String> namePredicate) {

    Precondition.param(namePredicate).isNotNull();
    return new MethodNamePredicate(namePredicate);
  }

  public static Predicate<Method> methodHasName(String name) {

    Precondition.param(name).isNotNull()
        .isNotEmpty();
    return methodNameMatches(name::equals);
  }

  public static Predicate<Method> methodOverrides(Method methodOverridden) {

    Precondition.param(methodOverridden).isNotNull();
    return new MethodOverridesAnotherPredicate(methodOverridden);
  }

  private static class MethodNamePredicate implements Predicate<Method> {

    private final Predicate<? super String> namePredicate;

    private MethodNamePredicate(Predicate<? super String> namePredicate) {

      this.namePredicate = namePredicate;
    }

    @Override
    public boolean test(Method method) {

      return namePredicate.test(method.getName());
    }
  }

  /**
   * The method returns a {@link Predicate} to test whether a method is overriden by the specified
   * {@code overridingMethod} .
   *
   * @param overridingMethod the overriding method used to test whether a method is overridden by it,
   *                         cannot be {@code null}.
   * @return the predicate instance created.
   *
   * @throws org.raistlic.common.precondition.InvalidParameterException when {@code overridingMethod}
   *         is {@code null}.
   */
  public static Predicate<Method> methodOverriddenBy(Method overridingMethod) {

    Precondition.param(overridingMethod).isNotNull();
    return new MethodOverriddenByAnotherPredicate(overridingMethod);
  }

  private static class MethodOverridesAnotherPredicate implements Predicate<Method> {

    private final Method overriddenMethod;

    private Predicate<Class<?>> declaringClassPredicate;

    private MethodOverridesAnotherPredicate(Method overriddenMethod) {

      this.overriddenMethod = overriddenMethod;
    }

    private Predicate<Class<?>> getDeclaringClassPredicate() {

      if (declaringClassPredicate == null) {
        declaringClassPredicate = hasSuperType(overriddenMethod.getDeclaringClass());
      }
      return declaringClassPredicate;
    }

    @Override
    public boolean test(Method method) {

      if (!getDeclaringClassPredicate().test(method.getDeclaringClass())) {
        return false;
      }
      if (!overriddenMethod.getName().equals(method.getName())) {
        return false;
      }
      if (!overriddenMethod.getReturnType().isAssignableFrom(method.getReturnType())) {
        return false;
      }
      return true;
    }
  }

  private static class MethodOverriddenByAnotherPredicate implements Predicate<Method> {

    private final Method overridingMethod;

    private Predicate<Class<?>> declaringClassPredicate;

    private MethodOverriddenByAnotherPredicate(Method overridingMethod) {

      this.overridingMethod = overridingMethod;
    }

    private Predicate<Class<?>> getDeclaringClassPredicate() {

      if (declaringClassPredicate == null) {
        declaringClassPredicate = hasSubType(overridingMethod.getDeclaringClass());
      }
      return declaringClassPredicate;
    }

    @Override
    public boolean test(Method method) {

      if (method == null) {
        return false;
      }
      Class<?> candidateDeclaringClass = method.getDeclaringClass();
      if (!getDeclaringClassPredicate().test(candidateDeclaringClass)) {
        return false;
      }
      if (!method.getName().equals(overridingMethod.getName())) {
        return false;
      }

      return true;
    }
  }

  // Class -----------------------------------------------------------------------------------------

  /**
   * The method returns a {@link Predicate} instance to test whether a class has the specified
   * {@code superType} .
   *
   * @param superType the super type used to test classes, cannot be {@code null}.
   * @return the predicate instance created.
   *
   * @throws org.raistlic.common.precondition.InvalidParameterException when {@code superType} is
   *         {@code null}.
   */
  public static Predicate<Class<?>> hasSuperType(Class<?> superType) {

    Precondition.param(superType).isNotNull();
    return new ClassHasSuperTypePredicate(superType);
  }

  /**
   * The method returns a {@link Predicate} instance to test whether a class has the specified
   * {@code subType} .
   *
   * @param subType the sub type used to test classes, cannot be {@code null}.
   * @return the predicate instance created.
   *
   * @throws org.raistlic.common.precondition.InvalidParameterException when {@code subType} is
   *         {@code null}.
   */
  public static Predicate<Class<?>> hasSubType(Class<?> subType) {

    Precondition.param(subType).isNotNull();
    return new ClassHasSubTypePredicate(subType);
  }

  private static final class ClassHasSuperTypePredicate implements Predicate<Class<?>> {

    private final Class<?> superType;

    private ClassHasSuperTypePredicate(Class<?> superType) {

      this.superType = superType;
    }

    @Override
    public boolean test(Class<?> aClass) {

      if (aClass == null) {
        return false;
      }
      return (aClass != superType) && superType.isAssignableFrom(aClass);
    }
  }

  private static final class ClassHasSubTypePredicate implements Predicate<Class<?>> {

    private final Class<?> subType;

    private ClassHasSubTypePredicate(Class<?> subType) {

      this.subType = subType;
    }

    @Override
    public boolean test(Class<?> aClass) {

      if (aClass == null) {
        return false;
      }
      return (aClass != subType) && aClass.isAssignableFrom(subType);
    }
  }
}


text:
/* global require */

// eslint-disable-next-line import/no-extraneous-dependencies
const Getopt = require('node-getopt');

let addon;
// eslint-disable-next-line import/no-unresolved
const config = require('./../../licode_config');
// eslint-disable-next-line import/no-unresolved
const mediaConfig = require('./../../rtp_media_config');

global.config = config || {};
global.config.erizo = global.config.erizo || {};
global.config.erizo.numWorkers = global.config.erizo.numWorkers || 24;
global.config.erizo.numIOWorkers = global.config.erizo.numIOWorkers || 1;
global.config.erizo.useNicer = global.config.erizo.useNicer || false;
global.config.erizo.stunserver = global.config.erizo.stunserver || '';
global.config.erizo.stunport = global.config.erizo.stunport || 0;
global.config.erizo.minport = global.config.erizo.minport || 0;
global.config.erizo.maxport = global.config.erizo.maxport || 0;
global.config.erizo.turnserver = global.config.erizo.turnserver || '';
global.config.erizo.turnport = global.config.erizo.turnport || 0;
global.config.erizo.turnusername = global.config.erizo.turnusername || '';
global.config.erizo.turnpass = global.config.erizo.turnpass || '';
global.config.erizo.networkinterface = global.config.erizo.networkinterface || '';
global.mediaConfig = mediaConfig || {};
// Parse command line arguments
const getopt = new Getopt([
  ['r', 'rabbit-host=ARG', 'RabbitMQ Host'],
  ['g', 'rabbit-port=ARG', 'RabbitMQ Port'],
  ['b', 'rabbit-heartbeat=ARG', 'RabbitMQ AMQP Heartbeat Timeout'],
  ['l', 'logging-config-file=ARG', 'Logging Config File'],
  ['s', 'stunserver=ARG', 'Stun Server IP'],
  ['p', 'stunport=ARG', 'Stun Server port'],
  ['m', 'minport=ARG', 'Minimum port'],
  ['M', 'maxport=ARG', 'Maximum port'],
  ['t', 'turnserver=ARG', 'TURN server IP'],
  ['T', 'turnport=ARG', 'TURN server PORT'],
  ['c', 'turnusername=ARG', 'TURN username'],
  ['C', 'turnpass=ARG', 'TURN password'],
  ['d', 'debug', 'Run Debug erizoAPI addon'],
  ['h', 'help', 'display this help'],
]);

const opt = getopt.parse(process.argv.slice(2));
let isDebugMode = false;

Object.keys(opt.options).forEach((prop) => {
  const value = opt.options[prop];
  switch (prop) {
    case 'help':
      getopt.showHelp();
      process.exit(0);
      break;
    case 'rabbit-host':
      global.config.rabbit = global.config.rabbit || {};
      global.config.rabbit.host = value;
      break;
    case 'rabbit-port':
      global.config.rabbit = global.config.rabbit || {};
      global.config.rabbit.port = value;
      break;
    case 'rabbit-heartbeat':
      global.config.rabbit = global.config.rabbit || {};
      global.config.rabbit.heartbeat = value;
      break;
    case 'logging-config-file':
      global.config.logger = global.config.logger || {};
      global.config.logger.configFile = value;
      break;
    case 'debug':
      // eslint-disable-next-line import/no-unresolved, global-require
      addon = require('./../../erizoAPI/build/Release/addonDebug');
      isDebugMode = true;
      break;
    default:
      global.config.erizo[prop] = value;
      break;
  }
});

if (!addon) {
  // eslint-disable-next-line
  addon = require('./../../erizoAPI/build/Release/addon');
}

// Load submodules with updated config
const logger = require('./../common/logger').logger;
const amqper = require('./../common/amqper');
const controller = require('./erizoJSController');

// Logger
const log = logger.getLogger('ErizoJS');

const threadPool = new addon.ThreadPool(global.config.erizo.numWorkers);
threadPool.start();

const ioThreadPool = new addon.IOThreadPool(global.config.erizo.numIOWorkers);

if (global.config.erizo.useNicer) {
  log.info('Starting ioThreadPool');
  ioThreadPool.start();
}

const ejsController = controller.ErizoJSController(threadPool, ioThreadPool);

ejsController.keepAlive = (callback) => {
  callback('callback', true);
};

ejsController.privateRegexp = new RegExp(process.argv[3], 'g');
ejsController.publicIP = process.argv[4];

amqper.connect(() => {
  try {
    amqper.setPublicRPC(ejsController);

    const rpcID = process.argv[2];

    log.info(`message: Started, erizoId: ${rpcID}, isDebugMode: ${isDebugMode}`);

    amqper.bindBroadcast('ErizoJS');
    amqper.bind(`ErizoJS_${rpcID}`, () => {
      log.debug(`message: bound to amqp queue, queueId: ErizoJS_${rpcID}`);
    });
  } catch (err) {
    log.error('message: AMQP connection error, ', logger.objectToLog(err));
  }
});


text:
var _        = require('lodash'),
    sinon    = require('sinon'),
    chai     = require('chai'),
    Parser   = require('../../../lib/parser/string'),
    Template = require('../../../lib/parser/string/template'),
    Async    = require('../../../lib/async'),
    Provider = require('../../../lib/provider'),
    assert, expect;

assert = chai.assert;
expect = chai.expect;

describe("Parser", function() {

    describe("#constructor", function() {

        it("should throw error when calling without async", function() {
            function builder() {
                new Parser();
            }

            expect(builder).to.throw(TypeError, "Async is expected");
        });

        it("should throw error when calling without template", function() {
            function builder() {
                new Parser(Object.create(Async.prototype));
            }

            expect(builder).to.throw(TypeError, "Template is expected");
        });

        it("should throw error when calling without provider", function() {
            function builder() {
                new Parser(Object.create(Async.prototype), Object.create(Template.prototype));
            }

            expect(builder).to.throw(TypeError, "Provider is expected");
        });

    });

});


text:
<?php
/**
 * @file
 * @author Lightly Salted Software Ltd
 * @date   16/04/17
 */

namespace LSS\YAContainer\Fixture;

class CircularDependencyA implements CircularDependencyInterface
{
    public function __construct(CircularDependencyB $oops)
    {
    }
}


text:
'use strict';

import {TPromise} from 'vs/base/common/winjs.base';
import nls = require('vs/nls');
import {EditorModel} from 'vs/workbench/common/editor';
import {StringEditorInput} from 'vs/workbench/common/editor/stringEditorInput';
import {OUTPUT_EDITOR_INPUT_ID, OUTPUT_PANEL_ID, IOutputEvent, OUTPUT_MIME, IOutputService} from 'vs/workbench/parts/output/common/output';
import {OutputPanel} from 'vs/workbench/parts/output/browser/outputPanel';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {IPanelService} from 'vs/workbench/services/panel/common/panelService';

/**
 * Output Editor Input
 */
export class OutputEditorInput extends StringEditorInput {

	private static instances: { [channel: string]: OutputEditorInput; } = Object.create(null);
	private static MAX_OUTPUT_LINES = 10000; // Max. number of output lines to show in output

	private outputSet: boolean;
	private channel: string;
	private toUnbind: { (): void; }[];

	public static getInstances(): OutputEditorInput[] {
		return Object.keys(OutputEditorInput.instances).map((key) => OutputEditorInput.instances[key]);
	}

	public static getInstance(instantiationService: IInstantiationService, channel: string): OutputEditorInput {
		if (OutputEditorInput.instances[channel]) {
			return OutputEditorInput.instances[channel];
		}

		OutputEditorInput.instances[channel] = instantiationService.createInstance(OutputEditorInput, channel);

		return OutputEditorInput.instances[channel];
	}

	constructor(
		channel: string,
		@IInstantiationService instantiationService: IInstantiationService,
		@IOutputService private outputService: IOutputService,
		@IPanelService private panelService: IPanelService
	) {
		super(nls.localize('output', "Output"), channel ? nls.localize('outputChannel', "for '{0}'", channel) : '', '', OUTPUT_MIME, true, instantiationService);

		this.channel = channel;
		this.toUnbind = [];

		const listenerUnbind = this.outputService.onOutput(this.onOutputReceived, this);
		this.toUnbind.push(() => listenerUnbind.dispose());
	}

	private onOutputReceived(e: IOutputEvent): void {
		if (this.outputSet && e.channel === this.channel) {
			if (e.output) {
				this.append(e.output);
				this.trim(OutputEditorInput.MAX_OUTPUT_LINES);
				const panel = this.panelService.getActivePanel();
				if (panel.getId() === OUTPUT_PANEL_ID && this.outputService.getActiveChannel() === this.channel) {
					(<OutputPanel>panel).revealLastLine();
				}
			} else if (e.output === null) {
				this.clearValue(); // special output indicates we should clear
			}
		}
	}

	public getId(): string {
		return OUTPUT_EDITOR_INPUT_ID;
	}

	public resolve(refresh?: boolean): TPromise<EditorModel> {
		return super.resolve(refresh).then(model => {

			// Just return model if output already set
			if (this.outputSet) {
				return model;
			}

			this.setValue(this.outputService.getOutput(this.channel));
			this.outputSet = true;

			return model;
		});
	}

	public getChannel(): string {
		return this.channel;
	}

	public matches(otherInput: any): boolean {
		if (otherInput instanceof OutputEditorInput) {
			let otherOutputEditorInput = <OutputEditorInput>otherInput;
			if (otherOutputEditorInput.getChannel() === this.channel) {
				return super.matches(otherInput);
			};
		}

		return false;
	}

	public dispose(): void {
		while (this.toUnbind.length) {
			this.toUnbind.pop()();
		}

		super.dispose();
	}
}


text:
module Georgia
  class RevisionStatusMessage

    include Pundit

    attr_reader :current_user

    def initialize current_user, page, revision, draft_revision=nil
      @current_user = current_user
      @page = page
      @revision = revision
      @draft_revision = draft_revision
    end

    def partial
      case @revision.status
      when 'draft' then draft_partial_sorter
      when 'review' then review_partial_sorter
      when 'revision' then revision_partial_sorter
      when 'published' then published_partial_sorter
      end
    end

    private

    def draft_partial_sorter
      if policy(@revision).approve?
        'request_review'
      elsif current_owner?
        'review'
      else
        'insufficient_rights'
      end
    end

    def review_partial_sorter
      if current_owner?
        'awaiting_review'
      elsif policy(@revision).approve?
        'review'
      else
        'insufficient_rights'
      end
    end

    def revision_partial_sorter
      if current_revision? and policy(@revision).approve?
        nil
      elsif current_revision? and !policy(@revision).approve?
        'insufficient_rights'
      elsif !current_revision? and policy(@revision).approve?
        'edit_current_revision'
      else
        'start_draft'
      end
    end

    def published_partial_sorter
      if !policy(@revision).approve?
        'insufficient_rights'
      end
    end

    def current_revision?
      @is_current_revision ||= @page.current_revision == @revision
    end

    def current_owner?
      @is_current_owner ||= @revision.user == @current_user
    end

  end
end


text:
create temporary view t as select * from values 0, 1, 2 as t(id);
create temporary view t2 as select * from values 0, 1 as t(id);

-- WITH clause should not fall into infinite loop by referencing self
WITH s AS (SELECT 1 FROM s) SELECT * FROM s;

WITH r AS (SELECT (SELECT * FROM r))
SELECT * FROM r;

-- WITH clause should reference the base table
WITH t AS (SELECT 1 FROM t) SELECT * FROM t;

-- WITH clause should not allow cross reference
WITH s1 AS (SELECT 1 FROM s2), s2 AS (SELECT 1 FROM s1) SELECT * FROM s1, s2;

-- WITH clause should reference the previous CTE
WITH t1 AS (SELECT * FROM t2), t2 AS (SELECT 2 FROM t1) SELECT * FROM t1 cross join t2;

-- SPARK-18609 CTE with self-join
WITH CTE1 AS (
  SELECT b.id AS id
  FROM   T2 a
         CROSS JOIN (SELECT id AS id FROM T2) b
)
SELECT t1.id AS c1,
       t2.id AS c2
FROM   CTE1 t1
       CROSS JOIN CTE1 t2;

-- CTE with column alias
WITH t(x) AS (SELECT 1)
SELECT * FROM t WHERE x = 1;

-- CTE with multiple column aliases
WITH t(x, y) AS (SELECT 1, 2)
SELECT * FROM t WHERE x = 1 AND y = 2;

-- CTE with duplicate column aliases
WITH t(x, x) AS (SELECT 1, 2)
SELECT * FROM t;

-- CTE with empty column alias list is not allowed
WITH t() AS (SELECT 1)
SELECT * FROM t;

-- CTEs with duplicate names are not allowed
WITH
  t(x) AS (SELECT 1),
  t(x) AS (SELECT 2)
SELECT * FROM t;

-- CTE in CTE definition
WITH t as (
  WITH t2 AS (SELECT 1)
  SELECT * FROM t2
)
SELECT * FROM t;

-- CTE in subquery
SELECT max(c) FROM (
  WITH t(c) AS (SELECT 1)
  SELECT * FROM t
);

-- CTE in subquery expression
SELECT (
  WITH t AS (SELECT 1)
  SELECT * FROM t
);

-- CTE in CTE definition shadows outer
WITH
  t AS (SELECT 1),
  t2 AS (
    WITH t AS (SELECT 2)
    SELECT * FROM t
  )
SELECT * FROM t2;

-- CTE in CTE definition shadows outer 2
WITH
  t(c) AS (SELECT 1),
  t2 AS (
    SELECT (
      SELECT max(c) FROM (
        WITH t(c) AS (SELECT 2)
        SELECT * FROM t
      )
    )
  )
SELECT * FROM t2;

-- CTE in CTE definition shadows outer 3
WITH
  t AS (SELECT 1),
  t2 AS (
    WITH t AS (SELECT 2),
    t2 AS (
      WITH t AS (SELECT 3)
      SELECT * FROM t
    )
    SELECT * FROM t2
  )
SELECT * FROM t2;

-- CTE in subquery shadows outer
WITH t(c) AS (SELECT 1)
SELECT max(c) FROM (
  WITH t(c) AS (SELECT 2)
  SELECT * FROM t
);

-- CTE in subquery shadows outer 2
WITH t(c) AS (SELECT 1)
SELECT sum(c) FROM (
  SELECT max(c) AS c FROM (
    WITH t(c) AS (SELECT 2)
    SELECT * FROM t
  )
);

-- CTE in subquery shadows outer 3
WITH t(c) AS (SELECT 1)
SELECT sum(c) FROM (
  WITH t(c) AS (SELECT 2)
  SELECT max(c) AS c FROM (
    WITH t(c) AS (SELECT 3)
    SELECT * FROM t
  )
);

-- CTE in subquery expression shadows outer
WITH t AS (SELECT 1)
SELECT (
  WITH t AS (SELECT 2)
  SELECT * FROM t
);

-- CTE in subquery expression shadows outer 2
WITH t AS (SELECT 1)
SELECT (
  SELECT (
    WITH t AS (SELECT 2)
    SELECT * FROM t
  )
);

-- CTE in subquery expression shadows outer 3
WITH t AS (SELECT 1)
SELECT (
  WITH t AS (SELECT 2)
  SELECT (
    WITH t AS (SELECT 3)
    SELECT * FROM t
  )
);

-- Clean up
DROP VIEW IF EXISTS t;
DROP VIEW IF EXISTS t2;


text:
package io.machinecode.chainlink.core.configuration;

import io.machinecode.chainlink.spi.configuration.ConfigurationLoader;
import io.machinecode.chainlink.spi.configuration.Declaration;
import io.machinecode.chainlink.spi.configuration.Dependencies;
import io.machinecode.chainlink.spi.property.PropertyLookup;
import io.machinecode.chainlink.spi.configuration.factory.Factory;
import io.machinecode.chainlink.spi.exception.UnresolvableResourceException;
import io.machinecode.chainlink.spi.inject.ArtifactOfWrongTypeException;

import java.lang.ref.WeakReference;

/**
 * @author Brent Douglas
 * @since 1.0
 */
public class DeclarationImpl<T> implements Declaration<T> {

    final WeakReference<ClassLoader> loader;
    final Class<? extends T> valueInterface;
    final Class<? extends Factory<? extends T>> factoryInterface;
    T value;
    Factory<? extends T> defaultFactory;
    Factory<? extends T> factory;
    Class<? extends T> valueClass;
    Class<? extends Factory<? extends T>> factoryClass;
    String ref;

    T cache;

    public DeclarationImpl(final WeakReference<ClassLoader> loader,
                           final Class<? extends T> valueInterface, final Class<? extends Factory<? extends T>> factoryInterface) {
        this.loader = loader;
        this.valueInterface = valueInterface;
        this.factoryInterface = factoryInterface;
    }

    private DeclarationImpl(final DeclarationImpl<T> that) {
        this(that.loader, that.valueInterface, that.factoryInterface);
        this.value = that.value;
        this.defaultFactory = that.defaultFactory;
        this.factory = that.factory;
        this.factoryClass = that.factoryClass;
        this.ref = that.ref;
        this.cache = that.cache;
    }

    public DeclarationImpl<T> copy() {
        return new DeclarationImpl<>(this);
    }

    boolean is(final Class<?> type) {
        return valueInterface.isAssignableFrom(type);
    }

    @Override
    public DeclarationImpl<T> setValue(final T that) {
        this.cache = null;
        this.value = that;
        return this;
    }

    @Override
    public Declaration<T> setValueClass(final Class<? extends T> that) {
        this.cache = null;
        this.valueClass = that;
        return this;
    }

    @Override
    public DeclarationImpl<T> setDefaultFactory(final Factory<? extends T> that) {
        this.cache = null;
        this.defaultFactory = that;
        return this;
    }

    @Override
    public DeclarationImpl<T> setFactory(final Factory<? extends T> that) {
        this.cache = null;
        this.factory = that;
        return this;
    }

    @Override
    public DeclarationImpl<T> setFactoryClass(final Class<? extends Factory<? extends T>> that) {
        this.cache = null;
        this.factoryClass = that;
        return this;
    }

    @Override
    public DeclarationImpl<T> setRef(final String that) {
        this.cache = null;
        this.ref = that;
        return this;
    }

    public T get(final Dependencies dependencies, final PropertyLookup properties, final ConfigurationLoader configurationLoader) {
        if (cache != null) {
            return cache;
        }
        if (value != null) {
            return cache = value;
        }
        try {
            if (valueClass != null) {
                return cache = valueClass.newInstance();
            } else if (factory != null) {
                return cache = factory.produce(dependencies, properties);
            } else if (factoryClass != null) {
                return cache = factoryClass.newInstance().produce(dependencies, properties);
            } else if (ref != null) {
                final ClassLoader classLoader = this.loader.get();
                if (classLoader == null) {
                    throw new UnresolvableResourceException(); //TODO Message
                }
                try {
                    final Factory<? extends T> factory = configurationLoader.load(ref, factoryInterface, classLoader);
                    if (factory == null) {
                        throw new UnresolvableResourceException("No configuration found for node with clazz=" + valueInterface.getSimpleName()); //TODO
                    }
                    return cache = factory.produce(dependencies, properties);
                } catch (final ArtifactOfWrongTypeException e) {
                    return cache = configurationLoader.load(ref, valueInterface, classLoader);
                }
            } else if (defaultFactory != null) {
                return cache = defaultFactory.produce(dependencies, properties);
            }
        } catch (final UnresolvableResourceException e) {
            throw e;
        } catch (final Exception e) {
            throw new UnresolvableResourceException(e); //TODO Message
        }
        throw new UnresolvableResourceException("No configuration found for node with clazz=" + valueInterface.getSimpleName()); //TODO
    }
}


text:
@interface LiveImageView () {

    CALayer  *_Layer;
}

@end

@implementation LiveImageView

- (id)initWithFrame:(CGRect)frame {

    if ([super initWithFrame:frame]) {

        _duration = 0.3f;
        _Layer    = self.layer;
    }

    return self;
}

@synthesize image = _image;

- (void)setImage:(UIImage *)image {

    if (_image != image) {

        CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"contents"];
        animation.fromValue         = (__bridge id)(_image.CGImage);
        animation.toValue           =  (__bridge id)(image.CGImage);
        animation.duration          = _duration;
        _Layer.contents             = (__bridge id)(image.CGImage);
        [_Layer addAnimation:animation forKey:nil];

        _image = image;
    }
}

- (UIImage *)image {

    return _image;
}

@end


text:
package net.java.sip.communicator.impl.protocol.jabber.extensions.whiteboard;

import java.awt.*;
import java.io.*;
import java.util.*;
import java.util.List;

import javax.xml.parsers.*;

import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.whiteboardobjects.*;
import net.java.sip.communicator.util.*;

import org.jitsi.util.xml.*;
import org.w3c.dom.*;

/**
 *  WhiteboardObjectPolyLineJabberImpl
 *

 * WhiteboardObjectPolyLineJabberImpl are created through
 * the <tt>WhiteboardSession</tt> session.
 *

 *
 * All WhiteboardObjectPolyLineJabberImpl have whiteboard object id.
 * @author Julien Waechter
 */
public class WhiteboardObjectPolyLineJabberImpl
  extends WhiteboardObjectJabberImpl implements WhiteboardObjectPolyLine
{
    private static final Logger logger =
      Logger.getLogger (WhiteboardObjectPolyLineJabberImpl.class);

    /**
     * list of WhiteboardPoint
     */
    private List<WhiteboardPoint> listPoints
        = new LinkedList<WhiteboardPoint>();

    /**
     * Default WhiteboardObjectPolyLineJabberImpl constructor.
     */
    public WhiteboardObjectPolyLineJabberImpl ()
    {
        super ();
    }

    /**
     * WhiteboardObjectPolyLineJabberImpl constructor.
     *
     * @param xml the XML string object to parse.
     */
    public WhiteboardObjectPolyLineJabberImpl (String xml)
    {
        try
        {
            DocumentBuilder builder
                    = XMLUtils.newDocumentBuilderFactory().newDocumentBuilder();
            InputStream in = new ByteArrayInputStream (xml.getBytes ());
            Document doc = builder.parse (in);

            Element e = doc.getDocumentElement ();
            String elementName = e.getNodeName ();
            if (elementName.equals ("polyline"))
            {
                //we have polyline
                String id = e.getAttribute ("id");
                String d = e.getAttribute ("points");
                String stroke = e.getAttribute ("stroke");
                String stroke_width = e.getAttribute ("stroke-width");

                this.setID (id);
                this.setThickness (Integer.parseInt (stroke_width));
                this.setColor (Color.decode (stroke).getRGB ());
                this.setPoints (getPolyPoints (d));

            }
        }
        catch (ParserConfigurationException ex)
        {
            if (logger.isDebugEnabled())
                logger.debug ("Problem WhiteboardObject : "+xml);
        }
        catch (IOException ex)
        {
            if (logger.isDebugEnabled())
                logger.debug ("Problem WhiteboardObject : "+xml);
        }
        catch (Exception ex)
        {
            if (logger.isDebugEnabled())
                logger.debug ("Problem WhiteboardObject : "+xml);
        }
    }

    /**
     * Sets the list of <tt>WhiteboardPoint</tt> instances that this
     * <tt>WhiteboardObject</tt> is composed of.
     *
     * @param points the list of <tt>WhiteboardPoint</tt> instances that this
     * <tt>WhiteboardObject</tt> is composed of.
     */
    public void setPoints (List<WhiteboardPoint> points)
    {
        this.listPoints =  new LinkedList<WhiteboardPoint>(points);
    }

    /**
     * Returns a list of all the <tt>WhiteboardPoint</tt> instances that this
     * <tt>WhiteboardObject</tt> is composed of.
     *
     * @return the list of <tt>WhiteboardPoint</tt>s composing this object.
     */
    public List<WhiteboardPoint> getPoints ()
    {
        return this.listPoints;
    }

    /**
     * Converts a String in a "150,375 150,325 250,325 250,375" format into
     * List of <tt>WhiteboardPoint</tt>.
     *
     * @param points the String to be converted to a
     * List of <tt>WhiteboardPoint</tt>.
     *
     * @return a List of the String points parameter
     */
    private List<WhiteboardPoint> getPolyPoints (String points)
    {
        List<WhiteboardPoint> list = new LinkedList<WhiteboardPoint>();
        if (points == null)
        {
            return list;
        }

        StringTokenizer tokenizer = new StringTokenizer (points);
        while (tokenizer.hasMoreTokens ())
        {
            String token = tokenizer.nextToken ();

            String[] coords = token.split (",");
            WhiteboardPoint p = new WhiteboardPoint (
              Double.parseDouble (coords[0]),
              Double.parseDouble (coords[1]));
            list.add (p);
        }

        return list;
    }

    /**
     * Returns the XML reppresentation of the PacketExtension.
     *
     * @return the packet extension as XML.
     * @todo Implement this org.jivesoftware.smack.packet.PacketExtension
     *   method
     */
    @Override
    public String toXML ()
    {
        String s = "<polyline id=\"#i\" points=\"#p\" " +
          "fill=\"#f\" stroke=\"#s\" stroke-width=\"#w\"/>";
        s = s.replaceAll ("#i", getID ());
        s = s.replaceAll ("#s",  colorToHex (getColor ()));
        s = s.replaceAll ("#w", ""+getThickness ());
        s = s.replaceAll ("#f", "none");

        StringBuilder sb = new StringBuilder ();

        for (int i = 0; i < listPoints.size (); i++)
        {
            WhiteboardPoint point = listPoints.get (i);
            sb.append (point.getX ());
            sb.append (",");
            sb.append (point.getY ());
            sb.append (" ");
        }
        s = s.replaceAll ("#p", sb.toString ());
        return s;
    }
}


text:
package au.com.codeka.warworlds.server.utils;

import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

import javax.imageio.ImageIO;

import org.apache.commons.imaging.ImageReadException;
import org.apache.commons.imaging.Imaging;

/**
 * A helper class we can use to ensure images are never greater than some maximum width/height.
 */
public class ImageSizer {
    public static byte[] ensureMaxSize(byte[] pngImage, int maxWidth, int maxHeight) {
        try {
            BufferedImage image = Imaging.getBufferedImage(pngImage);
            image = ensureMaxSize(image, maxWidth, maxHeight);

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ImageIO.write(image, "png", baos);
            return baos.toByteArray();
        } catch (IOException | ImageReadException e) {
            return pngImage; // no ideal, but shouldn't happen
        }
    }

    public static BufferedImage ensureMaxSize(BufferedImage img, int maxWidth, int maxHeight) {
        // make sure maxWidth/maxHeight is the same aspect ratio as the input image
        int width = img.getWidth();
        int height = img.getHeight();
        float aspect = (float) width / (float) height;
        if (aspect > 1.0f) {
            maxHeight = (int) (maxWidth / aspect);
        } else {
            maxWidth = (int) (maxHeight * aspect);
        }

        if (maxWidth > width || maxHeight > height) {
            return img;
        }

        BufferedImage after = new BufferedImage(maxWidth, maxHeight, BufferedImage.TYPE_INT_ARGB);
        AffineTransform at = new AffineTransform();
        at.scale((float) maxWidth / width, (float) maxHeight / height);
        AffineTransformOp scaleOp = new AffineTransformOp(at, AffineTransformOp.TYPE_BICUBIC);
        return scaleOp.filter(img, after);
    }
}


text:
'use strict';

var gulp = require('gulp');
var replace = require('gulp-replace');
var clean = require('gulp-clean');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var moment = require('moment');
var less = require('gulp-less');
var minifyCSS = require('gulp-css');

var join = require('path').join;

var pkg = require('./package.json');

gulp.task('clean', ['postapp'], function () {
  return gulp.src(join('dist', pkg.name), {read: false})
    .pipe(clean());
});

gulp.task('postapp', function() {
  var src = 'dist/' + pkg.name + '/' + pkg.version + '/src*.js'])
    .pipe(jshint());
});

gulp.task('postbuild', ['clean', 'sea-config']);


text:
package com.badlogic.gdx.utils;

import java.util.Arrays;

import com.badlogic.gdx.math.MathUtils;

/** A resizable, ordered or unordered int array. Avoids the boxing that occurs with ArrayList<Integer>. If unordered, this class
 * avoids a memory copy when removing elements (the last element is moved to the removed element's position).
 * @author Nathan Sweet */
public class IntArray {
	public int[] items;
	public int size;
	public boolean ordered;

	/** Creates an ordered array with a capacity of 16. */
	public IntArray () {
		this(false, 16);
	}

	/** Creates an ordered array with the specified capacity. */
	public IntArray (int capacity) {
		this(false, capacity);
	}

	/** @param ordered If false, methods that remove elements may change the order of other elements in the array, which avoids a
	 *           memory copy.
	 * @param capacity Any elements added beyond this will cause the backing array to be grown. */
	public IntArray (boolean ordered, int capacity) {
		this.ordered = ordered;
		items = new int[capacity];
	}

	/** Creates a new array containing the elements in the specific array. The new array will be ordered if the specific array is
	 * ordered. The capacity is set to the number of elements, so any subsequent elements added will cause the backing array to be
	 * grown. */
	public IntArray (IntArray array) {
		this.ordered = array.ordered;
		size = array.size;
		items = new int[size];
		System.arraycopy(array.items, 0, items, 0, size);
	}

	public void add (int value) {
		int[] items = this.items;
		if (size == items.length) items = resize(Math.max(8, (int)(size * 1.75f)));
		items[size++] = value;
	}

	public void addAll (IntArray array) {
		addAll(array, 0, array.size);
	}

	public void addAll (IntArray array, int offset, int length) {
		if (offset + length > array.size)
			throw new IllegalArgumentException("offset + length must be <= size: " + offset + " + " + length + " <= " + array.size);
		addAll(array.items, offset, length);
	}

	public void addAll (int[] array) {
		addAll(array, 0, array.length);
	}

	public void addAll (int[] array, int offset, int length) {
		int[] items = this.items;
		int sizeNeeded = size + length - offset;
		if (sizeNeeded >= items.length) items = resize(Math.max(8, (int)(sizeNeeded * 1.75f)));
		System.arraycopy(array, offset, items, size, length);
		size += length;
	}

	public int get (int index) {
		if (index >= size) throw new IndexOutOfBoundsException(String.valueOf(index));
		return items[index];
	}

	public void set (int index, int value) {
		if (index >= size) throw new IndexOutOfBoundsException(String.valueOf(index));
		items[index] = value;
	}

	public void insert (int index, int value) {
		int[] items = this.items;
		if (size == items.length) items = resize(Math.max(8, (int)(size * 1.75f)));
		if (ordered)
			System.arraycopy(items, index, items, index + 1, size - index);
		else
			items[size] = items[index];
		size++;
		items[index] = value;
	}

	public boolean contains (int value) {
		int i = size - 1;
		int[] items = this.items;
		while (i >= 0)
			if (items[i--] == value) return true;
		return false;
	}

	public int indexOf (int value) {
		int[] items = this.items;
		for (int i = 0, n = size; i < n; i++)
			if (items[i] == value) return i;
		return -1;
	}

	public boolean removeValue (int value) {
		int[] items = this.items;
		for (int i = 0, n = size; i < n; i++) {
			if (items[i] == value) {
				removeIndex(i);
				return true;
			}
		}
		return false;
	}

	/** Removes and returns the item at the specified index. */
	public int removeIndex (int index) {
		if (index >= size) throw new IndexOutOfBoundsException(String.valueOf(index));
		int[] items = this.items;
		int value = items[index];
		size--;
		if (ordered)
			System.arraycopy(items, index + 1, items, index, size - index);
		else
			items[index] = items[size];
		return value;
	}

	/** Removes and returns the last item. */
	public int pop () {
		return items[--size];
	}

	/** Returns the last item. */
	public int peek () {
		return items[size - 1];
	}

	public void clear () {
		size = 0;
	}

	/** Reduces the size of the backing array to the size of the actual items. This is useful to release memory when many items have
	 * been removed, or if it is known that more items will not be added. */
	public void shrink () {
		resize(size);
	}

	/** Increases the size of the backing array to acommodate the specified number of additional items. Useful before adding many
	 * items to avoid multiple backing array resizes.
	 * @return {@link #items} */
	public int[] ensureCapacity (int additionalCapacity) {
		int sizeNeeded = size + additionalCapacity;
		if (sizeNeeded >= items.length) resize(Math.max(8, sizeNeeded));
		return items;
	}

	protected int[] resize (int newSize) {
		int[] newItems = new int[newSize];
		int[] items = this.items;
		System.arraycopy(items, 0, newItems, 0, Math.min(items.length, newItems.length));
		this.items = newItems;
		return newItems;
	}

	public void sort () {
		Arrays.sort(items, 0, size);
	}

	public void reverse () {
		for (int i = 0, lastIndex = size - 1, n = size / 2; i < n; i++) {
			int ii = lastIndex - i;
			int temp = items[i];
			items[i] = items[ii];
			items[ii] = temp;
		}
	}

	public void shuffle () {
		for (int i = size - 1; i >= 0; i--) {
			int ii = MathUtils.random(i);
			int temp = items[i];
			items[i] = items[ii];
			items[ii] = temp;
		}
	}

	public String toString () {
		if (size == 0) return "[]";
		int[] items = this.items;
		StringBuilder buffer = new StringBuilder(32);
		buffer.append('[');
		buffer.append(items[0]);
		for (int i = 1; i < size; i++) {
			buffer.append(", ");
			buffer.append(items[i]);
		}
		buffer.append(']');
		return buffer.toString();
	}
}


text:
/*jshint expr: true*/
'use strict';

import path from 'path';
import expect from 'expect.js';
import request from 'supertest';

const SECRETS = require(path.resolve('./configurations/secrets'));
const SERVER = require(path.resolve('./configurations/server'));
const app = require(path.resolve(SERVER.build.paths.root, 'configs/app')).default;
const utils = require(path.resolve(SERVER.build.paths.root, 'configs/utils')).default;

describe('Express Configuration Tests:', () => {
  let _app;
  let agent;
  before(done => {
    _app = app(path.resolve(SERVER.build.paths.root));
    agent = request(_app);
    done();
  });
  describe('Testing cookie secrets configuration', () => {
    it('should warn if using default cookie secret in production mode.', () => {
      process.env.NODE_ENV = 'production';
      expect(utils.validCookieSecret(SECRETS.cookieSecret, false)).to.be.false;
      process.env.NODE_ENV = 'test';
    });
    it('should warn if using empty cookie secret in production mode.', () => {
      process.env.NODE_ENV = 'production';
      expect(utils.validCookieSecret('', false)).to.be.false;
      process.env.NODE_ENV = 'test';
    });
    it('should warn if using null cookie secret in production mode.', () => {
      process.env.NODE_ENV = 'production';
      expect(utils.validCookieSecret(null, false)).to.be.false;
      process.env.NODE_ENV = 'test';
    });
    it('should warn if using undefined cookie secret in production mode.', () => {
      process.env.NODE_ENV = 'production';
      expect(utils.validCookieSecret(undefined, false)).to.be.false;
      process.env.NODE_ENV = 'test';
    });
    it('should not warn if using custom cookie secret in production mode.', () => {
      process.env.NODE_ENV = 'production';
      expect(utils.validCookieSecret('mocha secret', false)).to.be.true;
      process.env.NODE_ENV = 'test';
    });
    it('should not warn if using default cookie secret in development mode.', () => {
      process.env.NODE_ENV = 'development';
      expect(utils.validCookieSecret(SECRETS.cookieSecret, false)).to.be.true;
      process.env.NODE_ENV = 'test';
    });
    it('should not warn if using default cookie secret in test mode.', () => {
      expect(utils.validCookieSecret(SECRETS.cookieSecret, false)).to.be.true;
    });
  });

  describe('Testing JWT secrets configuration', () => {
    it('should warn if using default jwt secret in production mode.', () => {
      process.env.NODE_ENV = 'production';
      expect(utils.validJwtSecret(SECRETS.jwtSecret, false)).to.be.false;
      process.env.NODE_ENV = 'test';
    });
    it('should warn if using empty jwt secret in production mode.', () => {
      process.env.NODE_ENV = 'production';
      expect(utils.validJwtSecret('', false)).to.be.false;
      process.env.NODE_ENV = 'test';
    });
    it('should warn if using null jwt secret in production mode.', () => {
      process.env.NODE_ENV = 'production';
      expect(utils.validJwtSecret(null, false)).to.be.false;
      process.env.NODE_ENV = 'test';
    });
    it('should warn if using undefined jwt secret in production mode.', () => {
      process.env.NODE_ENV = 'production';
      expect(utils.validJwtSecret(undefined, false)).to.be.false;
      process.env.NODE_ENV = 'test';
    });
    it('should not warn if using custom jwt secret in production mode.', () => {
      process.env.NODE_ENV = 'production';
      expect(utils.validJwtSecret('mocha secret', false)).to.be.true;
      process.env.NODE_ENV = 'test';
    });
    it('should not warn if using default jwt secret in development mode.', () => {
      process.env.NODE_ENV = 'development';
      expect(utils.validJwtSecret(SECRETS.jwtSecret, false)).to.be.true;
      process.env.NODE_ENV = 'test';
    });
    it('should not warn if using default jwt secret in test mode.', () => {
      expect(utils.validJwtSecret(SECRETS.jwtSecret, false)).to.be.true;
    });
  });

  describe('Testing CSRF configuration', () => {
    it('should return CSRF in cookies', done => {
      agent.get('/')
        .expect(res => {
          let headers = res.header['set-cookie'].join('');
          expect(headers).to.match(/\_csrf/);
          expect(headers).to.match(/csrfToken/);
        })
        .end(done);
    });
    it('should not return error when CSRF is not set in header on GET', done => {
      agent.get('/').end((err, data) => {
        if (err) {
          return done(err);
        }
        expect(data.error).to.be(false);
        done();
      });
    });
    it('should response 403 when CSRF is not set in header on POST', done => {
      agent.post('/').expect(403, done);
    });
    it('should response 403 when CSRF is not set in header on PUT', done => {
      agent.put('/').expect(403, done);
    });
    it('should response 403 when CSRF is not set in header on DELETE', done => {
      agent.del('/').expect(403, done);
    });
  });

  describe('Testing RateLimit throttling', () => {
    beforeEach(done => {
      process.env.NODE_ENV = 'production';
      done();
    });
    afterEach(done => {
      process.env.NODE_ENV = 'test';
      done();
    });
    it('should response 429 when request reaches limit', done => {
      const testRL = done => {
        agent.get('/').end((err, res) => {
          if (res.error) {
            expect(res.error.status).to.be(429);
            return done();
          }
          return testRL(done);
        });
      };
      testRL(done);
    });
  });
});


text:
@interface PopupView : UIView
@property (nonatomic, strong)IBOutlet UIView *innerView;
@property (nonatomic, weak)UIViewController *parentVC;

+ (instancetype)defaultPopupView;
@end


text:
from project.settings import *

LAYERS['layers'] = ('basic', 'smart')
SITE_ID = 4

try:
    import local_settings
    from local_settings import *
except ImportError:
    pass
else:
    if hasattr(local_settings, 'configure'):
        lcl = locals()
        di = local_settings.configure(**locals())
        lcl.update(**di)


text:
package org.apache.geode.cache.query.cq.internal.ops;

import java.util.LinkedList;
import java.util.List;

import org.apache.geode.InternalGemFireError;
import org.apache.geode.cache.client.ServerOperationException;
import org.apache.geode.cache.client.internal.AbstractOp;
import org.apache.geode.cache.client.internal.ConnectionStats;
import org.apache.geode.cache.client.internal.ExecutablePool;
import org.apache.geode.cache.query.cq.internal.ops.CreateCQOp.CreateCQOpImpl;
import org.apache.geode.internal.cache.tier.MessageType;
import org.apache.geode.internal.cache.tier.sockets.ChunkedMessage;
import org.apache.geode.internal.cache.tier.sockets.Message;
import org.apache.geode.internal.cache.tier.sockets.Part;
import org.apache.geode.internal.serialization.KnownVersion;

/**
 * Retrieves all durable cqs for a client from a server
 *
 * @since GemFire 7.0
 */
public class GetDurableCQsOp {
  /**
   * Retrieves all durable continuous queries on the server using connections from the given pool to
   * communicate with the server.
   *
   * @param pool the pool to use to communicate with the server.
   */
  public static List<String> execute(ExecutablePool pool) {
    AbstractOp op = new GetDurableCQsOpImpl();
    return (List<String>) pool.executeOnPrimary(op);
  }

  private GetDurableCQsOp() {
    // no instances allowed
  }

  private static class GetDurableCQsOpImpl extends CreateCQOpImpl {
    /**
     * @throws org.apache.geode.SerializationException if serialization fails
     */
    public GetDurableCQsOpImpl() {
      super(MessageType.GETDURABLECQS_MSG_TYPE, 1 /* numparts */);
    }

    @Override
    protected String getOpName() {
      return "getDurableCQs";
    }

    @Override
    protected long startAttempt(ConnectionStats stats) {
      return stats.startGetDurableCQs();
    }

    @Override
    protected void endSendAttempt(ConnectionStats stats, long start) {
      stats.endGetDurableCQsSend(start, hasFailed());
    }

    @Override
    protected void endAttempt(ConnectionStats stats, long start) {
      stats.endGetDurableCQs(start, hasTimedOut(), hasFailed());
    }

    @Override
    protected Message createResponseMessage() {
      return new ChunkedMessage(1, KnownVersion.CURRENT);
    }

    @Override
    protected Object processResponse(Message msg) throws Exception {

      ChunkedMessage getDurableCQsResponseMsg = (ChunkedMessage) msg;
      final List<String> result = new LinkedList<>();
      final Exception[] exceptionRef = new Exception[1];

      getDurableCQsResponseMsg.readHeader();
      final int msgType = getDurableCQsResponseMsg.getMessageType();
      if (msgType == MessageType.RESPONSE) {
        do {
          getDurableCQsResponseMsg.receiveChunk();
          // callback.handle(msg);
          Part part = getDurableCQsResponseMsg.getPart(0);
          Object o = part.getObject();
          if (o instanceof Throwable) {
            String s = "While performing a remote GetDurableCQs";
            exceptionRef[0] = new ServerOperationException(s, (Throwable) o);
          } else {
            result.addAll((List) o);
          }
        } while (!getDurableCQsResponseMsg.isLastChunk());
      } else {
        if (msgType == MessageType.EXCEPTION) {
          getDurableCQsResponseMsg.receiveChunk();
          Part part = msg.getPart(0);
          String s = "While performing a remote GetDurableCQs";
          throw new ServerOperationException(s, (Throwable) part.getObject());
          // Get the exception toString part.
          // This was added for c++ thin client and not used in java
          // Part exceptionToStringPart = msg.getPart(1);
        } else if (isErrorResponse(msgType)) {
          getDurableCQsResponseMsg.receiveChunk();
          Part part = msg.getPart(0);
          throw new ServerOperationException(part.getString());
        } else {
          throw new InternalGemFireError(
              "Unexpected message type " + MessageType.getString(msgType));
        }
      }

      if (exceptionRef[0] != null) {
        throw exceptionRef[0];
      } else {
        return result;
      }
    }

    @Override
    protected boolean isErrorResponse(int msgType) {
      return msgType == MessageType.GET_DURABLE_CQS_DATA_ERROR;
    }
  }
}


text:
(function ($) {

    var methods = {
        init: function () {
            // store this object
            var self = this;

            // merge data attributes with defaults
            self.settings = $.extend({
                'speed': 1000,                      // transition speed (milliseconds)
            }, {
                'speed': self.attr("data-speed")
            });

            function SetHeight() {
                var windowHeight = $(window).height();
                windowHeight = windowHeight > 834 ? 834 : windowHeight;
                self.height(windowHeight - 6);
            }

            // on resize set the height
            $(window).resize(function () {
                SetHeight()
            });

            // inital hieght set
            SetHeight();

        }
    };

    $.fn.tbaAutoHeight = function (method) {
        // Method calling logic
        if (methods[method]) {
            return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
        } else if (typeof method === 'object' || !method) {
            return methods.init.apply(this, arguments);
        } else {
            $.error('Method ' + method + ' does not exist on jQuery.tbaAutoHeight');
        }
    };
})(jQuery);


text:
// Copyright 2016 Max Toro Q.
//
// 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.

using System;
using System.IO;
using System.Net.Mail;
using System.Web.Mvc;

namespace MvcAccount {

   /// <summary>
   /// Sends SMTP notification messages.
   /// </summary>
   public class MailService {

      /// <summary>
      /// Sends SMTP notification <paramref name="messages"/>
      /// </summary>
      /// <param name="messages">The messages to send.</param>
      public virtual void Send(params MailMessage[] messages) {

         if (messages == null
            || messages.Length == 0) {

            return;
         }

         using (var smtp = new SmtpClient()) {

            foreach (MailMessage item in messages) {
               smtp.Send(item);
            }
         }
      }

      /// <summary>
      /// Renders a partial view that represents a mail template.
      /// </summary>
      /// <param name="controllerContext">The current controller context.</param>
      /// <param name="viewName">The name of the view to render.</param>
      /// <param name="model">An object to use as model for the view.</param>
      /// <returns>The view as a string.</returns>
      public virtual string RenderMailView(ControllerContext controllerContext, string viewName, object model) {

         ViewEngineResult viewResult = ViewEngines.Engines.FindLocalizedPartialView(controllerContext, viewName);

         if (viewResult.View == null) {
            throw new InvalidOperationException();
         }

         using (var output = new StringWriter()) {

            var viewContext = new ViewContext(
               controllerContext,
               viewResult.View,
               new ViewDataDictionary(model),
               new TempDataDictionary(),
               output
            );

            viewResult.View.Render(viewContext, output);

            return output.ToString();
         }
      }
   }
}


text:
case foo
 in *) echo bar ;& bar) foo; esac


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Russula ferreri var. ferreri

### Remarks
null


text:
<?php

$page['title'] = getlocal("confirm.take.head");

function tpl_content() { global $page, $mibewroot;
?>

		<?php echo getlocal2("confirm.take.message",array(safe_htmlspecialchars($page['user']), safe_htmlspecialchars($page['agent']))) ?>

			<a href="<?php echo safe_htmlspecialchars($page['link']) ?>">
				<img src="<?php echo $mibewroot ?>/images/submit.gif" width="40" height="35" border="0" alt="" />
			<a href="<?php echo safe_htmlspecialchars($page['link']) ?>">
				<?php echo getlocal("confirm.take.yes") ?>
			<a href="<?php echo safe_htmlspecialchars($page['link']) ?>">
				<img src="<?php echo $mibewroot ?>/images/submitrest.gif" width="10" height="35" border="0" alt="" />

				<img src="<?php echo $mibewroot ?>/images/submit.gif" width="40" height="35" border="0" alt="" />

				<?php echo getlocal("confirm.take.no") ?>

				<img src="<?php echo $mibewroot ?>/images/submitrest.gif" width="10" height="35" border="0" alt="" />

<?php
} /* content */

require_once('inc_main.php');
?>


text:
.class Lcom/google/common/collect/RegularContiguousSet$1;
.super Lcom/google/common/collect/AbstractLinkedIterator;
.source "RegularContiguousSet.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/google/common/collect/RegularContiguousSet;->iterator()Lcom/google/common/collect/UnmodifiableIterator;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/google/common/collect/AbstractLinkedIterator",
        "<TC;>;"
    }
.end annotation

# instance fields
.field final last:Ljava/lang/Comparable;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "TC;"
        }
    .end annotation
.end field

.field final synthetic this$0:Lcom/google/common/collect/RegularContiguousSet;

# direct methods
.method constructor <init>(Lcom/google/common/collect/RegularContiguousSet;Ljava/lang/Comparable;)V
    .locals 1

    .prologue
    .line 69
    .local p0, "this":Lcom/google/common/collect/RegularContiguousSet$1;, "Lcom/google/common/collect/RegularContiguousSet.1;"
    .local p2, "x0":Ljava/lang/Comparable;, "TC;"
    iput-object p1, p0, Lcom/google/common/collect/RegularContiguousSet$1;->this$0:Lcom/google/common/collect/RegularContiguousSet;

    invoke-direct {p0, p2}, Lcom/google/common/collect/AbstractLinkedIterator;-><init>(Ljava/lang/Object;)V

    .line 70
    iget-object v0, p0, Lcom/google/common/collect/RegularContiguousSet$1;->this$0:Lcom/google/common/collect/RegularContiguousSet;

    invoke-virtual {v0}, Lcom/google/common/collect/RegularContiguousSet;->last()Ljava/lang/Comparable;

    move-result-object v0

    iput-object v0, p0, Lcom/google/common/collect/RegularContiguousSet$1;->last:Ljava/lang/Comparable;

    return-void
.end method

# virtual methods
.method protected computeNext(Ljava/lang/Comparable;)Ljava/lang/Comparable;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TC;)TC;"
        }
    .end annotation

    .prologue
    .line 74
    .local p0, "this":Lcom/google/common/collect/RegularContiguousSet$1;, "Lcom/google/common/collect/RegularContiguousSet.1;"
    .local p1, "previous":Ljava/lang/Comparable;, "TC;"
    iget-object v0, p0, Lcom/google/common/collect/RegularContiguousSet$1;->last:Ljava/lang/Comparable;

    # invokes: Lcom/google/common/collect/RegularContiguousSet;->equalsOrThrow(Ljava/lang/Comparable;Ljava/lang/Comparable;)Z
    invoke-static {p1, v0}, Lcom/google/common/collect/RegularContiguousSet;->access$000(Ljava/lang/Comparable;Ljava/lang/Comparable;)Z

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :cond_0
    iget-object v0, p0, Lcom/google/common/collect/RegularContiguousSet$1;->this$0:Lcom/google/common/collect/RegularContiguousSet;

    iget-object v0, v0, Lcom/google/common/collect/RegularContiguousSet;->domain:Lcom/google/common/collect/DiscreteDomain;

    invoke-virtual {v0, p1}, Lcom/google/common/collect/DiscreteDomain;->next(Ljava/lang/Comparable;)Ljava/lang/Comparable;

    move-result-object v0

    goto :goto_0
.end method

.method protected bridge synthetic computeNext(Ljava/lang/Object;)Ljava/lang/Object;
    .locals 1
    .param p1, "x0"    # Ljava/lang/Object;

    .prologue
    .line 69
    .local p0, "this":Lcom/google/common/collect/RegularContiguousSet$1;, "Lcom/google/common/collect/RegularContiguousSet.1;"
    check-cast p1, Ljava/lang/Comparable;

    .end local p1    # "x0":Ljava/lang/Object;
    invoke-virtual {p0, p1}, Lcom/google/common/collect/RegularContiguousSet$1;->computeNext(Ljava/lang/Comparable;)Ljava/lang/Comparable;

    move-result-object v0

    return-object v0
.end method


text:
package org.apache.cassandra.cql3.statements;

import java.util.Set;

import org.apache.cassandra.audit.AuditLogContext;
import org.apache.cassandra.audit.AuditLogEntryType;
import org.apache.cassandra.auth.IResource;
import org.apache.cassandra.auth.Permission;
import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.cql3.RoleName;
import org.apache.cassandra.exceptions.RequestExecutionException;
import org.apache.cassandra.exceptions.RequestValidationException;
import org.apache.cassandra.service.ClientState;
import org.apache.cassandra.transport.messages.ResultMessage;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

public class RevokePermissionsStatement extends PermissionsManagementStatement
{
    public RevokePermissionsStatement(Set<Permission> permissions, IResource resource, RoleName grantee)
    {
        super(permissions, resource, grantee);
    }

    public ResultMessage execute(ClientState state) throws RequestValidationException, RequestExecutionException
    {
        DatabaseDescriptor.getAuthorizer().revoke(state.getUser(), permissions, resource, grantee);
        return null;
    }

    @Override
    public String toString()
    {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }

    @Override
    public AuditLogContext getAuditLogContext()
    {
        String keyspace = resource.hasParent() ? resource.getParent().getName() : resource.getName();
        return new AuditLogContext(AuditLogEntryType.REVOKE, keyspace, resource.getName());
    }
}


text:
/*
 * Copyright [2016] [http://bmp.lightbody.net/]
 *
 * 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.browsermob.core.har;

import org.codehaus.jackson.annotate.JsonWriteNullProperties;

@JsonWriteNullProperties(value = false)
public class HarPostDataParam {

  private String name;
  private String value;
  private String fileName;
  private String contentType;

  public HarPostDataParam() {
  }

  public HarPostDataParam(String name, String value) {
    this.name = name;
    this.value = value;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getValue() {
    return value;
  }

  public void setValue(String value) {
    this.value = value;
  }

  public String getFileName() {
    return fileName;
  }

  public void setFileName(String fileName) {
    this.fileName = fileName;
  }

  public String getContentType() {
    return contentType;
  }

  public void setContentType(String contentType) {
    this.contentType = contentType;
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

  <title>standard.db.sql.ODBCDisconnect</title>
  <link href="css/style.css" rel="stylesheet" type="text/css">
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >

    Concept Framework 2.2 documentation
  	Contents | Index

standard.db.sql.ODBCDisconnect

     Name
     Version
     Deprecated

     ODBCDisconnect
     version 1.0
     no

Prototype:

boolean ODBCDisconnect([number connectionID])

Parameters:

		   	   connectionID

		   	   the ID identifying the connection as returned by ODBCDriverConnect or ODBCConnect. If this parameter is missing, this will affect the first connection

Description:

Disconnects a previously connected driver.

Returns:

Returns true if succeeded, false if failed.

Documented by Eduard Suica, generation time: Sun Jan 27 18:15:19 2013
 GMT	(c)2013 Devronium Applications