text:
package js.lang.external.highcharts;

import com.github.fluorumlabs.disconnect.core.annotations.Import;
import com.github.fluorumlabs.disconnect.core.annotations.NpmPackage;
import java.lang.String;
import javax.annotation.Nullable;
import js.extras.JsEnum;
import js.lang.Any;
import js.lang.Unknown /* ( ColorString | GradientColorObject | PatternObject ) */;
import js.lang.Unknown /* ( number | string ) */;
import org.teavm.jso.JSProperty;

/**
 * (Highcharts) An array of background items for the pane.
 *
 */
@NpmPackage(
    name = "highcharts",
    version = "^8.1.2"
)
@Import(
    module = "highcharts/es-modules/masters/highcharts.src.js"
)
public interface PaneBackgroundOptions extends Any {
  /**
   * (Highcharts) The background color or gradient for the pane.
   *
   */
  @JSProperty("backgroundColor")
  @Nullable
  Unknown /* ( ColorString | GradientColorObject | PatternObject ) */ getBackgroundColor();

  /**
   * (Highcharts) The background color or gradient for the pane.
   *
   */
  @JSProperty("backgroundColor")
  void setBackgroundColor(@Nullable PatternObject value);

  /**
   * (Highcharts) The background color or gradient for the pane.
   *
   */
  @JSProperty("backgroundColor")
  void setBackgroundColor(@Nullable String value);

  /**
   * (Highcharts) The background color or gradient for the pane.
   *
   */
  @JSProperty("backgroundColor")
  void setBackgroundColor(@Nullable GradientColorObject value);

  /**
   * (Highcharts) The pane background border color.
   *
   */
  @JSProperty("borderColor")
  @Nullable
  Unknown /* ( ColorString | GradientColorObject | PatternObject ) */ getBorderColor();

  /**
   * (Highcharts) The pane background border color.
   *
   */
  @JSProperty("borderColor")
  void setBorderColor(@Nullable PatternObject value);

  /**
   * (Highcharts) The pane background border color.
   *
   */
  @JSProperty("borderColor")
  void setBorderColor(@Nullable String value);

  /**
   * (Highcharts) The pane background border color.
   *
   */
  @JSProperty("borderColor")
  void setBorderColor(@Nullable GradientColorObject value);

  /**
   * (Highcharts) The pixel border width of the pane background.
   *
   */
  @JSProperty("borderWidth")
  double getBorderWidth();

  /**
   * (Highcharts) The pixel border width of the pane background.
   *
   */
  @JSProperty("borderWidth")
  void setBorderWidth(double value);

  /**
   * (Highcharts) The class name for this background.
   *
   */
  @JSProperty("className")
  @Nullable
  String getClassName();

  /**
   * (Highcharts) The class name for this background.
   *
   */
  @JSProperty("className")
  void setClassName(@Nullable String value);

  /**
   * (Highcharts) The inner radius of the pane background. Can be either
   * numeric (pixels) or a percentage string.
   *
   */
  @JSProperty("innerRadius")
  @Nullable
  Unknown /* ( number | string ) */ getInnerRadius();

  /**
   * (Highcharts) The inner radius of the pane background. Can be either
   * numeric (pixels) or a percentage string.
   *
   */
  @JSProperty("innerRadius")
  void setInnerRadius(double value);

  /**
   * (Highcharts) The inner radius of the pane background. Can be either
   * numeric (pixels) or a percentage string.
   *
   */
  @JSProperty("innerRadius")
  void setInnerRadius(@Nullable String value);

  /**
   * (Highcharts) The outer radius of the circular pane background. Can be
   * either numeric (pixels) or a percentage string.
   *
   */
  @JSProperty("outerRadius")
  @Nullable
  Unknown /* ( number | string ) */ getOuterRadius();

  /**
   * (Highcharts) The outer radius of the circular pane background. Can be
   * either numeric (pixels) or a percentage string.
   *
   */
  @JSProperty("outerRadius")
  void setOuterRadius(double value);

  /**
   * (Highcharts) The outer radius of the circular pane background. Can be
   * either numeric (pixels) or a percentage string.
   *
   */
  @JSProperty("outerRadius")
  void setOuterRadius(@Nullable String value);

  /**
   * (Highcharts) The shape of the pane background. When solid, the
   * background is circular. When arc, the background extends only from the
   * min to the max of the value axis.
   *
   */
  @JSProperty("shape")
  @Nullable
  Shape getShape();

  /**
   * (Highcharts) The shape of the pane background. When solid, the
   * background is circular. When arc, the background extends only from the
   * min to the max of the value axis.
   *
   */
  @JSProperty("shape")
  void setShape(@Nullable Shape value);

  static Builder builder() {
    return new Builder();
  }

  abstract class Shape extends JsEnum {
    public static final Shape ARC = JsEnum.of("arc");

    public static final Shape CIRCLE = JsEnum.of("circle");

    public static final Shape SOLID = JsEnum.of("solid");
  }

  final class Builder {
    private final PaneBackgroundOptions object = Any.empty();

    private Builder() {
    }

    public PaneBackgroundOptions build() {
      return object;
    }

    /**
     * (Highcharts) The background color or gradient for the pane.
     *
     */
    public Builder backgroundColor(@Nullable PatternObject value) {
      object.setBackgroundColor(value);
      return this;
    }

    /**
     * (Highcharts) The background color or gradient for the pane.
     *
     */
    public Builder backgroundColor(@Nullable String value) {
      object.setBackgroundColor(value);
      return this;
    }

    /**
     * (Highcharts) The background color or gradient for the pane.
     *
     */
    public Builder backgroundColor(@Nullable GradientColorObject value) {
      object.setBackgroundColor(value);
      return this;
    }

    /**
     * (Highcharts) The pane background border color.
     *
     */
    public Builder borderColor(@Nullable PatternObject value) {
      object.setBorderColor(value);
      return this;
    }

    /**
     * (Highcharts) The pane background border color.
     *
     */
    public Builder borderColor(@Nullable String value) {
      object.setBorderColor(value);
      return this;
    }

    /**
     * (Highcharts) The pane background border color.
     *
     */
    public Builder borderColor(@Nullable GradientColorObject value) {
      object.setBorderColor(value);
      return this;
    }

    /**
     * (Highcharts) The pixel border width of the pane background.
     *
     */
    public Builder borderWidth(double value) {
      object.setBorderWidth(value);
      return this;
    }

    /**
     * (Highcharts) The class name for this background.
     *
     */
    public Builder className(@Nullable String value) {
      object.setClassName(value);
      return this;
    }

    /**
     * (Highcharts) The inner radius of the pane background. Can be either
     * numeric (pixels) or a percentage string.
     *
     */
    public Builder innerRadius(double value) {
      object.setInnerRadius(value);
      return this;
    }

    /**
     * (Highcharts) The inner radius of the pane background. Can be either
     * numeric (pixels) or a percentage string.
     *
     */
    public Builder innerRadius(@Nullable String value) {
      object.setInnerRadius(value);
      return this;
    }

    /**
     * (Highcharts) The outer radius of the circular pane background. Can be
     * either numeric (pixels) or a percentage string.
     *
     */
    public Builder outerRadius(double value) {
      object.setOuterRadius(value);
      return this;
    }

    /**
     * (Highcharts) The outer radius of the circular pane background. Can be
     * either numeric (pixels) or a percentage string.
     *
     */
    public Builder outerRadius(@Nullable String value) {
      object.setOuterRadius(value);
      return this;
    }

    /**
     * (Highcharts) The shape of the pane background. When solid, the
     * background is circular. When arc, the background extends only from the
     * min to the max of the value axis.
     *
     */
    public Builder shape(@Nullable Shape value) {
      object.setShape(value);
      return this;
    }
  }
}


text:
package com.laundryguy.booking.model.entity;

import com.laundryguy.booking.model.apiRequest.BookingRequest;
import com.laundryguy.booking.model.enums.BookingStatus;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by maninder on 9/7/16.
 */
@Entity
@Table(name = "booking")
public class Booking {
    private Integer bookingId;
    private String userName;
    private String email;
    private String cell;
    private String addressId;
    private Timestamp timeSlot;
    private Double amount;
    private Integer status;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "booking_id", nullable = false, insertable = true, updatable = true)
    public Integer getBookingId() {
        return bookingId;
    }

    public void setBookingId(Integer bookingId) {
        this.bookingId = bookingId;
    }

    @Basic
    @Column(name = "user_name", nullable = true, insertable = true, updatable = true, length = 50)
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic
    @Column(name = "email", nullable = true, insertable = true, updatable = true, length = 50)
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "cell", nullable = true, insertable = true, updatable = true, length = 11)
    public String getCell() {
        return cell;
    }

    public void setCell(String cell) {
        this.cell = cell;
    }

    @Basic
    @Column(name = "addressId", nullable = true, insertable = true, updatable = true, length = 100)
    public String getAddressId() {
        return addressId;
    }

    public void setAddressId(String addressId) {
        this.addressId = addressId;
    }

    @Basic
    @Column(name = "time_slot", nullable = false, insertable = true, updatable = true)
    public Timestamp getTimeSlot() {
        return timeSlot;
    }

    public void setTimeSlot(Timestamp timeSlot) {
        this.timeSlot = timeSlot;
    }

    @Basic
    @Column(name = "amount", nullable = true, insertable = true, updatable = true, precision = 0)
    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    @Basic
    @Column(name = "status", nullable = true, insertable = true, updatable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Booking booking = (Booking) o;

        if (bookingId != null ? !bookingId.equals(booking.bookingId) : booking.bookingId != null) return false;
        if (userName != null ? !userName.equals(booking.userName) : booking.userName != null) return false;
        if (email != null ? !email.equals(booking.email) : booking.email != null) return false;
        if (cell != null ? !cell.equals(booking.cell) : booking.cell != null) return false;
        if (addressId != null ? !addressId.equals(booking.addressId) : booking.addressId != null) return false;
        if (timeSlot != null ? !timeSlot.equals(booking.timeSlot) : booking.timeSlot != null) return false;
        if (amount != null ? !amount.equals(booking.amount) : booking.amount != null) return false;
        if (status != null ? !status.equals(booking.status) : booking.status != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = bookingId != null ? bookingId.hashCode() : 0;
        result = 31 * result + (userName != null ? userName.hashCode() : 0);
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (cell != null ? cell.hashCode() : 0);
        result = 31 * result + (addressId != null ? addressId.hashCode() : 0);
        result = 31 * result + (timeSlot != null ? timeSlot.hashCode() : 0);
        result = 31 * result + (amount != null ? amount.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        return result;
    }

    public static Booking build(String email, String cell, BookingRequest bookingRequest) {
        Booking booking = new Booking();
        booking.setEmail(email);
        booking.setCell(cell);
        booking.setUserName(email);
        booking.setStatus(BookingStatus.INITIATED.getStatus());
        booking.setTimeSlot(new Timestamp(bookingRequest.getTime()));
        return booking;
    }
}

domain: java


text:
package ch.usi.dag.disl.dynamicbypass;

public final class DynamicBypass {

    private static final boolean debug = Boolean.getBoolean ("debug");

    //

    public static boolean isActive () {
        return Thread.currentThread ().bypass;
    }

    public static void activate () {
        if (debug) {
            // bypass should be disabled in this state
            if (Thread.currentThread ().bypass) {
                throw new RuntimeException (
                    "fatal error: dynamic bypass activated twice");
            }
        }

        Thread.currentThread ().bypass = true;
    }

    public static void deactivate () {
        if (debug) {
            // bypass should be enabled in this state
            if (!Thread.currentThread ().bypass) {
                throw new RuntimeException (
                    "fatal error: dynamic bypass deactivated twice");
            }
        }

        Thread.currentThread ().bypass = false;
    }

}


text:
package org.iproduct.spring.webmvc.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
public class SwaggerConfig {
    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .build();
    }
}


text:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.jackrabbit.oak.run;

import org.apache.jackrabbit.oak.benchmark.LuceneBenchmarkRunner;
import org.apache.jackrabbit.oak.run.commons.Command;

public class BenchmarkLuceneCommand implements Command {

    @Override
    public void execute(String... args) throws Exception {
        LuceneBenchmarkRunner.main(args);
    }
}


text:
/*

MIT License

Copyright (c) 2021 TensorFlow

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

* */

package com.uca.reconobookapp.utils;

import android.util.Log;

import java.util.HashSet;
import java.util.Set;

public final class Logger {
    private static final String DEFAULT_TAG = "tensorflow";
    private static final int DEFAULT_MIN_LOG_LEVEL = Log.DEBUG;

    // Classes to be ignored when examining the stack trace
    private static final Set<String> IGNORED_CLASS_NAMES;

    static {
        IGNORED_CLASS_NAMES = new HashSet<String>(3);
        IGNORED_CLASS_NAMES.add("dalvik.system.VMStack");
        IGNORED_CLASS_NAMES.add("java.lang.Thread");
        IGNORED_CLASS_NAMES.add(Logger.class.getCanonicalName());
    }

    private final String tag;
    private final String messagePrefix;
    private int minLogLevel = DEFAULT_MIN_LOG_LEVEL;

    public Logger(final Class<?> clazz) {
        this(clazz.getSimpleName());
    }

    public Logger(final String messagePrefix) {
        this(DEFAULT_TAG, messagePrefix);
    }

    public Logger(final String tag, final String messagePrefix) {
        this.tag = tag;
        final String prefix = messagePrefix == null ? getCallerSimpleName() : messagePrefix;
        this.messagePrefix = (prefix.length() > 0) ? prefix + ": " : prefix;
    }

    /** Creates a Logger using the caller's class name as the message prefix. */
    public Logger() {
        this(DEFAULT_TAG, null);
    }

    /** Creates a Logger using the caller's class name as the message prefix. */
    public Logger(final int minLogLevel) {
        this(DEFAULT_TAG, null);
        this.minLogLevel = minLogLevel;
    }

    private static String getCallerSimpleName() {
        // Get the current callstack so we can pull the class of the caller off of it.
        final StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();

        for (final StackTraceElement elem : stackTrace) {
            final String className = elem.getClassName();
            if (!IGNORED_CLASS_NAMES.contains(className)) {
                // We're only interested in the simple name of the class, not the complete package.
                final String[] classParts = className.split("\\.");
                return classParts[classParts.length - 1];
            }
        }

        return Logger.class.getSimpleName();
    }

    public void setMinLogLevel(final int minLogLevel) {
        this.minLogLevel = minLogLevel;
    }

    public boolean isLoggable(final int logLevel) {
        return logLevel >= minLogLevel || Log.isLoggable(tag, logLevel);
    }

    private String toMessage(final String format, final Object... args) {
        return messagePrefix + (args.length > 0 ? String.format(format, args) : format);
    }

    public void v(final String format, final Object... args) {
        if (isLoggable(Log.VERBOSE)) {
            Log.v(tag, toMessage(format, args));
        }
    }

    public void v(final Throwable t, final String format, final Object... args) {
        if (isLoggable(Log.VERBOSE)) {
            Log.v(tag, toMessage(format, args), t);
        }
    }

    public void d(final String format, final Object... args) {
        if (isLoggable(Log.DEBUG)) {
            Log.d(tag, toMessage(format, args));
        }
    }

    public void d(final Throwable t, final String format, final Object... args) {
        if (isLoggable(Log.DEBUG)) {
            Log.d(tag, toMessage(format, args), t);
        }
    }

    public void i(final String format, final Object... args) {
        if (isLoggable(Log.INFO)) {
            Log.i(tag, toMessage(format, args));
        }
    }

    public void i(final Throwable t, final String format, final Object... args) {
        if (isLoggable(Log.INFO)) {
            Log.i(tag, toMessage(format, args), t);
        }
    }

    public void w(final String format, final Object... args) {
        if (isLoggable(Log.WARN)) {
            Log.w(tag, toMessage(format, args));
        }
    }

    public void w(final Throwable t, final String format, final Object... args) {
        if (isLoggable(Log.WARN)) {
            Log.w(tag, toMessage(format, args), t);
        }
    }

    public void e(final String format, final Object... args) {
        if (isLoggable(Log.ERROR)) {
            Log.e(tag, toMessage(format, args));
        }
    }

    public void e(final Throwable t, final String format, final Object... args) {
        if (isLoggable(Log.ERROR)) {
            Log.e(tag, toMessage(format, args), t);
        }
    }
}


text:
/*
 * Copyright (C) 2015-2022 Objectos Software LTDA.
 *
 * 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 br.com.objectos.html.boot.spec;

public class RootElementSpec implements AttributeDsl<RootElementSpec> {

  private final SpecDsl dsl;

  private AttributeSpec attribute;

  RootElementSpec(SpecDsl dsl) {
    this.dsl = dsl;
  }

  @Override
  public final AttributeDsl<RootElementSpec> as(String... alternatives) {
    attribute.as(alternatives);
    return this;
  }

  @Override
  public final AttributeDsl<RootElementSpec> attribute(String name) {
    stringKindIfNecessary();
    attribute = dsl.globalAttribute(name);
    return this;
  }

  @Override
  public final RootElementSpec attributeEnd() {
    stringKindIfNecessary();
    return this;
  }

  @Override
  public final RootElementSpec booleanType() {
    setKind(AttributeKind.BOOLEAN);
    return this;
  }

  @Override
  public final RootElementSpec classNameType() {
    attribute.addKind(AttributeKind.STRING);
    setKind(AttributeKind.CLASS_NAME);
    return this;
  }

  @Override
  public final RootElementSpec idType() {
    attribute.addKind(AttributeKind.STRING);
    setKind(AttributeKind.ID);
    return this;
  }

  private void stringKindIfNecessary() {
    if (attribute != null) {
      setKind(AttributeKind.STRING);
    }
  }

  private void setKind(AttributeKind kind) {
    attribute.addKind(kind);
    attribute = null;
  }

}


text:
/*
 * Copyright 2020 Google LLC
 *
 * 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
 *
 *     https://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.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/dialogflow/v2beta1/entity_type.proto

package com.google.cloud.dialogflow.v2beta1;

public interface BatchUpdateEntityTypesRequestOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * Required. The name of the agent to update or create entity types in.
   * Format: `projects/<Project ID>/agent`.
   *

   *
   * string parent = 1;
   *
   * @return The parent.
   */
  java.lang.String getParent();
  /**
   *
   *
   *

   * Required. The name of the agent to update or create entity types in.
   * Format: `projects/<Project ID>/agent`.
   *

   *
   * string parent = 1;
   *
   * @return The bytes for parent.
   */
  com.google.protobuf.ByteString getParentBytes();

  /**
   *
   *
   *

   * The URI to a Google Cloud Storage file containing entity types to update
   * or create. The file format can either be a serialized proto (of
   * EntityBatch type) or a JSON object. Note: The URI must start with
   * "gs://".
   *

   *
   * string entity_type_batch_uri = 2;
   *
   * @return The entityTypeBatchUri.
   */
  java.lang.String getEntityTypeBatchUri();
  /**
   *
   *
   *

   * The URI to a Google Cloud Storage file containing entity types to update
   * or create. The file format can either be a serialized proto (of
   * EntityBatch type) or a JSON object. Note: The URI must start with
   * "gs://".
   *

   *
   * string entity_type_batch_uri = 2;
   *
   * @return The bytes for entityTypeBatchUri.
   */
  com.google.protobuf.ByteString getEntityTypeBatchUriBytes();

  /**
   *
   *
   *

   * The collection of entity types to update or create.
   *

   *
   * .google.cloud.dialogflow.v2beta1.EntityTypeBatch entity_type_batch_inline = 3;
   *
   * @return Whether the entityTypeBatchInline field is set.
   */
  boolean hasEntityTypeBatchInline();
  /**
   *
   *
   *

   * The collection of entity types to update or create.
   *

   *
   * .google.cloud.dialogflow.v2beta1.EntityTypeBatch entity_type_batch_inline = 3;
   *
   * @return The entityTypeBatchInline.
   */
  com.google.cloud.dialogflow.v2beta1.EntityTypeBatch getEntityTypeBatchInline();
  /**
   *
   *
   *

   * The collection of entity types to update or create.
   *

   *
   * .google.cloud.dialogflow.v2beta1.EntityTypeBatch entity_type_batch_inline = 3;
   */
  com.google.cloud.dialogflow.v2beta1.EntityTypeBatchOrBuilder getEntityTypeBatchInlineOrBuilder();

  /**
   *
   *
   *

   * Optional. The language used to access language-specific data.
   * If not specified, the agent's default language is used.
   * For more information, see
   * [Multilingual intent and entity
   * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
   *

   *
   * string language_code = 4 [(.google.api.field_behavior) = OPTIONAL];
   *
   * @return The languageCode.
   */
  java.lang.String getLanguageCode();
  /**
   *
   *
   *

   * Optional. The language used to access language-specific data.
   * If not specified, the agent's default language is used.
   * For more information, see
   * [Multilingual intent and entity
   * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
   *

   *
   * string language_code = 4 [(.google.api.field_behavior) = OPTIONAL];
   *
   * @return The bytes for languageCode.
   */
  com.google.protobuf.ByteString getLanguageCodeBytes();

  /**
   *
   *
   *

   * Optional. The mask to control which fields get updated.
   *

   *
   * .google.protobuf.FieldMask update_mask = 5;
   *
   * @return Whether the updateMask field is set.
   */
  boolean hasUpdateMask();
  /**
   *
   *
   *

   * Optional. The mask to control which fields get updated.
   *

   *
   * .google.protobuf.FieldMask update_mask = 5;
   *
   * @return The updateMask.
   */
  com.google.protobuf.FieldMask getUpdateMask();
  /**
   *
   *
   *

   * Optional. The mask to control which fields get updated.
   *

   *
   * .google.protobuf.FieldMask update_mask = 5;
   */
  com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder();

  public com.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest.EntityTypeBatchCase
      getEntityTypeBatchCase();
}


text:
package org.openelisglobal.workplan.controller;

import java.io.File;
import java.util.HashMap;
import java.util.List;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.openelisglobal.common.controller.BaseController;
import org.openelisglobal.common.log.LogEvent;
import org.openelisglobal.test.service.TestServiceImpl;
import org.openelisglobal.workplan.form.WorkplanForm;
import org.openelisglobal.workplan.form.WorkplanForm.PrintWorkplan;
import org.openelisglobal.workplan.reports.ElisaWorkplanReport;
import org.openelisglobal.workplan.reports.IWorkplanReport;
import org.openelisglobal.workplan.reports.TestSectionWorkplanReport;
import org.openelisglobal.workplan.reports.TestWorkplanReport;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import net.sf.jasperreports.engine.JRDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperRunManager;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;

@Controller
public class PrintWorkplanReportController extends BaseController {

    private static IWorkplanReport workplanReport;
    private String reportPath;

    @RequestMapping(value = "/PrintWorkplanReport", method = RequestMethod.POST)
    public void showPrintWorkplanReport(HttpServletRequest request, HttpServletResponse response,
            @ModelAttribute("form") @Validated(PrintWorkplan.class) WorkplanForm form, BindingResult result) {
        if (result.hasErrors()) {
            writeErrorsToResponse(result, response);
            return;
        }

        request.getSession().setAttribute(SAVE_DISABLED, "true");

        String workplanType = form.getString("workplanType");
        String workplanName;

        if (workplanType.equals("test")) {
            String testID = (String) form.get("testTypeID");
            workplanName = getTestTypeName(testID);
        } else {
            workplanType = Character.toUpperCase(workplanType.charAt(0)) + workplanType.substring(1);
            workplanName = form.getString("testName");
        }

        // get workplan report based on testName
        workplanReport = getWorkplanReport(workplanType, workplanName);

        workplanReport.setReportPath(getReportPath());

        // set jasper report parameters
        HashMap<String, Object> parameterMap = workplanReport.getParameters();

        // prepare report
        List<?> workplanRows = workplanReport.prepareRows(form);

        // set Jasper report file name
        String reportFileName = workplanReport.getFileName();
        ClassLoader classLoader = getClass().getClassLoader();
        File reportFile = new File(classLoader.getResource("reports/" + reportFileName + ".jasper").getFile());

        try {

            byte[] bytes = null;

            JRDataSource dataSource = createReportDataSource(workplanRows);
            bytes = JasperRunManager.runReportToPdf(reportFile.getAbsolutePath(), parameterMap, dataSource);

            ServletOutputStream servletOutputStream = response.getOutputStream();
            response.setContentType("application/pdf");
            response.setContentLength(bytes.length);
            String downloadFilename = "WorkplanReport";
            response.setHeader("Content-Disposition", "filename=\"" + downloadFilename + ".pdf\"");

            servletOutputStream.write(bytes, 0, bytes.length);
            servletOutputStream.flush();
            servletOutputStream.close();

        } catch (JRException jre) {
            LogEvent.logError("PringWorkplanReportAction", "processRequest()", jre.toString());
            result.reject("error.jasper", "error.jasper");
        } catch (Exception e) {
            LogEvent.logError("PrintWorkplanReportAction", "processRequest()", e.toString());
            result.reject("error.jasper", "error.jasper");
        }

        if (result.hasErrors()) {
            saveErrors(result);
        }
    }

    private JRDataSource createReportDataSource(List<?> includedTests) {
        JRBeanCollectionDataSource dataSource;
        dataSource = new JRBeanCollectionDataSource(includedTests);

        return dataSource;
    }

    private String getTestTypeName(String id) {
        return TestServiceImpl.getUserLocalizedTestName(id);
    }

    public IWorkplanReport getWorkplanReport(String testType, String name) {

        IWorkplanReport workplan;

        if ("test".equals(testType)) {
            workplan = new TestWorkplanReport(name);
        } else if ("Serology".equals(testType)) {
            workplan = new ElisaWorkplanReport(name);
        } else {
            workplan = new TestSectionWorkplanReport(name);
        }

        return workplan;
    }

    public String getReportPath() {
        if (reportPath == null) {
            ClassLoader classLoader = getClass().getClassLoader();
            File reportFile = new File(classLoader.getResource("reports/").getFile());
            reportPath = reportFile.getAbsolutePath();
        }
        return reportPath;
    }

    @Override
    protected String findLocalForward(String forward) {
        if (FWD_SUCCESS.equals(forward)) {
            return "homePageDefinition";
        } else {
            return "PageNotFound";
        }
    }

    @Override
    protected String getPageSubtitleKey() {
        return "workplan.title";
    }

    @Override
    protected String getPageTitleKey() {
        return "workplan.title";
    }
}


text:
/**
 *
 */
package cl.zpricing.avant.web.administrators;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import cl.zpricing.avant.model.Parametro;
import cl.zpricing.avant.servicios.ServiciosRevenueManager;

/**
 * Controlador para el Administrador de Parametros
 *
 * Registro de versiones:
 *

 *
1.0 08-01-2009 MARIO: versi�n inicial.

 *

 *

 *  Todos los derechos reservados por ZhetaPricing.
 *

 */

public class ParametroController implements Controller {

	/**
	 * Impresi�n de log.
	 */
	private Logger log = (Logger) Logger.getLogger(this.getClass());

	private ServiciosRevenueManager serviciosRM;

	/**
	 * @return the serviciosRevenueManager
	 */
	public ServiciosRevenueManager getServiciosRM() {
		return serviciosRM;
	}

	/**
	 * @param serviciosRevenueManager the serviciosRevenueManager to set
	 */
	public void setServiciosRM(
			ServiciosRevenueManager serviciosRevenueManager) {
		this.serviciosRM = serviciosRevenueManager;
	}

	/* (non-Javadoc)
	 * @see org.springframework.web.servlet.mvc.SimpleFormController#referenceData(javax.servlet.http.HttpServletRequest, java.lang.Object, org.springframework.validation.Errors)
	 */
	@Override
	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
		log.debug("handleRequest...");
		log.debug("Sistema Parameter: " + request.getParameter("Sistema"));

		Map<String, Object> map = new HashMap<String, Object>();
		String sistema = request.getParameter("Sistema");
		ArrayList<String> sistemas = serviciosRM.obtenerSistemas();
		log.debug("sistemas" + sistemas.toString());
		map.put("sistemas", sistemas);

		if(sistema == null) {
			sistema = sistemas.get(0);
		}

		ArrayList<Parametro> parametros = new ArrayList<Parametro>();
		parametros = serviciosRM.obtenerParametro(sistema);
		log.debug("parametros: " + parametros.toString());
		map.put("parametros", parametros);
		ModelAndView mv = new ModelAndView("parametro", map);
		mv.addObject("sistema",sistema);
		mv.addObject("parametro", true);

		return mv;

	}

}


text:
package org.apache.maven.plugins.jira;

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import java.util.Collections;
import java.util.List;

import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
import org.apache.maven.artifact.repository.MavenArtifactRepository;
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
import org.apache.maven.plugin.testing.stubs.MavenProjectStub;

/**
 * @version $Id$
 */
public class JiraUnicodeTestProjectStub
    extends MavenProjectStub
{

    /** {@inheritDoc} */
    @Override
    public List<ArtifactRepository> getRemoteArtifactRepositories()
    {
        ArtifactRepositoryPolicy policy =
            new ArtifactRepositoryPolicy( true, ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS,
                                          ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE );
        ArtifactRepository repository = new MavenArtifactRepository( "central", "https://repo.maven.apache.org/maven2",
                                                                     new DefaultRepositoryLayout(), policy, policy );

        return Collections.singletonList( repository );
    }

}


text:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.jackrabbit.oak.exercise.security.principal;

import java.security.Principal;
import java.security.acl.Group;
import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterators;
import org.apache.jackrabbit.oak.spi.security.principal.PrincipalProvider;

/**
 * Custom principal provider that only knows of a predefined set of principals
 * and their group membership.
 *
 * EXERCISE: complete the implemenation
 */
class CustomPrincipalProvider implements PrincipalProvider {

    private final Set knownPrincipalNames;

    CustomPrincipalProvider(String[] knownPrincipalNames) {
        this.knownPrincipalNames = ImmutableSet.copyOf(knownPrincipalNames);
    }

    @Override
    public Principal getPrincipal(@Nonnull String principalName) {
        // EXERCISE: complete
        return null;
    }

    @Nonnull
    @Override
    public Set<Group> getGroupMembership(@Nonnull Principal principal) {
        // EXERCISE : expose the group membership of your known Principals
        // EXERCISE : add every other principal into one of your known-principal-groups to establish dynamic group membership
        return Collections.EMPTY_SET;
    }

    @Nonnull
    @Override
    public Set<? extends Principal> getPrincipals(@Nonnull String userID) {
        // EXERCISE : expose the principal-sets of your known principals
        // EXERCISE : add every other principal into one of your known-principal-groups to establish dynamic group membership
        return Collections.EMPTY_SET;
    }

    @Nonnull
    @Override
    public Iterator<? extends Principal> findPrincipals(@Nullable String nameHint, int searchType) {
        // EXERCISE
        return Iterators.emptyIterator();
    }

    @Nonnull
    @Override
    public Iterator<? extends Principal> findPrincipals(int searchType) {
        // EXERCISE
        return Iterators.emptyIterator();
    }
}


text:
/*
 * Copyright (c) 2008-2016 Computer Network Information Center (CNIC), Chinese Academy of Sciences.
 *
 * This file is part of Duckling project.
 *
 * 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.apache.pluto.driver.config.db;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import org.apache.pluto.driver.services.portal.PageConfig;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.core.RowMapper;

import cn.vlabs.duckling.util.ContainerBaseDAO;

/**
 * Introduction Here.
 * @date Mar 4, 2010
 * @author xiejj@cnic.cn
 */
public class PortalPageProvider extends ContainerBaseDAO {
	private static final String queryPage = "select * from vwb_portal_page where siteId=? and resourceId=?";
	private static final String queryAll = "select * from vwb_portal_page where siteId=?";
	private static final String removePage = "delete from vwb_portal_page where siteId=? and resourceId=?";
	private static final String insertPage="insert into vwb_portal_page(siteId,resourceId, title, uri) values(?,?, ?,?)";
	private static final String existPage = "select count(*) from vwb_portal_page where siteId=? and resourceId=?";
	private static final String updatePage = "update vwb_portal_page set title=?, uri=? where siteId=? and resourceId=?";
	private static final String selectPages = "select * from vwb_portal_page where siteId=? and resourceId in";
	public PageConfig getPageConfig(int siteId,int resourcId){
		return (PageConfig)getJdbcTemplate().query(queryPage, new Object[]{siteId,resourcId}, new ResultSetExtractor(){
			public Object extractData(ResultSet rs) throws SQLException, DataAccessException {
				if (rs.next())
					return readPageConfig(rs);
				else
					return null;
			}
		});
	}
	public void removePage(int siteId,int resourceId){
		getJdbcTemplate().update(removePage, new Object[]{siteId,resourceId});
	}
	public void creatPage(int siteId, PageConfig page){
		getJdbcTemplate().update(insertPage, new Object[]{siteId,page.getResourceId(),page.getTitle(), page.getUri()});
	}

	public void updatePage(int siteId,PageConfig page) {
		getJdbcTemplate().update(updatePage, new Object[]{page.getTitle(), page.getUri(),siteId, page.getResourceId()});
	}

	@SuppressWarnings("unchecked")
	public List<PageConfig> getAllPages(int siteId){
		return getJdbcTemplate().query(queryAll,new Object[]{siteId}, new RowMapper(){
			public Object mapRow(ResultSet rs, int i) throws SQLException {
				return readPageConfig(rs);
			}

		});
	}
	public boolean pageExist(int siteId,int resourceId){
		return getJdbcTemplate().queryForInt(existPage, new Object[]{siteId,resourceId})>0;
	}
	private PageConfig readPageConfig(ResultSet rs) throws SQLException {
		PageConfig config = new PageConfig();
		config.setTitle(rs.getString("title"));
		config.setUri(rs.getString("uri"));
		config.setResourceId(rs.getInt("resourceId"));
		return config;
	}

	@SuppressWarnings("unchecked")
	public List<PageConfig> getAppPages(int siteId, List<Integer> pageids) {
		String sql = selectPages+set2Sql(pageids);
		return (List<PageConfig>)getJdbcTemplate().query(sql,new Object[]{siteId}, new RowMapper(){
			public Object mapRow(final ResultSet rs, final int index) throws SQLException {
				return readPageConfig(rs);
			}
		});
	}
	private String set2Sql(List<Integer> ids){
		String sql = "(";
		boolean first=true;
		for (Integer id:ids){
			if (!first){
				sql+=","+id;
			}else{
				sql+=id;
				first=false;
			}
		}
		sql+=")";
		return sql;
	}
}


text:
package com.example.binstagram.activities;

import android.annotation.TargetApi;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.Toolbar;

import com.example.binstagram.R;
import com.example.binstagram.models.Post;
import com.parse.ParseException;
import com.parse.ParseFile;
import com.parse.ParseUser;
import com.parse.SaveCallback;

import org.json.JSONArray;

import java.io.File;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class CaptionActivity extends AppCompatActivity {

    @BindView(R.id.ivImagePreview)
    ImageView ivImagePreview;

    @BindView(R.id.etConfirmDescription)
    EditText etDescription;

    @BindView(R.id.btnConfirmPost)
    Button btnConfirmPost;

    @BindView(R.id.toolbar)
    Toolbar toolbar;

    @BindView(R.id.progressBar)
    ProgressBar progressBar;

    private File imageFile;

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_caption);
        ButterKnife.bind(this);

        progressBar.setVisibility(View.INVISIBLE);

        setActionBar(toolbar);
        if(getActionBar() != null)
            getActionBar().setDisplayShowTitleEnabled(false);

        if(getIntent().getExtras() != null) {
            imageFile = (File) getIntent().getExtras().get("image");
            setPreviewImage();
        }
    }

    private void setPreviewImage() {
        Bitmap myBitmap = BitmapFactory.decodeFile(imageFile.getAbsolutePath());
        ivImagePreview.setImageBitmap(myBitmap);
    }

    @OnClick(R.id.btnConfirmPost)
    public void confirmPost() {
        progressBar.setVisibility(View.VISIBLE);
        createPost(etDescription.getText().toString(), new ParseFile(imageFile),
                ParseUser.getCurrentUser(), progressBar);
    }

    private void createPost(String description, ParseFile image, ParseUser user,
                            final ProgressBar progressBar) {
        Post newPost = new Post();
        newPost.setDescription(description);
        newPost.setImage(image);
        newPost.setUser(user);
        newPost.put("comments", new JSONArray());
        newPost.put("likedBy", new JSONArray());

        newPost.saveInBackground(new SaveCallback() {
            @Override
            public void done(ParseException e) {
                if (e == null) {
                    progressBar.setVisibility(View.INVISIBLE);
                    startActivity(new Intent(CaptionActivity.this, HomeActivity.class));
                    finish();
                } else {
                    e.printStackTrace();
                }
            }
        });
    }
}


text:
package co.cloudify.jenkins.plugin;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.net.URL;
import java.nio.file.Files;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import co.cloudify.rest.client.BlueprintsClient;
import co.cloudify.rest.model.Blueprint;

/**
 * This class encapsulates all information required to upload a blueprint. It was designed
 * to cope with the fact that certain blueprint uploads would require additional resources
 * and those resources require cleanup, implying that using {@link AutoCloseable} would
 * probably be beneficial.
 *
 * @author Isaac Shabtay
 */
public class BlueprintUploadSpec implements Serializable, AutoCloseable {
    /** Serialization UID. */
    private static final long serialVersionUID = 1L;

    private static final Logger logger = LoggerFactory.getLogger(BlueprintUploadSpec.class);

    private static final String BLUEPRINT_FILE_NAME = "blueprint.yaml";

    private URL archiveUrl;
    private File archivePath;
    private String mainFileName;
    private String blueprintResourceName;
    private File tempBlueprintDir;

    public BlueprintUploadSpec(final URL archiveUrl, final String mainFileName) {
        Validate.notNull(archiveUrl);
        Validate.notEmpty(mainFileName);
        this.archiveUrl = archiveUrl;
        this.mainFileName = mainFileName;
    }

    public BlueprintUploadSpec(final File archivePath, final String mainFileName) {
        Validate.notNull(archivePath);
        Validate.notEmpty(mainFileName);
        this.archivePath = archivePath;
        this.mainFileName = mainFileName;
    }

    public BlueprintUploadSpec(final String blueprintResourceName) {
        Validate.notNull(blueprintResourceName);
        this.blueprintResourceName = blueprintResourceName;
    }

    public Blueprint upload(final BlueprintsClient client, final String id) throws IOException {
        if (blueprintResourceName != null) {
            tempBlueprintDir = Files.createTempDirectory("cfy").toFile();
            logger.info("Created temporary directory: {}", tempBlueprintDir);
            File blueprintPath = new File(tempBlueprintDir, BLUEPRINT_FILE_NAME);
            try (InputStream resourceAsStream = BlueprintUploadSpec.class.getResourceAsStream(blueprintResourceName)) {
                if (resourceAsStream == null) {
                    throw new RuntimeException(
                            String.format("Failed locating blueprint resource: %s", blueprintResourceName));
                }
                Files.copy(resourceAsStream, blueprintPath.toPath());
            }

            return client.upload(id, tempBlueprintDir, BLUEPRINT_FILE_NAME);
        }
        if (archiveUrl != null) {
            logger.info("Uploading blueprint '{}' from {}, main filename: {}", id, archiveUrl, mainFileName);
            return client.upload(id, archiveUrl, mainFileName);
        }
        return client.uploadArchive(id, archivePath, mainFileName);
    }

    @Override
    public void close() throws Exception {
        if (tempBlueprintDir != null) {
            // A temporary directory was created for uploading this.
            // So delete it.
            logger.info("Deleting temporary directory: {}", tempBlueprintDir);
            FileUtils.deleteDirectory(tempBlueprintDir);
        }
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("archiveUrl", archiveUrl)
                .append("archivePath", archivePath)
                .append("blueprintResourceName", blueprintResourceName)
                .append("mainFileName", mainFileName)
                .toString();
    }
}


text:
package org.iotivity.oc;

import org.iotivity.*;

public class OcRepresentation {

    private OCRepresentation nativeRepresentation;

    public OcRepresentation(OCRepresentation nativeRep) {
        if (nativeRep == null) {
            throw new IllegalArgumentException("Native OCRepresentation cannot be null");
        }
        nativeRepresentation = nativeRep;
    }

    // for unit testing only
    static public OcRepresentation createOcRepresentaionFromRoot() throws OcCborException {
        OCRepresentation nativeRep = OCRep.getOCRepresentaionFromRootObject();
        if (nativeRep != null) {
            return new OcRepresentation(nativeRep);
        }
        throw new OcCborException("Failed to create OcRepresentation from root object");
    }

    public String getKey() {
        return nativeRepresentation.getName();
    }

    public OCType getType() {
        return nativeRepresentation.getType();
    }

    public boolean getBoolean() throws OcCborException {
        Boolean returnValue = getValue().getBool();
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get boolean");
    }

    public long getLong() throws OcCborException {
        Long returnValue = getValue().getInteger();
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get long");
    }

    public double getDouble() throws OcCborException {
        Double returnValue = getValue().getDouble();
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get double");
    }

    public String getString() throws OcCborException {
        String returnValue = getValue().getString();
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get string");
    }

    public OCArray getArray() throws OcCborException {
        OCArray returnValue = getValue().getArray();
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get array");
    }

    public OcRepresentation getObject() throws OcCborException {
        OCRepresentation nativeRep = getValue().getObject();
        if (nativeRep != null) {
            return new OcRepresentation(nativeRep);
        }
        throw new OcCborException("Failed to get object");
    }

    public OcRepresentation getObjectArray() throws OcCborException {
        OCRepresentation nativeRep = getValue().getObjectArray();
        if (nativeRep != null) {
            return new OcRepresentation(nativeRep);
        }
        throw new OcCborException("Failed to get object array");
    }

    public OCValue getValue() throws OcCborException {
        OCValue returnValue = nativeRepresentation.getValue();
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get value");
    }

    public boolean getBoolean(String key) throws OcCborException {
        Boolean returnValue = OCRep.getBoolean(nativeRepresentation, key);
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get boolean for key " + key);
    }

    public long getLong(String key) throws OcCborException {
        Long returnValue = OCRep.getLong(nativeRepresentation, key);
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get long for key " + key);
    }

    public double getDouble(String key) throws OcCborException {
        Double returnValue = OCRep.getDouble(nativeRepresentation, key);
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get double for key " + key);
    }

    public String getString(String key) throws OcCborException {
        String returnValue = OCRep.getString(nativeRepresentation, key);
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get string for key " + key);
    }

    public byte[] getByteString(String key) throws OcCborException {
        byte[] returnValue = OCRep.getByteString(nativeRepresentation, key);
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get byte string for key " + key);
    }

    public OcRepresentation getObject(String key) throws OcCborException {
        OCRepresentation nativeRep = OCRep.getObject(nativeRepresentation, key);
        if (nativeRep != null) {
            return new OcRepresentation(nativeRep);
        }
        throw new OcCborException("Failed to get object for key " + key);
    }

    public boolean[] getBooleanArray(String key) throws OcCborException {
        boolean[] returnValue = OCRep.getBooleanArray(nativeRepresentation, key);
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get boolean array for key " + key);
    }

    public long[] getLongArray(String key) throws OcCborException {
        long[] returnValue = OCRep.getLongArray(nativeRepresentation, key);
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get long array for key " + key);
    }

    public double[] getDoubleArray(String key) throws OcCborException {
        double[] returnValue = OCRep.getDoubleArray(nativeRepresentation, key);
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get double array for key " + key);
    }

    public String[] getStringArray(String key) throws OcCborException {
        String[] returnValue = OCRep.getStringArray(nativeRepresentation, key);
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get string array for key " + key);
    }

    public byte[][] getByteStringArray(String key) throws OcCborException {
        byte[][] returnValue = OCRep.getByteStringArray(nativeRepresentation, key);
        if (returnValue != null) {
            return returnValue;
        }
        throw new OcCborException("Failed to get byte string array for key " + key);
    }

    public OcRepresentation getObjectArray(String key) throws OcCborException {
        OCRepresentation nativeRep = OCRep.getObjectArray(nativeRepresentation, key);
        if (nativeRep != null) {
            return new OcRepresentation(nativeRep);
        }
        throw new OcCborException("Failed to get object array for key " + key);
    }

    public OcRepresentation getNext() {
        OCRepresentation nativeRep = nativeRepresentation.getNext();
        if (nativeRep != null) {
            return new OcRepresentation(nativeRep);
        }
        return null;
    }
}


text:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.hop.pipeline.engines.remote;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.vfs2.FileObject;
import org.apache.hop.core.parameters.INamedParameterDefinitions;
import org.apache.hop.core.parameters.INamedParameters;
import org.apache.hop.server.HopServer;
import org.apache.hop.core.Const;
import org.apache.hop.core.IRowSet;
import org.apache.hop.core.Result;
import org.apache.hop.core.exception.HopException;
import org.apache.hop.core.logging.ILogChannel;
import org.apache.hop.core.logging.ILoggingObject;
import org.apache.hop.core.logging.LogChannel;
import org.apache.hop.core.logging.LogLevel;
import org.apache.hop.core.logging.LoggingObject;
import org.apache.hop.core.logging.LoggingObjectType;
import org.apache.hop.core.metadata.SerializableMetadataProvider;
import org.apache.hop.core.parameters.DuplicateParamException;
import org.apache.hop.core.parameters.NamedParameters;
import org.apache.hop.core.parameters.UnknownParamException;
import org.apache.hop.core.row.RowBuffer;
import org.apache.hop.core.util.Utils;
import org.apache.hop.core.variables.IVariables;
import org.apache.hop.core.variables.Variables;
import org.apache.hop.core.vfs.HopVfs;
import org.apache.hop.core.xml.XmlHandler;
import org.apache.hop.metadata.api.IHopMetadataProvider;
import org.apache.hop.pipeline.IExecutionFinishedListener;
import org.apache.hop.pipeline.IExecutionStartedListener;
import org.apache.hop.pipeline.IExecutionStoppedListener;
import org.apache.hop.pipeline.Pipeline;
import org.apache.hop.pipeline.PipelineConfiguration;
import org.apache.hop.pipeline.PipelineExecutionConfiguration;
import org.apache.hop.pipeline.PipelineMeta;
import org.apache.hop.pipeline.config.IPipelineEngineRunConfiguration;
import org.apache.hop.pipeline.config.PipelineRunConfiguration;
import org.apache.hop.pipeline.engine.EngineComponent;
import org.apache.hop.pipeline.engine.EngineComponent.ComponentExecutionStatus;
import org.apache.hop.pipeline.engine.EngineMetrics;
import org.apache.hop.pipeline.engine.IEngineComponent;
import org.apache.hop.pipeline.engine.IPipelineComponentRowsReceived;
import org.apache.hop.pipeline.engine.IPipelineEngine;
import org.apache.hop.pipeline.engine.PipelineEngineCapabilities;
import org.apache.hop.pipeline.engine.PipelineEnginePlugin;
import org.apache.hop.pipeline.transform.TransformStatus;
import org.apache.hop.resource.ResourceUtil;
import org.apache.hop.resource.TopLevelResource;
import org.apache.hop.workflow.WorkflowMeta;
import org.apache.hop.workflow.engine.IWorkflowEngine;
import org.apache.hop.www.PrepareExecutionPipelineServlet;
import org.apache.hop.www.RegisterPackageServlet;
import org.apache.hop.www.RegisterPipelineServlet;
import org.apache.hop.www.HopServerPipelineStatus;
import org.apache.hop.www.SniffTransformServlet;
import org.apache.hop.www.StartExecutionPipelineServlet;
import org.apache.hop.www.WebResult;
import org.w3c.dom.Node;

import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;

@PipelineEnginePlugin(
  id = "Remote",
  name = "Hop remote pipeline engine",
  description = "Executes your pipeline on a remote Hop server"
)
public class RemotePipelineEngine extends Variables implements IPipelineEngine<PipelineMeta> {

  /**
   * Constant specifying a filename containing XML to inject into a ZIP file created during resource export.
   */
  public static final String CONFIGURATION_IN_EXPORT_FILENAME = "__pipeline_execution_configuration__.xml";
  private final PipelineEngineCapabilities engineCapabilities;

  protected PipelineMeta subject;
  protected String pluginId;
  protected PipelineRunConfiguration pipelineRunConfiguration;
  protected boolean preparing;
  protected boolean readyToStart;
  protected boolean running;
  protected boolean finished;
  protected boolean stopped;
  protected boolean paused;
  protected boolean hasHaltedComponents;
  protected boolean preview;
  protected int errors;
  protected IHopMetadataProvider metadataProvider;
  protected ILogChannel logChannel;
  protected ILoggingObject loggingObject;
  protected EngineMetrics engineMetrics;
  protected Result previousResult;

  protected HopServer hopServer;

  protected ILoggingObject parent;
  protected IPipelineEngine parentPipeline;
  protected IWorkflowEngine<WorkflowMeta> parentWorkflow;
  protected LogLevel logLevel;
  protected boolean feedbackShown; // TODO factor out
  protected int feedbackSize; // TODO factor out

  protected String containerId;

  /**
   * A list of started listeners attached to the pipeline.
   */
  protected List<IExecutionStartedListener<IPipelineEngine<PipelineMeta>>> executionStartedListeners;

  /**
   * A list of finished listeners attached to the pipeline.
   */
  protected List<IExecutionFinishedListener<IPipelineEngine<PipelineMeta>>> executionFinishedListeners;

  /**
   * A list of stop-event listeners attached to the pipeline.
   */
  protected List<IExecutionStoppedListener<IPipelineEngine<PipelineMeta>>> executionStoppedListeners;

  /**
   * The active sub-pipelines.
   */
  protected Map<String, IPipelineEngine> activeSubPipelines;

  /**
   * The active subjobs
   */
  protected Map<String, IWorkflowEngine<WorkflowMeta>> activeSubWorkflows;

  protected Map<String, Object> extensionDataMap;

  protected int lastLogLineNr;
  protected Timer refreshTimer;

  /**
   * The named parameters.
   */
  protected INamedParameters namedParams = new NamedParameters();
  private String statusDescription;
  private ComponentExecutionStatus status;

  protected long serverPollDelay;
  protected long serverPollInterval;

  public RemotePipelineEngine() {
    super();
    logChannel = LogChannel.GENERAL;
    engineMetrics = new EngineMetrics();
    executionStartedListeners = Collections.synchronizedList( new ArrayList<>() );
    executionFinishedListeners = Collections.synchronizedList( new ArrayList<>() );
    executionStoppedListeners = Collections.synchronizedList( new ArrayList<>() );
    activeSubPipelines = new HashMap<>();
    activeSubWorkflows = new HashMap<>();
    engineCapabilities = new RemotePipelineEngineCapabilities();
    extensionDataMap = Collections.synchronizedMap( new HashMap<>() );
  }

  public RemotePipelineEngine( PipelineMeta subject ) {
    this();
    this.subject = subject;
  }

  @Override public IPipelineEngineRunConfiguration createDefaultPipelineEngineRunConfiguration() {
    return new RemotePipelineRunConfiguration();
  }

  @Override public void prepareExecution() throws HopException {
    try {
      IPipelineEngineRunConfiguration engineRunConfiguration = pipelineRunConfiguration.getEngineRunConfiguration();
      if ( !( engineRunConfiguration instanceof RemotePipelineRunConfiguration ) ) {
        throw new HopException( "The remote pipeline engine expects a remote pipeline configuration" );
      }
      RemotePipelineRunConfiguration remotePipelineRunConfiguration = (RemotePipelineRunConfiguration) pipelineRunConfiguration.getEngineRunConfiguration();

      String hopServerName = remotePipelineRunConfiguration.getHopServerName();
      if ( StringUtils.isEmpty( hopServerName ) ) {
        throw new HopException( "No remote Hop server was specified to run the pipeline on" );
      }
      String remoteRunConfigurationName = remotePipelineRunConfiguration.getRunConfigurationName();
      if ( StringUtils.isEmpty( remoteRunConfigurationName ) ) {
        throw new HopException( "No run configuration was specified to the remote pipeline with" );
      }
      if ( metadataProvider == null ) {
        throw new HopException( "The remote pipeline engine didn't receive a metadata to load hop server '" + hopServerName + "'" );
      }

      // Create a new log channel when we start the action
      // It's only now that we use it
      //
      this.logChannel = new LogChannel( this, subject );
      loggingObject = new LoggingObject( this );
      this.logChannel.setLogLevel( logLevel );

      logChannel.logBasic( "Executing this pipeline using the Remote Pipeline Engine with run configuration '" + pipelineRunConfiguration.getName() + "'" );

      serverPollDelay = Const.toLong( resolve( remotePipelineRunConfiguration.getServerPollDelay() ), 1000L );
      serverPollInterval = Const.toLong( resolve( remotePipelineRunConfiguration.getServerPollInterval() ), 2000L );

      hopServer = metadataProvider.getSerializer( HopServer.class ).load( hopServerName );
      if ( hopServer == null ) {
        throw new HopException( "Hop server '" + hopServerName + "' could not be found" );
      }

      PipelineExecutionConfiguration pipelineExecutionConfiguration = new PipelineExecutionConfiguration();
      pipelineExecutionConfiguration.setRunConfiguration( remoteRunConfigurationName );
      if ( logLevel != null ) {
        pipelineExecutionConfiguration.setLogLevel( logLevel );
      }
      if ( previousResult != null ) {
        pipelineExecutionConfiguration.setPreviousResult( previousResult );
      }

      sendToHopServer( subject, pipelineExecutionConfiguration, metadataProvider );

      setReadyToStart( true );
    } catch ( Exception e ) {
      throw new HopException( "Error preparing remote pipeline", e );
    }
  }

  /**
   * Send the pipeline for execution to a HopServer hop server.
   *
   * @param pipelineMeta           the pipeline meta-data
   * @param executionConfiguration the pipeline execution configuration
   * @throws HopException if any errors occur during the dispatch to the hop server
   */
  private void sendToHopServer( PipelineMeta pipelineMeta, PipelineExecutionConfiguration executionConfiguration, IHopMetadataProvider metadataProvider ) throws HopException {

    if ( hopServer == null ) {
      throw new HopException( "No remote server specified" );
    }
    if ( Utils.isEmpty( pipelineMeta.getName() ) ) {
      throw new HopException( "The pipeline needs a name to uniquely identify it by on the remote server." );
    }

    // Inject certain internal variables to make it more intuitive.
    //
    Map<String, String> vars = new HashMap<>();

    for ( String var : Const.INTERNAL_PIPELINE_VARIABLES ) {
      vars.put( var, getVariable( var ) );
    }
    for ( String var : Const.INTERNAL_WORKFLOW_VARIABLES ) {
      vars.put( var, getVariable( var ) );
    }
    // Overwrite with all the other variables we know off
    //
    for ( String var : getVariableNames() ) {
      vars.put( var, getVariable( var ) );
    }

    executionConfiguration.getVariablesMap().putAll( vars );

    hopServer.getLogChannel().setLogLevel( executionConfiguration.getLogLevel() );

    try {
      if ( executionConfiguration.isPassingExport() ) {

        // First export the workflow...
        //
        FileObject tempFile = HopVfs.createTempFile( "pipelineExport", HopVfs.Suffix.ZIP );

        // The executionConfiguration should not include external references here because all the resources should be
        // retrieved from the exported zip file
        // TODO: Serialize metadata objects to JSON and include it in the zip file
        //
        PipelineExecutionConfiguration clonedConfiguration = (PipelineExecutionConfiguration) executionConfiguration.clone();
        TopLevelResource topLevelResource = ResourceUtil.serializeResourceExportInterface( tempFile.getName().toString(), pipelineMeta, this,
          metadataProvider, clonedConfiguration.getXml(), CONFIGURATION_IN_EXPORT_FILENAME );

        // Send the zip file over to the hop server...
        //
        String result = hopServer.sendExport( this, topLevelResource.getArchiveName(), RegisterPackageServlet.TYPE_PIPELINE, topLevelResource.getBaseResourceName() );
        WebResult webResult = WebResult.fromXmlString( result );
        if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {
          throw new HopException( "There was an error passing the exported pipeline to the remote server: "
            + Const.CR + webResult.getMessage() );
        }
        containerId = webResult.getId();
      } else {

        // Now send it off to the remote server...
        // Include the JSON of the whole content of the current metadata
        //
        SerializableMetadataProvider serializableMetadataProvider = new SerializableMetadataProvider( metadataProvider );
        String xml = new PipelineConfiguration( pipelineMeta, executionConfiguration, serializableMetadataProvider ).getXml();
        String reply = hopServer.sendXml( this, xml, RegisterPipelineServlet.CONTEXT_PATH + "/?xml=Y" );
        WebResult webResult = WebResult.fromXmlString( reply );
        if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {
          throw new HopException( "There was an error posting the pipeline on the remote server: " + Const.CR
            + webResult.getMessage() );
        }
        containerId = webResult.getId();
      }

      // Prepare the pipeline
      //
      String reply = hopServer.execService( this, PrepareExecutionPipelineServlet.CONTEXT_PATH + "/?name=" + URLEncoder.encode( pipelineMeta.getName(), "UTF-8" ) + "&xml=Y&id=" + containerId );
      WebResult webResult = WebResult.fromXmlString( reply );
      if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {
        throw new HopException( "There was an error preparing the pipeline for execution on the remote server: " + Const.CR + webResult.getMessage() );
      }
      // Get the status right after preparation.
      //
      getPipelineStatus();
    } catch ( HopException ke ) {
      throw ke;
    } catch ( Exception e ) {
      throw new HopException( e );
    }
  }

  @Override public void startThreads() throws HopException {
    try {
      // Start the pipeline
      //
      String reply = hopServer.execService( this, StartExecutionPipelineServlet.CONTEXT_PATH + "/?name=" + URLEncoder.encode( subject.getName(), "UTF-8" ) + "&xml=Y&id=" + containerId );
      WebResult webResult = WebResult.fromXmlString( reply );
      if ( WebResult.STRING_OK.equals( webResult.getResult() ) ) {
        // Inform anyone that wants to know that the show has started
        //
        fireExecutionStartedListeners();

        // So the pipeline has been successfully started.
        // That doesn't mean that the execution itself is without error
        // To know that we need to monitor the execution remotely
        // We monitor this every 2 seconds after a 1 second delay (configurable)
        //
        TimerTask refreshTask = new TimerTask() {
          @Override public void run() {
            getPipelineStatus();
          }
        };
        refreshTimer = new Timer();
        refreshTimer.schedule( refreshTask, serverPollDelay, serverPollInterval );

        readyToStart = false;
        running = true;
      } else {
        throw new HopException( "Error starting pipeline on hop server '" + hopServer.getName() + "' with object ID '" + containerId + "' : " + webResult.getMessage() );
      }
    } catch ( Exception e ) {
      throw new HopException( "Unable to start pipeline on server '" + hopServer.getName() + "'", e );
    }
  }

  private synchronized void getPipelineStatus() throws RuntimeException {
    try {
      HopServerPipelineStatus pipelineStatus = hopServer.getPipelineStatus( this, subject.getName(), containerId, lastLogLineNr );
      synchronized ( engineMetrics ) {
        hasHaltedComponents = false;
        engineMetrics.setStartDate( pipelineStatus.getExecutionStartDate() );
        engineMetrics.setEndDate( pipelineStatus.getExecutionEndDate() );
        engineMetrics.getComponents().clear();
        engineMetrics.getComponentRunningMap().clear();
        engineMetrics.getComponentSpeedMap().clear();
        engineMetrics.getComponentMetricsMap().clear();

        for ( TransformStatus transformStatus : pipelineStatus.getTransformStatusList() ) {
          EngineComponent component = new EngineComponent( transformStatus.getTransformName(), transformStatus.getCopy() );
          component.setErrors( transformStatus.getErrors() );
          status = ComponentExecutionStatus.getStatusFromDescription( transformStatus.getStatusDescription() );
          statusDescription = status.getDescription();
          boolean running = status == ComponentExecutionStatus.STATUS_RUNNING;
          component.setRunning( running );
          boolean halted = status == ComponentExecutionStatus.STATUS_HALTED || status == ComponentExecutionStatus.STATUS_HALTING;
          if ( halted ) {
            hasHaltedComponents = true;
          }
          engineMetrics.setComponentStatus( component, transformStatus.getStatusDescription() );
          engineMetrics.setComponentRunning( component, running );
          engineMetrics.setComponentMetric( component, Pipeline.METRIC_READ, transformStatus.getLinesRead() );
          engineMetrics.setComponentMetric( component, Pipeline.METRIC_WRITTEN, transformStatus.getLinesWritten() );
          engineMetrics.setComponentMetric( component, Pipeline.METRIC_INPUT, transformStatus.getLinesInput() );
          engineMetrics.setComponentMetric( component, Pipeline.METRIC_OUTPUT, transformStatus.getLinesOutput() );
          engineMetrics.setComponentMetric( component, Pipeline.METRIC_REJECTED, transformStatus.getLinesRejected() );
          engineMetrics.setComponentMetric( component, Pipeline.METRIC_UPDATED, transformStatus.getLinesUpdated() );
          engineMetrics.setComponentMetric( component, Pipeline.METRIC_ERROR, transformStatus.getErrors() );
          engineMetrics.setComponentMetric( component, Pipeline.METRIC_BUFFER_IN, transformStatus.getInputBufferSize() );
          engineMetrics.setComponentMetric( component, Pipeline.METRIC_BUFFER_OUT, transformStatus.getOutputBufferSize() );
          engineMetrics.setComponentSpeed( component, transformStatus.getSpeed() );
          engineMetrics.getComponents().add( component );
        }

        running = pipelineStatus.isRunning();
        finished = pipelineStatus.isFinished();
        stopped = pipelineStatus.isStopped();
        paused = pipelineStatus.isPaused();
        errors = (int) pipelineStatus.getNrTransformErrors();

        lastLogLineNr = pipelineStatus.getLastLoggingLineNr();

        // Also pass the remote log to this log channel as BASIC logging...
        // TODO: make this configurable and split up the log lines individually so we can do a better job of this.
        // Now it's a bit garbled
        //
        if ( StringUtils.isNotEmpty( pipelineStatus.getLoggingString() ) ) {
          logChannel.logBasic( pipelineStatus.getLoggingString() );
        }

        // If the pipeline is finished, cancel the timer task
        //
        if ( finished ) {
          firePipelineExecutionFinishedListeners();
          refreshTimer.cancel();
          logChannel.logBasic( "Execution finished on a remote pipeline engine with run configuration '" + pipelineRunConfiguration.getName() + "'" );
        }
      }
    } catch ( Exception e ) {
      throw new RuntimeException( "Error getting the status of pipeline '" + subject.getName() + "' on hop server '" + hopServer.getName() + "' with object ID '" + containerId + "'", e );


text:
/**
 * ====================================================================
 * Nuts : Network Updatable Things Service
 * (universal package manager)
 *

 * is a new Open Source Package Manager to help install packages
 * and libraries for runtime execution. Nuts is the ultimate companion for
 * maven (and other build managers) as it helps installing all package
 * dependencies at runtime. Nuts is not tied to java and is a good choice
 * to share shell scripts and other 'things' . Its based on an extensible
 * architecture to help supporting a large range of sub managers / repositories.
 *
 *

 *

 * Copyright [2020] [thevpc]
 * 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 net.thevpc.nuts;

/**
 * Exception thrown when extension is already registered.
 *
 * @app.category Exceptions
 * @since 0.5.4
 */
public class NutsExtensionAlreadyRegisteredException extends NutsExtensionException {

    /**
     * installed id
     */
    private final String installed;

    /**
     * Constructs a new NutsExtensionAlreadyRegisteredException exception
     *
     * @param session   workspace
     * @param id        artifact id
     * @param installed installed id
     */
    public NutsExtensionAlreadyRegisteredException(NutsSession session, NutsId id, String installed) {
        super(session, id,
                NutsMessage.cstyle("extension already registered %s  as %", (id == null ? "<null>" : id), installed)
                , null);
        this.installed = installed;
    }

    /**
     * Constructs a new NutsExtensionAlreadyRegisteredException exception
     *
     * @param session   workspace
     * @param id        artifact id
     * @param installed installed id
     * @param cause     cause
     */
    public NutsExtensionAlreadyRegisteredException(NutsSession session, NutsId id, String installed, Throwable cause) {
        super(session, id, NutsMessage.cstyle("extension already registered %s  as %", (id == null ? "<null>" : id), installed), cause);
        this.installed = installed;
    }

    /**
     * registered/installed extension
     *
     * @return registered/installed extension
     */
    public String getInstalled() {
        return installed;
    }
}


text:
package edu.xiyou.shortrent.controller;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import edu.xiyou.shortrent.constant.CommenConstant;
import edu.xiyou.shortrent.constant.HouseConstant;
import edu.xiyou.shortrent.constant.UserConstant;
import edu.xiyou.shortrent.exception.ArguException;
import edu.xiyou.shortrent.model.House;
import edu.xiyou.shortrent.model.Order;
import edu.xiyou.shortrent.model.User;
import edu.xiyou.shortrent.model.vo.HouseVo;
import edu.xiyou.shortrent.model.vo.ResultVo;
import edu.xiyou.shortrent.security.RoleSign;
import edu.xiyou.shortrent.service.MailService;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang.time.DateUtils;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by andrew on 16-3-9.
 */
@Controller
@RequestMapping("/rent")
public class RentController extends BaseController {

    @Resource
    private MailService mailService;

    @RequestMapping(value = "/listHouses.action")
    public String listHouses(ModelMap modelMap) {
        List<House> houseList = null;
        try {
            House house = new House();
            house.setOnline(HouseConstant.HOUSE_ONLINE);
            house.setChecked(HouseConstant.HOUSE_CHECKED);
            houseList = rentService.selectBySelective(house);
        }catch (Exception e){
            logger.error("findHouses exception={}", e);
        }
        logger.info("listHouses record={}", houseList);
        modelMap.addAttribute("houseList", houseList);
        return "findHouses";
    }

    @RequestMapping(value = "findHouses.action", method = RequestMethod.POST)
    public String findHouses(@RequestParam(value = "maxArea", required = false)Integer maxArea,
                                            @RequestParam(value = "minArea", required = false)Integer minArea,
                                            @RequestParam(value = "maxPrice", required = false)Integer maxPrice,
                                            @RequestParam(value = "minPrice", required = false)Integer minPrice,
                                            @RequestParam(value = "addressContain", required = false)String addressContain,
                                            @RequestParam(value = "houseType", required = false) Short houseType,
                                            HttpServletRequest request, ModelMap modelMap){
        ResultVo<List<House>> resultVo = new ResultVo<>();
        List<House> houseList = null;
        HouseVo houseVo = new HouseVo();
        houseVo.setMaxArea(maxArea);
        houseVo.setMinArea(minArea);
        houseVo.setMaxPrice(maxPrice);
        houseVo.setMinPrice(minPrice);
        houseVo.setAddressContain(addressContain);
        houseVo.setHouseType(houseType);

        try {
            houseList = rentService.selectByHouseVo(houseVo);
            resultVo.setElement(houseList);
            resultVo.setApproved(true);
            resultVo.setMsg("获取成功");
        }catch (ArguException e){
            resultVo.setApproved(false);
            resultVo.setMsg(e.getMessage());
        }catch (Exception e){
            resultVo.setApproved(false);
            resultVo.setMsg("获取信息失败");
        }
        modelMap.addAttribute("houseList", houseList);
        resultVo.setElement(houseList);
        modelMap.addAttribute("houseVo", houseVo);
        return "findHouses";
    }

    @RequestMapping(value = "/{houseId}.action")
    public String findHouse(@PathVariable Integer houseId, HttpServletRequest request, ModelMap modelMap){
        if (houseId == null){
            modelMap.addAttribute(CommenConstant.ERROR, "查找信息不能为空");
            return "houseInfo";
        }

        House house = null;
        try {
            house = rentService.selectByPrimaryKey(houseId);
            User user = null;
            if (house != null && house.getOwerid() != null){
                user = userService.selectByPrimaryKey(house.getOwerid());
            }
            if (user != null && user.getUsername() != null){
                house.setOwerName(user.getUsername());
            }
        } catch (ArguException e){
            modelMap.addAttribute(CommenConstant.ERROR, e.getMessage());
        } catch (Exception e){
            modelMap.addAttribute(CommenConstant.ERROR, "房子信息有误");
        }
        modelMap.addAttribute("house", house);
        return "houseInfo";
    }

    @RequestMapping(value = "/ower/orderList.action")
//    @RequiresRoles(RoleSign.owner)
    public String findOrders(HttpServletRequest request, ModelMap modelMap){
        User user = (User) request.getSession().getAttribute(UserConstant.USER_DETAIL);
        if (user == null){
            return "redirect:/user/login.action";
        }
        Integer owerId = user.getId();
        if (owerId == null){
            modelMap.addAttribute(CommenConstant.ERROR, "查找信息不能为空");
            return "orderList";
        }

        List<Order> orderList = Lists.newArrayList();
        try {
            Order owerOrder = new Order();
            owerOrder.setOwerid(owerId);
            List<Order> owerList = orderService.selectBySelective(owerOrder);

            Order customOrder = new Order();
            customOrder.setCustomer(owerId);
            List<Order> customList = orderService.selectBySelective(customOrder);

            orderList.addAll(owerList);
            orderList.addAll(customList);

            Order order = new Order();
            order.setOwerid(owerId);
            User emptyUser = new User();
            List<User> userList = userService.selectBySelective(emptyUser);
            Map<Integer, User> userMap = Maps.newHashMap();
            for (User user1 : userList){
                userMap.put(user1.getId(), user1);
            }

            for (Order order1 : orderList){
                User owner = userMap.get(order1.getOwerid());
                order1.setOwerName(owner.getUsername());
                order1.setOwerMobile(owner.getMobile());

                User customer = userMap.get(order1.getCustomer());
                order1.setCustomerName(customer.getUsername());
                order1.setCustomerMobile(customer.getMobile());
            }
        }catch (Exception e){
            logger.error("orderList owerId={}, exception={}", owerId, e);
        }
        modelMap.addAttribute("orderList", orderList);
        return "orderList";
    }

    @RequestMapping(value = "/order/${orderId}.action")
    public String findOrder(@PathVariable Integer orderId, HttpServletRequest request, ModelMap modelMap){
        if (orderId == null){
            modelMap.addAttribute(CommenConstant.ERROR, "查找信息不能为空");
            return "orderDetail";
        }
        Order order = null;

        try {
            order = orderService.selectByPrimaryKey(orderId);
        } catch (Exception e) {
            logger.error("findOrder orderId={}, exception={}", orderId, e);
        }
        modelMap.addAttribute("order", order);
        return "orderDetail";
    }

    @RequestMapping(value = "/order/update/${orderId}.action")
    public String updateOrder(@PathVariable Integer orderId, HttpServletRequest request, ModelMap modelMap){
        if (orderId == null){
            modelMap.addAttribute(CommenConstant.ERROR, "订单信息不能为空");
            return "updateOrder";
        }
        Order order = null;

        try {
            order = orderService.selectByPrimaryKey(orderId);
        } catch (Exception e) {
            logger.error("findOrder orderId={}, exception={}", orderId, e);
        }
        modelMap.addAttribute("order", order);

        return "updateOrder";
    }

    @ResponseBody
    @RequestMapping(value = "/order/updateData/${orderId}.action", method = RequestMethod.POST)
//    @RequiresRoles(RoleSign.customer)
    public ResultVo<Order> updateOrderData(@PathVariable Integer orderId, @RequestParam("houseId")Integer houseId,
                                           @RequestParam("owerId")Integer owerId, @RequestParam("customerId")Integer customerId,
                                           @RequestParam(value = "amount", required = false)Integer amount,
                                           @RequestParam(value = "endTime", required = false)Date endTime,
                                           @RequestParam(value = "startTime", required = false)Date startTime,
                                           @RequestParam(value = "terminate", required = false)Short terminate,
                                           HttpServletRequest request, ModelMap modelMap){
        ResultVo<Order> resultVo = new ResultVo<>();
        Order order = new Order();
        order.setId(orderId);
        order.setOwerid(owerId);
        order.setCustomer(customerId);
        order.setAmount(amount);
        order.setEndtime(endTime);
        order.setTerminate(terminate);
        resultVo.setElement(order);
        if (amount == null || terminate == null || endTime == null){
            resultVo.setMsg("请输入正确的信息");
            resultVo.setApproved(true);
            return resultVo;
        }

        try {
            orderService.updateBySelective(order);
            resultVo.setApproved(true);
            resultVo.setMsg("修改成功");
        } catch (ArguException e) {
            resultVo.setMsg(e.getMessage());
            resultVo.setApproved(false);
        } catch (Exception e){
            resultVo.setApproved(false);
            resultVo.setMsg("请填写正确的信息");
        }
        return resultVo;
    }

    @RequestMapping(value = "/order/create.action")
//    @RequiresRoles(RoleSign.customer)
    public String createOrder(@RequestParam("houseId")Integer houseId, HttpServletRequest request, ModelMap modelMap){
        User user = (User) request.getSession().getAttribute(UserConstant.USER_DETAIL);
        if (user == null){
            return "redirect:/user/login.action";
        }
        House house = null;
        try {
             house = houseService.selectHouseByHouseId(houseId);
        } catch (Exception e) {
            logger.error("createOrder record={}, exception={}", houseId, e);
        }
        modelMap.addAttribute(UserConstant.USER_DETAIL, user);
        modelMap.addAttribute("house", house);
        return "createOrder";
    }

    @ResponseBody
    @RequestMapping(value = "/order/createData.action", method = RequestMethod.POST)
//    @RequiresRoles(RoleSign.customer)
    public ResultVo<Order> createOrderData(@RequestParam("hourseId")Integer hourseId, @RequestParam("owerId")Integer owerId,
                                           @RequestParam("customerId")Integer customerId, @RequestParam("amount")Integer amount,
                                           @RequestParam("beginTime")String beginTimeStr, @RequestParam("endTime")String endTimeStr,
                                           HttpServletRequest request, ModelMap modelMap){

        SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd");
        ResultVo<Order> resultVo = new ResultVo<>();
        Order order = new Order();
        order.setHourseid(hourseId);
        order.setOwerid(owerId);
        order.setCustomer(customerId);
        order.setAmount(amount);
        try {
            order.setBegintime(format.parse(beginTimeStr));
            order.setEndtime(format.parse(endTimeStr));
        } catch (ParseException e) {
            e.printStackTrace();
        }

        try {
            User owner = userService.selectByPrimaryKey(owerId);
            User customer = userService.selectByPrimaryKey(customerId);
            orderService.insertBySelective(order);
            if (owner.getEmail() != null && owner.getEmail().length() > 5){
                mailService.sendMail(owner.getEmail(), "您的房子被租了", "您的房子被租了，详情请登录短租网");
            }
            if (customer.getEmail() != null && customer.getEmail().length() > 5){
                mailService.sendMail(customer.getEmail(), "恭喜您租房成功", "恭喜您租房成功，详情请登录租房网");
            }
            resultVo.setApproved(true);
            resultVo.setMsg("添加成功");
        } catch (ArguException e) {
            resultVo.setApproved(false);
            resultVo.setMsg(e.getMessage());
        } catch (Exception e){
            resultVo.setApproved(false);
            resultVo.setMsg("添加失败");
        }
        return resultVo;
    }

    public MailService getMailService() {
        return mailService;
    }

    public void setMailService(MailService mailService) {
        this.mailService = mailService;
    }
}


text:
/**
 * Copyright 2010 - 2021 JetBrains s.r.o.
 *
 * 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 jetbrains.exodus.tree;

import org.junit.Assert;
import org.junit.Test;

public abstract class TreeAddressIteratorTest extends TreeBaseTest {

    protected abstract ITree createEmpty();

    @Test
    public void testEmpty() {
        Assert.assertFalse(createEmpty().addressIterator().hasNext());
    }
}