text
stringlengths 7
1.01M
|
|---|
package org.apache.ibatis.annotations;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* This annotation can be used when a @Select method is using a
* ResultHandler. Those methods must have void return type, so
* this annotation can be used to tell MyBatis what kind of object
* it should build for each row.
*
* @since 3.2.0
* @author Jeff Butler
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ResultType {
Class<?> value();
}
|
package org.hildan.livedoc.core.readers.javadoc;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import org.hildan.livedoc.core.model.doc.ApiDoc;
import org.hildan.livedoc.core.model.doc.ApiOperationDoc;
import org.hildan.livedoc.core.model.doc.async.AsyncMessageDoc;
import org.hildan.livedoc.core.readers.DocReader;
import org.hildan.livedoc.core.scanners.templates.TemplateProvider;
import org.hildan.livedoc.core.scanners.types.references.TypeReferenceProvider;
import org.jetbrains.annotations.NotNull;
/**
* An implementation of {@link DocReader} that reads the Javadoc of classes and methods to build the documentation. This
* implementation cannot identify controller classes or API operation methods, but it can document the ones that are
* identified by other readers.
*/
public class JavadocDocReader implements DocReader {
@NotNull
@Override
public Collection<Class<?>> findControllerTypes() {
// although this reader can read docs from any class, it cannot identify a class as a controller
return Collections.emptyList();
}
@NotNull
@Override
public Optional<ApiDoc> buildApiDocBase(@NotNull Class<?> controllerType) {
ApiDoc doc = new ApiDoc();
doc.setName(controllerType.getSimpleName());
doc.setDescription(JavadocHelper.getJavadocDescription(controllerType).orElse(null));
return Optional.of(doc);
}
@Override
public boolean isApiOperation(@NotNull Method method, @NotNull Class<?> controller) {
// although this reader can read docs from any method, it cannot identify a method as an API operation
return false;
}
@NotNull
@Override
public Optional<ApiOperationDoc> buildApiOperationDoc(@NotNull Method method, @NotNull Class<?> controller,
@NotNull ApiDoc parentApiDoc, @NotNull TypeReferenceProvider typeReferenceProvider,
@NotNull TemplateProvider templateProvider) {
ApiOperationDoc doc = new ApiOperationDoc();
doc.setName(method.getName());
doc.setDescription(JavadocHelper.getJavadocDescription(method).orElse(null));
return Optional.of(doc);
}
@Override
public boolean usesAsyncMessages(@NotNull Method method, @NotNull Class<?> controller) {
return false;
}
@NotNull
@Override
public List<AsyncMessageDoc> buildAsyncMessageDocs(@NotNull Collection<Method> methods,
@NotNull Class<?> controller, @NotNull ApiDoc parentApiDoc,
@NotNull TypeReferenceProvider typeReferenceProvider, @NotNull TemplateProvider templateProvider) {
// where to take the description depends on whether it's a SEND or SUBSCRIBE msg
// this reader does not have enough information to put something sensible here
return Collections.emptyList();
}
}
|
/*
* Copyright 2017 Daniel Nilsson
*
* 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 com.github.dannil.scbjavaclient.client.pricesandconsumption.cpi.hicp;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import com.github.dannil.scbjavaclient.client.AbstractClient;
import com.github.dannil.scbjavaclient.communication.URLEndpoint;
import com.github.dannil.scbjavaclient.constants.APIConstants;
import com.github.dannil.scbjavaclient.model.ResponseModel;
/**
* <p>Client which handles prices and consumption Consumer Price Index (CPI) Harmonized
* Index of Consumer Prices (HICP) data fetching.</p>
*
* @since 0.5.0
*/
public class PricesAndConsumptionCPIHICPClient extends AbstractClient {
/**
* <p>Default constructor.</p>
*/
public PricesAndConsumptionCPIHICPClient() {
super();
}
/**
* <p>Overloaded constructor.</p>
*
* @param locale
* the <code>Locale</code> for this client
*/
public PricesAndConsumptionCPIHICPClient(Locale locale) {
super(locale);
}
/**
* <p>Fetch all harmonized index annual changes data.</p>
*
* @return the data wrapped in a list of
* {@link com.github.dannil.scbjavaclient.model.ResponseModel ResponseModel}
* objects
*
* @see #getHarmonizedIndexAnnualChanges(Collection)
*/
public List<ResponseModel> getHarmonizedIndexAnnualChanges() {
return getHarmonizedIndexAnnualChanges(null);
}
/**
* <p>Fetch all harmonized index annual changes data which match the input
* constraints.</p>
*
* @param months
* the months
* @return the data wrapped in a list of
* {@link com.github.dannil.scbjavaclient.model.ResponseModel ResponseModel}
* objects
*/
public List<ResponseModel> getHarmonizedIndexAnnualChanges(Collection<String> months) {
return generate(months, "HIKPF12MP2015");
}
/**
* <p>Fetch all harmonized index monthly changes data.</p>
*
* @return the data wrapped in a list of
* {@link com.github.dannil.scbjavaclient.model.ResponseModel ResponseModel}
* objects
*
* @see #getHarmonizedIndexMonthlyChanges(Collection)
*/
public List<ResponseModel> getHarmonizedIndexMonthlyChanges() {
return getHarmonizedIndexMonthlyChanges(null);
}
/**
* <p>Fetch all harmonized index monthly changes data which match the input
* constraints.</p>
*
* @param months
* the months
* @return the data wrapped in a list of
* {@link com.github.dannil.scbjavaclient.model.ResponseModel ResponseModel}
* objects
*/
public List<ResponseModel> getHarmonizedIndexMonthlyChanges(Collection<String> months) {
return generate(months, "HIKPFFMP2015");
}
/**
* <p>Fetch all harmonized index months data.</p>
*
* @return the data wrapped in a list of
* {@link com.github.dannil.scbjavaclient.model.ResponseModel ResponseModel}
* objects
*
* @see #getHarmonizedIndexMonths(Collection)
*/
public List<ResponseModel> getHarmonizedIndexMonths() {
return getHarmonizedIndexMonths(null);
}
/**
* <p>Fetch all harmonized index months data which match the input constraints.</p>
*
* @param months
* the months
* @return the data wrapped in a list of
* {@link com.github.dannil.scbjavaclient.model.ResponseModel ResponseModel}
* objects
*/
public List<ResponseModel> getHarmonizedIndexMonths(Collection<String> months) {
return generate(months, "HIKPIND22015");
}
/**
* <p>Fetch all harmonized index years data.</p>
*
* @return the data wrapped in a list of
* {@link com.github.dannil.scbjavaclient.model.ResponseModel ResponseModel}
* objects
*
* @see #getHarmonizedIndexYears(Collection)
*/
public List<ResponseModel> getHarmonizedIndexYears() {
return getHarmonizedIndexYears(null);
}
/**
* <p>Fetch all harmonized index years data which match the input constraints.</p>
*
* @param years
* the years
* @return the data wrapped in a list of
* {@link com.github.dannil.scbjavaclient.model.ResponseModel ResponseModel}
* objects
*/
public List<ResponseModel> getHarmonizedIndexYears(Collection<Integer> years) {
return generate(years, "HIKPAR22015");
}
/**
* <p>Common generator method for the methods in this class.</p>
*
* @param times
* the times
* @param table
* the table
* @return a <code>List</code> of
* {@link com.github.dannil.scbjavaclient.model.ResponseModel ResponseModel}
*/
private List<ResponseModel> generate(Collection<?> times, String table) {
Map<String, Collection<?>> mappings = new HashMap<>();
mappings.put(APIConstants.TIME_CODE, times);
return getResponseModels(table, mappings);
}
@Override
public URLEndpoint getUrl() {
return getRootUrl().append("PR/PR0101/PR0101C/");
}
}
|
package ltd.newbee.mall.service;
import ltd.newbee.mall.common.DefaultAddressStatusEnum;
import ltd.newbee.mall.entity.AddressManagement;
import java.util.List;
/**
* Created by zhanghenan on 2020/6/13.
*/
public interface AddressManagementService {
int saveAddressManagement(AddressManagement addressManagement);
int updateAddressManagement(AddressManagement addressManagement);
boolean setAddressDefaultOrNot(Long id, DefaultAddressStatusEnum defaultAddressStatusEnum);
AddressManagement getDefaultAddressByUser(Long userId);
List<AddressManagement> listAddressManagementByUser(Long userId);
boolean setNotDefaultWhichIsDefault(Long userId);
AddressManagement getAddressInfoById(Long userId, Long id);
int deleteAddress(Long userId, Long id);
}
|
package kr.ac.hs.selab.notice.infrastructure;
import kr.ac.hs.selab.notice.domain.NoticeComment;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;
public interface NoticeCommentRepository extends JpaRepository<NoticeComment, Long> {
Optional<NoticeComment> findByIdAndDeleteFlag(Long id, boolean deleteFlag);
List<NoticeComment> findByNoticeIdAndDeleteFlag(Long noticeId, boolean deleteFlag);
Page<NoticeComment> findByNoticeIdAndDeleteFlag(Long noticeId, boolean deleteFlag, Pageable pageable);
Long countByNoticeIdAndDeleteFlag(Long noticeId, boolean deleteFlag);
}
|
package net.minecraft.world.gen.feature;
import java.util.Random;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
public class WorldGenDesertWells extends WorldGenerator
{
private static final String __OBFID = "CL_00000407";
public boolean generate(World p_76484_1_, Random p_76484_2_, int p_76484_3_, int p_76484_4_, int p_76484_5_)
{
while (p_76484_1_.isAirBlock(p_76484_3_, p_76484_4_, p_76484_5_) && p_76484_4_ > 2)
{
--p_76484_4_;
}
if (p_76484_1_.getBlock(p_76484_3_, p_76484_4_, p_76484_5_) != Blocks.sand)
{
return false;
}
else
{
int l;
int i1;
for (l = -2; l <= 2; ++l)
{
for (i1 = -2; i1 <= 2; ++i1)
{
if (p_76484_1_.isAirBlock(p_76484_3_ + l, p_76484_4_ - 1, p_76484_5_ + i1) && p_76484_1_.isAirBlock(p_76484_3_ + l, p_76484_4_ - 2, p_76484_5_ + i1))
{
return false;
}
}
}
for (l = -1; l <= 0; ++l)
{
for (i1 = -2; i1 <= 2; ++i1)
{
for (int j1 = -2; j1 <= 2; ++j1)
{
p_76484_1_.setBlock(p_76484_3_ + i1, p_76484_4_ + l, p_76484_5_ + j1, Blocks.sandstone, 0, 2);
}
}
}
p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_, Blocks.flowing_water, 0, 2);
p_76484_1_.setBlock(p_76484_3_ - 1, p_76484_4_, p_76484_5_, Blocks.flowing_water, 0, 2);
p_76484_1_.setBlock(p_76484_3_ + 1, p_76484_4_, p_76484_5_, Blocks.flowing_water, 0, 2);
p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_ - 1, Blocks.flowing_water, 0, 2);
p_76484_1_.setBlock(p_76484_3_, p_76484_4_, p_76484_5_ + 1, Blocks.flowing_water, 0, 2);
for (l = -2; l <= 2; ++l)
{
for (i1 = -2; i1 <= 2; ++i1)
{
if (l == -2 || l == 2 || i1 == -2 || i1 == 2)
{
p_76484_1_.setBlock(p_76484_3_ + l, p_76484_4_ + 1, p_76484_5_ + i1, Blocks.sandstone, 0, 2);
}
}
}
p_76484_1_.setBlock(p_76484_3_ + 2, p_76484_4_ + 1, p_76484_5_, Blocks.stone_slab, 1, 2);
p_76484_1_.setBlock(p_76484_3_ - 2, p_76484_4_ + 1, p_76484_5_, Blocks.stone_slab, 1, 2);
p_76484_1_.setBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_ + 2, Blocks.stone_slab, 1, 2);
p_76484_1_.setBlock(p_76484_3_, p_76484_4_ + 1, p_76484_5_ - 2, Blocks.stone_slab, 1, 2);
for (l = -1; l <= 1; ++l)
{
for (i1 = -1; i1 <= 1; ++i1)
{
if (l == 0 && i1 == 0)
{
p_76484_1_.setBlock(p_76484_3_ + l, p_76484_4_ + 4, p_76484_5_ + i1, Blocks.sandstone, 0, 2);
}
else
{
p_76484_1_.setBlock(p_76484_3_ + l, p_76484_4_ + 4, p_76484_5_ + i1, Blocks.stone_slab, 1, 2);
}
}
}
for (l = 1; l <= 3; ++l)
{
p_76484_1_.setBlock(p_76484_3_ - 1, p_76484_4_ + l, p_76484_5_ - 1, Blocks.sandstone, 0, 2);
p_76484_1_.setBlock(p_76484_3_ - 1, p_76484_4_ + l, p_76484_5_ + 1, Blocks.sandstone, 0, 2);
p_76484_1_.setBlock(p_76484_3_ + 1, p_76484_4_ + l, p_76484_5_ - 1, Blocks.sandstone, 0, 2);
p_76484_1_.setBlock(p_76484_3_ + 1, p_76484_4_ + l, p_76484_5_ + 1, Blocks.sandstone, 0, 2);
}
return true;
}
}
}
|
package com.supervisor.xe;
import java.io.IOException;
import java.time.format.DateTimeFormatter;
import java.util.List;
import com.supervisor.sdk.time.PeriodicityUnit;
import org.cactoos.iterable.Joined;
import org.cactoos.iterable.Mapped;
import org.takes.rs.xe.XeSource;
import org.takes.rs.xe.XeWrap;
import org.xembly.Directive;
import org.xembly.Directives;
import com.minlessika.map.CleanMap;
import com.supervisor.indicator.Indicator;
import com.supervisor.indicator.Indicators;
public final class XeIndicator extends XeWrap {
public XeIndicator(final String root, final Indicator item) throws IOException {
this(transform(root, item));
}
public XeIndicator(final Indicator item) throws IOException {
this("indicator", item);
}
public XeIndicator(final List<Indicator> items) {
this(new Directives()
.add("indicators")
.append(
new Joined<>(
new Mapped<Indicator, Iterable<Directive>>(
item -> transform("indicator", item),
items
)
)
).up());
}
public XeIndicator(final Indicators items) throws IOException {
this(items.items());
}
public XeIndicator(final Iterable<Directive> dir) {
super(new XeSource() {
@Override
public Iterable<Directive> toXembly() throws IOException {
return dir;
}
});
}
private static Iterable<Directive> transform(final String root, final Indicator item) throws IOException {
return new Directives()
.add(root)
.add(
new CleanMap<String, Object>()
.add("id", item.id())
.add("code", item.code())
.add("name", item.name())
.add("type", item.type().name())
.add("type_id", item.type().id())
.add("short_name", item.type().shortName())
.add("description", item.description())
.add("periodicity", periodicityOf(item))
.add("periodicity_reference", String.format("%s", item.periodicity().reference().format(DateTimeFormatter.ISO_LOCAL_DATE)))
.add("is_template", item.isTemplate())
.add("activity_id", item.activity().id())
.add("activity", item.activity().name())
.add("sizeX", item.sizeX())
.add("sizeY", item.sizeY())
.add("row", item.row())
.add("col", item.col())
)
.up();
}
private static String periodicityOf(Indicator item) throws IOException {
if(item.periodicity().unit() == PeriodicityUnit.FOREVER) {
return "Tous les temps";
}
return String.format("Chaque %s %s", item.periodicity().number(), item.periodicity().unit().toString());
}
}
|
/*
* Copyright 2016-present Open Networking Laboratory
*
* 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.onosproject.lisp.msg.protocols;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import io.netty.buffer.ByteBuf;
import org.onlab.util.ImmutableByteSequence;
import org.onosproject.lisp.msg.exceptions.LispParseError;
import org.onosproject.lisp.msg.exceptions.LispReaderException;
import org.onosproject.lisp.msg.exceptions.LispWriterException;
import java.util.Arrays;
import java.util.List;
import static com.google.common.base.MoreObjects.toStringHelper;
import static org.onosproject.lisp.msg.protocols.DefaultLispMapRecord.MapRecordWriter;
/**
* Default LISP map notify message class.
*/
public final class DefaultLispMapNotify implements LispMapNotify {
private final long nonce;
private final short keyId;
private final short authDataLength;
private final byte[] authenticationData;
private final List<LispMapRecord> mapRecords;
/**
* A private constructor that protects object instantiation from external.
*
* @param nonce nonce
* @param keyId key identifier
* @param authenticationData authentication data
* @param mapRecords a collection of map records
*/
private DefaultLispMapNotify(long nonce, short keyId, short authDataLength,
byte[] authenticationData, List<LispMapRecord> mapRecords) {
this.nonce = nonce;
this.keyId = keyId;
this.authDataLength = authDataLength;
this.authenticationData = authenticationData;
this.mapRecords = mapRecords;
}
@Override
public LispType getType() {
return LispType.LISP_MAP_NOTIFY;
}
@Override
public void writeTo(ByteBuf byteBuf) {
// TODO: serialize LispMapRegister message
}
@Override
public Builder createBuilder() {
return new DefaultNotifyBuilder();
}
@Override
public long getNonce() {
return nonce;
}
@Override
public int getRecordCount() {
return mapRecords.size();
}
@Override
public short getKeyId() {
return keyId;
}
@Override
public short getAuthDataLength() {
return authDataLength;
}
@Override
public byte[] getAuthenticationData() {
if (authenticationData != null && authenticationData.length != 0) {
return ImmutableByteSequence.copyFrom(authenticationData).asArray();
} else {
return new byte[0];
}
}
@Override
public List<LispMapRecord> getMapRecords() {
return ImmutableList.copyOf(mapRecords);
}
@Override
public String toString() {
return toStringHelper(this)
.add("type", getType())
.add("nonce", nonce)
.add("keyId", keyId)
.add("authentication data length", authDataLength)
.add("authentication data", authenticationData)
.add("mapRecords", mapRecords).toString();
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
DefaultLispMapNotify that = (DefaultLispMapNotify) o;
return Objects.equal(nonce, that.nonce) &&
Objects.equal(keyId, that.keyId) &&
Objects.equal(authDataLength, that.authDataLength) &&
Arrays.equals(authenticationData, that.authenticationData);
}
@Override
public int hashCode() {
return Objects.hashCode(nonce, keyId, authDataLength) +
Arrays.hashCode(authenticationData);
}
public static final class DefaultNotifyBuilder implements NotifyBuilder {
private long nonce;
private short keyId;
private short authDataLength;
private byte[] authenticationData;
private List<LispMapRecord> mapRecords = Lists.newArrayList();
@Override
public LispType getType() {
return LispType.LISP_MAP_NOTIFY;
}
@Override
public NotifyBuilder withNonce(long nonce) {
this.nonce = nonce;
return this;
}
@Override
public NotifyBuilder withKeyId(short keyId) {
this.keyId = keyId;
return this;
}
@Override
public NotifyBuilder withAuthDataLength(short authDataLength) {
this.authDataLength = authDataLength;
return this;
}
@Override
public NotifyBuilder withAuthenticationData(byte[] authenticationData) {
if (authenticationData != null) {
this.authenticationData = authenticationData;
} else {
this.authenticationData = new byte[0];
}
return this;
}
@Override
public NotifyBuilder withMapRecords(List<LispMapRecord> mapRecords) {
if (mapRecords != null) {
this.mapRecords = ImmutableList.copyOf(mapRecords);
}
return this;
}
@Override
public LispMapNotify build() {
if (authenticationData == null) {
authenticationData = new byte[0];
}
return new DefaultLispMapNotify(nonce, keyId, authDataLength,
authenticationData, mapRecords);
}
}
/**
* A LISP message reader for MapNotify message.
*/
public static final class NotifyReader implements LispMessageReader<LispMapNotify> {
private static final int RESERVED_SKIP_LENGTH = 3;
@Override
public LispMapNotify readFrom(ByteBuf byteBuf) throws LispParseError, LispReaderException {
if (byteBuf.readerIndex() != 0) {
return null;
}
// skip first three bytes as they represent type and reserved fields
byteBuf.skipBytes(RESERVED_SKIP_LENGTH);
// record count -> 8 bits
byte recordCount = (byte) byteBuf.readUnsignedByte();
// nonce -> 64 bits
long nonce = byteBuf.readLong();
// keyId -> 16 bits
short keyId = byteBuf.readShort();
// authenticationDataLength -> 16 bits
short authLength = byteBuf.readShort();
// authenticationData -> depends on the authenticationDataLength
byte[] authData = new byte[authLength];
byteBuf.readBytes(authData);
List<LispMapRecord> mapRecords = Lists.newArrayList();
for (int i = 0; i < recordCount; i++) {
mapRecords.add(new DefaultLispMapRecord.MapRecordReader().readFrom(byteBuf));
}
return new DefaultNotifyBuilder()
.withNonce(nonce)
.withKeyId(keyId)
.withAuthDataLength(authLength)
.withAuthenticationData(authData)
.withMapRecords(mapRecords)
.build();
}
}
/**
* A LISP message reader for MapNotify message.
*/
public static final class NotifyWriter implements LispMessageWriter<LispMapNotify> {
private static final int NOTIFY_SHIFT_BIT = 4;
private static final int UNUSED_ZERO = 0;
@Override
public void writeTo(ByteBuf byteBuf, LispMapNotify message) throws LispWriterException {
// specify LISP message type
byte msgType = (byte) (LispType.LISP_MAP_NOTIFY.getTypeCode() << NOTIFY_SHIFT_BIT);
byteBuf.writeByte(msgType);
// reserved field
byteBuf.writeShort((short) UNUSED_ZERO);
// record count
byteBuf.writeByte(message.getMapRecords().size());
// nonce
byteBuf.writeLong(message.getNonce());
// keyId
byteBuf.writeShort(message.getKeyId());
// authentication data and its length
if (message.getAuthenticationData() == null) {
byteBuf.writeShort((short) 0);
} else {
byteBuf.writeShort(message.getAuthenticationData().length);
byteBuf.writeBytes(message.getAuthenticationData());
}
// serialize map records
MapRecordWriter writer = new MapRecordWriter();
List<LispMapRecord> records = message.getMapRecords();
for (int i = 0; i < records.size(); i++) {
writer.writeTo(byteBuf, records.get(i));
}
}
}
}
|
package me.chanjar.weixin.mp.api.impl;
/**
* <pre>
* 默认接口实现类,使用apache httpclient实现
* Created by Binary Wang on 2017-5-27.
* </pre>
*
* @author <a href="https://github.com/binarywang">Binary Wang</a>
*/
public class WxMpServiceImpl extends WxMpServiceApacheHttpClientImpl {
}
|
package com.numberone.project.system.areawater.controller;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.numberone.framework.aspectj.lang.annotation.Log;
import com.numberone.framework.aspectj.lang.enums.BusinessType;
import com.numberone.project.system.areawater.domain.Areawater;
import com.numberone.project.system.areawater.service.IAreawaterService;
import com.numberone.framework.web.controller.BaseController;
import com.numberone.framework.web.domain.AjaxResult;
import com.numberone.common.utils.poi.ExcelUtil;
import com.numberone.common.utils.StringUtils;
import com.numberone.framework.web.domain.Ztree;
/**
* 子地区水表数据Controller
*
* @author sqalong
* @date 2021-01-12
*/
@Controller
@RequestMapping("/system/areawater")
public class AreawaterController extends BaseController
{
private String prefix = "system/areawater";
@Autowired
private IAreawaterService areawaterService;
@RequiresPermissions("system:areawater:view")
@GetMapping()
public String areawater()
{
return prefix + "/areawater";
}
/**
* 查询子地区水表数据树列表
*/
@RequiresPermissions("system:areawater:list")
@PostMapping("/list")
@ResponseBody
public List<Areawater> list(Areawater areawater)
{
List<Areawater> list = areawaterService.selectAreawaterList(areawater);
return list;
}
/**
* 导出子地区水表数据列表
*/
@RequiresPermissions("system:areawater:export")
@Log(title = "子地区水表数据", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(Areawater areawater)
{
List<Areawater> list = areawaterService.selectAreawaterList(areawater);
ExcelUtil<Areawater> util = new ExcelUtil<Areawater>(Areawater.class);
return util.exportExcel(list, "areawater");
}
/**
* 新增子地区水表数据
*/
@GetMapping(value = { "/add/{id}", "/add/" })
public String add(@PathVariable(value = "id", required = false) Long id, ModelMap mmap)
{
if (StringUtils.isNotNull(id))
{
mmap.put("areawater", areawaterService.selectAreawaterById(id));
}
return prefix + "/add";
}
/**
* 新增保存子地区水表数据
*/
@RequiresPermissions("system:areawater:add")
@Log(title = "子地区水表数据", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(Areawater areawater)
{
return toAjax(areawaterService.insertAreawater(areawater));
}
/**
* 修改子地区水表数据
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
Areawater areawater = areawaterService.selectAreawaterById(id);
mmap.put("areawater", areawater);
return prefix + "/edit";
}
/**
* 修改保存子地区水表数据
*/
@RequiresPermissions("system:areawater:edit")
@Log(title = "子地区水表数据", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(Areawater areawater)
{
return toAjax(areawaterService.updateAreawater(areawater));
}
/**
* 删除
*/
@RequiresPermissions("system:areawater:remove")
@Log(title = "子地区水表数据", businessType = BusinessType.DELETE)
@GetMapping("/remove/{id}")
@ResponseBody
public AjaxResult remove(@PathVariable("id") Long id)
{
return toAjax(areawaterService.deleteAreawaterById(id));
}
/**
* 选择子地区水表数据树
*/
@GetMapping(value = { "/selectAreawaterTree/{id}", "/selectAreawaterTree/" })
public String selectAreawaterTree(@PathVariable(value = "id", required = false) Long id, ModelMap mmap)
{
if (StringUtils.isNotNull(id))
{
mmap.put("areawater", areawaterService.selectAreawaterById(id));
}
return prefix + "/tree";
}
/**
* 加载子地区水表数据树列表
*/
@GetMapping("/treeData")
@ResponseBody
public List<Ztree> treeData()
{
List<Ztree> ztrees = areawaterService.selectAreawaterTree();
return ztrees;
}
}
|
package antlr;
/* ANTLR Translator Generator
* Project led by Terence Parr at http://www.cs.usfca.edu
* Software rights: http://www.antlr.org/license.html
*
* $Id: //depot/code/org.antlr/release/antlr-2.7.6/antlr/TreeParserSharedInputState.java#1 $
*/
/** This object contains the data associated with an
* input AST. Multiple parsers
* share a single TreeParserSharedInputState to parse
* the same tree or to have the parser walk multiple
* trees.
*/
public class TreeParserSharedInputState {
/** Are we guessing (guessing>0)? */
public int guessing = 0;
}
|
package com.twu.biblioteca.Console.Menu.MenuEntries;
import com.twu.biblioteca.Checkable.CheckableItem;
import com.twu.biblioteca.Printer.PrintableEntry;
import com.twu.biblioteca.Printer.PrinterFormat;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
import java.util.function.ToIntFunction;
public abstract class ListAllItemsMenuEntry extends MenuEntry {
private HashMap<String, CheckableItem> checkables;
private PrinterFormat printerFormat = new PrinterFormat();
public ListAllItemsMenuEntry(HashMap<String, CheckableItem> checkableMap) {
this.checkables = checkableMap;
}
public abstract ArrayList<PrintableEntry> getBookPrintableEntries(CheckableItem item);
protected Integer computePropertyMaxLength(ToIntFunction mapper) {
return new ArrayList<>(checkables.values()).stream().mapToInt(mapper).max().orElse(0);
}
public ArrayList<ArrayList<PrintableEntry>> getAllMapEntries() {
ArrayList<ArrayList<PrintableEntry>> result = new ArrayList<>();
for (CheckableItem itm : checkables.values()) {
if (itm.isCheckedOut()) {
continue;
}
ArrayList<PrintableEntry> item = getBookPrintableEntries(itm);
result.add(item);
}
return result;
}
@Override
public void execute(PrintStream printStream, Scanner scan) {
ArrayList<ArrayList<PrintableEntry>> items = getAllMapEntries();
for(int i=0;i<items.size();i++){
printStream.println(printerFormat.checkableItem(items.get(i)));
}
}
}
|
package com.padcmyanmar.sfc.network;
import com.google.gson.Gson;
import com.padcmyanmar.sfc.events.RestApiEvents;
import com.padcmyanmar.sfc.network.reponses.GetNewsResponse;
import org.greenrobot.eventbus.EventBus;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by aung on 12/3/17.
*/
public class MMNewsDataAgentImpl implements MMNewsDataAgent {
private static MMNewsDataAgentImpl objInstance;
private MMNewsAPI theAPI;
private MMNewsDataAgentImpl() {
OkHttpClient okHttpClient = new OkHttpClient.Builder()
.connectTimeout(60, TimeUnit.SECONDS)
.writeTimeout(60, TimeUnit.SECONDS)
.readTimeout(60, TimeUnit.SECONDS)
.build();
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("http://padcmyanmar.com/padc-3/mm-news/apis/")
.addConverterFactory(GsonConverterFactory.create(new Gson()))
.client(okHttpClient)
.build();
theAPI = retrofit.create(MMNewsAPI.class);
}
public static MMNewsDataAgentImpl getInstance() {
if (objInstance == null) {
objInstance = new MMNewsDataAgentImpl();
}
return objInstance;
}
@Override
public void loadMMNews(String accessToken, int pageNo) {
/* Call<GetNewsResponse> loadMMNewsCall = theAPI.loadMMNews(pageNo, accessToken);
loadMMNewsCall.enqueue(new Callback<GetNewsResponse>() {
@Override
public void onResponse(Call<GetNewsResponse> call, Response<GetNewsResponse> response) {
GetNewsResponse getNewsResponse = response.body();
if (getNewsResponse != null
&& getNewsResponse.getNewsList().size() > 0) {
RestApiEvents.NewsDataLoadedEvent newsDataLoadedEvent = new RestApiEvents.NewsDataLoadedEvent(
getNewsResponse.getPageNo(), getNewsResponse.getNewsList());
EventBus.getDefault().post(newsDataLoadedEvent);
} else {
RestApiEvents.ErrorInvokingAPIEvent errorEvent
= new RestApiEvents.ErrorInvokingAPIEvent("No data could be loaded for now. Pls try again later.");
EventBus.getDefault().post(errorEvent);
}
}
@Override
public void onFailure(Call<GetNewsResponse> call, Throwable t) {
RestApiEvents.ErrorInvokingAPIEvent errorEvent = new RestApiEvents.ErrorInvokingAPIEvent(t.getMessage());
EventBus.getDefault().post(errorEvent);
}
});*/
}
}
|
package edu.incense.android.session;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import android.content.Context;
import android.util.Log;
import edu.incense.android.InCenseApplication;
import edu.incense.android.datatask.DataTask;
import edu.incense.android.datatask.DataTaskFactory;
import edu.incense.android.datatask.InputEnabledTask;
import edu.incense.android.datatask.OutputEnabledTask;
import edu.incense.android.datatask.PipeBuffer;
import edu.incense.android.datatask.model.Task;
import edu.incense.android.datatask.model.TaskRelation;
import edu.incense.android.datatask.model.TaskType;
import edu.incense.android.datatask.trigger.GeneralTrigger;
/**
* Prepares/starts/stops the actual recording session using a thread(?).
*
* @author mxpxgx
*
*/
public class SessionController {
private static final String TAG = "SessionController";
public enum ControllerState {
INITIATED, PREPARED, STARTED, STOPPING, STOPPED
};
private SessionCompletionListener listener;
private volatile ControllerState state;
private Session session;
private List<DataTask> tasks;
private Context context;
// private ExecutorService executorService;
public SessionController(Context context, Session session) {
this.context = context;
this.session = session;
tasks = new ArrayList<DataTask>();
// executorService = Executors.newSingleThreadExecutor();
setState(ControllerState.INITIATED);
}
public String getSessionName() {
if (session != null) {
return session.getName();
}
return null;
}
/**
* @param state
* the state to set
*/
private synchronized void setState(ControllerState state) {
this.state = state;
}
/**
* @return the state
*/
public synchronized ControllerState getState() {
return state;
}
public void registerListener(SessionCompletionListener listener) {
this.listener = listener;
}
private void prepareSession() {
if (getState() == ControllerState.STARTED
|| getState() == ControllerState.STOPPING) {
return;
}
// TODO The usage of this HashMap could be improved (?)
// Map<String, DataTask> taskCollection =
// InCenseApplication.getInstance()
// .getTaskCollection();
try {
Map<String, DataTask> taskCollection = ((InCenseApplication) context
.getApplicationContext()).getTaskCollection();
// Initializes DataTasks if necessary
List<Task> tasks = session.getTasks();
DataTask dataTask = null;
for (Task t : tasks) {
dataTask = taskCollection.get(t.getName());
if (dataTask == null) {
dataTask = DataTaskFactory.createDataTask(t, context);
taskCollection.put(t.getName(), dataTask);
Log.i(TAG, "DataTask added: " + t.getName());
}
this.tasks.add(dataTask);
}
// Establish relationships
List<TaskRelation> relations = session.getRelations();
Log.d(TAG, "Starting to add relations: " + relations.size());
if (relations != null) {
PipeBuffer pipeBuffer;
OutputEnabledTask outputTask;
InputEnabledTask inputTask;
for (TaskRelation tr : relations) {
DataTask task1 = taskCollection.get(tr.getTask1());
Log.i(TAG, "Task: " + tr.getTask1());
// When first task is a trigger
if (task1.getTaskType() == TaskType.Trigger
|| task1.getTaskType() == TaskType.StopTrigger) {
GeneralTrigger trigger = (GeneralTrigger) task1;
if (tr.getTask2().endsWith("Survey")) {
trigger.addSurvey(tr.getTask2());
} else if (tr.getTask2().endsWith("Session")) {
trigger.addSession(tr.getTask2());
} else {
DataTask task2 = (DataTask) taskCollection.get(tr
.getTask2());
trigger.addTask(task2);
}
}
// When is not a trigger
else {
outputTask = (OutputEnabledTask) taskCollection.get(tr
.getTask1());
inputTask = (InputEnabledTask) taskCollection.get(tr
.getTask2());
pipeBuffer = new PipeBuffer();
outputTask.addOutput(pipeBuffer);
inputTask.addInput(pipeBuffer);
}
Log.d(TAG, "Relation added: " + tr.getTask1() + " and "
+ tr.getTask2());
}
}
setState(ControllerState.PREPARED);
} catch (Exception e) {
Log.e(TAG, "Preparing controller failed", e);
}
}
public void start() {
if (getState() == ControllerState.INITIATED) {
prepareSession();
}
if (getState() == ControllerState.PREPARED
|| getState() == ControllerState.STOPPED) {
setState(ControllerState.STARTED);
// executorService.execute(sessionRunnable);
run();
}
}
public void stop() {
if (getState() == ControllerState.STARTED) {
setState(ControllerState.STOPPING);
while (getState() != ControllerState.STOPPED) {
try {
Thread.sleep(100);
} catch (Exception e) {
Log.e(TAG, "Runnable sleep failed", e);
}
}
}
}
/**
* Returns duration in milliseconds based on the measure and units of the
* duration of the session. If measure type is not valid, returns the
* duration units.
*
* @param session
* @return
*/
private long getDuration(Session session) {
long duration = session.getDurationUnits();
String measure = session.getDurationMeasure();
if (measure.compareTo("minutes") == 0) {
duration = duration * 1000L * 60L;
} else if (measure.compareTo("hours") == 0) {
duration = duration * 1000L * 60L * 60L;
}
return duration;
}
// private Runnable sessionRunnable = new Runnable() {
public void run() {
// Compute duration of the session
long duration = getDuration(session);
// Start DataTasks in the session
for (DataTask dt : tasks) {
Log.i(TAG, "Starting: " + dt.getClass().getName());
if (!dt.isTriggered()) {
dt.start();
}
}
// Wait until duration time elapses
long startTime = System.currentTimeMillis();
long runningTime = 0;
while (duration >= runningTime && getState() == ControllerState.STARTED) {
runningTime = System.currentTimeMillis() - startTime;
try {
Thread.sleep(1000);
} catch (Exception e) {
Log.e(TAG, "Runnable sleep failed", e);
}
}
// Stop DataTasks
for (DataTask dt : tasks) {
Log.i(TAG, "Stoping: " + dt.getClass().getName());
if (dt.isRunning()) {
dt.stop();
}
dt.clear();
}
setState(ControllerState.STOPPED);
listener.completedSession(getSessionName(), runningTime);
}
// };
}
|
/**
* Copyright (C) 2013-2014 EaseMob Technologies. All rights reserved.
*
* 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 cn.ucai.womenjuhuiba.adapter;
import java.io.File;
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.AsyncTask;
import android.view.View;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.Toast;
import cn.ucai.womenjuhuiba.applib.controller.HXSDKHelper;
import com.easemob.chat.EMChatManager;
import com.easemob.chat.EMMessage;
import com.easemob.chat.EMMessage.ChatType;
import com.easemob.chat.VoiceMessageBody;
import com.easemob.chatuidemo.R;
import cn.ucai.womenjuhuiba.activity.ChatActivity;
import com.easemob.util.EMLog;
public class VoicePlayClickListener implements View.OnClickListener {
private static final String TAG = "VoicePlayClickListener";
EMMessage message;
VoiceMessageBody voiceBody;
ImageView voiceIconView;
private AnimationDrawable voiceAnimation = null;
MediaPlayer mediaPlayer = null;
ImageView iv_read_status;
Activity activity;
private ChatType chatType;
private BaseAdapter adapter;
public static boolean isPlaying = false;
public static VoicePlayClickListener currentPlayListener = null;
/**
*
* @param message
* @param v
* @param iv_read_status
* @param context
* @param activity
* @param user
* @param chatType
*/
public VoicePlayClickListener(EMMessage message, ImageView v, ImageView iv_read_status, BaseAdapter adapter, Activity activity,
String username) {
this.message = message;
voiceBody = (VoiceMessageBody) message.getBody();
this.iv_read_status = iv_read_status;
this.adapter = adapter;
voiceIconView = v;
this.activity = activity;
this.chatType = message.getChatType();
}
public void stopPlayVoice() {
voiceAnimation.stop();
if (message.direct == EMMessage.Direct.RECEIVE) {
voiceIconView.setImageResource(R.drawable.chatfrom_voice_playing);
} else {
voiceIconView.setImageResource(R.drawable.chatto_voice_playing);
}
// stop play voice
if (mediaPlayer != null) {
mediaPlayer.stop();
mediaPlayer.release();
}
isPlaying = false;
((ChatActivity) activity).playMsgId = null;
adapter.notifyDataSetChanged();
}
public void playVoice(String filePath) {
if (!(new File(filePath).exists())) {
return;
}
((ChatActivity) activity).playMsgId = message.getMsgId();
AudioManager audioManager = (AudioManager) activity.getSystemService(Context.AUDIO_SERVICE);
mediaPlayer = new MediaPlayer();
if (HXSDKHelper.getInstance().getModel().getSettingMsgSpeaker()) {
audioManager.setMode(AudioManager.MODE_NORMAL);
audioManager.setSpeakerphoneOn(true);
mediaPlayer.setAudioStreamType(AudioManager.STREAM_RING);
} else {
audioManager.setSpeakerphoneOn(false);// 关闭扬声器
// 把声音设定成Earpiece(听筒)出来,设定为正在通话中
audioManager.setMode(AudioManager.MODE_IN_CALL);
mediaPlayer.setAudioStreamType(AudioManager.STREAM_VOICE_CALL);
}
try {
mediaPlayer.setDataSource(filePath);
mediaPlayer.prepare();
mediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
// TODO Auto-generated method stub
mediaPlayer.release();
mediaPlayer = null;
stopPlayVoice(); // stop animation
}
});
isPlaying = true;
currentPlayListener = this;
mediaPlayer.start();
showAnimation();
// 如果是接收的消息
if (message.direct == EMMessage.Direct.RECEIVE) {
try {
if (!message.isAcked) {
message.isAcked = true;
// 告知对方已读这条消息
if (chatType != ChatType.GroupChat && chatType != ChatType.ChatRoom)
EMChatManager.getInstance().ackMessageRead(message.getFrom(), message.getMsgId());
}
} catch (Exception e) {
message.isAcked = false;
}
if (!message.isListened() && iv_read_status != null && iv_read_status.getVisibility() == View.VISIBLE) {
// 隐藏自己未播放这条语音消息的标志
iv_read_status.setVisibility(View.INVISIBLE);
EMChatManager.getInstance().setMessageListened(message);
}
}
} catch (Exception e) {
}
}
// show the voice playing animation
private void showAnimation() {
// play voice, and start animation
if (message.direct == EMMessage.Direct.RECEIVE) {
voiceIconView.setImageResource(R.anim.voice_from_icon);
} else {
voiceIconView.setImageResource(R.anim.voice_to_icon);
}
voiceAnimation = (AnimationDrawable) voiceIconView.getDrawable();
voiceAnimation.start();
}
@Override
public void onClick(View v) {
String st = activity.getResources().getString(R.string.Is_download_voice_click_later);
if (isPlaying) {
if (((ChatActivity) activity).playMsgId != null && ((ChatActivity) activity).playMsgId.equals(message.getMsgId())) {
currentPlayListener.stopPlayVoice();
return;
}
currentPlayListener.stopPlayVoice();
}
if (message.direct == EMMessage.Direct.SEND) {
// for sent msg, we will try to play the voice file directly
playVoice(voiceBody.getLocalUrl());
} else {
if (message.status == EMMessage.Status.SUCCESS) {
File file = new File(voiceBody.getLocalUrl());
if (file.exists() && file.isFile())
playVoice(voiceBody.getLocalUrl());
else
EMLog.e(TAG, "file not exist");
} else if (message.status == EMMessage.Status.INPROGRESS) {
String s=new String();
Toast.makeText(activity, st, Toast.LENGTH_SHORT).show();
} else if (message.status == EMMessage.Status.FAIL) {
Toast.makeText(activity, st, Toast.LENGTH_SHORT).show();
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
EMChatManager.getInstance().asyncFetchMessage(message);
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
adapter.notifyDataSetChanged();
}
}.execute();
}
}
}
}
|
/* *****************************************************************************
* Copyright (c) 2015-2018 Skymind, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available 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.
*
* SPDX-License-Identifier: Apache-2.0
******************************************************************************/
package org.nd4j.linalg.activations.impl;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.nd4j.linalg.activations.BaseActivationFunction;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.api.ops.impl.transforms.strict.Swish;
import org.nd4j.linalg.api.ops.impl.transforms.strict.SwishDerivative;
import org.nd4j.linalg.factory.Nd4j;
import org.nd4j.common.primitives.Pair;
/**
* f(x) = x * sigmoid(x)
*/
@EqualsAndHashCode(callSuper = false)
@Getter
public class ActivationSwish extends BaseActivationFunction {
@Override
public INDArray getActivation(INDArray in, boolean training) {
Nd4j.getExecutioner().execAndReturn(new Swish(in));
return in;
}
@Override
public Pair<INDArray, INDArray> backprop(INDArray in, INDArray epsilon) {
assertShape(in, epsilon);
INDArray dLdz = Nd4j.getExecutioner().exec(new SwishDerivative(in));
dLdz.muli(epsilon);
return new Pair<>(dLdz, null);
}
@Override
public String toString() {
return "swish";
}
}
|
// ----------------------------------------------------------------------
// <copyright file="Base64.java" company="Expensify">
// (c) Copyright Expensify. http://www.expensify.com
// This source is subject to the Microsoft Public License (Ms-PL)
// Please see license.txt on https://github.com/Expensify/WindowsPhoneTestFramework
// All other rights reserved.
// </copyright>
//
// ------------------------------------------------------------------------
//
// this file borrowed from http://hi-android.info/src/android/util/Base64.java.html
//
// see Apache license details below
//
/*
* Copyright (C) 2010 The Android Open Source 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 com.expensify.testframework.utils;
import java.io.UnsupportedEncodingException;
/**
* Utilities for encoding and decoding the Base64 representation of
* binary data. See RFCs <a
* href="http://www.ietf.org/rfc/rfc2045.txt">2045</a> and <a
* href="http://www.ietf.org/rfc/rfc3548.txt">3548</a>.
*/
public class Base64 {
/**
* Default values for encoder/decoder flags.
*/
public static final int DEFAULT = 0;
/**
* Encoder flag bit to omit the padding '=' characters at the end
* of the output (if any).
*/
public static final int NO_PADDING = 1;
/**
* Encoder flag bit to omit all line terminators (i.e., the output
* will be on one long line).
*/
public static final int NO_WRAP = 2;
/**
* Encoder flag bit to indicate lines should be terminated with a
* CRLF pair instead of just an LF. Has no effect if {@code
* NO_WRAP} is specified as well.
*/
public static final int CRLF = 4;
/**
* Encoder/decoder flag bit to indicate using the "URL and
* filename safe" variant of Base64 (see RFC 3548 section 4) where
* {@code -} and {@code _} are used in place of {@code +} and
* {@code /}.
*/
public static final int URL_SAFE = 8;
/**
* Flag to pass to {@link Base64OutputStream} to indicate that it
* should not close the output stream it is wrapping when it
* itself is closed.
*/
public static final int NO_CLOSE = 16;
// --------------------------------------------------------
// shared code
// --------------------------------------------------------
/* package */ static abstract class Coder {
public byte[] output;
public int op;
/**
* Encode/decode another block of input data. this.output is
* provided by the caller, and must be big enough to hold all
* the coded data. On exit, this.opwill be set to the length
* of the coded data.
*
* @param finish true if this is the final call to process for
* this object. Will finalize the coder state and
* include any final bytes in the output.
*
* @return true if the input so far is good; false if some
* error has been detected in the input stream..
*/
public abstract boolean process(byte[] input, int offset, int len, boolean finish);
/**
* @return the maximum number of bytes a call to process()
* could produce for the given number of input bytes. This may
* be an overestimate.
*/
public abstract int maxOutputSize(int len);
}
// --------------------------------------------------------
// decoding
// --------------------------------------------------------
/**
* Decode the Base64-encoded data in input and return the data in
* a new byte array.
*
* <p>The padding '=' characters at the end are considered optional, but
* if any are present, there must be the correct number of them.
*
* @param str the input String to decode, which is converted to
* bytes using the default charset
* @param flags controls certain features of the decoded output.
* Pass {@code DEFAULT} to decode standard Base64.
*
* @throws IllegalArgumentException if the input contains
* incorrect padding
*/
public static byte[] decode(String str, int flags) {
return decode(str.getBytes(), flags);
}
/**
* Decode the Base64-encoded data in input and return the data in
* a new byte array.
*
* <p>The padding '=' characters at the end are considered optional, but
* if any are present, there must be the correct number of them.
*
* @param input the input array to decode
* @param flags controls certain features of the decoded output.
* Pass {@code DEFAULT} to decode standard Base64.
*
* @throws IllegalArgumentException if the input contains
* incorrect padding
*/
public static byte[] decode(byte[] input, int flags) {
return decode(input, 0, input.length, flags);
}
/**
* Decode the Base64-encoded data in input and return the data in
* a new byte array.
*
* <p>The padding '=' characters at the end are considered optional, but
* if any are present, there must be the correct number of them.
*
* @param input the data to decode
* @param offset the position within the input array at which to start
* @param len the number of bytes of input to decode
* @param flags controls certain features of the decoded output.
* Pass {@code DEFAULT} to decode standard Base64.
*
* @throws IllegalArgumentException if the input contains
* incorrect padding
*/
public static byte[] decode(byte[] input, int offset, int len, int flags) {
// Allocate space for the most data the input could represent.
// (It could contain less if it contains whitespace, etc.)
Decoder decoder = new Decoder(flags, new byte[len*3/4]);
if (!decoder.process(input, offset, len, true)) {
throw new IllegalArgumentException("bad base-64");
}
// Maybe we got lucky and allocated exactly enough output space.
if (decoder.op == decoder.output.length) {
return decoder.output;
}
// Need to shorten the array, so allocate a new one of the
// right size and copy.
byte[] temp = new byte[decoder.op];
System.arraycopy(decoder.output, 0, temp, 0, decoder.op);
return temp;
}
/* package */ static class Decoder extends Coder {
/**
* Lookup table for turning bytes into their position in the
* Base64 alphabet.
*/
private static final int DECODE[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
};
/**
* Decode lookup table for the "web safe" variant (RFC 3548
* sec. 4) where - and _ replace + and /.
*/
private static final int DECODE_WEBSAFE[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1, -1,
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63,
-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
};
/** Non-data values in the DECODE arrays. */
private static final int SKIP = -1;
private static final int EQUALS = -2;
/**
* States 0-3 are reading through the next input tuple.
* State 4 is having read one '=' and expecting exactly
* one more.
* State 5 is expecting no more data or padding characters
* in the input.
* State 6 is the error state; an error has been detected
* in the input and no future input can "fix" it.
*/
private int state; // state number (0 to 6)
private int value;
final private int[] alphabet;
public Decoder(int flags, byte[] output) {
this.output = output;
alphabet = ((flags & URL_SAFE) == 0) ? DECODE : DECODE_WEBSAFE;
state = 0;
value = 0;
}
/**
* @return an overestimate for the number of bytes {@code
* len} bytes could decode to.
*/
public int maxOutputSize(int len) {
return len * 3/4 + 10;
}
/**
* Decode another block of input data.
*
* @return true if the state machine is still healthy. false if
* bad base-64 data has been detected in the input stream.
*/
public boolean process(byte[] input, int offset, int len, boolean finish) {
if (this.state == 6) return false;
int p = offset;
len += offset;
// Using local variables makes the decoder about 12%
// faster than if we manipulate the member variables in
// the loop. (Even alphabet makes a measurable
// difference, which is somewhat surprising to me since
// the member variable is final.)
int state = this.state;
int value = this.value;
int op = 0;
final byte[] output = this.output;
final int[] alphabet = this.alphabet;
while (p < len) {
// Try the fast path: we're starting a new tuple and the
// next four bytes of the input stream are all data
// bytes. This corresponds to going through states
// 0-1-2-3-0. We expect to use this method for most of
// the data.
//
// If any of the next four bytes of input are non-data
// (whitespace, etc.), value will end up negative. (All
// the non-data values in decode are small negative
// numbers, so shifting any of them up and or'ing them
// together will result in a value with its top bit set.)
//
// You can remove this whole block and the output should
// be the same, just slower.
if (state == 0) {
while (p+4 <= len &&
(value = ((alphabet[input[p] & 0xff] << 18) |
(alphabet[input[p+1] & 0xff] << 12) |
(alphabet[input[p+2] & 0xff] << 6) |
(alphabet[input[p+3] & 0xff]))) >= 0) {
output[op+2] = (byte) value;
output[op+1] = (byte) (value >> 8);
output[op] = (byte) (value >> 16);
op += 3;
p += 4;
}
if (p >= len) break;
}
// The fast path isn't available -- either we've read a
// partial tuple, or the next four input bytes aren't all
// data, or whatever. Fall back to the slower state
// machine implementation.
int d = alphabet[input[p++] & 0xff];
switch (state) {
case 0:
if (d >= 0) {
value = d;
++state;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 1:
if (d >= 0) {
value = (value << 6) | d;
++state;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 2:
if (d >= 0) {
value = (value << 6) | d;
++state;
} else if (d == EQUALS) {
// Emit the last (partial) output tuple;
// expect exactly one more padding character.
output[op++] = (byte) (value >> 4);
state = 4;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 3:
if (d >= 0) {
// Emit the output triple and return to state 0.
value = (value << 6) | d;
output[op+2] = (byte) value;
output[op+1] = (byte) (value >> 8);
output[op] = (byte) (value >> 16);
op += 3;
state = 0;
} else if (d == EQUALS) {
// Emit the last (partial) output tuple;
// expect no further data or padding characters.
output[op+1] = (byte) (value >> 2);
output[op] = (byte) (value >> 10);
op += 2;
state = 5;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 4:
if (d == EQUALS) {
++state;
} else if (d != SKIP) {
this.state = 6;
return false;
}
break;
case 5:
if (d != SKIP) {
this.state = 6;
return false;
}
break;
}
}
if (!finish) {
// We're out of input, but a future call could provide
// more.
this.state = state;
this.value = value;
this.op = op;
return true;
}
// Done reading input. Now figure out where we are left in
// the state machine and finish up.
switch (state) {
case 0:
// Output length is a multiple of three. Fine.
break;
case 1:
// Read one extra input byte, which isn't enough to
// make another output byte. Illegal.
this.state = 6;
return false;
case 2:
// Read two extra input bytes, enough to emit 1 more
// output byte. Fine.
output[op++] = (byte) (value >> 4);
break;
case 3:
// Read three extra input bytes, enough to emit 2 more
// output bytes. Fine.
output[op++] = (byte) (value >> 10);
output[op++] = (byte) (value >> 2);
break;
case 4:
// Read one padding '=' when we expected 2. Illegal.
this.state = 6;
return false;
case 5:
// Read all the padding '='s we expected and no more.
// Fine.
break;
}
this.state = state;
this.op = op;
return true;
}
}
// --------------------------------------------------------
// encoding
// --------------------------------------------------------
/**
* Base64-encode the given data and return a newly allocated
* String with the result.
*
* @param input the data to encode
* @param flags controls certain features of the encoded output.
* Passing {@code DEFAULT} results in output that
* adheres to RFC 2045.
*/
public static String encodeToString(byte[] input, int flags) {
try {
return new String(encode(input, flags), "US-ASCII");
} catch (UnsupportedEncodingException e) {
// US-ASCII is guaranteed to be available.
throw new AssertionError(e);
}
}
/**
* Base64-encode the given data and return a newly allocated
* String with the result.
*
* @param input the data to encode
* @param offset the position within the input array at which to
* start
* @param len the number of bytes of input to encode
* @param flags controls certain features of the encoded output.
* Passing {@code DEFAULT} results in output that
* adheres to RFC 2045.
*/
public static String encodeToString(byte[] input, int offset, int len, int flags) {
try {
return new String(encode(input, offset, len, flags), "US-ASCII");
} catch (UnsupportedEncodingException e) {
// US-ASCII is guaranteed to be available.
throw new AssertionError(e);
}
}
/**
* Base64-encode the given data and return a newly allocated
* byte[] with the result.
*
* @param input the data to encode
* @param flags controls certain features of the encoded output.
* Passing {@code DEFAULT} results in output that
* adheres to RFC 2045.
*/
public static byte[] encode(byte[] input, int flags) {
return encode(input, 0, input.length, flags);
}
/**
* Base64-encode the given data and return a newly allocated
* byte[] with the result.
*
* @param input the data to encode
* @param offset the position within the input array at which to
* start
* @param len the number of bytes of input to encode
* @param flags controls certain features of the encoded output.
* Passing {@code DEFAULT} results in output that
* adheres to RFC 2045.
*/
public static byte[] encode(byte[] input, int offset, int len, int flags) {
Encoder encoder = new Encoder(flags, null);
// Compute the exact length of the array we will produce.
int output_len = len / 3 * 4;
// Account for the tail of the data and the padding bytes, if any.
if (encoder.do_padding) {
if (len % 3 > 0) {
output_len += 4;
}
} else {
switch (len % 3) {
case 0: break;
case 1: output_len += 2; break;
case 2: output_len += 3; break;
}
}
// Account for the newlines, if any.
if (encoder.do_newline && len > 0) {
output_len += (((len-1) / (3 * Encoder.LINE_GROUPS)) + 1) *
(encoder.do_cr ? 2 : 1);
}
encoder.output = new byte[output_len];
encoder.process(input, offset, len, true);
assert encoder.op == output_len;
return encoder.output;
}
/* package */ static class Encoder extends Coder {
/**
* Emit a new line every this many output tuples. Corresponds to
* a 76-character line length (the maximum allowable according to
* <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a>).
*/
public static final int LINE_GROUPS = 19;
/**
* Lookup table for turning Base64 alphabet positions (6 bits)
* into output bytes.
*/
private static final byte ENCODE[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/',
};
/**
* Lookup table for turning Base64 alphabet positions (6 bits)
* into output bytes.
*/
private static final byte ENCODE_WEBSAFE[] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_',
};
final private byte[] tail;
/* package */ int tailLen;
private int count;
final public boolean do_padding;
final public boolean do_newline;
final public boolean do_cr;
final private byte[] alphabet;
public Encoder(int flags, byte[] output) {
this.output = output;
do_padding = (flags & NO_PADDING) == 0;
do_newline = (flags & NO_WRAP) == 0;
do_cr = (flags & CRLF) != 0;
alphabet = ((flags & URL_SAFE) == 0) ? ENCODE : ENCODE_WEBSAFE;
tail = new byte[2];
tailLen = 0;
count = do_newline ? LINE_GROUPS : -1;
}
/**
* @return an overestimate for the number of bytes {@code
* len} bytes could encode to.
*/
public int maxOutputSize(int len) {
return len * 8/5 + 10;
}
public boolean process(byte[] input, int offset, int len, boolean finish) {
// Using local variables makes the encoder about 9% faster.
final byte[] alphabet = this.alphabet;
final byte[] output = this.output;
int op = 0;
int count = this.count;
int p = offset;
len += offset;
int v = -1;
// First we need to concatenate the tail of the previous call
// with any input bytes available now and see if we can empty
// the tail.
switch (tailLen) {
case 0:
// There was no tail.
break;
case 1:
if (p+2 <= len) {
// A 1-byte tail with at least 2 bytes of
// input available now.
v = ((tail[0] & 0xff) << 16) |
((input[p++] & 0xff) << 8) |
(input[p++] & 0xff);
tailLen = 0;
};
break;
case 2:
if (p+1 <= len) {
// A 2-byte tail with at least 1 byte of input.
v = ((tail[0] & 0xff) << 16) |
((tail[1] & 0xff) << 8) |
(input[p++] & 0xff);
tailLen = 0;
}
break;
}
if (v != -1) {
output[op++] = alphabet[(v >> 18) & 0x3f];
output[op++] = alphabet[(v >> 12) & 0x3f];
output[op++] = alphabet[(v >> 6) & 0x3f];
output[op++] = alphabet[v & 0x3f];
if (--count == 0) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
count = LINE_GROUPS;
}
}
// At this point either there is no tail, or there are fewer
// than 3 bytes of input available.
// The main loop, turning 3 input bytes into 4 output bytes on
// each iteration.
while (p+3 <= len) {
v = ((input[p] & 0xff) << 16) |
((input[p+1] & 0xff) << 8) |
(input[p+2] & 0xff);
output[op] = alphabet[(v >> 18) & 0x3f];
output[op+1] = alphabet[(v >> 12) & 0x3f];
output[op+2] = alphabet[(v >> 6) & 0x3f];
output[op+3] = alphabet[v & 0x3f];
p += 3;
op += 4;
if (--count == 0) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
count = LINE_GROUPS;
}
}
if (finish) {
// Finish up the tail of the input. Note that we need to
// consume any bytes in tail before any bytes
// remaining in input; there should be at most two bytes
// total.
if (p-tailLen == len-1) {
int t = 0;
v = ((tailLen > 0 ? tail[t++] : input[p++]) & 0xff) << 4;
tailLen -= t;
output[op++] = alphabet[(v >> 6) & 0x3f];
output[op++] = alphabet[v & 0x3f];
if (do_padding) {
output[op++] = '=';
output[op++] = '=';
}
if (do_newline) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
}
} else if (p-tailLen == len-2) {
int t = 0;
v = (((tailLen > 1 ? tail[t++] : input[p++]) & 0xff) << 10) |
(((tailLen > 0 ? tail[t++] : input[p++]) & 0xff) << 2);
tailLen -= t;
output[op++] = alphabet[(v >> 12) & 0x3f];
output[op++] = alphabet[(v >> 6) & 0x3f];
output[op++] = alphabet[v & 0x3f];
if (do_padding) {
output[op++] = '=';
}
if (do_newline) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
}
} else if (do_newline && op > 0 && count != LINE_GROUPS) {
if (do_cr) output[op++] = '\r';
output[op++] = '\n';
}
assert tailLen == 0;
assert p == len;
} else {
// Save the leftovers in tail to be consumed on the next
// call to encodeInternal.
if (p == len-1) {
tail[tailLen++] = input[p];
} else if (p == len-2) {
tail[tailLen++] = input[p];
tail[tailLen++] = input[p+1];
}
}
this.op = op;
this.count = count;
return true;
}
}
private Base64() { } // don't instantiate
}
|
package com.idlefish.flutterboost.containers;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.os.Build;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.Lifecycle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.io.Serializable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import com.idlefish.flutterboost.BoostPluginRegistry;
import com.idlefish.flutterboost.FlutterBoost;
import com.idlefish.flutterboost.Utils;
import com.idlefish.flutterboost.XFlutterView;
import com.idlefish.flutterboost.interfaces.IFlutterViewContainer;
import com.idlefish.flutterboost.interfaces.IOperateSyncer;
import io.flutter.Log;
import io.flutter.app.FlutterActivity;
import io.flutter.embedding.android.*;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.engine.FlutterShellArgs;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
import io.flutter.plugin.platform.PlatformPlugin;
import static android.content.ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW;
public class FlutterActivityAndFragmentDelegate implements IFlutterViewContainer {
private static final String TAG = "FlutterActivityAndFragmentDelegate";
@NonNull
private Host host;
@Nullable
private FlutterEngine flutterEngine;
@Nullable
private FlutterSplashView flutterSplashView;
@Nullable
private XFlutterView flutterView;
@Nullable
private PlatformPlugin platformPlugin;
private boolean isFlutterEngineFromHost;
protected IOperateSyncer mSyncer;
FlutterActivityAndFragmentDelegate(@NonNull Host host) {
this.host = host;
}
void release() {
this.host = null;
this.flutterEngine = null;
this.flutterView = null;
this.platformPlugin = null;
}
@Nullable
FlutterEngine getFlutterEngine() {
return flutterEngine;
}
XFlutterView getFlutterView() {
return flutterView;
}
void onAttach(@NonNull Context context) {
ensureAlive();
if (FlutterBoost.instance().platform().whenEngineStart() == FlutterBoost.ConfigBuilder.FLUTTER_ACTIVITY_CREATED) {
FlutterBoost.instance().doInitialFlutter();
}
// When "retain instance" is true, the FlutterEngine will survive configuration
// changes. Therefore, we create a new one only if one does not already exist.
if (flutterEngine == null) {
setupFlutterEngine();
}
// Regardless of whether or not a FlutterEngine already existed, the PlatformPlugin
// is bound to a specific Activity. Therefore, it needs to be created and configured
// every time this Fragment attaches to a new Activity.
// TODO(mattcarroll): the PlatformPlugin needs to be reimagined because it implicitly takes
// control of the entire window. This is unacceptable for non-fullscreen
// use-cases.
platformPlugin = host.providePlatformPlugin(host.getActivity(), flutterEngine);
host.configureFlutterEngine(flutterEngine);
host.getActivity().getWindow().setFormat(PixelFormat.TRANSLUCENT);
}
private void setupFlutterEngine() {
Log.d(TAG, "Setting up FlutterEngine.");
// Second, defer to subclasses for a custom FlutterEngine.
flutterEngine = host.provideFlutterEngine(host.getContext());
if (flutterEngine != null) {
isFlutterEngineFromHost = true;
return;
}
// Our host did not provide a custom FlutterEngine. Create a FlutterEngine to back our
// FlutterView.
Log.d(TAG, "No preferred FlutterEngine was provided. Creating a new FlutterEngine for"
+ " this NewFlutterFragment.");
isFlutterEngineFromHost = false;
}
@SuppressLint("ResourceType")
@NonNull
View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
Log.v(TAG, "Creating FlutterView.");
flutterEngine.getActivityControlSurface().attachToActivity(
host.getActivity(),
host.getLifecycle()
);
mSyncer = FlutterBoost.instance().containerManager().generateSyncer(this);
ensureAlive();
flutterView = new XFlutterView(host.getActivity(), FlutterBoost.instance().platform().renderMode(), host.getTransparencyMode());
flutterSplashView = new FlutterSplashView(host.getContext());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
flutterSplashView.setId(View.generateViewId());
} else {
// TODO(mattcarroll): Find a better solution to this ID. This is a random, static ID.
// It might conflict with other Views, and it means that only a single FlutterSplashView
// can exist in a View hierarchy at one time.
flutterSplashView.setId(486947586);
}
flutterSplashView.displayFlutterViewWithSplash(flutterView, host.provideSplashScreen());
mSyncer.onCreate();
return flutterSplashView;
}
void onStart() {
Log.v(TAG, "onStart()");
ensureAlive();
// We post() the code that attaches the FlutterEngine to our FlutterView because there is
// some kind of blocking logic on the native side when the surface is connected. That lag
// causes launching Activitys to wait a second or two before launching. By post()'ing this
// behavior we are able to move this blocking logic to after the Activity's launch.
// TODO(mattcarroll): figure out how to avoid blocking the MAIN thread when connecting a surface
}
void onResume() {
mSyncer.onAppear();
Log.v(TAG, "onResume()");
ensureAlive();
flutterEngine.getLifecycleChannel().appIsResumed();
BoostPluginRegistry registry = (BoostPluginRegistry) FlutterBoost.instance().getPluginRegistry();
ActivityPluginBinding binding = registry.getRegistrarAggregate().getActivityPluginBinding();
if (binding != null && (binding.getActivity() != this.host.getActivity())) {
flutterEngine.getActivityControlSurface().attachToActivity(
host.getActivity(),
host.getLifecycle()
);
}
}
void onPostResume() {
Log.v(TAG, "onPostResume()");
ensureAlive();
Utils.setStatusBarLightMode(host.getActivity(), true);
}
void onPause() {
Log.v(TAG, "onPause()");
ensureAlive();
mSyncer.onDisappear();
flutterEngine.getLifecycleChannel().appIsInactive();
}
void onStop() {
Log.v(TAG, "onStop()");
ensureAlive();
}
void onDestroyView() {
Log.v(TAG, "onDestroyView()");
mSyncer.onDestroy();
ensureAlive();
BoostPluginRegistry registry = (BoostPluginRegistry) FlutterBoost.instance().getPluginRegistry();
ActivityPluginBinding binding = registry.getRegistrarAggregate().getActivityPluginBinding();
if (binding != null && (binding.getActivity() == this.host.getActivity())) {
registry.getRegistrarAggregate().onDetachedFromActivityForConfigChanges();
flutterEngine.getActivityControlSurface().detachFromActivityForConfigChanges();
}
flutterView.release();
}
void onDetach() {
Log.v(TAG, "onDetach()");
ensureAlive();
// Null out the platformPlugin to avoid a possible retain cycle between the plugin, this Fragment,
// and this Fragment's Activity.
if (platformPlugin != null) {
platformPlugin.destroy();
platformPlugin = null;
}
Utils.fixInputMethodManagerLeak(host.getActivity());
}
void onBackPressed() {
mSyncer.onBackPressed();
ensureAlive();
}
void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
mSyncer.onRequestPermissionsResult(requestCode, permissions, grantResults);
ensureAlive();
if (flutterEngine != null) {
Log.v(TAG, "Forwarding onRequestPermissionsResult() to FlutterEngine:\n"
+ "requestCode: " + requestCode + "\n"
+ "permissions: " + Arrays.toString(permissions) + "\n"
+ "grantResults: " + Arrays.toString(grantResults));
flutterEngine.getActivityControlSurface().onRequestPermissionsResult(requestCode, permissions, grantResults);
} else {
Log.w(TAG, "onRequestPermissionResult() invoked before NewFlutterFragment was attached to an Activity.");
}
}
void onNewIntent(@NonNull Intent intent) {
mSyncer.onNewIntent(intent);
ensureAlive();
if (flutterEngine != null) {
Log.v(TAG, "Forwarding onNewIntent() to FlutterEngine.");
flutterEngine.getActivityControlSurface().onNewIntent(intent);
} else {
Log.w(TAG, "onNewIntent() invoked before NewFlutterFragment was attached to an Activity.");
}
}
void onActivityResult(int requestCode, int resultCode, Intent data) {
mSyncer.onActivityResult(requestCode, resultCode, data);
Map<String, Object> result = null;
if (data != null) {
Serializable rlt = data.getSerializableExtra(RESULT_KEY);
if (rlt instanceof Map) {
result = (Map<String, Object>) rlt;
}
}
mSyncer.onContainerResult(requestCode, resultCode, result);
ensureAlive();
if (flutterEngine != null) {
Log.v(TAG, "Forwarding onActivityResult() to FlutterEngine:\n"
+ "requestCode: " + requestCode + "\n"
+ "resultCode: " + resultCode + "\n"
+ "data: " + data);
flutterEngine.getActivityControlSurface().onActivityResult(requestCode, resultCode, data);
} else {
Log.w(TAG, "onActivityResult() invoked before NewFlutterFragment was attached to an Activity.");
}
}
void onUserLeaveHint() {
ensureAlive();
if (flutterEngine != null) {
Log.v(TAG, "Forwarding onUserLeaveHint() to FlutterEngine.");
flutterEngine.getActivityControlSurface().onUserLeaveHint();
} else {
Log.w(TAG, "onUserLeaveHint() invoked before NewFlutterFragment was attached to an Activity.");
}
}
void onTrimMemory(int level) {
mSyncer.onTrimMemory(level);
ensureAlive();
if (flutterEngine != null) {
// Use a trim level delivered while the application is running so the
// framework has a chance to react to the notification.
if (level == TRIM_MEMORY_RUNNING_LOW) {
Log.v(TAG, "Forwarding onTrimMemory() to FlutterEngine. Level: " + level);
flutterEngine.getSystemChannel().sendMemoryPressureWarning();
}
} else {
Log.w(TAG, "onTrimMemory() invoked before NewFlutterFragment was attached to an Activity.");
}
}
void onLowMemory() {
Log.v(TAG, "Forwarding onLowMemory() to FlutterEngine.");
mSyncer.onLowMemory();
ensureAlive();
flutterEngine.getSystemChannel().sendMemoryPressureWarning();
}
/**
* Ensures that this delegate has not been {@link #release()}'ed.
* <p>
* An {@code IllegalStateException} is thrown if this delegate has been {@link #release()}'ed.
*/
private void ensureAlive() {
if (host == null) {
throw new IllegalStateException("Cannot execute method on a destroyed FlutterActivityAndFragmentDelegate.");
}
}
@Override
public Activity getContextActivity() {
return (Activity) this.host.getActivity();
}
@Override
public FlutterSplashView getBoostFlutterView() {
return this.flutterSplashView;
}
@Override
public void finishContainer(Map<String, Object> result) {
if (result != null) {
setBoostResult(this.host.getActivity(), new HashMap<>(result));
this.host.getActivity().finish();
} else {
this.host.getActivity().finish();
}
}
public void setBoostResult(Activity activity, HashMap result) {
Intent intent = new Intent();
if (result != null) {
intent.putExtra(IFlutterViewContainer.RESULT_KEY, result);
}
activity.setResult(Activity.RESULT_OK, intent);
}
@Override
public String getContainerUrl() {
return this.host.getContainerUrl();
}
@Override
public Map getContainerUrlParams() {
return this.host.getContainerUrlParams();
}
@Override
public void onContainerShown() {
}
@Override
public void onContainerHidden() {
}
/**
* The {@link FlutterActivity} or {@link FlutterFragment} that owns this
* {@code FlutterActivityAndFragmentDelegate}.
*/
/* package */ interface Host extends SplashScreenProvider, FlutterEngineProvider, FlutterEngineConfigurator {
/**
* Returns the {@link Context} that backs the host {@link Activity} or {@code Fragment}.
*/
@NonNull
Context getContext();
/**
* Returns the host {@link Activity} or the {@code Activity} that is currently attached
* to the host {@code Fragment}.
*/
@Nullable
Activity getActivity();
/**
* Returns the {@link Lifecycle} that backs the host {@link Activity} or {@code Fragment}.
*/
@NonNull
Lifecycle getLifecycle();
/**
* Returns the {@link FlutterShellArgs} that should be used when initializing Flutter.
*/
@NonNull
FlutterShellArgs getFlutterShellArgs();
/**
* Returns the {@link FlutterView.RenderMode} used by the {@link FlutterView} that
* displays the {@link FlutterEngine}'s content.
*/
@NonNull
FlutterView.RenderMode getRenderMode();
/**
* Returns the {@link FlutterView.TransparencyMode} used by the {@link FlutterView} that
* displays the {@link FlutterEngine}'s content.
*/
@NonNull
FlutterView.TransparencyMode getTransparencyMode();
@Nullable
@Override
SplashScreen provideSplashScreen();
/**
* Returns the {@link FlutterEngine} that should be rendered to a {@link FlutterView}.
* <p>
* If {@code null} is returned, a new {@link FlutterEngine} will be created automatically.
*/
@Nullable
@Override
FlutterEngine provideFlutterEngine(@NonNull Context context);
/**
* Hook for the host to create/provide a {@link PlatformPlugin} if the associated
* Flutter experience should control system chrome.
*/
@Nullable
PlatformPlugin providePlatformPlugin(@Nullable Activity activity, @NonNull FlutterEngine flutterEngine);
/**
* Hook for the host to configure the {@link FlutterEngine} as desired.
*/
@Override
void configureFlutterEngine(@NonNull FlutterEngine flutterEngine);
/**
* Returns true if the {@link FlutterEngine}'s plugin system should be connected to the
* host {@link Activity}, allowing plugins to interact with it.
*/
boolean shouldAttachEngineToActivity();
String getContainerUrl();
Map getContainerUrlParams();
}
}
|
/*
* Copyright 2017 peter.
*
* 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.jini.print.attribute.standard;
import javax.print.attribute.Attribute;
import javax.print.attribute.EnumSyntax;
/**
* The "baling-when" member attribute specified when baling is performed. The
* default value may be derived from the "finishing-template" value or, if a
* default value cannot be determined from that value, using an implementation
* or site defined value.
*
* @see Bailing
* @see FinishingsCollection
* @see FinishingTemplate
*
* @author peter
*/
public class BailingWhen extends EnumSyntax implements Attribute {
public static final BailingWhen AFTER_SETS = new BailingWhen(0),
AFTER_JOB = new BailingWhen(1);
private BailingWhen(int i) {
super(i);
}
@Override
public Class<? extends Attribute> getCategory() {
return BailingWhen.class;
}
@Override
public String getName() {
return "bailing-when";
}
@Override
protected String[] getStringTable() {
return new String[]{
"after-sets",
"after-job",};
}
@Override
protected EnumSyntax[] getEnumValueTable() {
return new EnumSyntax[]{
AFTER_SETS,
AFTER_JOB,};
}
}
|
/*
* The MIT License (MIT)
*
* Copyright (c) Despector <https://despector.voxelgenesis.com>
* Copyright (c) contributors
*
* 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 org.spongepowered.despector.ast.insn;
import org.spongepowered.despector.ast.AstVisitor;
import org.spongepowered.despector.ast.Locals.LocalInstance;
import org.spongepowered.despector.ast.insn.cst.DoubleConstant;
import org.spongepowered.despector.ast.insn.cst.FloatConstant;
import org.spongepowered.despector.ast.insn.cst.IntConstant;
import org.spongepowered.despector.ast.insn.cst.LongConstant;
import org.spongepowered.despector.ast.insn.cst.NullConstant;
import org.spongepowered.despector.ast.insn.cst.StringConstant;
import org.spongepowered.despector.ast.insn.cst.TypeConstant;
import org.spongepowered.despector.ast.insn.misc.Cast;
import org.spongepowered.despector.ast.insn.misc.InstanceOf;
import org.spongepowered.despector.ast.insn.misc.MultiNewArray;
import org.spongepowered.despector.ast.insn.misc.NewArray;
import org.spongepowered.despector.ast.insn.misc.NumberCompare;
import org.spongepowered.despector.ast.insn.misc.Ternary;
import org.spongepowered.despector.ast.insn.op.NegativeOperator;
import org.spongepowered.despector.ast.insn.op.Operator;
import org.spongepowered.despector.ast.insn.var.ArrayAccess;
import org.spongepowered.despector.ast.insn.var.InstanceFieldAccess;
import org.spongepowered.despector.ast.insn.var.LocalAccess;
import org.spongepowered.despector.ast.insn.var.StaticFieldAccess;
import org.spongepowered.despector.ast.stmt.invoke.InstanceMethodInvoke;
import org.spongepowered.despector.ast.stmt.invoke.Lambda;
import org.spongepowered.despector.ast.stmt.invoke.MethodReference;
import org.spongepowered.despector.ast.stmt.invoke.New;
import org.spongepowered.despector.ast.stmt.invoke.StaticMethodInvoke;
/**
* A visitor which may be used to traverse the AST.
*/
public interface InstructionVisitor extends AstVisitor {
void visitArrayAccess(ArrayAccess insn);
void visitCast(Cast insn);
void visitDoubleConstant(DoubleConstant insn);
void visitDynamicInvoke(Lambda insn);
void visitFloatConstant(FloatConstant insn);
void visitInstanceFieldAccess(InstanceFieldAccess insn);
void visitInstanceMethodInvoke(InstanceMethodInvoke insn);
void visitInstanceOf(InstanceOf insn);
void visitIntConstant(IntConstant insn);
void visitLocalAccess(LocalAccess insn);
void visitLocalInstance(LocalInstance local);
void visitLongConstant(LongConstant insn);
void visitMultiNewArray(MultiNewArray insn);
void visitNegativeOperator(NegativeOperator insn);
void visitNew(New insn);
void visitNewArray(NewArray insn);
void visitNullConstant(NullConstant insn);
void visitNumberCompare(NumberCompare insn);
void visitOperator(Operator insn);
void visitStaticFieldAccess(StaticFieldAccess insn);
void visitStaticMethodInvoke(StaticMethodInvoke insn);
void visitStringConstant(StringConstant insn);
void visitTernary(Ternary insn);
void visitTypeConstant(TypeConstant insn);
void visitMethodReference(MethodReference methodReference);
}
|
/*
* This file was automatically generated by EvoSuite
* Wed Dec 16 16:15:49 GMT 2015
*/
package org.jsecurity.authc;
import static org.junit.Assert.*;
import org.junit.Test;
import java.net.Inet4Address;
import java.net.InetAddress;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.mock.java.net.MockInetAddress;
import org.evosuite.runtime.testdata.EvoSuiteFile;
import org.evosuite.runtime.testdata.EvoSuiteLocalAddress;
import org.evosuite.runtime.testdata.EvoSuiteRemoteAddress;
import org.evosuite.runtime.testdata.EvoSuiteURL;
import org.jsecurity.authc.UsernamePasswordToken;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true)
public class UsernamePasswordToken_ESTest extends UsernamePasswordToken_ESTest_scaffolding {
//Test case number: 0
/*
* 1 covered goal:
* Goal 1. org.jsecurity.authc.UsernamePasswordToken.toString()Ljava/lang/String;: I43 Branch 7 IFNULL L363 - false
*/
@Test
public void test00() throws Throwable {
char[] charArray0 = new char[5];
Inet4Address inet4Address0 = (Inet4Address)MockInetAddress.getByName("");
UsernamePasswordToken usernamePasswordToken0 = new UsernamePasswordToken("", charArray0, true, (InetAddress) inet4Address0);
String string0 = usernamePasswordToken0.toString();
assertTrue(usernamePasswordToken0.isRememberMe());
assertEquals("org.jsecurity.authc.UsernamePasswordToken - , rememberMe=true (/127.0.0.1)", string0);
}
//Test case number: 1
/*
* 1 covered goal:
* Goal 1. org.jsecurity.authc.UsernamePasswordToken.toString()Ljava/lang/String;: I43 Branch 7 IFNULL L363 - true
*/
@Test
public void test01() throws Throwable {
UsernamePasswordToken usernamePasswordToken0 = new UsernamePasswordToken();
String string0 = usernamePasswordToken0.toString();
assertEquals("org.jsecurity.authc.UsernamePasswordToken - null, rememberMe=false", string0);
}
//Test case number: 2
@Test
public void test02() throws Throwable {
UsernamePasswordToken usernamePasswordToken0 = new UsernamePasswordToken("", "", true);
assertTrue(usernamePasswordToken0.isRememberMe());
usernamePasswordToken0.clear();
assertFalse(usernamePasswordToken0.isRememberMe());
}
//Test case number: 3
/*
* 1 covered goal:
* Goal 1. org.jsecurity.authc.UsernamePasswordToken.clear()V: I22 Branch 5 IFNULL L340 - true
*/
@Test
public void test03() throws Throwable {
UsernamePasswordToken usernamePasswordToken0 = new UsernamePasswordToken();
usernamePasswordToken0.clear();
assertFalse(usernamePasswordToken0.isRememberMe());
}
//Test case number: 4
/*
* 1 covered goal:
* Goal 1. org.jsecurity.authc.UsernamePasswordToken.isRememberMe()Z: root-Branch
*/
@Test
public void test04() throws Throwable {
UsernamePasswordToken usernamePasswordToken0 = new UsernamePasswordToken();
boolean boolean0 = usernamePasswordToken0.isRememberMe();
assertFalse(boolean0);
}
//Test case number: 5
/*
* 1 covered goal:
* Goal 1. org.jsecurity.authc.UsernamePasswordToken.getInetAddress()Ljava/net/InetAddress;: root-Branch
*/
@Test
public void test05() throws Throwable {
UsernamePasswordToken usernamePasswordToken0 = new UsernamePasswordToken("", "", true);
InetAddress inetAddress0 = usernamePasswordToken0.getInetAddress();
assertTrue(usernamePasswordToken0.isRememberMe());
}
//Test case number: 6
/*
* 2 covered goals:
* Goal 1. org.jsecurity.authc.UsernamePasswordToken.setUsername(Ljava/lang/String;)V: root-Branch
* Goal 2. org.jsecurity.authc.UsernamePasswordToken.<init>(Ljava/lang/String;[C)V: root-Branch
*/
@Test
public void test06() throws Throwable {
char[] charArray0 = new char[5];
UsernamePasswordToken usernamePasswordToken0 = new UsernamePasswordToken((String) null, charArray0);
usernamePasswordToken0.setUsername("");
assertFalse(usernamePasswordToken0.isRememberMe());
}
//Test case number: 7
/*
* 1 covered goal:
* Goal 1. org.jsecurity.authc.UsernamePasswordToken.setPassword([C)V: root-Branch
*/
@Test
public void test07() throws Throwable {
UsernamePasswordToken usernamePasswordToken0 = new UsernamePasswordToken();
char[] charArray0 = new char[8];
usernamePasswordToken0.setPassword(charArray0);
assertFalse(usernamePasswordToken0.isRememberMe());
}
//Test case number: 8
/*
* 3 covered goals:
* Goal 1. org.jsecurity.authc.UsernamePasswordToken.getPassword()[C: root-Branch
* Goal 2. org.jsecurity.authc.UsernamePasswordToken.getCredentials()Ljava/lang/Object;: root-Branch
* Goal 3. org.jsecurity.authc.UsernamePasswordToken.<init>(Ljava/lang/String;[CZ)V: root-Branch
*/
@Test
public void test08() throws Throwable {
char[] charArray0 = new char[10];
UsernamePasswordToken usernamePasswordToken0 = new UsernamePasswordToken("'<QgY-@*/Bf", charArray0, true);
Object object0 = usernamePasswordToken0.getCredentials();
assertTrue(usernamePasswordToken0.isRememberMe());
}
//Test case number: 9
/*
* 2 covered goals:
* Goal 1. org.jsecurity.authc.UsernamePasswordToken.getPrincipal()Ljava/lang/Object;: root-Branch
* Goal 2. org.jsecurity.authc.UsernamePasswordToken.getUsername()Ljava/lang/String;: root-Branch
*/
@Test
public void test09() throws Throwable {
UsernamePasswordToken usernamePasswordToken0 = new UsernamePasswordToken();
Object object0 = usernamePasswordToken0.getPrincipal();
assertFalse(usernamePasswordToken0.isRememberMe());
}
//Test case number: 10
/*
* 5 covered goals:
* Goal 1. org.jsecurity.authc.UsernamePasswordToken.<init>(Ljava/lang/String;[CLjava/net/InetAddress;)V: root-Branch
* Goal 2. org.jsecurity.authc.UsernamePasswordToken.<init>(Ljava/lang/String;[CZLjava/net/InetAddress;)V: root-Branch
* Goal 3. org.jsecurity.authc.UsernamePasswordToken.clear()V: I22 Branch 5 IFNULL L340 - false
* Goal 4. org.jsecurity.authc.UsernamePasswordToken.clear()V: I35 Branch 6 IF_ICMPGE L341 - true
* Goal 5. org.jsecurity.authc.UsernamePasswordToken.clear()V: I35 Branch 6 IF_ICMPGE L341 - false
*/
@Test
public void test10() throws Throwable {
char[] charArray0 = new char[6];
UsernamePasswordToken usernamePasswordToken0 = new UsernamePasswordToken("WnKr", charArray0, (InetAddress) null);
usernamePasswordToken0.clear();
assertFalse(usernamePasswordToken0.isRememberMe());
}
//Test case number: 11
/*
* 1 covered goal:
* Goal 1. org.jsecurity.authc.UsernamePasswordToken.setInetAddress(Ljava/net/InetAddress;)V: root-Branch
*/
@Test
public void test11() throws Throwable {
UsernamePasswordToken usernamePasswordToken0 = new UsernamePasswordToken();
byte[] byteArray0 = new byte[4];
Inet4Address inet4Address0 = (Inet4Address)MockInetAddress.getByAddress("", byteArray0);
usernamePasswordToken0.setInetAddress((InetAddress) inet4Address0);
assertFalse(usernamePasswordToken0.isRememberMe());
}
//Test case number: 12
/*
* 2 covered goals:
* Goal 1. org.jsecurity.authc.UsernamePasswordToken.setRememberMe(Z)V: root-Branch
* Goal 2. org.jsecurity.authc.UsernamePasswordToken.<init>()V: root-Branch
*/
@Test
public void test12() throws Throwable {
UsernamePasswordToken usernamePasswordToken0 = new UsernamePasswordToken();
usernamePasswordToken0.setRememberMe(false);
assertFalse(usernamePasswordToken0.isRememberMe());
}
}
|
package io.split.android.client.validators;
import com.google.common.base.Strings;
/**
* Validates an instance of Key class.
*/
public class KeyValidatorImpl implements KeyValidator {
private final int MAX_MATCHING_KEY_LENGTH = ValidationConfig.getInstance().getMaximumKeyLength();
private final int MAX_BUCKETING_KEY_LENGTH = ValidationConfig.getInstance().getMaximumKeyLength();
@Override
public ValidationErrorInfo validate(String matchingKey, String bucketingKey) {
if (matchingKey == null) {
return new ValidationErrorInfo(ValidationErrorInfo.ERROR_SOME, "you passed a null key, matching key must be a non-empty string");
}
if (Strings.isNullOrEmpty(matchingKey.trim())) {
return new ValidationErrorInfo(ValidationErrorInfo.ERROR_SOME,"you passed an empty string, matching key must be a non-empty string");
}
if (matchingKey.length() > MAX_MATCHING_KEY_LENGTH) {
return new ValidationErrorInfo(ValidationErrorInfo.ERROR_SOME, "matching key too long - must be " + MAX_MATCHING_KEY_LENGTH + " characters or less");
}
if (bucketingKey != null) {
if (Strings.isNullOrEmpty(bucketingKey.trim())) {
return new ValidationErrorInfo(ValidationErrorInfo.ERROR_SOME, "you passed an empty string, bucketing key must be null or a non-empty string");
}
if (bucketingKey.length() > MAX_BUCKETING_KEY_LENGTH) {
return new ValidationErrorInfo(ValidationErrorInfo.ERROR_SOME, "bucketing key too long - must be " + MAX_MATCHING_KEY_LENGTH + " characters or less");
}
}
return null;
}
}
|
/*
* 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.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.videointelligence.v1p2beta1.model;
/**
* A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative
* to the original image and range from 0 to 1.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Cloud Video Intelligence API. For a detailed
* explanation see:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class GoogleCloudVideointelligenceV2beta1NormalizedVertex extends com.google.api.client.json.GenericJson {
/**
* X coordinate.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Float x;
/**
* Y coordinate.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Float y;
/**
* X coordinate.
* @return value or {@code null} for none
*/
public java.lang.Float getX() {
return x;
}
/**
* X coordinate.
* @param x x or {@code null} for none
*/
public GoogleCloudVideointelligenceV2beta1NormalizedVertex setX(java.lang.Float x) {
this.x = x;
return this;
}
/**
* Y coordinate.
* @return value or {@code null} for none
*/
public java.lang.Float getY() {
return y;
}
/**
* Y coordinate.
* @param y y or {@code null} for none
*/
public GoogleCloudVideointelligenceV2beta1NormalizedVertex setY(java.lang.Float y) {
this.y = y;
return this;
}
@Override
public GoogleCloudVideointelligenceV2beta1NormalizedVertex set(String fieldName, Object value) {
return (GoogleCloudVideointelligenceV2beta1NormalizedVertex) super.set(fieldName, value);
}
@Override
public GoogleCloudVideointelligenceV2beta1NormalizedVertex clone() {
return (GoogleCloudVideointelligenceV2beta1NormalizedVertex) super.clone();
}
}
|
package proholz.xsdparser;
/**
* States the exact number of length to a given type, either a {@link String}, a {@link List}, or another measurable type.
* The value is defined as an {@link Integer}.
*/
public class XsdLength extends XsdIntegerRestrictions {
public static final String XSD_TAG = "xsd:length";
public static final String XS_TAG = "xs:length";
private XsdLength(XsdParserCore! parser, Dictionary<String, String>! elementFieldsMapParam) {
super(parser, elementFieldsMapParam);
value = AttributeValidations.validateRequiredNonNegativeInteger(XSD_TAG, VALUE_TAG, attributesMap.Item[VALUE_TAG]);
}
@Override
public void accept(XsdAbstractElementVisitor xsdAbstractElementVisitor) {
super.accept(xsdAbstractElementVisitor);
xsdAbstractElementVisitor.visit(this);
}
public static ReferenceBase parse(XsdParserCore! parser, XmlElement node){
return ReferenceBase.createFromXsd(new XsdLength(parser, convertNodeMap(node.Attributes)));
}
}
|
package com.tencent.cos.xml.model.bucket;
import com.tencent.cos.xml.common.ClientErrorCode;
import com.tencent.cos.xml.exception.CosXmlClientException;
import com.tencent.cos.xml.exception.CosXmlServiceException;
import com.tencent.cos.xml.model.CosXmlResult;
import com.tencent.cos.xml.model.tag.Tagging;
import com.tencent.cos.xml.transfer.XmlParser;
import com.tencent.qcloud.core.http.HttpResponse;
import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
final public class GetBucketTaggingResult extends CosXmlResult {
public Tagging tagging;
@Override
public void parseResponseBody(HttpResponse response) throws CosXmlServiceException, CosXmlClientException {
super.parseResponseBody(response);
tagging = new Tagging();
try {
XmlParser.parseTagging(response.byteStream(), tagging);
} catch (XmlPullParserException e) {
throw new CosXmlClientException(ClientErrorCode.SERVERERROR.getCode(), e);
} catch (IOException e) {
throw new CosXmlClientException(ClientErrorCode.POOR_NETWORK.getCode(), e);
}
}
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.storage.internal.avro.implementation.schema;
import com.azure.storage.internal.avro.implementation.AvroConstants;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.JsonNodeType;
import java.util.LinkedList;
import java.util.List;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.ARRAY;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.BOOLEAN;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.BYTES;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.DOUBLE;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.ENUM;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.FIXED;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.FLOAT;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.INT;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.LONG;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.MAP;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.NULL;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.PRIMITIVE_TYPES;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.RECORD;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.STRING;
import static com.azure.storage.internal.avro.implementation.AvroConstants.Types.UNION;
/**
* A class that represents an Avro type.
* AvroTypes function as a type that stores all the data a schema may need.
* @see AvroType#getType(JsonNode)
*/
public class AvroType {
private final String type;
/**
* Creates a new instance of an AvroType.
* @param type The type associated with the AvroType.
*/
AvroType(String type) {
this.type = type;
}
/**
* @return the type.
*/
String getType() {
return type;
}
/**
* An avro primitive type.
* No additional data is required to parse a primitive.
*/
static class AvroPrimitiveType extends AvroType {
/**
* Creates a new instance of an AvroPrimitiveType.
* @param type The type associated with the AvroType.
* @see AvroConstants.Types#PRIMITIVE_TYPES
*/
AvroPrimitiveType(String type) {
super(type);
}
}
/**
* An avro record type.
* A record is defined by an array of fields.
* @see AvroRecordField
*/
static class AvroRecordType extends AvroType {
private final String name;
private final List<AvroRecordField> fields;
/**
* Creates a new instance of an AvroRecordType.
* @param name The name of the record.
* @param fields The fields in the record.
*/
AvroRecordType(String name, List<AvroRecordField> fields) {
super(RECORD);
this.name = name;
this.fields = fields;
}
/**
* @return the name.
*/
String getName() {
return name;
}
/**
* @return the fields.
*/
List<AvroRecordField> getFields() {
return fields;
}
}
/**
* An avro enum type.
* An enum is defined by an array of symbols.
*/
static class AvroEnumType extends AvroType {
private final String name;
private final List<String> symbols;
/**
* Creates a new instance of an AvroEnumType.
* @param name The name of the enum.
* @param symbols The symbols associated with the enum.
*/
AvroEnumType(String name, List<String> symbols) {
super(ENUM);
this.name = name;
this.symbols = symbols;
}
/**
* @return the name.
*/
String getName() {
return name;
}
/**
* @return the symbols.
*/
List<String> getSymbols() {
return symbols;
}
}
/**
* An avro array type.
* An array is defined by the type of the items in it.
*/
static class AvroArrayType extends AvroType {
private final AvroType itemType;
/**
* Creates a new instance of an AvroArrayType.
* @param itemType The type of the items in the array.
*/
AvroArrayType(AvroType itemType) {
super(ARRAY);
this.itemType = itemType;
}
/**
* @return the type of the items.
*/
AvroType getItemType() {
return itemType;
}
}
/**
* An avro map type.
* A map is defined by the type of the values in it. The key by default is of type String.
*/
static class AvroMapType extends AvroType {
private final AvroType valueType;
/**
* Creates a new instance of an AvroMapType.
* @param valueType The type of the values in the map.
*/
AvroMapType(AvroType valueType) {
super(MAP);
this.valueType = valueType;
}
/**
* @return the type of the values.
*/
AvroType getValueType() {
return valueType;
}
}
/**
* An avro union type.
* A union is defined by an array of AvroTypes it could possibly be.
*/
static class AvroUnionType extends AvroType {
private final List<AvroType> types;
/**
* Creates a new instance of an AvroUnionType.
* @param types The types that define a union.
*/
AvroUnionType(List<AvroType> types) {
super(UNION);
this.types = types;
}
/**
* @return the types.
*/
List<AvroType> getTypes() {
return types;
}
}
/**
* An avro fixed type.
* Fixed is defined by the number of bytes to read.
*/
static class AvroFixedType extends AvroType {
private final Long size;
/**
* Creates a new instance of an AvroFixedType.
* @param size The number of bytes to read.
*/
AvroFixedType(Long size) {
super(FIXED);
this.size = size;
}
/**
* @return The number of bytes to read.
*/
Long getSize() {
return size;
}
}
/**
* Gets the AvroType specified by the json string.
*
* @param jsonString the json string.
* @return {@link AvroType}
*/
public static AvroType getType(String jsonString) {
JsonNode schemaJson;
try {
schemaJson = new ObjectMapper().readTree(jsonString);
} catch (JsonProcessingException e) {
throw new IllegalStateException(e.getMessage());
}
return AvroType.getType(schemaJson);
}
/**
* Gets the AvroType specified by the JsonNode.
*
* @param jsonSchema the json node that specifies the schema.
* @return {@link AvroType}
*/
private static AvroType getType(JsonNode jsonSchema) {
JsonNodeType nodeType = jsonSchema.getNodeType();
switch (nodeType) {
/* Primitive Avro Types. */
case STRING:
return getJsonStringType(jsonSchema);
/* Union Avro Types. */
case ARRAY:
return getJsonArrayType(jsonSchema);
/* Complex Avro Types. */
case OBJECT:
return getJsonObjectType(jsonSchema);
default:
throw new RuntimeException("Unsupported type");
}
}
/**
* Gets the AvroType specified by a String JsonNode.
*
* @param jsonSchema the json node that specifies the schema.
* @return {@link AvroType}
*/
private static AvroType getJsonStringType(JsonNode jsonSchema) {
/* TODO (gapra): This could also be another named type. Not required for QQ/CF. */
/* Example: "long" */
String type = jsonSchema.asText();
if (PRIMITIVE_TYPES.contains(type)) {
return new AvroPrimitiveType(type);
} else {
throw new RuntimeException("Unsupported type");
}
}
/**
* Gets the AvroType specified by an Array JsonNode.
*
* @param jsonSchema the json node that specifies the schema.
* @return {@link AvroType}
*/
private static AvroType getJsonArrayType(JsonNode jsonSchema) {
/* Example: ["null","string"] */
List<AvroType> types = getUnionTypes(jsonSchema);
return new AvroUnionType(types);
}
/**
* Gets the AvroType specified by an Object JsonNode.
*
* @param jsonSchema the json node that specifies the schema.
* @return {@link AvroType}
*/
private static AvroType getJsonObjectType(JsonNode jsonSchema) {
String type = jsonSchema.get("type").asText();
switch (type) {
/* Primitive Types. */
case NULL:
case BOOLEAN:
case INT:
case LONG:
case FLOAT:
case DOUBLE:
case BYTES:
case STRING:
/* Example: {"type": "string"} */
return new AvroPrimitiveType(type);
case RECORD: {
/* Example: { "type": "record",
"name": "test",
"fields" : [
{"name": "a", "type": "long"},
{"name": "b", "type": "string"}
]
} */
if (jsonSchema.get("aliases") != null) {
throw new IllegalArgumentException("Unexpected aliases in schema.");
}
String fullName = jsonSchema.get("name").asText();
String name = fullName.substring(fullName.lastIndexOf('.') + 1);
List<AvroRecordField> fields = getRecordFields(jsonSchema.withArray("fields"));
return new AvroRecordType(name, fields);
}
case ENUM: {
/* Example: { "type": "enum",
"name": "Suit",
"symbols" : ["SPADES", "HEARTS", "DIAMONDS", "CLUBS"]
} */
if (jsonSchema.get("aliases") != null) {
throw new IllegalArgumentException("Unexpected aliases in schema.");
}
String name = jsonSchema.get("name").asText();
List<String> symbols = getEnumSymbols(jsonSchema.withArray("symbols"));
return new AvroEnumType(name, symbols);
}
case ARRAY: {
/* Example: {"type": "array", "items": "string"} */
AvroType items = getType(jsonSchema.get("items"));
return new AvroArrayType(items);
}
case MAP: {
/* Example: {"type": "map", "values": "long"} */
AvroType values = getType(jsonSchema.get("values"));
return new AvroMapType(values);
}
case FIXED: {
/* Example: {"type": "fixed", "size": 16, "name": "md5"} */
Long size = jsonSchema.get("size").asLong();
return new AvroFixedType(size);
}
default:
throw new RuntimeException("Unsupported type");
}
}
/**
* Gets the types of the union.
*
* @param parent the JsonNode array
* @return The types of the union.
*/
private static List<AvroType> getUnionTypes(JsonNode parent) {
/* Example: ["null","string"] */
List<AvroType> types = new LinkedList<>();
/* Get the type of each JsonNode in parent. */
for (JsonNode child : parent) {
AvroType type = getType(child);
types.add(type);
}
return types;
}
/**
* Gets the symbols of the enum.
*
* @param parent The JsonNode array
* @return The symbols of the enum.
*/
private static List<String> getEnumSymbols(JsonNode parent) {
/* Example: ["A", "B", "C", "D"] */
List<String> symbols = new LinkedList<>();
for (JsonNode child : parent) {
symbols.add(child.asText());
}
return symbols;
}
/**
* Gets the fields of the record.
*
* @param parent The JsonNode array
* @return The fields of the record.
*/
private static List<AvroRecordField> getRecordFields(JsonNode parent) {
/* Example: [ {"name": "a", "type": "long"}, {"name": "b", "type": "string"} ] */
List<AvroRecordField> fields = new LinkedList<>();
/* Get the name and type of each JsonNode in parent. */
for (JsonNode child : parent) {
String name = child.get("name").asText();
AvroType type = getType(child.get("type"));
fields.add(new AvroRecordField(name, type));
}
return fields;
}
}
|
package com.enhinck.db.excel;
import com.monitorjbl.xlsx.StreamingReader;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.map.HashedMap;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
public class CommonExcelReadUtil {
@Data
public static class ColumnObject {
private Field field;
private ExcelColumn excelColumn;
}
static Map<Class<?>, IExcelCellValueAdapt> cache = new HashedMap();
/**
* @param is 流
* @param classType 类型
* @return
*/
public static <T> List<T> getDataFromExcel(InputStream is, Class<T> classType) {
List<T> objects = new ArrayList<>();
try {
// 缓存读取 低内存占用
Workbook workbook = StreamingReader.builder()
.rowCacheSize(50)
.bufferSize(4096)
.open(is);
int sheetCount = 0;
Field[] fields = classType.getDeclaredFields();
Map<Integer, ColumnObject> colums = new HashMap<>();
processCellIndexColumn(workbook, fields, colums);
for (Sheet sheet : workbook) {
int rowCount = 0;
for (Row r : sheet) {
int cellIndex = 0;
T object = classType.newInstance();
for (Cell cell : r) {
ColumnObject columnObject = colums.get(cellIndex);
ExcelColumn excelColumn = columnObject.getExcelColumn();
IExcelCellValueAdapt iExcelCellValueAdapt = cache.get(excelColumn.valueAdapt());
if (iExcelCellValueAdapt == null) {
iExcelCellValueAdapt = excelColumn.valueAdapt().newInstance();
cache.put(excelColumn.valueAdapt(), iExcelCellValueAdapt);
}
Object value = iExcelCellValueAdapt.getCellValue(cell);
columnObject.getField().setAccessible(true);
columnObject.getField().set(object, value);
cellIndex++;
}
objects.add(object);
rowCount++;
}
sheetCount++;
}
} catch (Exception e) {
log.info("读取excel异常:{}", e);
}
return objects;
}
/**
* 获取excel标题列
*
* @param workbook
* @param fields
* @param colums
*/
private static void processCellIndexColumn(Workbook workbook, Field[] fields, Map<Integer, ColumnObject> colums) {
// 反射获取对应字段值
out:
for (Sheet sheet : workbook) {
for (Row r : sheet) {
int cellIndex = 0;
for (Cell cell : r) {
String columnName = cell.getStringCellValue();
for (int i = 0; i < fields.length; i++) {
Field field = fields[i];
ExcelColumn excelColumn = fields[i].getAnnotation(ExcelColumn.class);
if (excelColumn != null) {
if (excelColumn.name().equalsIgnoreCase(columnName)) {
ColumnObject columnObject = new ColumnObject();
columnObject.setExcelColumn(excelColumn);
columnObject.setField(field);
colums.put(cellIndex, columnObject);
}
}
}
cellIndex++;
}
break out;
}
}
}
}
|
package de.adorsys.opba.protocol.xs2a.tests.e2e.sandbox;
import de.adorsys.opba.protocol.api.common.Approach;
import de.adorsys.opba.protocol.xs2a.tests.e2e.JGivenConfig;
import de.adorsys.opba.protocol.xs2a.tests.e2e.sandbox.servers.SandboxServers;
import de.adorsys.opba.protocol.xs2a.tests.e2e.sandbox.servers.WebDriverBasedPaymentInitiation;
import de.adorsys.opba.protocol.xs2a.tests.e2e.sandbox.servers.config.RetryableConfig;
import de.adorsys.opba.protocol.xs2a.tests.e2e.stages.PaymentResult;
import de.adorsys.psd2.sandbox.cms.starter.Xs2aCmsAutoConfiguration;
import io.github.bonigarcia.seljup.SeleniumExtension;
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.UUID;
import static de.adorsys.opba.protocol.xs2a.tests.Const.ENABLE_HEAVY_TESTS;
import static de.adorsys.opba.protocol.xs2a.tests.Const.TRUE_BOOL;
import static de.adorsys.opba.protocol.xs2a.tests.TestProfiles.MOCKED_SANDBOX;
import static de.adorsys.opba.protocol.xs2a.tests.TestProfiles.ONE_TIME_POSTGRES_RAMFS;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
/**
* Happy-path heavy test that uses Dynamic-Sandbox to drive banking-protocol.
*/
@EnabledIfEnvironmentVariable(named = ENABLE_HEAVY_TESTS, matches = TRUE_BOOL)
@EnableAutoConfiguration(exclude = {
HypermediaAutoConfiguration.class,
Xs2aCmsAutoConfiguration.class,
ManagementWebSecurityAutoConfiguration.class,
SecurityAutoConfiguration.class,
})
@ExtendWith(SeleniumExtension.class)
@Transactional(propagation = Propagation.NOT_SUPPORTED)
@SpringBootTest(classes = {RetryableConfig.class, Xs2aRealSandboxProtocolApplication.class, JGivenConfig.class}, webEnvironment = RANDOM_PORT)
@ActiveProfiles(profiles = {ONE_TIME_POSTGRES_RAMFS, MOCKED_SANDBOX})
public class SandboxE2EProtocolPisTest extends SandboxCommonTest<
SandboxServers<? extends SandboxServers<?>>,
WebDriverBasedPaymentInitiation<? extends WebDriverBasedPaymentInitiation<?>>,
PaymentResult<? extends PaymentResult<?>>> {
private final String OPBA_LOGIN = UUID.randomUUID().toString();
private final String OPBA_PASSWORD = UUID.randomUUID().toString();
@ParameterizedTest
@EnumSource(Approach.class)
void testSinglePaymentUsingEmbedded(Approach expectedApproach) {
given()
.enabled_embedded_sandbox_mode()
.preferred_sca_approach_selected_for_all_banks_in_opba(expectedApproach)
.rest_assured_points_to_opba_server_with_fintech_signer_on_banking_api()
.user_registered_in_opba_with_credentials(OPBA_LOGIN, OPBA_PASSWORD);
when()
.fintech_calls_initiate_payment_for_max_musterman()
.and()
.user_logged_in_into_opba_as_opba_user_with_credentials_using_fintech_supplied_url(OPBA_LOGIN, OPBA_PASSWORD)
.and()
.user_max_musterman_provided_initial_parameters_to_make_payment()
.and()
.user_max_musterman_provided_password_to_embedded_authorization()
.and()
.user_max_musterman_selected_sca_challenge_type_email2_to_embedded_authorization()
.and()
.user_max_musterman_provided_sca_challenge_result_to_embedded_authorization_and_sees_redirect_to_fintech_ok();
then()
.open_banking_has_stored_payment()
.fintech_calls_payment_activation_for_current_authorization_id()
.fintech_calls_payment_status()
.fintech_calls_payment_information_iban_700();
}
@ParameterizedTest
@EnumSource(Approach.class)
void testSinglePaymentUsingRedirect(Approach expectedApproach, FirefoxDriver firefoxDriver) {
given()
.enabled_redirect_sandbox_mode()
.preferred_sca_approach_selected_for_all_banks_in_opba(expectedApproach)
.rest_assured_points_to_opba_server_with_fintech_signer_on_banking_api()
.user_registered_in_opba_with_credentials(OPBA_LOGIN, OPBA_PASSWORD);
when()
.fintech_calls_initiate_payment_for_anton_brueckner()
.and()
.user_logged_in_into_opba_as_opba_user_with_credentials_using_fintech_supplied_url(OPBA_LOGIN, OPBA_PASSWORD)
.and()
.user_anton_brueckner_provided_initial_parameters_to_authorize_initiation_payment()
.and()
.user_anton_brueckner_sees_that_he_needs_to_be_redirected_to_aspsp_and_redirects_to_aspsp()
.and()
.sandbox_anton_brueckner_navigates_to_bank_auth_page(firefoxDriver)
.and()
.sandbox_anton_brueckner_inputs_username_and_password(firefoxDriver)
.and()
.sandbox_anton_brueckner_confirms_consent_information(firefoxDriver)
.and()
.sandbox_anton_brueckner_selects_sca_method(firefoxDriver)
.and()
.sandbox_anton_brueckner_provides_sca_challenge_result(firefoxDriver)
.and()
.sandbox_anton_brueckner_clicks_redirect_back_to_tpp_button_api_localhost_cookie_only(firefoxDriver);
then()
.open_banking_has_stored_payment()
.fintech_calls_payment_activation_for_current_authorization_id()
.fintech_calls_payment_status()
.fintech_calls_payment_information_iban_400();
}
}
|
package thaumcraft.api.research.theorycraft;
import net.minecraft.init.Blocks;
public class AidBookshelf implements ITheorycraftAid {
@Override
public Object getAidObject() {
return Blocks.BOOKSHELF;
}
@Override
public Class<TheorycraftCard>[] getCards() {
return new Class[] {CardBalance.class, CardNotation.class, CardNotation.class, CardStudy.class, CardStudy.class, CardStudy.class};
}
}
|
/*
* Copyright 2002-2017 the original author or authors.
*
* 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.
*/
package org.springframework.web.context.request;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
import org.junit.runners.Parameterized.Parameters;
import org.springframework.mock.web.test.MockHttpServletRequest;
import org.springframework.mock.web.test.MockHttpServletResponse;
import static org.junit.Assert.*;
/**
* Parameterized tests for {@link ServletWebRequest}.
*
* @author Juergen Hoeller
* @author Brian Clozel
* @author Markus Malkusch
*/
@RunWith(Parameterized.class)
public class ServletWebRequestHttpMethodsTests {
private static final String CURRENT_TIME = "Wed, 09 Apr 2014 09:57:42 GMT";
private SimpleDateFormat dateFormat;
private MockHttpServletRequest servletRequest;
private MockHttpServletResponse servletResponse;
private ServletWebRequest request;
private Date currentDate;
@Parameter
public String method;
@Parameters(name = "{0}")
static public Iterable<Object[]> safeMethods() {
return Arrays.asList(new Object[][] {
{"GET"}, {"HEAD"}
});
}
@Before
public void setup() {
currentDate = new Date();
dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
servletRequest = new MockHttpServletRequest(method, "https://example.org");
servletResponse = new MockHttpServletResponse();
request = new ServletWebRequest(servletRequest, servletResponse);
}
@Test
public void checkNotModifiedNon2xxStatus() {
long epochTime = currentDate.getTime();
servletRequest.addHeader("If-Modified-Since", epochTime);
servletResponse.setStatus(304);
assertFalse(request.checkNotModified(epochTime));
assertEquals(304, servletResponse.getStatus());
assertNull(servletResponse.getHeader("Last-Modified"));
}
@Test // SPR-13516
public void checkNotModifiedInvalidStatus() {
long epochTime = currentDate.getTime();
servletRequest.addHeader("If-Modified-Since", epochTime);
servletResponse.setStatus(0);
assertFalse(request.checkNotModified(epochTime));
}
@Test // SPR-14559
public void checkNotModifiedInvalidIfNoneMatchHeader() {
String etag = "\"etagvalue\"";
servletRequest.addHeader("If-None-Match", "missingquotes");
assertFalse(request.checkNotModified(etag));
assertEquals(200, servletResponse.getStatus());
assertEquals(etag, servletResponse.getHeader("ETag"));
}
@Test
public void checkNotModifiedHeaderAlreadySet() {
long epochTime = currentDate.getTime();
servletRequest.addHeader("If-Modified-Since", epochTime);
servletResponse.addHeader("Last-Modified", CURRENT_TIME);
assertTrue(request.checkNotModified(epochTime));
assertEquals(304, servletResponse.getStatus());
assertEquals(1, servletResponse.getHeaders("Last-Modified").size());
assertEquals(CURRENT_TIME, servletResponse.getHeader("Last-Modified"));
}
@Test
public void checkNotModifiedTimestamp() {
long epochTime = currentDate.getTime();
servletRequest.addHeader("If-Modified-Since", epochTime);
assertTrue(request.checkNotModified(epochTime));
assertEquals(304, servletResponse.getStatus());
assertEquals(dateFormat.format(epochTime), servletResponse.getHeader("Last-Modified"));
}
@Test
public void checkModifiedTimestamp() {
long oneMinuteAgo = currentDate.getTime() - (1000 * 60);
servletRequest.addHeader("If-Modified-Since", oneMinuteAgo);
assertFalse(request.checkNotModified(currentDate.getTime()));
assertEquals(200, servletResponse.getStatus());
assertEquals(dateFormat.format(currentDate.getTime()), servletResponse.getHeader("Last-Modified"));
}
@Test
public void checkNotModifiedETag() {
String etag = "\"Foo\"";
servletRequest.addHeader("If-None-Match", etag);
assertTrue(request.checkNotModified(etag));
assertEquals(304, servletResponse.getStatus());
assertEquals(etag, servletResponse.getHeader("ETag"));
}
@Test
public void checkNotModifiedETagWithSeparatorChars() {
String etag = "\"Foo, Bar\"";
servletRequest.addHeader("If-None-Match", etag);
assertTrue(request.checkNotModified(etag));
assertEquals(304, servletResponse.getStatus());
assertEquals(etag, servletResponse.getHeader("ETag"));
}
@Test
public void checkModifiedETag() {
String currentETag = "\"Foo\"";
String oldETag = "Bar";
servletRequest.addHeader("If-None-Match", oldETag);
assertFalse(request.checkNotModified(currentETag));
assertEquals(200, servletResponse.getStatus());
assertEquals(currentETag, servletResponse.getHeader("ETag"));
}
@Test
public void checkNotModifiedUnpaddedETag() {
String etag = "Foo";
String paddedETag = String.format("\"%s\"", etag);
servletRequest.addHeader("If-None-Match", paddedETag);
assertTrue(request.checkNotModified(etag));
assertEquals(304, servletResponse.getStatus());
assertEquals(paddedETag, servletResponse.getHeader("ETag"));
}
@Test
public void checkModifiedUnpaddedETag() {
String currentETag = "Foo";
String oldETag = "Bar";
servletRequest.addHeader("If-None-Match", oldETag);
assertFalse(request.checkNotModified(currentETag));
assertEquals(200, servletResponse.getStatus());
assertEquals(String.format("\"%s\"", currentETag), servletResponse.getHeader("ETag"));
}
@Test
public void checkNotModifiedWildcardIsIgnored() {
String etag = "\"Foo\"";
servletRequest.addHeader("If-None-Match", "*");
assertFalse(request.checkNotModified(etag));
assertEquals(200, servletResponse.getStatus());
assertEquals(etag, servletResponse.getHeader("ETag"));
}
@Test
public void checkNotModifiedETagAndTimestamp() {
String etag = "\"Foo\"";
servletRequest.addHeader("If-None-Match", etag);
servletRequest.addHeader("If-Modified-Since", currentDate.getTime());
assertTrue(request.checkNotModified(etag, currentDate.getTime()));
assertEquals(304, servletResponse.getStatus());
assertEquals(etag, servletResponse.getHeader("ETag"));
assertEquals(dateFormat.format(currentDate.getTime()), servletResponse.getHeader("Last-Modified"));
}
@Test // SPR-14224
public void checkNotModifiedETagAndModifiedTimestamp() {
String etag = "\"Foo\"";
servletRequest.addHeader("If-None-Match", etag);
long currentEpoch = currentDate.getTime();
long oneMinuteAgo = currentEpoch - (1000 * 60);
servletRequest.addHeader("If-Modified-Since", oneMinuteAgo);
assertTrue(request.checkNotModified(etag, currentEpoch));
assertEquals(304, servletResponse.getStatus());
assertEquals(etag, servletResponse.getHeader("ETag"));
assertEquals(dateFormat.format(currentEpoch), servletResponse.getHeader("Last-Modified"));
}
@Test
public void checkModifiedETagAndNotModifiedTimestamp() {
String currentETag = "\"Foo\"";
String oldETag = "\"Bar\"";
servletRequest.addHeader("If-None-Match", oldETag);
long epochTime = currentDate.getTime();
servletRequest.addHeader("If-Modified-Since", epochTime);
assertFalse(request.checkNotModified(currentETag, epochTime));
assertEquals(200, servletResponse.getStatus());
assertEquals(currentETag, servletResponse.getHeader("ETag"));
assertEquals(dateFormat.format(epochTime), servletResponse.getHeader("Last-Modified"));
}
@Test
public void checkNotModifiedETagWeakStrong() {
String etag = "\"Foo\"";
String weakETag = String.format("W/%s", etag);
servletRequest.addHeader("If-None-Match", etag);
assertTrue(request.checkNotModified(weakETag));
assertEquals(304, servletResponse.getStatus());
assertEquals(weakETag, servletResponse.getHeader("ETag"));
}
@Test
public void checkNotModifiedETagStrongWeak() {
String etag = "\"Foo\"";
servletRequest.addHeader("If-None-Match", String.format("W/%s", etag));
assertTrue(request.checkNotModified(etag));
assertEquals(304, servletResponse.getStatus());
assertEquals(etag, servletResponse.getHeader("ETag"));
}
@Test
public void checkNotModifiedMultipleETags() {
String etag = "\"Bar\"";
String multipleETags = String.format("\"Foo\", %s", etag);
servletRequest.addHeader("If-None-Match", multipleETags);
assertTrue(request.checkNotModified(etag));
assertEquals(304, servletResponse.getStatus());
assertEquals(etag, servletResponse.getHeader("ETag"));
}
@Test
public void checkNotModifiedTimestampWithLengthPart() throws ParseException {
long epochTime = dateFormat.parse(CURRENT_TIME).getTime();
servletRequest.setMethod("GET");
servletRequest.addHeader("If-Modified-Since", "Wed, 09 Apr 2014 09:57:42 GMT; length=13774");
assertTrue(request.checkNotModified(epochTime));
assertEquals(304, servletResponse.getStatus());
assertEquals(dateFormat.format(epochTime), servletResponse.getHeader("Last-Modified"));
}
@Test
public void checkModifiedTimestampWithLengthPart() throws ParseException {
long epochTime = dateFormat.parse(CURRENT_TIME).getTime();
servletRequest.setMethod("GET");
servletRequest.addHeader("If-Modified-Since", "Wed, 08 Apr 2014 09:57:42 GMT; length=13774");
assertFalse(request.checkNotModified(epochTime));
assertEquals(200, servletResponse.getStatus());
assertEquals(dateFormat.format(epochTime), servletResponse.getHeader("Last-Modified"));
}
@Test
public void checkNotModifiedTimestampConditionalPut() {
long currentEpoch = currentDate.getTime();
long oneMinuteAgo = currentEpoch - (1000 * 60);
servletRequest.setMethod("PUT");
servletRequest.addHeader("If-UnModified-Since", currentEpoch);
assertFalse(request.checkNotModified(oneMinuteAgo));
assertEquals(200, servletResponse.getStatus());
assertEquals(null, servletResponse.getHeader("Last-Modified"));
}
@Test
public void checkNotModifiedTimestampConditionalPutConflict() {
long currentEpoch = currentDate.getTime();
long oneMinuteAgo = currentEpoch - (1000 * 60);
servletRequest.setMethod("PUT");
servletRequest.addHeader("If-UnModified-Since", oneMinuteAgo);
assertTrue(request.checkNotModified(currentEpoch));
assertEquals(412, servletResponse.getStatus());
assertEquals(null, servletResponse.getHeader("Last-Modified"));
}
}
|
/*
* JBoss, Home of Professional Open Source.
* Copyright 2016 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* 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.keycloak.authorization.store;
import java.util.List;
import java.util.Map;
import org.keycloak.authorization.model.Policy;
import org.keycloak.authorization.model.ResourceServer;
import org.keycloak.representations.idm.authorization.AbstractPolicyRepresentation;
/**
* A {@link PolicyStore} is responsible to manage the persistence of {@link Policy} instances.
*
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/
public interface PolicyStore {
/**
* Creates a new {@link Policy} instance. The new instance is not necessarily persisted though, which may require
* a call to the {#save} method to actually make it persistent.
*
* @param representation the policy representation
* @param resourceServer the resource server to which this policy belongs
* @return a new instance of {@link Policy}
*/
Policy create(AbstractPolicyRepresentation representation, ResourceServer resourceServer);
/**
* Deletes a policy from the underlying persistence mechanism.
*
* @param id the id of the policy to delete
*/
void delete(String id);
/**
* Returns a {@link Policy} with the given <code>id</code>
*
* @param id the identifier of the policy
* @param resourceServerId the resource server id
* @return a policy with the given identifier.
*/
Policy findById(String id, String resourceServerId);
/**
* Returns a {@link Policy} with the given <code>name</code>
*
* @param name the name of the policy
* @param resourceServerId the resource server id
* @return a policy with the given name.
*/
Policy findByName(String name, String resourceServerId);
/**
* Returns a list of {@link Policy} associated with a {@link ResourceServer} with the given <code>resourceServerId</code>.
*
* @param resourceServerId the identifier of a resource server
* @return a list of policies that belong to the given resource server
*/
List<Policy> findByResourceServer(String resourceServerId);
/**
* Returns a list of {@link Policy} associated with a {@link ResourceServer} with the given <code>resourceServerId</code>.
*
* @param attributes a map holding the attributes that will be used as a filter
* @param resourceServerId the identifier of a resource server
* @return a list of policies that belong to the given resource server
*/
List<Policy> findByResourceServer(Map<String, String[]> attributes, String resourceServerId, int firstResult, int maxResult);
/**
* Returns a list of {@link Policy} associated with a {@link org.keycloak.authorization.core.model.Resource} with the given <code>resourceId</code>.
*
* @param resourceId the identifier of a resource
* @param resourceServerId the resource server id
* @return a list of policies associated with the given resource
*/
List<Policy> findByResource(String resourceId, String resourceServerId);
/**
* Returns a list of {@link Policy} associated with a {@link org.keycloak.authorization.core.model.Resource} with the given <code>type</code>.
*
* @param resourceType the type of a resource
* @param resourceServerId the resource server id
* @return a list of policies associated with the given resource type
*/
List<Policy> findByResourceType(String resourceType, String resourceServerId);
/**
* Returns a list of {@link Policy} associated with a {@link org.keycloak.authorization.core.model.Scope} with the given <code>scopeIds</code>.
*
* @param scopeIds the id of the scopes
* @param resourceServerId the resource server id
* @return a list of policies associated with the given scopes
*/
List<Policy> findByScopeIds(List<String> scopeIds, String resourceServerId);
/**
* Returns a list of {@link Policy} with the given <code>type</code>.
*
* @param type the type of the policy
* @param resourceServerId the resource server id
* @return a list of policies with the given type
*/
List<Policy> findByType(String type, String resourceServerId);
/**
* Returns a list of {@link Policy} that depends on another policy with the given <code>id</code>.
*
* @param id the id of the policy to query its dependents
* @param resourceServerId the resource server id
* @return a list of policies that depends on the a policy with the given identifier
*/
List<Policy> findDependentPolicies(String id, String resourceServerId);
/**
* Notify this store about changes to data associated with policies. E.g.: resources and scopes..
*
* TODO: need a better strategy to handle cross-references between stores, specially in cases where the store is caching data. Use some event-based solution here.
*
* @param cached
*/
default void notifyChange(Object cached) {}
}
|
/*
* Copyright (C) 2010 The Android Open Source 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 com.android.gallery3d.photoeditor.filters;
import android.media.effect.Effect;
import android.media.effect.EffectFactory;
import com.android.gallery3d.photoeditor.Photo;
/**
* Shadow filter applied to the image.
*/
public class ShadowFilter extends Filter {
private float black;
/**
* Sets the shadow blackness level.
*
* @param shadow ranges from 0 to 1.
*/
public void setShadow(float shadow) {
black = shadow * 0.5f;
validate();
}
@Override
public void process(Photo src, Photo dst) {
Effect effect = getEffect(EffectFactory.EFFECT_BLACKWHITE);
effect.setParameter("black", black);
effect.setParameter("white", 1f);
effect.apply(src.texture(), src.width(), src.height(), dst.texture());
}
}
|
package org.bgp4j.net.events.open;
import org.bgp4j.net.EChannelDirection;
public class UnacceptableHoldTimerNotificationEvent extends
OpenNotificationEvent {
public UnacceptableHoldTimerNotificationEvent(EChannelDirection direction) {
super(direction);
}
}
|
package top.codecrab.gulimall.order.service;
import com.baomidou.mybatisplus.extension.service.IService;
import top.codecrab.common.utils.PageUtils;
import top.codecrab.gulimall.order.entity.OrderEntity;
import java.util.Map;
/**
* 订单
*
* @author codecrab
* @date 2021-05-28 22:46:28
*/
public interface OrderService extends IService<OrderEntity> {
PageUtils queryPage(Map<String, Object> params);
}
|
/*
* Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 com.amazonaws.services.pinpoint.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEndpoint" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DeleteEndpointRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The unique identifier for the application. This identifier is displayed as the <b>Project ID</b> on the Amazon
* Pinpoint console.
* </p>
*/
private String applicationId;
/**
* <p>
* The unique identifier for the endpoint.
* </p>
*/
private String endpointId;
/**
* <p>
* The unique identifier for the application. This identifier is displayed as the <b>Project ID</b> on the Amazon
* Pinpoint console.
* </p>
*
* @param applicationId
* The unique identifier for the application. This identifier is displayed as the <b>Project ID</b> on the
* Amazon Pinpoint console.
*/
public void setApplicationId(String applicationId) {
this.applicationId = applicationId;
}
/**
* <p>
* The unique identifier for the application. This identifier is displayed as the <b>Project ID</b> on the Amazon
* Pinpoint console.
* </p>
*
* @return The unique identifier for the application. This identifier is displayed as the <b>Project ID</b> on the
* Amazon Pinpoint console.
*/
public String getApplicationId() {
return this.applicationId;
}
/**
* <p>
* The unique identifier for the application. This identifier is displayed as the <b>Project ID</b> on the Amazon
* Pinpoint console.
* </p>
*
* @param applicationId
* The unique identifier for the application. This identifier is displayed as the <b>Project ID</b> on the
* Amazon Pinpoint console.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeleteEndpointRequest withApplicationId(String applicationId) {
setApplicationId(applicationId);
return this;
}
/**
* <p>
* The unique identifier for the endpoint.
* </p>
*
* @param endpointId
* The unique identifier for the endpoint.
*/
public void setEndpointId(String endpointId) {
this.endpointId = endpointId;
}
/**
* <p>
* The unique identifier for the endpoint.
* </p>
*
* @return The unique identifier for the endpoint.
*/
public String getEndpointId() {
return this.endpointId;
}
/**
* <p>
* The unique identifier for the endpoint.
* </p>
*
* @param endpointId
* The unique identifier for the endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeleteEndpointRequest withEndpointId(String endpointId) {
setEndpointId(endpointId);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getApplicationId() != null)
sb.append("ApplicationId: ").append(getApplicationId()).append(",");
if (getEndpointId() != null)
sb.append("EndpointId: ").append(getEndpointId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DeleteEndpointRequest == false)
return false;
DeleteEndpointRequest other = (DeleteEndpointRequest) obj;
if (other.getApplicationId() == null ^ this.getApplicationId() == null)
return false;
if (other.getApplicationId() != null && other.getApplicationId().equals(this.getApplicationId()) == false)
return false;
if (other.getEndpointId() == null ^ this.getEndpointId() == null)
return false;
if (other.getEndpointId() != null && other.getEndpointId().equals(this.getEndpointId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getApplicationId() == null) ? 0 : getApplicationId().hashCode());
hashCode = prime * hashCode + ((getEndpointId() == null) ? 0 : getEndpointId().hashCode());
return hashCode;
}
@Override
public DeleteEndpointRequest clone() {
return (DeleteEndpointRequest) super.clone();
}
}
|
package org.valkyrienskies.mod.common.physics.collision;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
import lombok.Value;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlime;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.MoverType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.WorldServer;
import net.minecraft.world.chunk.Chunk;
import org.valkyrienskies.mod.common.math.VSMath;
import org.valkyrienskies.mod.common.math.Vector;
import org.valkyrienskies.mod.common.physics.collision.polygons.EntityPolygon;
import org.valkyrienskies.mod.common.physics.collision.polygons.EntityPolygonCollider;
import org.valkyrienskies.mod.common.physics.collision.polygons.Polygon;
import org.valkyrienskies.mod.common.physics.collision.polygons.ShipPolygon;
import org.valkyrienskies.mod.common.physics.management.physo.PhysicsObject;
import org.valkyrienskies.mod.common.physmanagement.interaction.EntityDraggable;
import org.valkyrienskies.mod.common.physmanagement.interaction.IDraggable;
import org.valkyrienskies.mod.common.ship_handling.IHasShipManager;
import valkyrienwarfare.api.TransformType;
public class EntityCollisionInjector {
private static final double errorSignificance = .001D;
// Returns false if game should use default collision
@Nullable
public static IntermediateMovementVariableStorage alterEntityMovement(Entity entity,
MoverType type, double dx, double dy, double dz) {
Vector velVec = new Vector(dx, dy, dz);
double origDx = dx;
double origDy = dy;
double origDz = dz;
double origPosX = entity.posX;
double origPosY = entity.posY;
double origPosZ = entity.posZ;
boolean isLiving = entity instanceof EntityLivingBase;
Vec3d velocity = new Vec3d(dx, dy, dz);
EntityPolygon playerBeforeMove = new EntityPolygon(entity.getEntityBoundingBox(), entity);
List<Polygon> colPolys = getCollidingPolygonsAndDoBlockCols(entity, velocity);
PhysicsObject worldBelow = null;
IDraggable draggable = EntityDraggable.getDraggableFromEntity(entity);
Vector total = new Vector();
// Used to reset the player position after collision processing, effectively
// using the player to integrate their velocity
double posOffestX = 0;
double posOffestY = 0;
double posOffestZ = 0;
for (Polygon poly : colPolys) {
if (poly instanceof ShipPolygon) {
ShipPolygon shipPoly = (ShipPolygon) poly;
try {
EntityPolygonCollider fast = new EntityPolygonCollider(playerBeforeMove,
shipPoly, shipPoly.normals, velVec.getAddition(total));
if (!fast.arePolygonsSeparated()) {
// fastCollisions.add(fast);
worldBelow = shipPoly.shipFrom;
Vector response = fast.getCollisions()[fast.getMinDistanceIndex()]
.getResponse();
// TODO: Add more potential yResponses
double stepSquared = entity.stepHeight * entity.stepHeight;
boolean isStep = isLiving && entity.onGround;
if (response.y >= 0
&& VSMath.canStandOnNormal(
fast.getCollisionAxes()[fast.getMinDistanceIndex()])) {
Vector slowButStopped = new Vector(0,
-fast.getCollisions()[fast.getMinDistanceIndex()]
.getCollisionPenetrationDistance() / fast
.getCollisionAxes()[fast.getMinDistanceIndex()].y, 0);
response = slowButStopped;
}
if (isStep) {
EntityLivingBase living = (EntityLivingBase) entity;
if (Math.abs(living.moveForward) > .01D
|| Math.abs(living.moveStrafing) > .01D) {
for (int i = 3; i < 6; i++) {
Vector tempResponse = fast.getCollisions()[i].getResponse();
if (tempResponse.y > 0
&& VSMath.canStandOnNormal(
fast.getCollisions()[i].getCollisionNormal())
&& tempResponse.lengthSq() < stepSquared) {
if (tempResponse.lengthSq() < .1D) {
// Too small to be a real step, let it through
response = tempResponse;
} else {
// System.out.println("Try Stepping!");
AxisAlignedBB axisalignedbb = entity
.getEntityBoundingBox()
.offset(tempResponse.x, tempResponse.y,
tempResponse.z);
entity.setEntityBoundingBox(axisalignedbb);
// I think this correct, but it may create more problems than it solves
response.zero();
entity.resetPositionToBB();
}
// entity.moveEntity(x, y, z);
// response = tempResponse;
}
}
}
}
// total.add(response);
if (Math.abs(response.x) > .01D) {
total.x += response.x;
}
if (Math.abs(response.y) > .01D) {
total.y += response.y;
}
if (Math.abs(response.z) > .01D) {
total.z += response.z;
}
entity.posX += response.x;
entity.posY += response.y;
entity.posZ += response.z;
posOffestX += response.x;
posOffestY += response.y;
posOffestZ += response.z;
AxisAlignedBB axisalignedbb = entity.getEntityBoundingBox()
.offset(response.x, response.y, response.z);
entity.setEntityBoundingBox(axisalignedbb);
entity.resetPositionToBB();
}
} catch (Exception e) {
// Do nothing
}
}
}
AxisAlignedBB axisalignedbb = entity.getEntityBoundingBox()
.offset(-posOffestX, -posOffestY, -posOffestZ);
entity.setEntityBoundingBox(axisalignedbb);
entity.resetPositionToBB();
draggable.setWorldBelowFeet(worldBelow);
if (worldBelow == null) {
return null;
}
dx += total.x;
dy += total.y;
dz += total.z;
boolean alreadyOnGround = entity.onGround && (dy == origDy) && origDy < 0;
Vector original = new Vector(origDx, origDy, origDz);
Vector newMov = new Vector(dx - origDx, dy - origDy, dz - origDz);
entity.collidedHorizontally = original.dot(newMov) < 0;
entity.collidedVertically = isDifSignificant(dy, origDy);
entity.onGround = entity.collidedVertically && origDy < 0 || alreadyOnGround;
entity.collided = entity.collidedHorizontally || entity.collidedVertically;
// entity.resetPositionToBB();
double motionYBefore = entity.motionY;
float oldFallDistance = entity.fallDistance;
Vector dxyz;
if (entity instanceof EntityLivingBase) {
EntityLivingBase base = (EntityLivingBase) entity;
// base.motionY = dy;
// Delete this ladder crap; need a custom solution!
// if (base.isOnLadder()) {
// base.motionX = MathHelper.clamp(base.motionX, -0.15000000596046448D,
// 0.15000000596046448D);
// base.motionZ = MathHelper.clamp(base.motionZ, -0.15000000596046448D,
// 0.15000000596046448D);
// base.fallDistance = 0.0F;
// if (base.motionY < -0.15D) {
// base.motionY = -0.15D;
// }
// boolean flag = base.isSneaking() && base instanceof EntityPlayer;
// if (flag && base.motionY < 0.0D) {
// base.motionY = 0.0D;
// }
// }
dxyz = new Vector(dx, dy, dz);
} else {
dxyz = new Vector(dx, dy, dz);
}
Vector origDxyz = new Vector(origDx, origDy, origDz);
Vector origPosXyz = new Vector(origPosX, origPosY, origPosZ);
if (worldBelow != null && false) {
double playerMass = 100D;
Vector impulse = new Vector(total);
Vector inBodyPos = new Vector(entity.posX, entity.posY, entity.posZ);
// inBodyPos.transform(worldBelow.wrapping.coordTransform.wToLRotation);
// impulse.transform(worldBelow.wrapping.coordTransform.wToLRotation);
impulse.multiply(playerMass * -100D);
// impulse.multiply();
// PhysicsQueuedForce queuedForce = new PhysicsQueuedForce(impulse, inBodyPos,
// false, 1);
// worldBelow.wrapping.queueForce(queuedForce);
}
return new IntermediateMovementVariableStorage(dxyz, origDxyz, origPosXyz, alreadyOnGround,
motionYBefore,
oldFallDistance);
}
public static void alterEntityMovementPost(Entity entity,
IntermediateMovementVariableStorage storage) {
double dx = storage.dxyz.x;
double dy = storage.dxyz.y;
double dz = storage.dxyz.z;
double origDx = storage.origDxyz.x;
double origDy = storage.origDxyz.y;
double origDz = storage.origDxyz.z;
double origPosX = storage.origPosXyz.x;
double origPosY = storage.origPosXyz.y;
double origPosZ = storage.origPosXyz.z;
boolean alreadyOnGround = storage.alreadyOnGround;
double motionYBefore = storage.motionYBefore;
float oldFallDistance = storage.oldFallDistance;
IDraggable draggable = EntityDraggable.getDraggableFromEntity(entity);
PhysicsObject worldBelow = draggable.getWorldBelowFeet();
entity.collidedHorizontally =
(motionInterfering(dx, origDx)) || (motionInterfering(dz, origDz));
entity.collidedVertically = isDifSignificant(dy, origDy);
entity.onGround =
entity.collidedVertically && origDy < 0 || alreadyOnGround || entity.onGround;
entity.collided = entity.collidedHorizontally || entity.collidedVertically;
Vector entityPosInShip = new Vector(entity.posX, entity.posY - 0.20000000298023224D,
entity.posZ);
worldBelow.getShipTransformationManager().getCurrentTickTransform()
.transform(entityPosInShip,
TransformType.GLOBAL_TO_SUBSPACE);
int j4 = MathHelper.floor(entityPosInShip.x);
int l4 = MathHelper.floor(entityPosInShip.y);
int i5 = MathHelper.floor(entityPosInShip.z);
BlockPos blockpos = new BlockPos(j4, l4, i5);
IBlockState iblockstate = entity.world.getBlockState(blockpos);
Block block = iblockstate.getBlock();
// TODO: Use Mixins to call entity.updateFallState() instead!
// fixes slime blocks
if (block instanceof BlockSlime && !entity.isInWeb) {
entity.motionY = motionYBefore;
}
entity.fallDistance = oldFallDistance;
if (entity instanceof EntityLivingBase) {
if (!entity.world.isRemote && entity.fallDistance > 3.0F && entity.onGround) {
// System.out.println("LAND DAMNIT!");
float f = MathHelper.ceil(entity.fallDistance - 3.0F);
if (!iblockstate.getBlock().isAir(iblockstate, entity.world, blockpos)) {
double d0 = Math.min(0.2F + f / 15.0F, 2.5D);
int i = (int) (150.0D * d0);
if (!iblockstate.getBlock()
.addLandingEffects(iblockstate, (WorldServer) entity.world, blockpos,
iblockstate, (EntityLivingBase) entity, i)) {
((WorldServer) entity.world)
.spawnParticle(EnumParticleTypes.BLOCK_DUST, entity.posX,
entity.posY, entity.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D,
Block.getStateId(iblockstate));
}
}
}
}
if (entity.onGround) {
if (entity.fallDistance > 0.0F) {
// Responsible for breaking crops when you jump on them
iblockstate.getBlock()
.onFallenUpon(entity.world, blockpos, entity, entity.fallDistance);
}
entity.fallDistance = 0.0F;
} else if (entity.motionY < 0.0D) {
entity.fallDistance = (float) (entity.fallDistance - entity.motionY);
}
if (/* entity.canTriggerWalking() **/
entity instanceof EntityPlayer && !entity.isRiding()) {
if (dy != origDy) {
// if (!(entity.motionY > 0 && dy > 0)) {
block.onLanded(entity.world, entity);
// }
}
if (block != null && entity.onGround) {
block.onEntityWalk(entity.world, blockpos, entity);
}
// entity.distanceWalkedModified = (float)((double)entity.distanceWalkedModified
// + (double)MathHelper.sqrt_double(d12 * d12 + d14 * d14) * 0.6D);
// entity.distanceWalkedOnStepModified =
// (float)((double)entity.distanceWalkedOnStepModified +
// (double)MathHelper.sqrt_double(d12 * d12 + d13 * d13 + d14 * d14) * 0.6D);
if (entity.distanceWalkedOnStepModified > entity.nextStepDistance
&& iblockstate.getMaterial() != Material.AIR) {
entity.nextStepDistance = (int) entity.distanceWalkedOnStepModified + 1;
/*
* if (this.isInWater()) { float f = MathHelper.sqrt_double(this.motionX *
* this.motionX * 0.20000000298023224D + this.motionY * this.motionY +
* this.motionZ * this.motionZ * 0.20000000298023224D) * 0.35F;
*
* if (f > 1.0F) { f = 1.0F; }
*
* this.playSound(this.getSwimSound(), f, 1.0F + (this.rand.nextFloat() -
* this.rand.nextFloat()) * 0.4F); }
*/
// System.out.println("Play a sound!");
// entity.playStepSound(blockpos, block);
// TODO: In future, replace this with entity.playStepSound()
SoundType soundtype = block
.getSoundType(entity.world.getBlockState(blockpos), entity.world, blockpos,
entity);
if (entity.world.getBlockState(blockpos.up()).getBlock() == Blocks.SNOW_LAYER) {
soundtype = Blocks.SNOW_LAYER.getSoundType();
entity.playSound(soundtype.getStepSound(), soundtype.getVolume() * 0.15F,
soundtype.getPitch());
} else if (!block.getDefaultState().getMaterial().isLiquid()) {
entity.playSound(soundtype.getStepSound(), soundtype.getVolume() * 0.15F,
soundtype.getPitch());
}
}
}
if (dx != origDx) {
entity.motionX = dx;
}
if (dy != origDy) {
if (!(entity.motionY > 0 && dy > 0)) {
entity.motionY = 0;
}
}
if (dz != origDz) {
entity.motionZ = dz;
}
}
/*
* This method generates an arrayList of Polygons that the player is colliding
* with
*/
public static ArrayList<Polygon> getCollidingPolygonsAndDoBlockCols(Entity entity,
Vec3d velocity) {
ArrayList<Polygon> collisions = new ArrayList<Polygon>();
AxisAlignedBB entityBB = entity.getEntityBoundingBox()
.offset(velocity.x, velocity.y, velocity.z).expand(1, 1,
1);
List<PhysicsObject> ships = ((IHasShipManager) entity.getEntityWorld()).getManager()
.getNearbyPhysObjects(entityBB);
// If a player is riding a Ship, don't process any collision between that Ship
// and the Player
for (PhysicsObject wrapper : ships) {
try {
Polygon playerInLocal = new Polygon(entityBB,
wrapper.getShipTransformationManager()
.getCurrentTickTransform(),
TransformType.GLOBAL_TO_SUBSPACE);
AxisAlignedBB bb = playerInLocal.getEnclosedAABB();
if ((bb.maxX - bb.minX) * (bb.maxZ - bb.minZ) > 9898989) {
// This is too big, something went wrong here
break;
}
List<AxisAlignedBB> collidingBBs = entity.world.getCollisionBoxes(entity, bb);
// TODO: Fix the performance of this!
if (entity.world.isRemote || entity instanceof EntityPlayer) {
VSMath.mergeAABBList(collidingBBs);
}
for (AxisAlignedBB inLocal : collidingBBs) {
ShipPolygon poly = new ShipPolygon(inLocal,
wrapper.getShipTransformationManager()
.getCurrentTickTransform(),
TransformType.SUBSPACE_TO_GLOBAL,
wrapper.getShipTransformationManager().normals,
wrapper);
collisions.add(poly);
}
} catch (Exception e) {
e.printStackTrace();
}
}
for (PhysicsObject wrapper : ships) {
double posX = entity.posX;
double posY = entity.posY;
double posZ = entity.posZ;
Vector entityPos = new Vector(posX, posY, posZ);
wrapper.getShipTransformationManager().getCurrentTickTransform()
.transform(entityPos,
TransformType.GLOBAL_TO_SUBSPACE);
// RotationMatrices.applyTransform(wrapper.wrapping.coordTransform.wToLTransform,
// entityPos);
setEntityPositionAndUpdateBB(entity, entityPos.x, entityPos.y, entityPos.z);
int entityChunkX = MathHelper.floor(entity.posX / 16.0D);
int entityChunkZ = MathHelper.floor(entity.posZ / 16.0D);
if (wrapper.getOwnedChunks().containsChunk(entityChunkX, entityChunkZ)) {
Chunk chunkIn = wrapper
.getChunkAt(entityChunkX, entityChunkZ);
int chunkYIndex = MathHelper.floor(entity.posY / 16.0D);
if (chunkYIndex < 0) {
chunkYIndex = 0;
}
if (chunkYIndex >= chunkIn.entityLists.length) {
chunkYIndex = chunkIn.entityLists.length - 1;
}
chunkIn.entityLists[chunkYIndex].add(entity);
entity.doBlockCollisions();
chunkIn.entityLists[chunkYIndex].remove(entity);
}
setEntityPositionAndUpdateBB(entity, posX, posY, posZ);
}
return collisions;
}
public static void setEntityPositionAndUpdateBB(Entity entity, double x, double y, double z) {
entity.posX = x;
entity.posY = y;
entity.posZ = z;
float f = entity.width / 2.0F;
float f1 = entity.height;
entity.boundingBox = new AxisAlignedBB(x - f, y, z - f, x + f, y + f1, z + f);
}
private static boolean isDifSignificant(double dif1, double d2) {
return !(Math.abs(dif1 - d2) < errorSignificance);
}
private static boolean motionInterfering(double orig, double modded) {
return Math.signum(orig) != Math.signum(modded);
}
@Value
public static class IntermediateMovementVariableStorage {
public final Vector dxyz;
public final Vector origDxyz;
public final Vector origPosXyz;
public final boolean alreadyOnGround;
public final double motionYBefore;
public final float oldFallDistance;
}
}
|
/*
* Copyright 2015 Stanley Shyiko
*
* 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 com.github.shyiko.mysql.binlog;
import com.github.shyiko.mysql.binlog.GtidSet.Interval;
import com.github.shyiko.mysql.binlog.GtidSet.UUIDSet;
import org.testng.annotations.Test;
import java.util.LinkedList;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotEquals;
import static org.testng.Assert.assertTrue;
/**
* @author <a href="mailto:stanley.shyiko@gmail.com">Stanley Shyiko</a>
*/
public class GtidSetTest {
private static final String UUID = "24bc7850-2c16-11e6-a073-0242ac110002";
@Test
public void testAdd() throws Exception {
GtidSet gtidSet = new GtidSet("00000000-0000-0000-0000-000000000000:3-5");
gtidSet.add("00000000-0000-0000-0000-000000000000:2");
gtidSet.add("00000000-0000-0000-0000-000000000000:4");
gtidSet.add("00000000-0000-0000-0000-000000000000:5");
gtidSet.add("00000000-0000-0000-0000-000000000000:7");
gtidSet.add("00000000-0000-0000-0000-000000000001:9");
gtidSet.add("00000000-0000-0000-0000-000000000000:0");
assertEquals(gtidSet.toString(),
"00000000-0000-0000-0000-000000000000:0-0:2-5:7-7,00000000-0000-0000-0000-000000000001:9-9");
}
@Test
public void testJoin() throws Exception {
GtidSet gtidSet = new GtidSet("00000000-0000-0000-0000-000000000000:3-4:6-7");
gtidSet.add("00000000-0000-0000-0000-000000000000:5");
assertEquals(gtidSet.getUUIDSets().iterator().next().getIntervals().iterator().next().getEnd(), 7);
assertEquals(gtidSet.toString(), "00000000-0000-0000-0000-000000000000:3-7");
}
@Test
public void testEmptySet() throws Exception {
assertEquals(new GtidSet("").toString(), "");
}
@Test
public void testEquals() {
assertEquals(new GtidSet(""), new GtidSet(null));
assertEquals(new GtidSet(""), new GtidSet(""));
assertEquals(new GtidSet(UUID + ":1-191"), new GtidSet(UUID + ":1-191"));
assertEquals(new GtidSet(UUID + ":1-191:192-199"), new GtidSet(UUID + ":1-191:192-199"));
assertEquals(new GtidSet(UUID + ":1-191:192-199"), new GtidSet(UUID + ":1-199"));
assertEquals(new GtidSet(UUID + ":1-191:193-199"), new GtidSet(UUID + ":1-191:193-199"));
assertNotEquals(new GtidSet(UUID + ":1-191:193-199"), new GtidSet(UUID + ":1-199"));
}
@Test
public void testSubsetOf() {
GtidSet[] set = {
new GtidSet(""),
new GtidSet(UUID + ":1-191"),
new GtidSet(UUID + ":192-199"),
new GtidSet(UUID + ":1-191:192-199"),
new GtidSet(UUID + ":1-191:193-199"),
new GtidSet(UUID + ":2-199"),
new GtidSet(UUID + ":1-200")
};
byte[][] subsetMatrix = {
{1, 1, 1, 1, 1, 1, 1},
{0, 1, 0, 1, 1, 0, 1},
{0, 0, 1, 1, 0, 1, 1},
{0, 0, 0, 1, 0, 0, 1},
{0, 0, 0, 1, 1, 0, 1},
{0, 0, 0, 1, 0, 1, 1},
{0, 0, 0, 0, 0, 0, 1},
};
for (int i = 0; i < subsetMatrix.length; i++) {
byte[] subset = subsetMatrix[i];
for (int j = 0; j < subset.length; j++) {
assertEquals(set[i].isContainedWithin(set[j]), subset[j] == 1,
"\"" + set[i] + "\" was expected to be a subset of \"" + set[j] + "\"" +
" (" + i + "," + j + ")");
}
}
}
@Test
public void testSingleInterval() {
GtidSet gtidSet = new GtidSet(UUID + ":1-191");
UUIDSet uuidSet = gtidSet.getUUIDSet(UUID);
assertEquals(uuidSet.getIntervals().size(), 1);
assertTrue(uuidSet.getIntervals().contains(new Interval(1, 191)));
assertEquals(uuidSet.getIntervals().iterator().next(), new Interval(1, 191));
assertEquals(new LinkedList<Interval>(uuidSet.getIntervals()).getLast(), new Interval(1, 191));
assertEquals(gtidSet.toString(), UUID + ":1-191");
}
@Test
public void testCollapseAdjacentIntervals() {
GtidSet gtidSet = new GtidSet(UUID + ":1-191:192-199");
UUIDSet uuidSet = gtidSet.getUUIDSet(UUID);
assertEquals(uuidSet.getIntervals().size(), 1);
assertTrue(uuidSet.getIntervals().contains(new Interval(1, 199)));
assertEquals(uuidSet.getIntervals().iterator().next(), new Interval(1, 199));
assertEquals(new LinkedList<Interval>(uuidSet.getIntervals()).getLast(), new Interval(1, 199));
assertEquals(gtidSet.toString(), UUID + ":1-199");
}
@Test
public void testNotCollapseNonAdjacentIntervals() {
GtidSet gtidSet = new GtidSet(UUID + ":1-191:193-199");
UUIDSet uuidSet = gtidSet.getUUIDSet(UUID);
assertEquals(uuidSet.getIntervals().size(), 2);
assertEquals(uuidSet.getIntervals().iterator().next(), new Interval(1, 191));
assertEquals(new LinkedList<Interval>(uuidSet.getIntervals()).getLast(), new Interval(193, 199));
assertEquals(gtidSet.toString(), UUID + ":1-191:193-199");
}
@Test
public void testMultipleIntervals() {
GtidSet set = new GtidSet(UUID + ":1-191:193-199:1000-1033");
UUIDSet uuidSet = set.getUUIDSet(UUID);
assertEquals(uuidSet.getIntervals().size(), 3);
assertTrue(uuidSet.getIntervals().contains(new Interval(193, 199)));
assertEquals(uuidSet.getIntervals().iterator().next(), new Interval(1, 191));
assertEquals(new LinkedList<Interval>(uuidSet.getIntervals()).getLast(), new Interval(1000, 1033));
assertEquals(set.toString(), UUID + ":1-191:193-199:1000-1033");
}
@Test
public void testMultipleIntervalsThatMayBeAdjacent() {
GtidSet gtidSet = new GtidSet(UUID + ":1-191:192-199:1000-1033:1035-1036:1038-1039");
UUIDSet uuidSet = gtidSet.getUUIDSet(UUID);
assertEquals(uuidSet.getIntervals().size(), 4);
assertTrue(uuidSet.getIntervals().contains(new Interval(1000, 1033)));
assertTrue(uuidSet.getIntervals().contains(new Interval(1035, 1036)));
assertEquals(uuidSet.getIntervals().iterator().next(), new Interval(1, 199));
assertEquals(new LinkedList<Interval>(uuidSet.getIntervals()).getLast(), new Interval(1038, 1039));
assertEquals(gtidSet.toString(), UUID + ":1-199:1000-1033:1035-1036:1038-1039");
}
@Test
public void testPutUUIDSet() {
GtidSet gtidSet = new GtidSet(UUID + ":1-191");
UUIDSet uuidSet = gtidSet.getUUIDSet(UUID);
GtidSet gtidSet2 = new GtidSet(UUID + ":1-190");
UUIDSet uuidSet2 = gtidSet2.getUUIDSet(UUID);
gtidSet.putUUIDSet(uuidSet2);
assertEquals(gtidSet, gtidSet2);
}
}
|
package org.tomeeboot.cdi;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @author Gabriel Francisco - gabfssilva@gmail.com
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface EnableCDI {
}
|
package io.vertx.tp.plugin.cache.hit;
import io.vertx.core.json.JsonObject;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentMap;
/**
* @author <a href="http://www.origin-x.cn">Lang</a>
* Split data for SINGLE/MULTI
*/
public interface L1Algorithm {
String FIELD_DATA = "data";
String FIELD_CONDITION = "condition";
String FIELD_TYPE = "type";
String FIELD_REFER = "refer";
String FIELD_KEY = "key";
String CACHE_DATA = "DATA";
String CACHE_DATA_REF = "REFERENCE";
String CACHE_DATA_TREE = "TREE";
String CNODE_RECORD = "RECORD";
String CNODE_LIST = "LIST";
String CNODE_CONNECTOR = "+";
/*
* Common usage to generate cache key
* 1) treeMap is native method in lower
* 2) condition is high level method for data unique
* This api is called by `CMessage` object purely
*/
String dataKey(String type, TreeMap<String, String> treeMap);
String dataTreeKey(String type, TreeMap<String, String> treeMap);
String dataKey(String type, JsonObject condition);
String dataRefKey(String type, JsonObject condition);
/*
* Phase 2: Cache Data Generation
*/
ConcurrentMap<String, Object> buildData(JsonObject jsonBody);
/*
* Phase 3: Cache Data Tree Generation
*/
ConcurrentMap<String, Object> buildReference(JsonObject jsonBody);
}
|
package org.yes.cart.bulkimport.xml.internal;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for entityImportModeType.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="entityImportModeType">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="MERGE"/>
* <enumeration value="DELETE"/>
* <enumeration value="INSERT_ONLY"/>
* <enumeration value="UPDATE_ONLY"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "entityImportModeType")
@XmlEnum
public enum EntityImportModeType {
MERGE,
DELETE,
INSERT_ONLY,
UPDATE_ONLY;
public String value() {
return name();
}
public static EntityImportModeType fromValue(String v) {
return valueOf(v);
}
}
|
package me.deadlight.ezchestshop.Data.SQLite;
import me.deadlight.ezchestshop.EzChestShop;
import me.deadlight.ezchestshop.Utils.Objects.EzShop;
import me.deadlight.ezchestshop.Utils.Objects.ShopSettings;
import me.deadlight.ezchestshop.Utils.Utils;
import org.bukkit.Location;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import java.util.logging.Level;
public abstract class Database {
EzChestShop plugin;
Connection connection;
public Database(EzChestShop instance) {
plugin = instance;
}
public abstract Connection getSQLConnection();
public abstract void load();
public abstract void disconnect();
public void initialize() {
connection = getSQLConnection();
}
public void close(PreparedStatement ps, ResultSet rs) {
try {
if (ps != null)
ps.close();
if (rs != null)
rs.close();
} catch (SQLException e) {
Error.close(plugin, e);
}
}
/**
* Query the Database for a String value
*
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
* @param column the name of the column whose data needs to be queried
* @param table the table that is to be queried
* @return the resulting String or null
*/
public String getString(String primary_key, String key, String column, String table) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("SELECT * FROM " + table + " WHERE " + primary_key + " = ?;");
ps.setString(1, key);
rs = ps.executeQuery();
if (rs.next()) {
return rs.getString(column);
}
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return null;
}
/**
* Query the Database for a Integer value
*
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
* @param column the name of the column whose data needs to be queried
* @param table the table that is to be queried
* @return the resulting Integer or null
*/
public Integer getInt(String primary_key, String key, String column, String table) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("SELECT * FROM " + table + " WHERE " + primary_key + " = ?;");
ps.setString(1, key);
rs = ps.executeQuery();
if (rs.next()) {
return rs.getInt(column); // Removed check, let's see if this breaks anything...
}
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return null;
}
/**
* Query the Database for a Boolean value
*
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
* @param column the name of the column whose data needs to be queried
* @param table the table that is to be queried
* @return the resulting Boolean or false
*/
public boolean getBool(String primary_key, String key, String column, String table) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("SELECT * FROM " + table + " WHERE " + primary_key + " = ?;");
ps.setString(1, key);
rs = ps.executeQuery();
if (rs.next()) {
return rs.getBoolean(column);
}
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return false;
}
/**
* Query the Database for a Long value
*
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
* @param column the name of the column whose data needs to be queried
* @param table the table that is to be queried
* @return the resulting long or 0
*/
public long getBigInt(String primary_key, String key, String column, String table) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("SELECT * FROM " + table + " WHERE " + primary_key + " = ?;");
ps.setString(1, key);
rs = ps.executeQuery();
if (rs.next()) {
return rs.getLong(column);
}
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return 0;
}
/**
* Query the Database for a Double value
*
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
* @param column the name of the column whose data needs to be queried
* @param table the table that is to be queried
* @return the resulting long or 0
*/
public double getDouble(String primary_key, String key, String column, String table) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("SELECT * FROM " + table + " WHERE " + primary_key + " = ?;");
ps.setString(1, key);
rs = ps.executeQuery();
if (rs.next()) {
return rs.getDouble(column);
}
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return 0;
}
/**
* Set a String in the Database.
*
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
* @param column the name of the column whose data needs to be queried
* @param table the table that is to be queried
* @param data the new String to be set
*/
public void setString(String primary_key, String key, String column, String table, String data) {
setString(primary_key, key, column, table, data, false);
}
/**
* Set a String in the Database and make sure to check if the value exists, else add it.
* (not completely working)
*
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
* @param column the name of the column whose data needs to be queried
* @param table the table that is to be queried
* @param data the new String to be set
* @param checkExsting boolean checking if a the row has any entries so far already.
*/
public void setString(String primary_key, String key, String column, String table, String data,
boolean checkExsting) {
Connection conn = null;
PreparedStatement ps = null;
try {
conn = getSQLConnection();
//Check if existing -> if not insert new entry
if (checkExsting && !hasKey(table, primary_key, key)) {
//String statement = "REPLACE INTO " + table + " (" + primary_key + ", " + column + ") VALUES('" + key + "','" + data + "');";
ps = conn.prepareStatement("REPLACE INTO " + table +
" (" + primary_key + ", " + column + ") VALUES(?,?);");
ps.setString(1, key);
ps.setString(2, data);
} else {
//if existing, update old data
ps = conn.prepareStatement("UPDATE " + table + " SET " + column + " = ? WHERE "
+ primary_key + " = ?;");
ps.setString(1, data);
ps.setString(2, key);
}
ps.executeUpdate();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
}
/**
* Set a Int in the Database.
*
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
* @param column the name of the column whose data needs to be queried
* @param table the table that is to be queried
* @param data the int to be set
*/
public void setInt(String primary_key, String key, String column, String table, int data) {
Connection conn = null;
PreparedStatement ps = null;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("UPDATE " + table + " SET " + column + " = ? WHERE " + primary_key
+ " = ?;");
ps.setInt(1, data);
ps.setString(2, key);
ps.executeUpdate();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
}
/**
* Set a Double in the Database.
*
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
* @param column the name of the column whose data needs to be queried
* @param table the table that is to be queried
* @param data the int to be set
*/
public void setDouble(String primary_key, String key, String column, String table, double data) {
Connection conn = null;
PreparedStatement ps = null;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("UPDATE " + table + " SET " + column + " = ? WHERE " + primary_key
+ " = ?;");
ps.setDouble(1, data);
ps.setString(2, key);
ps.executeUpdate();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
}
/**
* Set a Boolean in the Database.
*
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
* @param column the name of the column whose data needs to be queried
* @param table the table that is to be queried
* @param data the Boolean to be set
*/
public void setBool(String primary_key, String key, String column, String table, Boolean data) {
Connection conn = null;
PreparedStatement ps = null;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("UPDATE " + table + " SET " + column + " = ? WHERE "
+ primary_key + " = ?;");
ps.setBoolean(1, data);
ps.setString(2, key);
ps.executeUpdate();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
}
/**
* Get a Int in the Database and increment it's value by a given value.
*
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
* @param column the name of the column whose data needs to be queried
* @param table the table that is to be queried
* @param increment the int value that the resulting data will be incremented by.
*/
public void incrementInt(String primary_key, String key, String column, String table, int increment) {
Connection conn = null;
PreparedStatement ps = null;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("UPDATE " + table + " SET " + column + " = " + column + " + ? WHERE " + primary_key + " = ?;");
ps.setInt(1, increment);
ps.setString(2, key);
ps.executeUpdate();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
}
/**
* Reset a row in the Database.
*
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
* @param table the table that is to be queried
*/
public void deleteEntry(String primary_key, String key, String table) {
Connection conn = null;
PreparedStatement ps = null;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("DELETE FROM " + table + " WHERE " + primary_key + " = ?;");
ps.setString(1, key);
ps.executeUpdate();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
}
/**
* Prepares a Column for future data insertion.
*
* @param table the table that is to be queried
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
*/
public void prepareColumn(String table, String primary_key, String key) {
Connection conn = null;
PreparedStatement ps = null;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("REPLACE INTO " + table + " (" + primary_key + ") VALUES(?)");
ps.setString(1, key);
ps.executeUpdate();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
}
/**
* Query the Database and return a List of all primary Keys that have a value present in a given column.
*
* @param primary_key the name of the primary key row.
* @param column the name of the column whose data needs to be queried
* @param table the table that is to be queried
* @return a List of all resulting Keys, if none, the List will be empty
*/
public List<String> getKeysByExistance(String primary_key, String column, String table) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs;
List<String> keys = new ArrayList<>();
try {
conn = getSQLConnection();
ps = conn.prepareStatement(
"SELECT " + primary_key + " FROM " + table + " WHERE " + column + " IS NOT NULL;");
rs = ps.executeQuery();
while (rs.next()) {
keys.add(rs.getString(primary_key));
}
return keys;
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return keys;
}
/**
* Query the Database and return a List of all primary Keys based on a Expression that is executed on a Column.<br>
* Example: <br>
* getKeysByExpresiion("location", "owner", "shopdata", "IS \"8224bb2a-4c45-4798-84dc-73a0ed8048f5\"");
*
* @param primary_key the name of the primary key row.
* @param column the name of the column whose data needs to be queried
* @param table the table that is to be queried
* @param expression the Expression to be queried with
* @return a List of the resulting keys, if none the List will be empty
*/
public List<String> getKeysByExpresiion(String primary_key, String column, String table, String expression) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs;
List<String> keys = new ArrayList<>();
try {
conn = getSQLConnection();
ps = conn.prepareStatement(
"SELECT " + primary_key + " FROM " + table + " WHERE " + column + " " + expression + ";");
rs = ps.executeQuery();
while (rs.next()) {
keys.add(rs.getString(primary_key));
}
return keys;
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return keys;
}
/**
* Query the Database for a List of all primary Keys of a given table
*
* @param primary_key the name of the primary key row.
* @param table the table that is to be queried
* @return the resulting keys, if none the List will be Empty
*/
public List<String> getKeys(String primary_key, String table) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs;
List<String> keys = new ArrayList<>();
try {
conn = getSQLConnection();
ps = conn.prepareStatement(
"SELECT " + primary_key + " FROM " + table + ";");
rs = ps.executeQuery();
while (rs.next()) {
keys.add(rs.getString(primary_key));
}
return keys;
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return keys;
}
public void PreparePlayerdata(String table, String uuid) {
Connection conn = null;
PreparedStatement ps = null;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("REPLACE INTO " + table + " (uuid) VALUES(?)");
ps.setString(1, uuid);
ps.executeUpdate();
return;
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return;
}
// Check if Player is in DB:
public boolean hasPlayer(String table, UUID key) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("SELECT * FROM " + table + " WHERE uuid = ?;");
ps.setString(1, (key.toString()));
rs = ps.executeQuery();
if (rs.next()) {
return true;
} else
return false;
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return false;
}
/**
* Check if the Database contains a given primary key.
*
* @param table the table that is to be queried
* @param primary_key the name of the primary key row.
* @param key the value of the primary key that is to query
* @return a boolean if the primary key exists
*/
public boolean hasKey(String table, String primary_key, String key) {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("SELECT * FROM " + table + " WHERE " + primary_key + " = ?;");
ps.setString(1, key);
rs = ps.executeQuery();
return rs.next();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return false;
}
/**
* Check if the Database contains a given Table
*
* @param table the table that is to be queried
* @return a boolean based on the existence of the queried table
*/
public boolean hasTable(String table) {
// SELECT name FROM sqlite_master WHERE type='table' AND name='{table_name}';
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("SELECT name FROM sqlite_master WHERE type='table' AND name=?");
ps.setString(1, table);
rs = ps.executeQuery();
return rs.next();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return false;
}
/**
* Adds quotes to a String. Required for certain expressions.
*
* @param s a string that should be surrounded with quotes
* @return a string surrounded with quotes
*/
private String addQuotes(String s) {
if (s == null)
return null;
if (s.equals(""))
return null;
return "'" + s + "'";
}
public void insertShop(String sloc, String owner, String item, double buyprice, double sellprice, boolean msgtoggle,
boolean dbuy, boolean dsell, String admins, boolean shareincome, String trans, boolean adminshop, String rotation) {
Connection conn = null;
PreparedStatement ps = null;
try {
conn = getSQLConnection();
ps = conn.prepareStatement(
"REPLACE INTO shopdata (location,owner,item,buyPrice,sellPrice,msgToggle,"
+ "buyDisabled,sellDisabled,admins,shareIncome,transactions,adminshop,rotation) "
+ "VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)");
ps.setString(1, sloc);
ps.setString(2, owner);
ps.setString(3, item);
ps.setDouble(4, buyprice);
ps.setDouble(5, sellprice);
ps.setBoolean(6, msgtoggle);
ps.setBoolean(7, dbuy);
ps.setBoolean(8, dsell);
ps.setString(9, admins);
ps.setBoolean(10, shareincome);
ps.setString(11, trans);
ps.setBoolean(12, adminshop);
ps.setString(13, rotation);
ps.executeUpdate();
return;
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return;
}
public HashMap<Location, EzShop> queryShops() {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs;
try {
conn = getSQLConnection();
ps = conn.prepareStatement("SELECT * FROM shopdata;");
rs = ps.executeQuery();
HashMap<Location, EzShop> map = new HashMap<>();
while (rs.next()) {
String sloc = rs.getString("location");
map.put(Utils.StringtoLocation(sloc), new EzShop(Utils.StringtoLocation(sloc), rs.getString("owner"), Utils.decodeItem(rs.getString("item")),
rs.getDouble("buyPrice"), rs.getDouble("sellPrice"), new ShopSettings(sloc, rs.getBoolean("msgToggle"),
rs.getBoolean("buyDisabled"), rs.getBoolean("sellDisabled"), rs.getString("admins"),
rs.getBoolean("shareIncome"), rs.getString("transactions"), rs.getBoolean("adminshop"), rs.getString("rotation"))));
}
return map;
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionExecute(), e);
} finally {
try {
if (ps != null)
ps.close();
if (conn != null)
conn.close();
} catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, Errors.sqlConnectionClose(), e);
}
}
return null;
}
}
|
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc.
*
* 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 hudson;
import hudson.model.Hudson;
import jenkins.model.Jenkins;
import hudson.util.OneShotEvent;
import java.io.IOException;
import java.net.BindException;
import java.net.DatagramPacket;
import java.net.InetAddress;
import java.net.MulticastSocket;
import java.net.SocketAddress;
import java.net.UnknownHostException;
import java.nio.channels.ClosedByInterruptException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Monitors a UDP multicast broadcast and respond with the location of the Hudson service.
*
* <p>
* Useful for auto-discovery of Hudson in the network.
*
* @author Kohsuke Kawaguchi
*/
public class UDPBroadcastThread extends Thread {
private final Jenkins jenkins;
public final OneShotEvent ready = new OneShotEvent();
private MulticastSocket mcs;
private boolean shutdown;
/**
* @deprecated as of 1.416
* Use {@link #UDPBroadcastThread(Jenkins)}
*/
public UDPBroadcastThread(Hudson jenkins) throws IOException {
this((Jenkins)jenkins);
}
public UDPBroadcastThread(Jenkins jenkins) throws IOException {
super("Jenkins UDP "+PORT+" monitoring thread");
this.jenkins = jenkins;
mcs = new MulticastSocket(PORT);
}
@Override
public void run() {
try {
mcs.joinGroup(MULTICAST);
ready.signal();
while(true) {
byte[] buf = new byte[2048];
DatagramPacket p = new DatagramPacket(buf,buf.length);
mcs.receive(p);
SocketAddress sender = p.getSocketAddress();
// prepare a response
TcpSlaveAgentListener tal = jenkins.getTcpSlaveAgentListener();
StringBuilder rsp = new StringBuilder("<hudson>");
tag(rsp,"version", Jenkins.VERSION);
tag(rsp,"url", jenkins.getRootUrl());
tag(rsp,"server-id", Util.getDigestOf(jenkins.getSecretKey()));
tag(rsp,"slave-port",tal==null?null:tal.getPort());
for (UDPBroadcastFragment f : UDPBroadcastFragment.all())
f.buildFragment(rsp,sender);
rsp.append("</hudson>");
byte[] response = rsp.toString().getBytes("UTF-8");
mcs.send(new DatagramPacket(response,response.length,sender));
}
} catch (ClosedByInterruptException e) {
// shut down
} catch (BindException e) {
// if we failed to listen to UDP, just silently abandon it, as a stack trace
// makes people unnecessarily concerned, for a feature that currently does no good.
LOGGER.log(Level.WARNING, "Failed to listen to UDP port "+PORT,e);
} catch (IOException e) {
if (shutdown) return; // forcibly closed
LOGGER.log(Level.WARNING, "UDP handling problem",e);
}
}
private void tag(StringBuilder buf, String tag, Object value) {
if(value==null) return;
buf.append('<').append(tag).append('>').append(value).append("</").append(tag).append('>');
}
public void shutdown() {
shutdown = true;
mcs.close();
interrupt();
}
public static final int PORT = Integer.getInteger("hudson.udp",33848);
private static final Logger LOGGER = Logger.getLogger(UDPBroadcastThread.class.getName());
/**
* Multicast socket address.
*/
public static InetAddress MULTICAST;
static {
try {
MULTICAST = InetAddress.getByAddress(new byte[]{(byte)239, (byte)77, (byte)124, (byte)213});
} catch (UnknownHostException e) {
throw new Error(e);
}
}
}
|
/*
* Copyright (C) 2020 The Android Open Source 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 com.android.systemui.people.widget;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.LauncherApps;
import android.os.Bundle;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.os.UserManager;
import android.service.notification.NotificationStats;
import android.text.TextUtils;
import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.app.UnlaunchableAppActivity;
import com.android.internal.logging.UiEventLogger;
import com.android.internal.logging.UiEventLoggerImpl;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.statusbar.NotificationVisibility;
import com.android.systemui.people.PeopleSpaceUtils;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.wmshell.BubblesManager;
import com.android.wm.shell.bubbles.Bubble;
import java.util.Optional;
import javax.inject.Inject;
/** Proxy activity to launch ShortcutInfo's conversation. */
public class LaunchConversationActivity extends Activity {
private static final String TAG = "PeopleSpaceLaunchConv";
private static final boolean DEBUG = PeopleSpaceUtils.DEBUG;
private UiEventLogger mUiEventLogger = new UiEventLoggerImpl();
private NotificationEntryManager mNotificationEntryManager;
private final Optional<BubblesManager> mBubblesManagerOptional;
private final UserManager mUserManager;
private boolean mIsForTesting;
private IStatusBarService mIStatusBarService;
private CommandQueue mCommandQueue;
private Bubble mBubble;
private NotificationEntry mEntryToBubble;
@Inject
public LaunchConversationActivity(NotificationEntryManager notificationEntryManager,
Optional<BubblesManager> bubblesManagerOptional, UserManager userManager,
CommandQueue commandQueue) {
super();
mNotificationEntryManager = notificationEntryManager;
mBubblesManagerOptional = bubblesManagerOptional;
mUserManager = userManager;
mCommandQueue = commandQueue;
mCommandQueue.addCallback(new CommandQueue.Callbacks() {
// (b/190833924) Wait for the app transition to finish before showing the bubble,
// opening the bubble while the transition is happening can mess with the placement
// of the bubble's surface.
@Override
public void appTransitionFinished(int displayId) {
if (mBubblesManagerOptional.isPresent()) {
if (mBubble != null) {
mBubblesManagerOptional.get().expandStackAndSelectBubble(mBubble);
} else if (mEntryToBubble != null) {
mBubblesManagerOptional.get().expandStackAndSelectBubble(mEntryToBubble);
}
}
mCommandQueue.removeCallback(this);
}
});
}
@Override
public void onCreate(Bundle savedInstanceState) {
if (!mIsForTesting) {
super.onCreate(savedInstanceState);
}
if (DEBUG) Log.d(TAG, "onCreate called");
Intent intent = getIntent();
String tileId = intent.getStringExtra(PeopleSpaceWidgetProvider.EXTRA_TILE_ID);
String packageName = intent.getStringExtra(PeopleSpaceWidgetProvider.EXTRA_PACKAGE_NAME);
UserHandle userHandle = intent.getParcelableExtra(
PeopleSpaceWidgetProvider.EXTRA_USER_HANDLE);
String notificationKey =
intent.getStringExtra(PeopleSpaceWidgetProvider.EXTRA_NOTIFICATION_KEY);
if (!TextUtils.isEmpty(tileId)) {
if (DEBUG) {
Log.d(TAG, "Launching conversation with shortcutInfo id " + tileId);
}
mUiEventLogger.log(PeopleSpaceUtils.PeopleSpaceWidgetEvent.PEOPLE_SPACE_WIDGET_CLICKED);
try {
if (mUserManager.isQuietModeEnabled(userHandle)) {
if (DEBUG) Log.d(TAG, "Cannot launch app when quieted");
final Intent dialogIntent =
UnlaunchableAppActivity.createInQuietModeDialogIntent(
userHandle.getIdentifier());
this.getApplicationContext().startActivity(dialogIntent);
finish();
return;
}
// We can potentially bubble without a notification, so rather than rely on
// notificationKey here (which could be null if there's no notification or if the
// bubble is suppressing the notification), so we'll use the shortcutId for lookups.
// This misses one specific case: a bubble that was never opened & still has a
// visible notification, but the bubble was dismissed & aged out of the overflow.
// So it wouldn't exist in the stack or overflow to be looked up BUT the notif entry
// would still exist & be bubbleable. So if we don't get a bubble from the
// shortcutId, fallback to notificationKey if it exists.
if (mBubblesManagerOptional.isPresent()) {
mBubble = mBubblesManagerOptional.get().getBubbleWithShortcutId(tileId);
NotificationEntry entry = mNotificationEntryManager.getPendingOrActiveNotif(
notificationKey);
if (mBubble != null || (entry != null && entry.canBubble())) {
mEntryToBubble = entry;
if (DEBUG) {
Log.d(TAG,
"Opening bubble: " + mBubble + ", entry: " + mEntryToBubble);
}
// Just opt-out and don't cancel the notification for bubbles.
finish();
return;
}
}
if (mIStatusBarService == null) {
mIStatusBarService = IStatusBarService.Stub.asInterface(
ServiceManager.getService(Context.STATUS_BAR_SERVICE));
}
clearNotificationIfPresent(notificationKey, packageName, userHandle);
LauncherApps launcherApps =
getApplicationContext().getSystemService(LauncherApps.class);
launcherApps.startShortcut(
packageName, tileId, null, null, userHandle);
} catch (Exception e) {
Log.e(TAG, "Exception launching shortcut:" + e);
}
} else {
if (DEBUG) Log.d(TAG, "Trying to launch conversation with null shortcutInfo.");
}
finish();
}
void clearNotificationIfPresent(String notifKey, String packageName, UserHandle userHandle) {
if (TextUtils.isEmpty(notifKey)) {
if (DEBUG) Log.d(TAG, "Skipping clear notification: notification key is empty");
return;
}
try {
if (mIStatusBarService == null || mNotificationEntryManager == null) {
if (DEBUG) {
Log.d(TAG, "Skipping clear notification: null services, key: " + notifKey);
}
return;
}
NotificationEntry entry = mNotificationEntryManager.getPendingOrActiveNotif(notifKey);
if (entry == null || entry.getRanking() == null) {
if (DEBUG) {
Log.d(TAG, "Skipping clear notification: NotificationEntry or its Ranking"
+ " is null, key: " + notifKey);
}
return;
}
int count = mNotificationEntryManager.getActiveNotificationsCount();
int rank = entry.getRanking().getRank();
NotificationVisibility notifVisibility = NotificationVisibility.obtain(notifKey,
rank, count, true);
if (DEBUG) Log.d(TAG, "Clearing notification, key: " + notifKey + ", rank: " + rank);
mIStatusBarService.onNotificationClear(
packageName, userHandle.getIdentifier(), notifKey,
NotificationStats.DISMISSAL_OTHER,
NotificationStats.DISMISS_SENTIMENT_POSITIVE, notifVisibility);
} catch (Exception e) {
Log.e(TAG, "Exception cancelling notification:" + e);
}
}
@VisibleForTesting
void setIsForTesting(boolean isForTesting, IStatusBarService statusBarService) {
mIsForTesting = isForTesting;
mIStatusBarService = statusBarService;
}
}
|
/*
* Copyright (c) 2008-2019, Hazelcast, Inc. All Rights Reserved.
*
* 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 com.hazelcast.client.impl.protocol.task;
import com.hazelcast.client.impl.protocol.ClientMessage;
import com.hazelcast.instance.impl.Node;
import com.hazelcast.internal.nio.Connection;
/**
* Base callable Message task.
*/
public abstract class AbstractCallableMessageTask<P>
extends AbstractMessageTask<P> {
protected AbstractCallableMessageTask(ClientMessage clientMessage, Node node, Connection connection) {
super(clientMessage, node, connection);
}
@Override
public final void processMessage() throws Exception {
Object result = call();
sendResponse(result);
}
protected abstract Object call() throws Exception;
}
|
package org.refactoringminer.rm1;
import gr.uom.java.xmi.UMLModel;
import gr.uom.java.xmi.UMLModelASTReader;
import gr.uom.java.xmi.diff.MoveSourceFolderRefactoring;
import gr.uom.java.xmi.diff.MovedClassToAnotherSourceFolder;
import gr.uom.java.xmi.diff.RenamePattern;
import gr.uom.java.xmi.diff.StringDistance;
import gr.uom.java.xmi.diff.UMLModelDiff;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.StringWriter;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.regex.Matcher;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevTree;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.treewalk.TreeWalk;
import org.kohsuke.github.GHCommit;
import org.kohsuke.github.GHPullRequest;
import org.kohsuke.github.GHPullRequestCommitDetail;
import org.kohsuke.github.GHRepository;
import org.kohsuke.github.GHRepositoryWrapper;
import org.kohsuke.github.GHTree;
import org.kohsuke.github.GHTreeEntry;
import org.kohsuke.github.GitHub;
import org.kohsuke.github.PagedIterable;
import org.refactoringminer.api.Churn;
import org.refactoringminer.api.GitHistoryRefactoringMiner;
import org.refactoringminer.api.GitService;
import org.refactoringminer.api.Refactoring;
import org.refactoringminer.api.RefactoringHandler;
import org.refactoringminer.api.RefactoringMinerTimedOutException;
import org.refactoringminer.api.RefactoringType;
import org.refactoringminer.util.GitServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
public class GitHistoryRefactoringMinerImpl implements GitHistoryRefactoringMiner {
Logger logger = LoggerFactory.getLogger(GitHistoryRefactoringMinerImpl.class);
private Set<RefactoringType> refactoringTypesToConsider = null;
private GitHub gitHub;
public GitHistoryRefactoringMinerImpl() {
this.setRefactoringTypesToConsider(RefactoringType.ALL);
}
public void setRefactoringTypesToConsider(RefactoringType ... types) {
this.refactoringTypesToConsider = new HashSet<RefactoringType>();
for (RefactoringType type : types) {
this.refactoringTypesToConsider.add(type);
}
}
private void detect(GitService gitService, Repository repository, final RefactoringHandler handler, Iterator<RevCommit> i) {
int commitsCount = 0;
int errorCommitsCount = 0;
int refactoringsCount = 0;
File metadataFolder = repository.getDirectory();
File projectFolder = metadataFolder.getParentFile();
String projectName = projectFolder.getName();
long time = System.currentTimeMillis();
while (i.hasNext()) {
RevCommit currentCommit = i.next();
try {
List<Refactoring> refactoringsAtRevision = detectRefactorings(gitService, repository, handler, projectFolder, currentCommit);
refactoringsCount += refactoringsAtRevision.size();
} catch (Exception e) {
logger.warn(String.format("Ignored revision %s due to error", currentCommit.getId().getName()), e);
handler.handleException(currentCommit.getId().getName(),e);
errorCommitsCount++;
}
commitsCount++;
long time2 = System.currentTimeMillis();
if ((time2 - time) > 20000) {
time = time2;
logger.info(String.format("Processing %s [Commits: %d, Errors: %d, Refactorings: %d]", projectName, commitsCount, errorCommitsCount, refactoringsCount));
}
}
handler.onFinish(refactoringsCount, commitsCount, errorCommitsCount);
logger.info(String.format("Analyzed %s [Commits: %d, Errors: %d, Refactorings: %d]", projectName, commitsCount, errorCommitsCount, refactoringsCount));
}
protected List<Refactoring> detectRefactorings(GitService gitService, Repository repository, final RefactoringHandler handler, File projectFolder, RevCommit currentCommit) throws Exception {
List<Refactoring> refactoringsAtRevision;
String commitId = currentCommit.getId().getName();
List<String> filePathsBefore = new ArrayList<String>();
List<String> filePathsCurrent = new ArrayList<String>();
Map<String, String> renamedFilesHint = new HashMap<String, String>();
gitService.fileTreeDiff(repository, currentCommit, filePathsBefore, filePathsCurrent, renamedFilesHint);
Set<String> repositoryDirectoriesBefore = new LinkedHashSet<String>();
Set<String> repositoryDirectoriesCurrent = new LinkedHashSet<String>();
Map<String, String> fileContentsBefore = new LinkedHashMap<String, String>();
Map<String, String> fileContentsCurrent = new LinkedHashMap<String, String>();
try (RevWalk walk = new RevWalk(repository)) {
// If no java files changed, there is no refactoring. Also, if there are
// only ADD's or only REMOVE's there is no refactoring
if (!filePathsBefore.isEmpty() && !filePathsCurrent.isEmpty() && currentCommit.getParentCount() > 0) {
RevCommit parentCommit = currentCommit.getParent(0);
populateFileContents(repository, parentCommit, filePathsBefore, fileContentsBefore, repositoryDirectoriesBefore);
populateFileContents(repository, currentCommit, filePathsCurrent, fileContentsCurrent, repositoryDirectoriesCurrent);
List<MoveSourceFolderRefactoring> moveSourceFolderRefactorings = processIdenticalFiles(fileContentsBefore, fileContentsCurrent, renamedFilesHint);
UMLModel parentUMLModel = createModel(fileContentsBefore, repositoryDirectoriesBefore);
UMLModel currentUMLModel = createModel(fileContentsCurrent, repositoryDirectoriesCurrent);
UMLModelDiff modelDiff = parentUMLModel.diff(currentUMLModel, renamedFilesHint);
refactoringsAtRevision = modelDiff.getRefactorings();
refactoringsAtRevision.addAll(moveSourceFolderRefactorings);
refactoringsAtRevision = filter(refactoringsAtRevision);
} else {
//logger.info(String.format("Ignored revision %s with no changes in java files", commitId));
refactoringsAtRevision = Collections.emptyList();
}
handler.handle(commitId, refactoringsAtRevision);
walk.dispose();
}
return refactoringsAtRevision;
}
private List<MoveSourceFolderRefactoring> processIdenticalFiles(Map<String, String> fileContentsBefore, Map<String, String> fileContentsCurrent, Map<String, String> renamedFilesHint) throws IOException {
Map<String, String> identicalFiles = new HashMap<String, String>();
for(String key : fileContentsBefore.keySet()) {
if(renamedFilesHint.containsKey(key)) {
String renamedFile = renamedFilesHint.get(key);
String fileBefore = fileContentsBefore.get(key);
String fileAfter = fileContentsCurrent.get(renamedFile);
if(fileBefore.equals(fileAfter) || StringDistance.trivialCommentChange(fileBefore, fileAfter)) {
identicalFiles.put(key, renamedFile);
}
}
if(fileContentsCurrent.containsKey(key)) {
String fileBefore = fileContentsBefore.get(key);
String fileAfter = fileContentsCurrent.get(key);
if(fileBefore.equals(fileAfter) || StringDistance.trivialCommentChange(fileBefore, fileAfter)) {
identicalFiles.put(key, key);
}
}
}
fileContentsBefore.keySet().removeAll(identicalFiles.keySet());
fileContentsCurrent.keySet().removeAll(identicalFiles.values());
List<MoveSourceFolderRefactoring> moveSourceFolderRefactorings = new ArrayList<MoveSourceFolderRefactoring>();
for(String key : identicalFiles.keySet()) {
String originalPath = key;
String movedPath = identicalFiles.get(key);
String originalPathPrefix = "";
if(originalPath.contains("/")) {
originalPathPrefix = originalPath.substring(0, originalPath.lastIndexOf('/'));
}
String movedPathPrefix = "";
if(movedPath.contains("/")) {
movedPathPrefix = movedPath.substring(0, movedPath.lastIndexOf('/'));
}
if(!originalPathPrefix.equals(movedPathPrefix) && !key.endsWith("package-info.java")) {
MovedClassToAnotherSourceFolder refactoring = new MovedClassToAnotherSourceFolder(null, null, originalPathPrefix, movedPathPrefix);
RenamePattern renamePattern = refactoring.getRenamePattern();
boolean foundInMatchingMoveSourceFolderRefactoring = false;
for(MoveSourceFolderRefactoring moveSourceFolderRefactoring : moveSourceFolderRefactorings) {
if(moveSourceFolderRefactoring.getPattern().equals(renamePattern)) {
moveSourceFolderRefactoring.putIdenticalFilePaths(originalPath, movedPath);
foundInMatchingMoveSourceFolderRefactoring = true;
break;
}
}
if(!foundInMatchingMoveSourceFolderRefactoring) {
MoveSourceFolderRefactoring moveSourceFolderRefactoring = new MoveSourceFolderRefactoring(renamePattern);
moveSourceFolderRefactoring.putIdenticalFilePaths(originalPath, movedPath);
moveSourceFolderRefactorings.add(moveSourceFolderRefactoring);
}
}
}
return moveSourceFolderRefactorings;
}
private void populateFileContents(Repository repository, RevCommit commit,
List<String> filePaths, Map<String, String> fileContents, Set<String> repositoryDirectories) throws Exception {
logger.info("Processing {} {} ...", repository.getDirectory().getParent().toString(), commit.getName());
RevTree parentTree = commit.getTree();
try (TreeWalk treeWalk = new TreeWalk(repository)) {
treeWalk.addTree(parentTree);
treeWalk.setRecursive(true);
while (treeWalk.next()) {
String pathString = treeWalk.getPathString();
if(filePaths.contains(pathString)) {
ObjectId objectId = treeWalk.getObjectId(0);
ObjectLoader loader = repository.open(objectId);
StringWriter writer = new StringWriter();
IOUtils.copy(loader.openStream(), writer);
fileContents.put(pathString, writer.toString());
}
if(pathString.endsWith(".java") && pathString.contains("/")) {
String directory = pathString.substring(0, pathString.lastIndexOf("/"));
repositoryDirectories.add(directory);
//include sub-directories
String subDirectory = new String(directory);
while(subDirectory.contains("/")) {
subDirectory = subDirectory.substring(0, subDirectory.lastIndexOf("/"));
repositoryDirectories.add(subDirectory);
}
}
}
}
}
protected List<Refactoring> detectRefactorings(final RefactoringHandler handler, File projectFolder, String cloneURL, String currentCommitId) {
List<Refactoring> refactoringsAtRevision = Collections.emptyList();
try {
ChangedFileInfo changedFileInfo = populateWithGitHubAPI(projectFolder, cloneURL, currentCommitId);
String parentCommitId = changedFileInfo.getParentCommitId();
List<String> filesBefore = changedFileInfo.getFilesBefore();
List<String> filesCurrent = changedFileInfo.getFilesCurrent();
Map<String, String> renamedFilesHint = changedFileInfo.getRenamedFilesHint();
File currentFolder = new File(projectFolder.getParentFile(), projectFolder.getName() + "-" + currentCommitId);
File parentFolder = new File(projectFolder.getParentFile(), projectFolder.getName() + "-" + parentCommitId);
if (!currentFolder.exists()) {
downloadAndExtractZipFile(projectFolder, cloneURL, currentCommitId);
}
if (!parentFolder.exists()) {
downloadAndExtractZipFile(projectFolder, cloneURL, parentCommitId);
}
Set<String> repositoryDirectoriesBefore = new LinkedHashSet<String>();
Set<String> repositoryDirectoriesCurrent = new LinkedHashSet<String>();
Map<String, String> fileContentsBefore = new LinkedHashMap<String, String>();
Map<String, String> fileContentsCurrent = new LinkedHashMap<String, String>();
if (currentFolder.exists() && parentFolder.exists()) {
populateFileContents(currentFolder, filesCurrent, fileContentsCurrent, repositoryDirectoriesCurrent);
populateFileContents(parentFolder, filesBefore, fileContentsBefore, repositoryDirectoriesBefore);
List<MoveSourceFolderRefactoring> moveSourceFolderRefactorings = processIdenticalFiles(fileContentsBefore, fileContentsCurrent, renamedFilesHint);
UMLModel parentUMLModel = createModel(fileContentsBefore, repositoryDirectoriesBefore);
UMLModel currentUMLModel = createModel(fileContentsCurrent, repositoryDirectoriesCurrent);
// Diff between currentModel e parentModel
UMLModelDiff modelDiff = parentUMLModel.diff(currentUMLModel, renamedFilesHint);
refactoringsAtRevision = modelDiff.getRefactorings();
refactoringsAtRevision.addAll(moveSourceFolderRefactorings);
refactoringsAtRevision = filter(refactoringsAtRevision);
}
else {
logger.warn(String.format("Folder %s not found", currentFolder.getPath()));
}
} catch (Exception e) {
logger.warn(String.format("Ignored revision %s due to error", currentCommitId), e);
handler.handleException(currentCommitId, e);
}
handler.handle(currentCommitId, refactoringsAtRevision);
return refactoringsAtRevision;
}
private void populateFileContents(File projectFolder, List<String> filePaths, Map<String, String> fileContents, Set<String> repositoryDirectories) throws IOException {
for(String path : filePaths) {
String fullPath = projectFolder + File.separator + path.replaceAll("/", systemFileSeparator);
String contents = FileUtils.readFileToString(new File(fullPath));
fileContents.put(path, contents);
String directory = new String(path);
while(directory.contains("/")) {
directory = directory.substring(0, directory.lastIndexOf("/"));
repositoryDirectories.add(directory);
}
}
}
private void downloadAndExtractZipFile(File projectFolder, String cloneURL, String commitId)
throws IOException {
String downloadLink = extractDownloadLink(cloneURL, commitId);
File destinationFile = new File(projectFolder.getParentFile(), projectFolder.getName() + "-" + commitId + ".zip");
logger.info(String.format("Downloading archive %s", downloadLink));
FileUtils.copyURLToFile(new URL(downloadLink), destinationFile);
logger.info(String.format("Unzipping archive %s", downloadLink));
java.util.zip.ZipFile zipFile = new ZipFile(destinationFile);
try {
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
File entryDestination = new File(projectFolder.getParentFile(), entry.getName());
if (entry.isDirectory()) {
entryDestination.mkdirs();
} else {
entryDestination.getParentFile().mkdirs();
InputStream in = zipFile.getInputStream(entry);
OutputStream out = new FileOutputStream(entryDestination);
IOUtils.copy(in, out);
IOUtils.closeQuietly(in);
out.close();
}
}
} finally {
zipFile.close();
}
}
public static class ChangedFileInfo {
private String parentCommitId;
private List<String> filesBefore;
private List<String> filesCurrent;
private Map<String, String> renamedFilesHint;
public ChangedFileInfo() {
}
public ChangedFileInfo(String parentCommitId, List<String> filesBefore,
List<String> filesCurrent, Map<String, String> renamedFilesHint) {
this.filesBefore = filesBefore;
this.filesCurrent = filesCurrent;
this.renamedFilesHint = renamedFilesHint;
this.parentCommitId = parentCommitId;
}
public String getParentCommitId() {
return parentCommitId;
}
public List<String> getFilesBefore() {
return filesBefore;
}
public List<String> getFilesCurrent() {
return filesCurrent;
}
public Map<String, String> getRenamedFilesHint() {
return renamedFilesHint;
}
}
private ChangedFileInfo populateWithGitHubAPI(File projectFolder, String cloneURL, String currentCommitId) throws IOException {
logger.info("Processing {} {} ...", cloneURL, currentCommitId);
String jsonFilePath = projectFolder.getName() + "-" + currentCommitId + ".json";
File jsonFile = new File(projectFolder.getParent(), jsonFilePath);
if(jsonFile.exists()) {
final ObjectMapper mapper = new ObjectMapper();
ChangedFileInfo changedFileInfo = mapper.readValue(jsonFile, ChangedFileInfo.class);
return changedFileInfo;
}
else {
GHRepository repository = getGitHubRepository(cloneURL);
List<GHCommit.File> commitFiles = new ArrayList<>();
GHCommit commit = new GHRepositoryWrapper(repository).getCommit(currentCommitId, commitFiles);
String parentCommitId = commit.getParents().get(0).getSHA1();
List<String> filesBefore = new ArrayList<String>();
List<String> filesCurrent = new ArrayList<String>();
Map<String, String> renamedFilesHint = new HashMap<String, String>();
for (GHCommit.File commitFile : commitFiles) {
if (commitFile.getFileName().endsWith(".java")) {
if (commitFile.getStatus().equals("modified")) {
filesBefore.add(commitFile.getFileName());
filesCurrent.add(commitFile.getFileName());
}
else if (commitFile.getStatus().equals("added")) {
filesCurrent.add(commitFile.getFileName());
}
else if (commitFile.getStatus().equals("removed")) {
filesBefore.add(commitFile.getFileName());
}
else if (commitFile.getStatus().equals("renamed")) {
filesBefore.add(commitFile.getPreviousFilename());
filesCurrent.add(commitFile.getFileName());
renamedFilesHint.put(commitFile.getPreviousFilename(), commitFile.getFileName());
}
}
}
ChangedFileInfo changedFileInfo = new ChangedFileInfo(parentCommitId, filesBefore, filesCurrent, renamedFilesHint);
final ObjectMapper mapper = new ObjectMapper();
mapper.writeValue(jsonFile, changedFileInfo);
return changedFileInfo;
}
}
private GitHub connectToGitHub() {
if(gitHub == null) {
try {
Properties prop = new Properties();
InputStream input = new FileInputStream("github-oauth.properties");
prop.load(input);
String oAuthToken = prop.getProperty("OAuthToken");
if (oAuthToken != null) {
gitHub = GitHub.connectUsingOAuth(oAuthToken);
if(gitHub.isCredentialValid()) {
logger.info("Connected to GitHub with OAuth token");
}
}
else {
gitHub = GitHub.connect();
}
} catch(FileNotFoundException e) {
logger.warn("File github-oauth.properties was not found in RefactoringMiner's execution directory", e);
} catch(IOException ioe) {
ioe.printStackTrace();
}
}
return gitHub;
}
protected List<Refactoring> filter(List<Refactoring> refactoringsAtRevision) {
if (this.refactoringTypesToConsider == null) {
return refactoringsAtRevision;
}
List<Refactoring> filteredList = new ArrayList<Refactoring>();
for (Refactoring ref : refactoringsAtRevision) {
if (this.refactoringTypesToConsider.contains(ref.getRefactoringType())) {
filteredList.add(ref);
}
}
return filteredList;
}
@Override
public void detectAll(Repository repository, String branch, final RefactoringHandler handler) throws Exception {
GitService gitService = new GitServiceImpl() {
@Override
public boolean isCommitAnalyzed(String sha1) {
return handler.skipCommit(sha1);
}
};
RevWalk walk = gitService.createAllRevsWalk(repository, branch);
try {
detect(gitService, repository, handler, walk.iterator());
} finally {
walk.dispose();
}
}
@Override
public void fetchAndDetectNew(Repository repository, final RefactoringHandler handler) throws Exception {
GitService gitService = new GitServiceImpl() {
@Override
public boolean isCommitAnalyzed(String sha1) {
return handler.skipCommit(sha1);
}
};
RevWalk walk = gitService.fetchAndCreateNewRevsWalk(repository);
try {
detect(gitService, repository, handler, walk.iterator());
} finally {
walk.dispose();
}
}
protected UMLModel createModel(Map<String, String> fileContents, Set<String> repositoryDirectories) throws Exception {
return new UMLModelASTReader(fileContents, repositoryDirectories).getUmlModel();
}
private static final String systemFileSeparator = Matcher.quoteReplacement(File.separator);
@Override
public void detectAtCommit(Repository repository, String commitId, RefactoringHandler handler) {
String cloneURL = repository.getConfig().getString("remote", "origin", "url");
File metadataFolder = repository.getDirectory();
File projectFolder = metadataFolder.getParentFile();
GitService gitService = new GitServiceImpl();
RevWalk walk = new RevWalk(repository);
try {
RevCommit commit = walk.parseCommit(repository.resolve(commitId));
if (commit.getParentCount() > 0) {
walk.parseCommit(commit.getParent(0));
this.detectRefactorings(gitService, repository, handler, projectFolder, commit);
}
else {
logger.warn(String.format("Ignored revision %s because it has no parent", commitId));
}
} catch (MissingObjectException moe) {
this.detectRefactorings(handler, projectFolder, cloneURL, commitId);
} catch (RefactoringMinerTimedOutException e) {
logger.warn(String.format("Ignored revision %s due to timeout", commitId), e);
} catch (Exception e) {
logger.warn(String.format("Ignored revision %s due to error", commitId), e);
handler.handleException(commitId, e);
} finally {
walk.close();
walk.dispose();
}
}
public void detectAtCommit(Repository repository, String commitId, RefactoringHandler handler, int timeout) {
ExecutorService service = Executors.newSingleThreadExecutor();
Future<?> f = null;
try {
Runnable r = () -> detectAtCommit(repository, commitId, handler);
f = service.submit(r);
f.get(timeout, TimeUnit.SECONDS);
} catch (TimeoutException e) {
f.cancel(true);
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
service.shutdown();
}
}
@Override
public String getConfigId() {
return "RM1";
}
@Override
public void detectBetweenTags(Repository repository, String startTag, String endTag, RefactoringHandler handler)
throws Exception {
GitService gitService = new GitServiceImpl() {
@Override
public boolean isCommitAnalyzed(String sha1) {
return handler.skipCommit(sha1);
}
};
Iterable<RevCommit> walk = gitService.createRevsWalkBetweenTags(repository, startTag, endTag);
detect(gitService, repository, handler, walk.iterator());
}
@Override
public void detectBetweenCommits(Repository repository, String startCommitId, String endCommitId,
RefactoringHandler handler) throws Exception {
GitService gitService = new GitServiceImpl() {
@Override
public boolean isCommitAnalyzed(String sha1) {
return handler.skipCommit(sha1);
}
};
Iterable<RevCommit> walk = gitService.createRevsWalkBetweenCommits(repository, startCommitId, endCommitId);
detect(gitService, repository, handler, walk.iterator());
}
@Override
public Churn churnAtCommit(Repository repository, String commitId, RefactoringHandler handler) {
GitService gitService = new GitServiceImpl();
RevWalk walk = new RevWalk(repository);
try {
RevCommit commit = walk.parseCommit(repository.resolve(commitId));
if (commit.getParentCount() > 0) {
walk.parseCommit(commit.getParent(0));
return gitService.churn(repository, commit);
}
else {
logger.warn(String.format("Ignored revision %s because it has no parent", commitId));
}
} catch (MissingObjectException moe) {
logger.warn(String.format("Ignored revision %s due to missing commit", commitId), moe);
} catch (Exception e) {
logger.warn(String.format("Ignored revision %s due to error", commitId), e);
handler.handleException(commitId, e);
} finally {
walk.close();
walk.dispose();
}
return null;
}
@Override
public void detectAtCommit(String gitURL, String commitId, RefactoringHandler handler, int timeout) {
ExecutorService service = Executors.newSingleThreadExecutor();
Future<?> f = null;
try {
Runnable r = () -> detectRefactorings(handler, gitURL, commitId);
f = service.submit(r);
f.get(timeout, TimeUnit.SECONDS);
} catch (TimeoutException e) {
f.cancel(true);
} catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
service.shutdown();
}
}
protected List<Refactoring> detectRefactorings(final RefactoringHandler handler, String gitURL, String currentCommitId) {
List<Refactoring> refactoringsAtRevision = Collections.emptyList();
try {
Set<String> repositoryDirectoriesBefore = ConcurrentHashMap.newKeySet();
Set<String> repositoryDirectoriesCurrent = ConcurrentHashMap.newKeySet();
Map<String, String> fileContentsBefore = new ConcurrentHashMap<String, String>();
Map<String, String> fileContentsCurrent = new ConcurrentHashMap<String, String>();
Map<String, String> renamedFilesHint = new ConcurrentHashMap<String, String>();
populateWithGitHubAPI(gitURL, currentCommitId, fileContentsBefore, fileContentsCurrent, renamedFilesHint, repositoryDirectoriesBefore, repositoryDirectoriesCurrent);
List<MoveSourceFolderRefactoring> moveSourceFolderRefactorings = processIdenticalFiles(fileContentsBefore, fileContentsCurrent, renamedFilesHint);
UMLModel currentUMLModel = createModel(fileContentsCurrent, repositoryDirectoriesCurrent);
UMLModel parentUMLModel = createModel(fileContentsBefore, repositoryDirectoriesBefore);
// Diff between currentModel e parentModel
UMLModelDiff modelDiff = parentUMLModel.diff(currentUMLModel, renamedFilesHint);
refactoringsAtRevision = modelDiff.getRefactorings();
refactoringsAtRevision.addAll(moveSourceFolderRefactorings);
refactoringsAtRevision = filter(refactoringsAtRevision);
}
catch(RefactoringMinerTimedOutException e) {
logger.warn(String.format("Ignored revision %s due to timeout", currentCommitId), e);
handler.handleException(currentCommitId, e);
}
catch (Exception e) {
logger.warn(String.format("Ignored revision %s due to error", currentCommitId), e);
handler.handleException(currentCommitId, e);
}
handler.handle(currentCommitId, refactoringsAtRevision);
return refactoringsAtRevision;
}
private void populateWithGitHubAPI(String cloneURL, String currentCommitId,
Map<String, String> filesBefore, Map<String, String> filesCurrent, Map<String, String> renamedFilesHint,
Set<String> repositoryDirectoriesBefore, Set<String> repositoryDirectoriesCurrent) throws IOException, InterruptedException {
logger.info("Processing {} {} ...", cloneURL, currentCommitId);
GHRepository repository = getGitHubRepository(cloneURL);
List<GHCommit.File> commitFiles = new ArrayList<>();
GHCommit currentCommit = new GHRepositoryWrapper(repository).getCommit(currentCommitId, commitFiles);
final String parentCommitId = currentCommit.getParents().get(0).getSHA1();
Set<String> deletedAndRenamedFileParentDirectories = ConcurrentHashMap.newKeySet();
ExecutorService pool = Executors.newFixedThreadPool(commitFiles.size());
for (GHCommit.File commitFile : commitFiles) {
String fileName = commitFile.getFileName();
if (commitFile.getFileName().endsWith(".java")) {
if (commitFile.getStatus().equals("modified")) {
Runnable r = () -> {
try {
URL currentRawURL = commitFile.getRawUrl();
InputStream currentRawFileInputStream = currentRawURL.openStream();
String currentRawFile = IOUtils.toString(currentRawFileInputStream);
String rawURLInParentCommit = currentRawURL.toString().replace(currentCommitId, parentCommitId);
InputStream parentRawFileInputStream = new URL(rawURLInParentCommit).openStream();
String parentRawFile = IOUtils.toString(parentRawFileInputStream);
filesBefore.put(fileName, parentRawFile);
filesCurrent.put(fileName, currentRawFile);
}
catch(IOException e) {
e.printStackTrace();
}
};
pool.submit(r);
}
else if (commitFile.getStatus().equals("added")) {
Runnable r = () -> {
try {
URL currentRawURL = commitFile.getRawUrl();
InputStream currentRawFileInputStream = currentRawURL.openStream();
String currentRawFile = IOUtils.toString(currentRawFileInputStream);
filesCurrent.put(fileName, currentRawFile);
}
catch(IOException e) {
e.printStackTrace();
}
};
pool.submit(r);
}
else if (commitFile.getStatus().equals("removed")) {
Runnable r = () -> {
try {
URL rawURL = commitFile.getRawUrl();
InputStream rawFileInputStream = rawURL.openStream();
String rawFile = IOUtils.toString(rawFileInputStream);
filesBefore.put(fileName, rawFile);
if(fileName.contains("/")) {
deletedAndRenamedFileParentDirectories.add(fileName.substring(0, fileName.lastIndexOf("/")));
}
}
catch(IOException e) {
e.printStackTrace();
}
};
pool.submit(r);
}
else if (commitFile.getStatus().equals("renamed")) {
Runnable r = () -> {
try {
String previousFilename = commitFile.getPreviousFilename();
URL currentRawURL = commitFile.getRawUrl();
InputStream currentRawFileInputStream = currentRawURL.openStream();
String currentRawFile = IOUtils.toString(currentRawFileInputStream);
String rawURLInParentCommit = currentRawURL.toString().replace(currentCommitId, parentCommitId).replace(fileName, previousFilename);
InputStream parentRawFileInputStream = new URL(rawURLInParentCommit).openStream();
String parentRawFile = IOUtils.toString(parentRawFileInputStream);
filesBefore.put(previousFilename, parentRawFile);
filesCurrent.put(fileName, currentRawFile);
renamedFilesHint.put(previousFilename, fileName);
if(previousFilename.contains("/")) {
deletedAndRenamedFileParentDirectories.add(previousFilename.substring(0, previousFilename.lastIndexOf("/")));
}
}
catch(IOException e) {
e.printStackTrace();
}
};
pool.submit(r);
}
}
}
pool.shutdown();
pool.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
repositoryDirectories(currentCommit.getTree(), "", repositoryDirectoriesCurrent, deletedAndRenamedFileParentDirectories);
repositoryDirectoriesCurrent.addAll(deletedAndRenamedFileParentDirectories);
//allRepositoryDirectories(currentCommit.getTree(), "", repositoryDirectoriesCurrent);
//GHCommit parentCommit = repository.getCommit(parentCommitId);
//allRepositoryDirectories(parentCommit.getTree(), "", repositoryDirectoriesBefore);
}
private void repositoryDirectories(GHTree tree, String pathFromRoot, Set<String> repositoryDirectories, Set<String> targetPaths) throws IOException {
for(GHTreeEntry entry : tree.getTree()) {
String path = null;
if(pathFromRoot.equals("")) {
path = entry.getPath();
}
else {
path = pathFromRoot + "/" + entry.getPath();
}
if(atLeastOneStartsWith(targetPaths, path)) {
if(targetPaths.contains(path)) {
repositoryDirectories.add(path);
}
else {
repositoryDirectories.add(path);
GHTree asTree = entry.asTree();
if(asTree != null) {
repositoryDirectories(asTree, path, repositoryDirectories, targetPaths);
}
}
}
}
}
private boolean atLeastOneStartsWith(Set<String> targetPaths, String path) {
for(String targetPath : targetPaths) {
if(path.endsWith("/") && targetPath.startsWith(path)) {
return true;
}
else if(!path.endsWith("/") && targetPath.startsWith(path + "/")) {
return true;
}
}
return false;
}
/*
private void allRepositoryDirectories(GHTree tree, String pathFromRoot, Set<String> repositoryDirectories) throws IOException {
for(GHTreeEntry entry : tree.getTree()) {
String path = null;
if(pathFromRoot.equals("")) {
path = entry.getPath();
}
else {
path = pathFromRoot + "/" + entry.getPath();
}
GHTree asTree = entry.asTree();
if(asTree != null) {
allRepositoryDirectories(asTree, path, repositoryDirectories);
}
else if(path.endsWith(".java")) {
repositoryDirectories.add(path.substring(0, path.lastIndexOf("/")));
}
}
}
*/
@Override
public void detectAtPullRequest(String cloneURL, int pullRequestId, RefactoringHandler handler, int timeout) throws IOException {
GHRepository repository = getGitHubRepository(cloneURL);
GHPullRequest pullRequest = repository.getPullRequest(pullRequestId);
PagedIterable<GHPullRequestCommitDetail> commits = pullRequest.listCommits();
for(GHPullRequestCommitDetail commit : commits) {
detectAtCommit(cloneURL, commit.getSha(), handler, timeout);
}
}
public GHRepository getGitHubRepository(String cloneURL) throws IOException {
GitHub gitHub = connectToGitHub();
String repoName = extractRepositoryName(cloneURL);
return gitHub.getRepository(repoName);
}
private static final String GITHUB_URL = "https://github.com/";
private static final String BITBUCKET_URL = "https://bitbucket.org/";
private static String extractRepositoryName(String cloneURL) {
int hostLength = 0;
if(cloneURL.startsWith(GITHUB_URL)) {
hostLength = GITHUB_URL.length();
}
else if(cloneURL.startsWith(BITBUCKET_URL)) {
hostLength = BITBUCKET_URL.length();
}
int indexOfDotGit = cloneURL.length();
if(cloneURL.endsWith(".git")) {
indexOfDotGit = cloneURL.indexOf(".git");
}
else if(cloneURL.endsWith("/")) {
indexOfDotGit = cloneURL.length() - 1;
}
String repoName = cloneURL.substring(hostLength, indexOfDotGit);
return repoName;
}
public static String extractCommitURL(String cloneURL, String commitId) {
int indexOfDotGit = cloneURL.length();
if(cloneURL.endsWith(".git")) {
indexOfDotGit = cloneURL.indexOf(".git");
}
else if(cloneURL.endsWith("/")) {
indexOfDotGit = cloneURL.length() - 1;
}
String commitResource = "/";
if(cloneURL.startsWith(GITHUB_URL)) {
commitResource = "/commit/";
}
else if(cloneURL.startsWith(BITBUCKET_URL)) {
commitResource = "/commits/";
}
String commitURL = cloneURL.substring(0, indexOfDotGit) + commitResource + commitId;
return commitURL;
}
private static String extractDownloadLink(String cloneURL, String commitId) {
int indexOfDotGit = cloneURL.length();
if(cloneURL.endsWith(".git")) {
indexOfDotGit = cloneURL.indexOf(".git");
}
else if(cloneURL.endsWith("/")) {
indexOfDotGit = cloneURL.length() - 1;
}
String downloadResource = "/";
if(cloneURL.startsWith(GITHUB_URL)) {
downloadResource = "/archive/";
}
else if(cloneURL.startsWith(BITBUCKET_URL)) {
downloadResource = "/get/";
}
String downloadLink = cloneURL.substring(0, indexOfDotGit) + downloadResource + commitId + ".zip";
return downloadLink;
}
}
|
/*
* Xero OAuth 2 Identity Service API
* These endpoints are related to managing authentication tokens and identity for Xero API
*
* The version of the OpenAPI document: 2.10.0
* Contact: api@xero.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.xero.api.client;
import com.fasterxml.jackson.core.type.TypeReference;
import com.google.api.client.auth.oauth2.BearerToken;
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpContent;
import com.google.api.client.http.HttpHeaders;
import com.google.api.client.http.HttpMethods;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpResponse;
import com.google.api.client.http.HttpResponseException;
import com.google.api.client.http.HttpTransport;
import com.xero.api.ApiClient;
import com.xero.api.XeroApiExceptionHandler;
import com.xero.models.identity.Connection;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.ws.rs.core.UriBuilder;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** IdentityApi has methods for interacting with all endpoints in the API set */
public class IdentityApi {
private ApiClient apiClient;
private static IdentityApi instance = null;
private String userAgent = "Default";
private String version = "4.8.0";
static final Logger logger = LoggerFactory.getLogger(IdentityApi.class);
/** IdentityApi */
public IdentityApi() {
this(new ApiClient());
}
/**
* IdentityApi getInstance
*
* @param apiClient ApiClient pass into the new instance of this class
* @return instance of this class
*/
public static IdentityApi getInstance(ApiClient apiClient) {
if (instance == null) {
instance = new IdentityApi(apiClient);
}
return instance;
}
/**
* IdentityApi
*
* @param apiClient ApiClient pass into the new instance of this class
*/
public IdentityApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* get ApiClient
*
* @return apiClient the current ApiClient
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* set ApiClient
*
* @param apiClient ApiClient pass into the new instance of this class
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* set user agent
*
* @param userAgent string to override the user agent
*/
public void setUserAgent(String userAgent) {
this.userAgent = userAgent;
}
/**
* get user agent
*
* @return String of user agent
*/
public String getUserAgent() {
return this.userAgent + " [Xero-Java-" + this.version + "]";
}
/**
* Deletes a connection for this user (i.e. disconnect a tenant) Override the base server url that
* include version
*
* <p><b>204</b> - Success - connection has been deleted no content returned
*
* <p><b>404</b> - Resource not found
*
* @param id Unique identifier for retrieving single object
* @param accessToken Authorization token for user set in header of each request
* @throws IOException if an error occurs while attempting to invoke the API *
*/
public void deleteConnection(String accessToken, UUID id) throws IOException {
try {
deleteConnectionForHttpResponse(accessToken, id);
} catch (HttpResponseException e) {
if (logger.isDebugEnabled()) {
logger.debug(
"------------------ HttpResponseException "
+ e.getStatusCode()
+ " : deleteConnection -------------------");
logger.debug(e.toString());
}
XeroApiExceptionHandler handler = new XeroApiExceptionHandler();
handler.execute(e);
} catch (IOException ioe) {
throw ioe;
}
}
/**
* Deletes a connection for this user (i.e. disconnect a tenant) Override the base server url that
* include version
*
* <p><b>204</b> - Success - connection has been deleted no content returned
*
* <p><b>404</b> - Resource not found
*
* @param id Unique identifier for retrieving single object
* @param accessToken Authorization token for user set in header of each request
* @return HttpResponse
* @throws IOException if an error occurs while attempting to invoke the API
*/
public HttpResponse deleteConnectionForHttpResponse(String accessToken, UUID id)
throws IOException {
// verify the required parameter 'id' is set
if (id == null) {
throw new IllegalArgumentException(
"Missing the required parameter 'id' when calling deleteConnection");
}
if (accessToken == null) {
throw new IllegalArgumentException(
"Missing the required parameter 'accessToken' when calling deleteConnection");
}
HttpHeaders headers = new HttpHeaders();
headers.setAccept("");
headers.setUserAgent(this.getUserAgent());
// create a map of path variables
final Map<String, Object> uriVariables = new HashMap<String, Object>();
uriVariables.put("id", id);
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Connections/{id}");
String url = uriBuilder.buildFromMap(uriVariables).toString();
GenericUrl genericUrl = new GenericUrl(url);
if (logger.isDebugEnabled()) {
logger.debug("DELETE " + genericUrl.toString());
}
HttpContent content = null;
Credential credential =
new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken);
HttpTransport transport = apiClient.getHttpTransport();
HttpRequestFactory requestFactory = transport.createRequestFactory(credential);
return requestFactory
.buildRequest(HttpMethods.DELETE, genericUrl, content)
.setHeaders(headers)
.setConnectTimeout(apiClient.getConnectionTimeout())
.setReadTimeout(apiClient.getReadTimeout())
.execute();
}
/**
* Retrieves the connections for this user Override the base server url that include version
*
* <p><b>200</b> - Success - return response of type Connections array with 0 to n Connection
*
* @param authEventId Filter by authEventId
* @param accessToken Authorization token for user set in header of each request
* @return List<Connection>
* @throws IOException if an error occurs while attempting to invoke the API *
*/
public List<Connection> getConnections(String accessToken, UUID authEventId) throws IOException {
try {
TypeReference<List<Connection>> typeRef = new TypeReference<List<Connection>>() {};
HttpResponse response = getConnectionsForHttpResponse(accessToken, authEventId);
return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);
} catch (HttpResponseException e) {
if (logger.isDebugEnabled()) {
logger.debug(
"------------------ HttpResponseException "
+ e.getStatusCode()
+ " : getConnections -------------------");
logger.debug(e.toString());
}
XeroApiExceptionHandler handler = new XeroApiExceptionHandler();
handler.execute(e);
} catch (IOException ioe) {
throw ioe;
}
return null;
}
/**
* Retrieves the connections for this user Override the base server url that include version
*
* <p><b>200</b> - Success - return response of type Connections array with 0 to n Connection
*
* @param authEventId Filter by authEventId
* @param accessToken Authorization token for user set in header of each request
* @return HttpResponse
* @throws IOException if an error occurs while attempting to invoke the API
*/
public HttpResponse getConnectionsForHttpResponse(String accessToken, UUID authEventId)
throws IOException {
if (accessToken == null) {
throw new IllegalArgumentException(
"Missing the required parameter 'accessToken' when calling getConnections");
}
HttpHeaders headers = new HttpHeaders();
headers.setAccept("application/json");
headers.setUserAgent(this.getUserAgent());
UriBuilder uriBuilder = UriBuilder.fromUri(apiClient.getBasePath() + "/Connections");
if (authEventId != null) {
String key = "authEventId";
Object value = authEventId;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
uriBuilder = uriBuilder.queryParam(key, value);
}
}
String url = uriBuilder.build().toString();
GenericUrl genericUrl = new GenericUrl(url);
if (logger.isDebugEnabled()) {
logger.debug("GET " + genericUrl.toString());
}
HttpContent content = null;
Credential credential =
new Credential(BearerToken.authorizationHeaderAccessMethod()).setAccessToken(accessToken);
HttpTransport transport = apiClient.getHttpTransport();
HttpRequestFactory requestFactory = transport.createRequestFactory(credential);
return requestFactory
.buildRequest(HttpMethods.GET, genericUrl, content)
.setHeaders(headers)
.setConnectTimeout(apiClient.getConnectionTimeout())
.setReadTimeout(apiClient.getReadTimeout())
.execute();
}
/**
* convert intput to byte array
*
* @param is InputStream the server status code returned
* @return byteArrayInputStream a ByteArrayInputStream
* @throws IOException for failed or interrupted I/O operations
*/
public ByteArrayInputStream convertInputToByteArray(InputStream is) throws IOException {
byte[] bytes = IOUtils.toByteArray(is);
try {
// Process the input stream..
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
return byteArrayInputStream;
} finally {
is.close();
}
}
}
|
package com.example.thanatos.weather.gson;
import com.google.gson.annotations.SerializedName;
public class Now {
@SerializedName("tmp")
public String temperature;
@SerializedName("cond")
public More more;
public class More {
@SerializedName("txt")
public String info;
}
}
|
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. 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.wso2.carbon.connector;
import org.apache.axiom.om.OMElement;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemOptions;
import org.apache.commons.vfs2.FileType;
import org.apache.commons.vfs2.impl.StandardFileSystemManager;
import org.apache.synapse.MessageContext;
import org.codehaus.jettison.json.JSONException;
import org.wso2.carbon.connector.core.AbstractConnector;
import org.wso2.carbon.connector.core.Connector;
import org.wso2.carbon.connector.core.util.ConnectorUtils;
import org.wso2.carbon.connector.util.FileConnectorUtils;
import org.wso2.carbon.connector.util.FileConstants;
import org.wso2.carbon.connector.util.FilePattenMatcher;
import org.wso2.carbon.connector.util.ResultPayloadCreate;
import javax.xml.stream.XMLStreamException;
import java.io.File;
import java.io.IOException;
public class FileMove extends AbstractConnector implements Connector {
private static final Log log = LogFactory.getLog(FileMove.class);
public void connect(MessageContext messageContext) {
boolean includeParentDirectory;
String source = (String) ConnectorUtils.lookupTemplateParamater(messageContext,
FileConstants.FILE_LOCATION);
String destination = (String) ConnectorUtils.lookupTemplateParamater(messageContext,
FileConstants.NEW_FILE_LOCATION);
String filePattern = (String) ConnectorUtils.lookupTemplateParamater(messageContext,
FileConstants.FILE_PATTERN);
String includeParentDir = (String) ConnectorUtils.lookupTemplateParamater(messageContext,
FileConstants.INCLUDE_PARENT_DIRECTORY);
if (StringUtils.isEmpty(includeParentDir)) {
includeParentDirectory = Boolean.parseBoolean(FileConstants.DEFAULT_INCLUDE_PARENT_DIRECTORY);
} else {
includeParentDirectory = Boolean.parseBoolean(includeParentDir);
}
boolean resultStatus = moveFile(source, destination, messageContext, includeParentDirectory, filePattern);
generateResults(messageContext, resultStatus);
}
/**
* Generate the result
*
* @param messageContext The message context that is processed by a handler in the handle method
* @param resultStatus Result of the status (true/false)
*/
private void generateResults(MessageContext messageContext, boolean resultStatus) {
ResultPayloadCreate resultPayload = new ResultPayloadCreate();
String response = FileConstants.START_TAG + resultStatus + FileConstants.END_TAG;
try {
OMElement element = resultPayload.performSearchMessages(response);
resultPayload.preparePayload(messageContext, element);
} catch (XMLStreamException e) {
handleException(e.getMessage(), e, messageContext);
} catch (IOException e) {
handleException(e.getMessage(), e, messageContext);
} catch (JSONException e) {
handleException(e.getMessage(), e, messageContext);
}
}
/**
* Move the files
*
* @param source Location of the file
* @param destination Destination of the file
* @return return a resultStatus
*/
private boolean moveFile(String source, String destination, MessageContext messageContext,
boolean includeParentDirectory, String filePattern) {
boolean resultStatus = false;
StandardFileSystemManager manager = null;
try {
manager = FileConnectorUtils.getManager();
FileSystemOptions fso = FileConnectorUtils.getFso(messageContext, source, manager);
// Create remote object
FileObject remoteFile = manager.resolveFile(source, fso);
if (remoteFile.exists()) {
if (remoteFile.getType() == FileType.FILE) {
fileMove(destination, remoteFile, messageContext, manager);
} else {
folderMove(source, destination, filePattern, includeParentDirectory, messageContext, manager);
}
resultStatus = true;
if (log.isDebugEnabled()) {
log.debug("File move completed from " + source + " to " + destination);
}
} else {
log.error("The file/folder location does not exist.");
resultStatus = false;
}
} catch (IOException e) {
handleException("Unable to move a file/folder.", e, messageContext);
} finally {
if (manager != null) {
manager.close();
}
}
return resultStatus;
}
/**
* Move the file
*
* @param destination New location of the folder
* @param remoteFile Location of the file
* @param messageContext The message context that is processed by a handler in the handle method
* @param manager Standard file system manager
*/
private void fileMove(String destination, FileObject remoteFile, MessageContext messageContext,
StandardFileSystemManager manager) throws IOException {
FileSystemOptions fso = FileConnectorUtils.getFso(messageContext, destination, manager);
FileObject file = manager.resolveFile(destination, fso);
if (FileConnectorUtils.isFolder(file)) {
if (!file.exists()) {
file.createFolder();
}
file = manager.resolveFile(destination + File.separator + remoteFile.getName().getBaseName(), fso);
}
remoteFile.moveTo(file);
}
/**
* Move the folder
*
* @param destination New location of the folder
* @param source Location of the folder
* @param messageContext The message context that is processed by a handler in the handle method
* @param includeParentDirectory Boolean type
* @param manager Standard file system manager
*/
private void folderMove(String source, String destination, String filePattern, boolean includeParentDirectory,
MessageContext messageContext, StandardFileSystemManager manager) throws IOException {
FileSystemOptions sourceFso = FileConnectorUtils.getFso(messageContext, source, manager);
FileSystemOptions destinationFso = FileConnectorUtils.getFso(messageContext, destination, manager);
FileObject remoteFile = manager.resolveFile(source, sourceFso);
FileObject file = manager.resolveFile(destination, destinationFso);
if (StringUtils.isNotEmpty(filePattern)) {
FileObject[] children = remoteFile.getChildren();
for (FileObject child : children) {
if (child.getType() == FileType.FILE) {
moveFileWithPattern(child, destination, filePattern, manager, messageContext);
} else if (child.getType() == FileType.FOLDER) {
String newSource = source + File.separator + child.getName().getBaseName();
folderMove(newSource, destination, filePattern, includeParentDirectory, messageContext, manager);
}
}
} else if (includeParentDirectory) {
file = manager.resolveFile(destination + File.separator + remoteFile.getName().getBaseName(),
destinationFso);
file.createFolder();
remoteFile.moveTo(file);
} else {
if (!file.exists()) {
file.createFolder();
}
remoteFile.moveTo(file);
remoteFile.createFolder();
}
}
/**
* @param remoteFile Location of the file
* @param destination New file location
* @param filePattern Pattern of the file
* @param manager Standard file system manager
* @param messageContext The message context that is generated for processing the file
* @throws IOException
*/
private void moveFileWithPattern(FileObject remoteFile, String destination, String filePattern,
StandardFileSystemManager manager, MessageContext messageContext) throws IOException {
FilePattenMatcher patternMatcher = new FilePattenMatcher(filePattern);
try {
if (patternMatcher.validate(remoteFile.getName().getBaseName())) {
FileSystemOptions fso = FileConnectorUtils.getFso(messageContext, destination, manager);
FileObject file = manager.resolveFile(destination, fso);
if (!file.exists()) {
file.createFolder();
}
file = manager.resolveFile(destination + File.separator + remoteFile.getName().getBaseName(), fso);
remoteFile.moveTo(file);
}
} catch (IOException e) {
log.error("Error occurred while moving a file. " + e.getMessage(), e);
}
}
}
|
/*
* 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.camel.builder.xml;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.language.xpath.DefaultNamespaceContext;
import org.apache.camel.language.xpath.XPathBuilder;
import org.apache.camel.support.builder.Namespaces;
import org.junit.Test;
public class DefaultNamespaceContextTest extends ContextTestSupport {
@Test
public void testDefaultNamespaceContextEmpty() throws Exception {
XPathBuilder builder = XPathBuilder.xpath("/foo");
builder.start();
DefaultNamespaceContext context = builder.getNamespaceContext();
assertNotNull(context);
String uri = context.getNamespaceURI("foo");
assertNull(uri);
String prefix = context.getPrefix("foo");
assertNull(prefix);
Iterator<String> it = context.getPrefixes("foo");
assertEquals(false, it.hasNext());
}
@Test
public void testDefaultNamespaceContextPre() throws Exception {
XPathBuilder builder = XPathBuilder.xpath("/foo").namespace("pre", "http://acme/cheese");
builder.start();
DefaultNamespaceContext context = builder.getNamespaceContext();
assertNotNull(context);
String uri = context.getNamespaceURI("pre");
assertEquals("http://acme/cheese", uri);
String prefix = context.getPrefix("http://acme/cheese");
assertEquals("pre", prefix);
Iterator<String> it = context.getPrefixes("http://acme/cheese");
assertEquals(true, it.hasNext());
assertEquals("pre", it.next());
}
@Test
public void testDefaultNamespaceContextDualNamespaces() throws Exception {
XPathBuilder builder = XPathBuilder.xpath("/foo").namespace("pre", "http://acme/cheese").namespace("bar", "http://acme/bar");
builder.start();
DefaultNamespaceContext context = builder.getNamespaceContext();
assertNotNull(context);
String uri = context.getNamespaceURI("pre");
assertEquals("http://acme/cheese", uri);
String uri2 = context.getNamespaceURI("bar");
assertEquals("http://acme/bar", uri2);
String prefix = context.getPrefix("http://acme/cheese");
assertEquals("pre", prefix);
String prefix2 = context.getPrefix("http://acme/bar");
assertEquals("bar", prefix2);
Iterator<String> it = context.getPrefixes("http://acme/cheese");
assertEquals(true, it.hasNext());
assertEquals("pre", it.next());
Iterator<String> it2 = context.getPrefixes("http://acme/bar");
assertEquals(true, it2.hasNext());
assertEquals("bar", it2.next());
}
@Test
public void testDefaultNamespaceContextParent() throws Exception {
XPathBuilder builder = XPathBuilder.xpath("/foo");
builder.start();
DefaultNamespaceContext context = builder.getNamespaceContext();
assertNotNull(context);
String uri = context.getNamespaceURI("in");
assertEquals(Namespaces.IN_NAMESPACE, uri);
String prefix = context.getPrefix(Namespaces.IN_NAMESPACE);
assertEquals("in", prefix);
Iterator<String> it = context.getPrefixes(Namespaces.IN_NAMESPACE);
assertEquals(true, it.hasNext());
assertEquals("in", it.next());
String uri2 = context.getNamespaceURI("out");
assertEquals(Namespaces.OUT_NAMESPACE, uri2);
String uri3 = context.getNamespaceURI("env");
assertEquals(Namespaces.ENVIRONMENT_VARIABLES, uri3);
String uri4 = context.getNamespaceURI("system");
assertEquals(Namespaces.SYSTEM_PROPERTIES_NAMESPACE, uri4);
}
@Test
public void testDefaultNamespaceContextCtr() throws Exception {
DefaultNamespaceContext context = new DefaultNamespaceContext();
// should not have any namespaces
String uri = context.getNamespaceURI("in");
assertEquals(null, uri);
}
@Test
public void testDefaultNamespaceContextAnotherCtr() throws Exception {
Map<String, String> map = new HashMap<>();
map.put("foo", "http://acme/cheese");
DefaultNamespaceContext context = new DefaultNamespaceContext(null, map);
// should not have any default namespaces
String uri = context.getNamespaceURI("in");
assertEquals(null, uri);
String uri2 = context.getNamespaceURI("foo");
assertEquals("http://acme/cheese", uri2);
}
}
|
package applications.bolts.udf.comm;
import brisk.components.operators.base.filterBolt;
import brisk.execution.ExecutionGraph;
import model.cdr.CallDetailRecord;
import org.slf4j.Logger;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import static constants.VoIPSTREAMConstants.Component;
import static constants.VoIPSTREAMConstants.Conf;
/**
* @author Maycon Viana Bordin <mayconbordin@gmail.com>
*/
public abstract class AbstractScoreBolt extends filterBolt {
private static final long serialVersionUID = 878583150054802430L;
private final String configPrefix;
protected double thresholdMin;
protected double thresholdMax;
protected Map<String, Entry> map;
public AbstractScoreBolt(Logger LOG, String configPrefix, Map<String, Double> inputSelectivity, Map<String, Double> output_selectivity) {
super(LOG, inputSelectivity, output_selectivity);
this.configPrefix = configPrefix;
}
public AbstractScoreBolt(Logger LOG, String configPrefix, Map<String, Double> output_selectivity) {
super(LOG, null, output_selectivity);
this.configPrefix = configPrefix;
}
protected AbstractScoreBolt(Logger log, String configPrefix, Map<String, Double> inputSelectivity, Map<String, Double> output_selectivity, double read_selectivity) {
super(log, inputSelectivity, output_selectivity, read_selectivity);
this.configPrefix = configPrefix;
}
protected static Source parseComponentId(String id) {
switch (id) {
case Component.VOICE_DISPATCHER:
return Source.VD;
case Component.ECR24:
return Source.ECR24;
case Component.CT24:
return Source.CT24;
case Component.ECR:
return Source.ECR;
case Component.RCR:
return Source.RCR;
case Component.ENCR:
return Source.ENCR;
case Component.ACD:
return Source.ACD;
case Component.GLOBAL_ACD:
return Source.GACD;
case Component.URL:
return Source.URL;
case Component.FOFIR:
return Source.FOFIR;
default:
return Source.NONE;
}
}
protected static double score(double v1, double v2, double vi) {
double score = vi / (v1 + (v2 - v1));
if (score < 0) score = 0;
if (score > 1) score = 1;
return score;
}
@Override
public void initialize(int thread_Id, int thisTaskId, ExecutionGraph graph) {
super.initialize(thread_Id, thisTaskId, graph);
map = new HashMap<>();//when this is too large..
// parameters
if (configPrefix != null) {
thresholdMin = config.getDouble(String.format(Conf.SCORE_THRESHOLD_MIN, configPrefix));
thresholdMax = config.getDouble(String.format(Conf.SCORE_THRESHOLD_MAX, configPrefix));
}
}
protected abstract Source[] getFields();
protected enum Source {
ECR, RCR, ECR24, ENCR, CT24, VD, FOFIR, ACD, GACD, URL, NONE
}
protected class Entry {
final CallDetailRecord cdr;
final Source[] fields;
final double[] values;
public Entry(CallDetailRecord cdr) {
this.cdr = cdr;
this.fields = getFields();
values = new double[fields.length];
Arrays.fill(values, Double.NaN);
}
public void set(Source src, double rate) {
values[pos(src)] = rate;
}
public double get(Source src) {
return values[pos(src)];
}
public boolean isFull() {
for (double value : values)
if (Double.isNaN(value))
return false;
return true;
}
private int pos(Source src) {
for (int i = 0; i < fields.length; i++)
if (fields[i] == src)
return i;
return -1;
}
public double[] getValues() {
return values;
}
@Override
public String toString() {
return "Entry{" + "cdr=" + cdr + ", fields=" + Arrays.toString(fields) + ", values=" + Arrays.toString(values) + '}';
}
}
}
|
package module588packageJava0;
import java.lang.Integer;
public class Foo749 {
Integer int0;
Integer int1;
public void foo0() {
new module588packageJava0.Foo748().foo6();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
public void foo6() {
foo5();
}
}
|
package com.sovannarith.mixer.service;
public class MixerService {
}
|
/*
* JBoss, Home of Professional Open Source
* Copyright 2006, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
* This program is distributed in the hope that it will be useful, but WITHOUT A
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License,
* v.2.1 along with this distribution; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
* (C) 2005-2006,
* @author JBoss Inc.
*/
/*
* Copyright (C) 1998, 1999, 2000,
*
* Arjuna Solutions Limited,
* Newcastle upon Tyne,
* Tyne and Wear,
* UK.
*
* $Id: RecoverableXAConnection.java 2342 2006-03-30 13:06:17Z $
*/
package com.arjuna.ats.jta.xa;
import java.sql.SQLException;
import javax.sql.XAConnection;
import javax.sql.XADataSource;
import javax.transaction.xa.XAResource;
import com.arjuna.ats.arjuna.state.InputObjectState;
import com.arjuna.ats.arjuna.state.OutputObjectState;
/**
* XA connection implementations must provide an implementation
* of this class.
*
* @author Mark Little (mark_little@hp.com)
* @version $Id: RecoverableXAConnection.java 2342 2006-03-30 13:06:17Z $
* @since JTS 1.2.4.
*/
// check
public interface RecoverableXAConnection
{
public static final int AUTO_RECOVERY = 0;
public static final int OBJECT_RECOVERY = 1;
public boolean packInto (OutputObjectState os);
public boolean unpackFrom (InputObjectState os);
public XAResource getResource () throws SQLException;
public XAConnection getConnection () throws SQLException;
public XAConnection getCurrentConnection () throws SQLException;
public XADataSource getDataSource () throws SQLException;
void closeCloseCurrentConnection() throws SQLException;
/**
* @return true if the connection is being used within a transaction,
* false otherwise.
*/
public boolean inuse ();
/**
* @since JTS 2.2.
*/
public void reset (); // reset the connection for new useage
/**
* @since JTS 2.2.
*/
public void close (); // close the connection and make available for gc
/**
* Remember the transaction we are being used within.
*
* @since JTS 2.2.
*/
public boolean setTransaction (javax.transaction.Transaction tx);
/**
* Is this the same transaction?
*
* @return true if the connection can be used by this
* transaction, false otherwise.
* @since JTS 2.2.
*/
public boolean validTransaction (javax.transaction.Transaction tx);
}
|
/**
* Autogenerated by Thrift Compiler (0.12.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.dubbo.samples.rpc.nativethrift.api;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-07-02")
public class DemoService {
public interface Iface {
public boolean echoBool(boolean arg) throws org.apache.thrift.TException;
public byte echoByte(byte arg) throws org.apache.thrift.TException;
public short echoI16(short arg) throws org.apache.thrift.TException;
public int echoI32(int arg) throws org.apache.thrift.TException;
public long echoI64(long arg) throws org.apache.thrift.TException;
public double echoDouble(double arg) throws org.apache.thrift.TException;
public java.lang.String echoString(java.lang.String arg) throws org.apache.thrift.TException;
}
public interface AsyncIface {
public void echoBool(boolean arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;
public void echoByte(byte arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Byte> resultHandler) throws org.apache.thrift.TException;
public void echoI16(short arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Short> resultHandler) throws org.apache.thrift.TException;
public void echoI32(int arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Integer> resultHandler) throws org.apache.thrift.TException;
public void echoI64(long arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Long> resultHandler) throws org.apache.thrift.TException;
public void echoDouble(double arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Double> resultHandler) throws org.apache.thrift.TException;
public void echoString(java.lang.String arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException;
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
public Factory() {}
public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
return new Client(prot);
}
public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
return new Client(iprot, oprot);
}
}
public Client(org.apache.thrift.protocol.TProtocol prot)
{
super(prot, prot);
}
public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
super(iprot, oprot);
}
public boolean echoBool(boolean arg) throws org.apache.thrift.TException
{
send_echoBool(arg);
return recv_echoBool();
}
public void send_echoBool(boolean arg) throws org.apache.thrift.TException
{
echoBool_args args = new echoBool_args();
args.setArg(arg);
sendBase("echoBool", args);
}
public boolean recv_echoBool() throws org.apache.thrift.TException
{
echoBool_result result = new echoBool_result();
receiveBase(result, "echoBool");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "echoBool failed: unknown result");
}
public byte echoByte(byte arg) throws org.apache.thrift.TException
{
send_echoByte(arg);
return recv_echoByte();
}
public void send_echoByte(byte arg) throws org.apache.thrift.TException
{
echoByte_args args = new echoByte_args();
args.setArg(arg);
sendBase("echoByte", args);
}
public byte recv_echoByte() throws org.apache.thrift.TException
{
echoByte_result result = new echoByte_result();
receiveBase(result, "echoByte");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "echoByte failed: unknown result");
}
public short echoI16(short arg) throws org.apache.thrift.TException
{
send_echoI16(arg);
return recv_echoI16();
}
public void send_echoI16(short arg) throws org.apache.thrift.TException
{
echoI16_args args = new echoI16_args();
args.setArg(arg);
sendBase("echoI16", args);
}
public short recv_echoI16() throws org.apache.thrift.TException
{
echoI16_result result = new echoI16_result();
receiveBase(result, "echoI16");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "echoI16 failed: unknown result");
}
public int echoI32(int arg) throws org.apache.thrift.TException
{
send_echoI32(arg);
return recv_echoI32();
}
public void send_echoI32(int arg) throws org.apache.thrift.TException
{
echoI32_args args = new echoI32_args();
args.setArg(arg);
sendBase("echoI32", args);
}
public int recv_echoI32() throws org.apache.thrift.TException
{
echoI32_result result = new echoI32_result();
receiveBase(result, "echoI32");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "echoI32 failed: unknown result");
}
public long echoI64(long arg) throws org.apache.thrift.TException
{
send_echoI64(arg);
return recv_echoI64();
}
public void send_echoI64(long arg) throws org.apache.thrift.TException
{
echoI64_args args = new echoI64_args();
args.setArg(arg);
sendBase("echoI64", args);
}
public long recv_echoI64() throws org.apache.thrift.TException
{
echoI64_result result = new echoI64_result();
receiveBase(result, "echoI64");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "echoI64 failed: unknown result");
}
public double echoDouble(double arg) throws org.apache.thrift.TException
{
send_echoDouble(arg);
return recv_echoDouble();
}
public void send_echoDouble(double arg) throws org.apache.thrift.TException
{
echoDouble_args args = new echoDouble_args();
args.setArg(arg);
sendBase("echoDouble", args);
}
public double recv_echoDouble() throws org.apache.thrift.TException
{
echoDouble_result result = new echoDouble_result();
receiveBase(result, "echoDouble");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "echoDouble failed: unknown result");
}
public java.lang.String echoString(java.lang.String arg) throws org.apache.thrift.TException
{
send_echoString(arg);
return recv_echoString();
}
public void send_echoString(java.lang.String arg) throws org.apache.thrift.TException
{
echoString_args args = new echoString_args();
args.setArg(arg);
sendBase("echoString", args);
}
public java.lang.String recv_echoString() throws org.apache.thrift.TException
{
echoString_result result = new echoString_result();
receiveBase(result, "echoString");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "echoString failed: unknown result");
}
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
private org.apache.thrift.async.TAsyncClientManager clientManager;
private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
this.clientManager = clientManager;
this.protocolFactory = protocolFactory;
}
public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
return new AsyncClient(protocolFactory, clientManager, transport);
}
}
public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
super(protocolFactory, clientManager, transport);
}
public void echoBool(boolean arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
checkReady();
echoBool_call method_call = new echoBool_call(arg, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class echoBool_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Boolean> {
private boolean arg;
public echoBool_call(boolean arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.arg = arg;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("echoBool", org.apache.thrift.protocol.TMessageType.CALL, 0));
echoBool_args args = new echoBool_args();
args.setArg(arg);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Boolean getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_echoBool();
}
}
public void echoByte(byte arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Byte> resultHandler) throws org.apache.thrift.TException {
checkReady();
echoByte_call method_call = new echoByte_call(arg, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class echoByte_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Byte> {
private byte arg;
public echoByte_call(byte arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Byte> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.arg = arg;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("echoByte", org.apache.thrift.protocol.TMessageType.CALL, 0));
echoByte_args args = new echoByte_args();
args.setArg(arg);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Byte getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_echoByte();
}
}
public void echoI16(short arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Short> resultHandler) throws org.apache.thrift.TException {
checkReady();
echoI16_call method_call = new echoI16_call(arg, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class echoI16_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Short> {
private short arg;
public echoI16_call(short arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Short> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.arg = arg;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("echoI16", org.apache.thrift.protocol.TMessageType.CALL, 0));
echoI16_args args = new echoI16_args();
args.setArg(arg);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Short getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_echoI16();
}
}
public void echoI32(int arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Integer> resultHandler) throws org.apache.thrift.TException {
checkReady();
echoI32_call method_call = new echoI32_call(arg, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class echoI32_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Integer> {
private int arg;
public echoI32_call(int arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Integer> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.arg = arg;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("echoI32", org.apache.thrift.protocol.TMessageType.CALL, 0));
echoI32_args args = new echoI32_args();
args.setArg(arg);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Integer getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_echoI32();
}
}
public void echoI64(long arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Long> resultHandler) throws org.apache.thrift.TException {
checkReady();
echoI64_call method_call = new echoI64_call(arg, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class echoI64_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Long> {
private long arg;
public echoI64_call(long arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Long> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.arg = arg;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("echoI64", org.apache.thrift.protocol.TMessageType.CALL, 0));
echoI64_args args = new echoI64_args();
args.setArg(arg);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Long getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_echoI64();
}
}
public void echoDouble(double arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Double> resultHandler) throws org.apache.thrift.TException {
checkReady();
echoDouble_call method_call = new echoDouble_call(arg, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class echoDouble_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.Double> {
private double arg;
public echoDouble_call(double arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.Double> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.arg = arg;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("echoDouble", org.apache.thrift.protocol.TMessageType.CALL, 0));
echoDouble_args args = new echoDouble_args();
args.setArg(arg);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.Double getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_echoDouble();
}
}
public void echoString(java.lang.String arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
checkReady();
echoString_call method_call = new echoString_call(arg, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class echoString_call extends org.apache.thrift.async.TAsyncMethodCall<java.lang.String> {
private java.lang.String arg;
public echoString_call(java.lang.String arg, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.arg = arg;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("echoString", org.apache.thrift.protocol.TMessageType.CALL, 0));
echoString_args args = new echoString_args();
args.setArg(arg);
args.write(prot);
prot.writeMessageEnd();
}
public java.lang.String getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_echoString();
}
}
}
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName());
public Processor(I iface) {
super(iface, getProcessMap(new java.util.HashMap<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
}
protected Processor(I iface, java.util.Map<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
super(iface, getProcessMap(processMap));
}
private static <I extends Iface> java.util.Map<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(java.util.Map<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
processMap.put("echoBool", new echoBool());
processMap.put("echoByte", new echoByte());
processMap.put("echoI16", new echoI16());
processMap.put("echoI32", new echoI32());
processMap.put("echoI64", new echoI64());
processMap.put("echoDouble", new echoDouble());
processMap.put("echoString", new echoString());
return processMap;
}
public static class echoBool<I extends Iface> extends org.apache.thrift.ProcessFunction<I, echoBool_args> {
public echoBool() {
super("echoBool");
}
public echoBool_args getEmptyArgsInstance() {
return new echoBool_args();
}
protected boolean isOneway() {
return false;
}
@Override
protected boolean rethrowUnhandledExceptions() {
return false;
}
public echoBool_result getResult(I iface, echoBool_args args) throws org.apache.thrift.TException {
echoBool_result result = new echoBool_result();
result.success = iface.echoBool(args.arg);
result.setSuccessIsSet(true);
return result;
}
}
public static class echoByte<I extends Iface> extends org.apache.thrift.ProcessFunction<I, echoByte_args> {
public echoByte() {
super("echoByte");
}
public echoByte_args getEmptyArgsInstance() {
return new echoByte_args();
}
protected boolean isOneway() {
return false;
}
@Override
protected boolean rethrowUnhandledExceptions() {
return false;
}
public echoByte_result getResult(I iface, echoByte_args args) throws org.apache.thrift.TException {
echoByte_result result = new echoByte_result();
result.success = iface.echoByte(args.arg);
result.setSuccessIsSet(true);
return result;
}
}
public static class echoI16<I extends Iface> extends org.apache.thrift.ProcessFunction<I, echoI16_args> {
public echoI16() {
super("echoI16");
}
public echoI16_args getEmptyArgsInstance() {
return new echoI16_args();
}
protected boolean isOneway() {
return false;
}
@Override
protected boolean rethrowUnhandledExceptions() {
return false;
}
public echoI16_result getResult(I iface, echoI16_args args) throws org.apache.thrift.TException {
echoI16_result result = new echoI16_result();
result.success = iface.echoI16(args.arg);
result.setSuccessIsSet(true);
return result;
}
}
public static class echoI32<I extends Iface> extends org.apache.thrift.ProcessFunction<I, echoI32_args> {
public echoI32() {
super("echoI32");
}
public echoI32_args getEmptyArgsInstance() {
return new echoI32_args();
}
protected boolean isOneway() {
return false;
}
@Override
protected boolean rethrowUnhandledExceptions() {
return false;
}
public echoI32_result getResult(I iface, echoI32_args args) throws org.apache.thrift.TException {
echoI32_result result = new echoI32_result();
result.success = iface.echoI32(args.arg);
result.setSuccessIsSet(true);
return result;
}
}
public static class echoI64<I extends Iface> extends org.apache.thrift.ProcessFunction<I, echoI64_args> {
public echoI64() {
super("echoI64");
}
public echoI64_args getEmptyArgsInstance() {
return new echoI64_args();
}
protected boolean isOneway() {
return false;
}
@Override
protected boolean rethrowUnhandledExceptions() {
return false;
}
public echoI64_result getResult(I iface, echoI64_args args) throws org.apache.thrift.TException {
echoI64_result result = new echoI64_result();
result.success = iface.echoI64(args.arg);
result.setSuccessIsSet(true);
return result;
}
}
public static class echoDouble<I extends Iface> extends org.apache.thrift.ProcessFunction<I, echoDouble_args> {
public echoDouble() {
super("echoDouble");
}
public echoDouble_args getEmptyArgsInstance() {
return new echoDouble_args();
}
protected boolean isOneway() {
return false;
}
@Override
protected boolean rethrowUnhandledExceptions() {
return false;
}
public echoDouble_result getResult(I iface, echoDouble_args args) throws org.apache.thrift.TException {
echoDouble_result result = new echoDouble_result();
result.success = iface.echoDouble(args.arg);
result.setSuccessIsSet(true);
return result;
}
}
public static class echoString<I extends Iface> extends org.apache.thrift.ProcessFunction<I, echoString_args> {
public echoString() {
super("echoString");
}
public echoString_args getEmptyArgsInstance() {
return new echoString_args();
}
protected boolean isOneway() {
return false;
}
@Override
protected boolean rethrowUnhandledExceptions() {
return false;
}
public echoString_result getResult(I iface, echoString_args args) throws org.apache.thrift.TException {
echoString_result result = new echoString_result();
result.success = iface.echoString(args.arg);
return result;
}
}
}
public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName());
public AsyncProcessor(I iface) {
super(iface, getProcessMap(new java.util.HashMap<java.lang.String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
}
protected AsyncProcessor(I iface, java.util.Map<java.lang.String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
super(iface, getProcessMap(processMap));
}
private static <I extends AsyncIface> java.util.Map<java.lang.String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(java.util.Map<java.lang.String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
processMap.put("echoBool", new echoBool());
processMap.put("echoByte", new echoByte());
processMap.put("echoI16", new echoI16());
processMap.put("echoI32", new echoI32());
processMap.put("echoI64", new echoI64());
processMap.put("echoDouble", new echoDouble());
processMap.put("echoString", new echoString());
return processMap;
}
public static class echoBool<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, echoBool_args, java.lang.Boolean> {
public echoBool() {
super("echoBool");
}
public echoBool_args getEmptyArgsInstance() {
return new echoBool_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean>() {
public void onComplete(java.lang.Boolean o) {
echoBool_result result = new echoBool_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
echoBool_result result = new echoBool_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, echoBool_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
iface.echoBool(args.arg,resultHandler);
}
}
public static class echoByte<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, echoByte_args, java.lang.Byte> {
public echoByte() {
super("echoByte");
}
public echoByte_args getEmptyArgsInstance() {
return new echoByte_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Byte> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Byte>() {
public void onComplete(java.lang.Byte o) {
echoByte_result result = new echoByte_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
echoByte_result result = new echoByte_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, echoByte_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Byte> resultHandler) throws org.apache.thrift.TException {
iface.echoByte(args.arg,resultHandler);
}
}
public static class echoI16<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, echoI16_args, java.lang.Short> {
public echoI16() {
super("echoI16");
}
public echoI16_args getEmptyArgsInstance() {
return new echoI16_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Short> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Short>() {
public void onComplete(java.lang.Short o) {
echoI16_result result = new echoI16_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
echoI16_result result = new echoI16_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, echoI16_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Short> resultHandler) throws org.apache.thrift.TException {
iface.echoI16(args.arg,resultHandler);
}
}
public static class echoI32<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, echoI32_args, java.lang.Integer> {
public echoI32() {
super("echoI32");
}
public echoI32_args getEmptyArgsInstance() {
return new echoI32_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Integer> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Integer>() {
public void onComplete(java.lang.Integer o) {
echoI32_result result = new echoI32_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
echoI32_result result = new echoI32_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, echoI32_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Integer> resultHandler) throws org.apache.thrift.TException {
iface.echoI32(args.arg,resultHandler);
}
}
public static class echoI64<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, echoI64_args, java.lang.Long> {
public echoI64() {
super("echoI64");
}
public echoI64_args getEmptyArgsInstance() {
return new echoI64_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Long> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Long>() {
public void onComplete(java.lang.Long o) {
echoI64_result result = new echoI64_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
echoI64_result result = new echoI64_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, echoI64_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Long> resultHandler) throws org.apache.thrift.TException {
iface.echoI64(args.arg,resultHandler);
}
}
public static class echoDouble<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, echoDouble_args, java.lang.Double> {
public echoDouble() {
super("echoDouble");
}
public echoDouble_args getEmptyArgsInstance() {
return new echoDouble_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.Double> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.Double>() {
public void onComplete(java.lang.Double o) {
echoDouble_result result = new echoDouble_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
echoDouble_result result = new echoDouble_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, echoDouble_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Double> resultHandler) throws org.apache.thrift.TException {
iface.echoDouble(args.arg,resultHandler);
}
}
public static class echoString<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, echoString_args, java.lang.String> {
public echoString() {
super("echoString");
}
public echoString_args getEmptyArgsInstance() {
return new echoString_args();
}
public org.apache.thrift.async.AsyncMethodCallback<java.lang.String> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<java.lang.String>() {
public void onComplete(java.lang.String o) {
echoString_result result = new echoString_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
echoString_result result = new echoString_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, echoString_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
iface.echoString(args.arg,resultHandler);
}
}
}
public static class echoBool_args implements org.apache.thrift.TBase<echoBool_args, echoBool_args._Fields>, java.io.Serializable, Cloneable, Comparable<echoBool_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoBool_args");
private static final org.apache.thrift.protocol.TField ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("arg", org.apache.thrift.protocol.TType.BOOL, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoBool_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoBool_argsTupleSchemeFactory();
public boolean arg; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ARG((short)1, "arg");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // ARG
return ARG;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __ARG_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.ARG, new org.apache.thrift.meta_data.FieldMetaData("arg", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoBool_args.class, metaDataMap);
}
public echoBool_args() {
}
public echoBool_args(
boolean arg)
{
this();
this.arg = arg;
setArgIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoBool_args(echoBool_args other) {
__isset_bitfield = other.__isset_bitfield;
this.arg = other.arg;
}
public echoBool_args deepCopy() {
return new echoBool_args(this);
}
@Override
public void clear() {
setArgIsSet(false);
this.arg = false;
}
public boolean isArg() {
return this.arg;
}
public echoBool_args setArg(boolean arg) {
this.arg = arg;
setArgIsSet(true);
return this;
}
public void unsetArg() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ARG_ISSET_ID);
}
/** Returns true if field arg is set (has been assigned a value) and false otherwise */
public boolean isSetArg() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ARG_ISSET_ID);
}
public void setArgIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ARG_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ARG:
if (value == null) {
unsetArg();
} else {
setArg((java.lang.Boolean)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ARG:
return isArg();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case ARG:
return isSetArg();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoBool_args)
return this.equals((echoBool_args)that);
return false;
}
public boolean equals(echoBool_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_arg = true;
boolean that_present_arg = true;
if (this_present_arg || that_present_arg) {
if (!(this_present_arg && that_present_arg))
return false;
if (this.arg != that.arg)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((arg) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(echoBool_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetArg()).compareTo(other.isSetArg());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetArg()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arg, other.arg);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoBool_args(");
boolean first = true;
sb.append("arg:");
sb.append(this.arg);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// alas, we cannot check 'arg' because it's a primitive and you chose the non-beans generator.
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoBool_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoBool_argsStandardScheme getScheme() {
return new echoBool_argsStandardScheme();
}
}
private static class echoBool_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoBool_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoBool_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // ARG
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.arg = iprot.readBool();
struct.setArgIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetArg()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'arg' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoBool_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(ARG_FIELD_DESC);
oprot.writeBool(struct.arg);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoBool_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoBool_argsTupleScheme getScheme() {
return new echoBool_argsTupleScheme();
}
}
private static class echoBool_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoBool_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoBool_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeBool(struct.arg);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoBool_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.arg = iprot.readBool();
struct.setArgIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class echoBool_result implements org.apache.thrift.TBase<echoBool_result, echoBool_result._Fields>, java.io.Serializable, Cloneable, Comparable<echoBool_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoBool_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoBool_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoBool_resultTupleSchemeFactory();
public boolean success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoBool_result.class, metaDataMap);
}
public echoBool_result() {
}
public echoBool_result(
boolean success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoBool_result(echoBool_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public echoBool_result deepCopy() {
return new echoBool_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = false;
}
public boolean isSuccess() {
return this.success;
}
public echoBool_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Boolean)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return isSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoBool_result)
return this.equals((echoBool_result)that);
return false;
}
public boolean equals(echoBool_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((success) ? 131071 : 524287);
return hashCode;
}
@Override
public int compareTo(echoBool_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoBool_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoBool_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoBool_resultStandardScheme getScheme() {
return new echoBool_resultStandardScheme();
}
}
private static class echoBool_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoBool_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoBool_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoBool_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoBool_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoBool_resultTupleScheme getScheme() {
return new echoBool_resultTupleScheme();
}
}
private static class echoBool_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoBool_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoBool_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoBool_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class echoByte_args implements org.apache.thrift.TBase<echoByte_args, echoByte_args._Fields>, java.io.Serializable, Cloneable, Comparable<echoByte_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoByte_args");
private static final org.apache.thrift.protocol.TField ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("arg", org.apache.thrift.protocol.TType.BYTE, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoByte_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoByte_argsTupleSchemeFactory();
public byte arg; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ARG((short)1, "arg");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // ARG
return ARG;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __ARG_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.ARG, new org.apache.thrift.meta_data.FieldMetaData("arg", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoByte_args.class, metaDataMap);
}
public echoByte_args() {
}
public echoByte_args(
byte arg)
{
this();
this.arg = arg;
setArgIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoByte_args(echoByte_args other) {
__isset_bitfield = other.__isset_bitfield;
this.arg = other.arg;
}
public echoByte_args deepCopy() {
return new echoByte_args(this);
}
@Override
public void clear() {
setArgIsSet(false);
this.arg = 0;
}
public byte getArg() {
return this.arg;
}
public echoByte_args setArg(byte arg) {
this.arg = arg;
setArgIsSet(true);
return this;
}
public void unsetArg() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ARG_ISSET_ID);
}
/** Returns true if field arg is set (has been assigned a value) and false otherwise */
public boolean isSetArg() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ARG_ISSET_ID);
}
public void setArgIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ARG_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ARG:
if (value == null) {
unsetArg();
} else {
setArg((java.lang.Byte)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ARG:
return getArg();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case ARG:
return isSetArg();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoByte_args)
return this.equals((echoByte_args)that);
return false;
}
public boolean equals(echoByte_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_arg = true;
boolean that_present_arg = true;
if (this_present_arg || that_present_arg) {
if (!(this_present_arg && that_present_arg))
return false;
if (this.arg != that.arg)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + (int) (arg);
return hashCode;
}
@Override
public int compareTo(echoByte_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetArg()).compareTo(other.isSetArg());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetArg()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arg, other.arg);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoByte_args(");
boolean first = true;
sb.append("arg:");
sb.append(this.arg);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// alas, we cannot check 'arg' because it's a primitive and you chose the non-beans generator.
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoByte_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoByte_argsStandardScheme getScheme() {
return new echoByte_argsStandardScheme();
}
}
private static class echoByte_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoByte_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoByte_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // ARG
if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
struct.arg = iprot.readByte();
struct.setArgIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetArg()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'arg' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoByte_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(ARG_FIELD_DESC);
oprot.writeByte(struct.arg);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoByte_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoByte_argsTupleScheme getScheme() {
return new echoByte_argsTupleScheme();
}
}
private static class echoByte_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoByte_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoByte_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeByte(struct.arg);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoByte_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.arg = iprot.readByte();
struct.setArgIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class echoByte_result implements org.apache.thrift.TBase<echoByte_result, echoByte_result._Fields>, java.io.Serializable, Cloneable, Comparable<echoByte_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoByte_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BYTE, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoByte_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoByte_resultTupleSchemeFactory();
public byte success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoByte_result.class, metaDataMap);
}
public echoByte_result() {
}
public echoByte_result(
byte success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoByte_result(echoByte_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public echoByte_result deepCopy() {
return new echoByte_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = 0;
}
public byte getSuccess() {
return this.success;
}
public echoByte_result setSuccess(byte success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Byte)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoByte_result)
return this.equals((echoByte_result)that);
return false;
}
public boolean equals(echoByte_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + (int) (success);
return hashCode;
}
@Override
public int compareTo(echoByte_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoByte_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoByte_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoByte_resultStandardScheme getScheme() {
return new echoByte_resultStandardScheme();
}
}
private static class echoByte_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoByte_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoByte_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
struct.success = iprot.readByte();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoByte_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeByte(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoByte_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoByte_resultTupleScheme getScheme() {
return new echoByte_resultTupleScheme();
}
}
private static class echoByte_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoByte_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoByte_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeByte(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoByte_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readByte();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class echoI16_args implements org.apache.thrift.TBase<echoI16_args, echoI16_args._Fields>, java.io.Serializable, Cloneable, Comparable<echoI16_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoI16_args");
private static final org.apache.thrift.protocol.TField ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("arg", org.apache.thrift.protocol.TType.I16, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoI16_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoI16_argsTupleSchemeFactory();
public short arg; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ARG((short)1, "arg");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // ARG
return ARG;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __ARG_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.ARG, new org.apache.thrift.meta_data.FieldMetaData("arg", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoI16_args.class, metaDataMap);
}
public echoI16_args() {
}
public echoI16_args(
short arg)
{
this();
this.arg = arg;
setArgIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoI16_args(echoI16_args other) {
__isset_bitfield = other.__isset_bitfield;
this.arg = other.arg;
}
public echoI16_args deepCopy() {
return new echoI16_args(this);
}
@Override
public void clear() {
setArgIsSet(false);
this.arg = 0;
}
public short getArg() {
return this.arg;
}
public echoI16_args setArg(short arg) {
this.arg = arg;
setArgIsSet(true);
return this;
}
public void unsetArg() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ARG_ISSET_ID);
}
/** Returns true if field arg is set (has been assigned a value) and false otherwise */
public boolean isSetArg() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ARG_ISSET_ID);
}
public void setArgIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ARG_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ARG:
if (value == null) {
unsetArg();
} else {
setArg((java.lang.Short)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ARG:
return getArg();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case ARG:
return isSetArg();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoI16_args)
return this.equals((echoI16_args)that);
return false;
}
public boolean equals(echoI16_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_arg = true;
boolean that_present_arg = true;
if (this_present_arg || that_present_arg) {
if (!(this_present_arg && that_present_arg))
return false;
if (this.arg != that.arg)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + arg;
return hashCode;
}
@Override
public int compareTo(echoI16_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetArg()).compareTo(other.isSetArg());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetArg()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arg, other.arg);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoI16_args(");
boolean first = true;
sb.append("arg:");
sb.append(this.arg);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// alas, we cannot check 'arg' because it's a primitive and you chose the non-beans generator.
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoI16_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoI16_argsStandardScheme getScheme() {
return new echoI16_argsStandardScheme();
}
}
private static class echoI16_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoI16_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoI16_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // ARG
if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
struct.arg = iprot.readI16();
struct.setArgIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetArg()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'arg' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoI16_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(ARG_FIELD_DESC);
oprot.writeI16(struct.arg);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoI16_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoI16_argsTupleScheme getScheme() {
return new echoI16_argsTupleScheme();
}
}
private static class echoI16_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoI16_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoI16_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeI16(struct.arg);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoI16_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.arg = iprot.readI16();
struct.setArgIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class echoI16_result implements org.apache.thrift.TBase<echoI16_result, echoI16_result._Fields>, java.io.Serializable, Cloneable, Comparable<echoI16_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoI16_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I16, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoI16_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoI16_resultTupleSchemeFactory();
public short success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoI16_result.class, metaDataMap);
}
public echoI16_result() {
}
public echoI16_result(
short success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoI16_result(echoI16_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public echoI16_result deepCopy() {
return new echoI16_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = 0;
}
public short getSuccess() {
return this.success;
}
public echoI16_result setSuccess(short success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Short)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoI16_result)
return this.equals((echoI16_result)that);
return false;
}
public boolean equals(echoI16_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + success;
return hashCode;
}
@Override
public int compareTo(echoI16_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoI16_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoI16_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoI16_resultStandardScheme getScheme() {
return new echoI16_resultStandardScheme();
}
}
private static class echoI16_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoI16_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoI16_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
struct.success = iprot.readI16();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoI16_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeI16(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoI16_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoI16_resultTupleScheme getScheme() {
return new echoI16_resultTupleScheme();
}
}
private static class echoI16_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoI16_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoI16_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeI16(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoI16_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readI16();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class echoI32_args implements org.apache.thrift.TBase<echoI32_args, echoI32_args._Fields>, java.io.Serializable, Cloneable, Comparable<echoI32_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoI32_args");
private static final org.apache.thrift.protocol.TField ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("arg", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoI32_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoI32_argsTupleSchemeFactory();
public int arg; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ARG((short)1, "arg");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // ARG
return ARG;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __ARG_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.ARG, new org.apache.thrift.meta_data.FieldMetaData("arg", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoI32_args.class, metaDataMap);
}
public echoI32_args() {
}
public echoI32_args(
int arg)
{
this();
this.arg = arg;
setArgIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoI32_args(echoI32_args other) {
__isset_bitfield = other.__isset_bitfield;
this.arg = other.arg;
}
public echoI32_args deepCopy() {
return new echoI32_args(this);
}
@Override
public void clear() {
setArgIsSet(false);
this.arg = 0;
}
public int getArg() {
return this.arg;
}
public echoI32_args setArg(int arg) {
this.arg = arg;
setArgIsSet(true);
return this;
}
public void unsetArg() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ARG_ISSET_ID);
}
/** Returns true if field arg is set (has been assigned a value) and false otherwise */
public boolean isSetArg() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ARG_ISSET_ID);
}
public void setArgIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ARG_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ARG:
if (value == null) {
unsetArg();
} else {
setArg((java.lang.Integer)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ARG:
return getArg();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case ARG:
return isSetArg();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoI32_args)
return this.equals((echoI32_args)that);
return false;
}
public boolean equals(echoI32_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_arg = true;
boolean that_present_arg = true;
if (this_present_arg || that_present_arg) {
if (!(this_present_arg && that_present_arg))
return false;
if (this.arg != that.arg)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + arg;
return hashCode;
}
@Override
public int compareTo(echoI32_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetArg()).compareTo(other.isSetArg());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetArg()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arg, other.arg);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoI32_args(");
boolean first = true;
sb.append("arg:");
sb.append(this.arg);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// alas, we cannot check 'arg' because it's a primitive and you chose the non-beans generator.
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoI32_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoI32_argsStandardScheme getScheme() {
return new echoI32_argsStandardScheme();
}
}
private static class echoI32_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoI32_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoI32_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // ARG
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.arg = iprot.readI32();
struct.setArgIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetArg()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'arg' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoI32_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(ARG_FIELD_DESC);
oprot.writeI32(struct.arg);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoI32_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoI32_argsTupleScheme getScheme() {
return new echoI32_argsTupleScheme();
}
}
private static class echoI32_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoI32_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoI32_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeI32(struct.arg);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoI32_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.arg = iprot.readI32();
struct.setArgIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class echoI32_result implements org.apache.thrift.TBase<echoI32_result, echoI32_result._Fields>, java.io.Serializable, Cloneable, Comparable<echoI32_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoI32_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoI32_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoI32_resultTupleSchemeFactory();
public int success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoI32_result.class, metaDataMap);
}
public echoI32_result() {
}
public echoI32_result(
int success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoI32_result(echoI32_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public echoI32_result deepCopy() {
return new echoI32_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = 0;
}
public int getSuccess() {
return this.success;
}
public echoI32_result setSuccess(int success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Integer)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoI32_result)
return this.equals((echoI32_result)that);
return false;
}
public boolean equals(echoI32_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + success;
return hashCode;
}
@Override
public int compareTo(echoI32_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoI32_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoI32_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoI32_resultStandardScheme getScheme() {
return new echoI32_resultStandardScheme();
}
}
private static class echoI32_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoI32_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoI32_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.success = iprot.readI32();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoI32_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeI32(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoI32_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoI32_resultTupleScheme getScheme() {
return new echoI32_resultTupleScheme();
}
}
private static class echoI32_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoI32_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoI32_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeI32(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoI32_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readI32();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class echoI64_args implements org.apache.thrift.TBase<echoI64_args, echoI64_args._Fields>, java.io.Serializable, Cloneable, Comparable<echoI64_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoI64_args");
private static final org.apache.thrift.protocol.TField ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("arg", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoI64_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoI64_argsTupleSchemeFactory();
public long arg; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ARG((short)1, "arg");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // ARG
return ARG;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __ARG_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.ARG, new org.apache.thrift.meta_data.FieldMetaData("arg", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoI64_args.class, metaDataMap);
}
public echoI64_args() {
}
public echoI64_args(
long arg)
{
this();
this.arg = arg;
setArgIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoI64_args(echoI64_args other) {
__isset_bitfield = other.__isset_bitfield;
this.arg = other.arg;
}
public echoI64_args deepCopy() {
return new echoI64_args(this);
}
@Override
public void clear() {
setArgIsSet(false);
this.arg = 0;
}
public long getArg() {
return this.arg;
}
public echoI64_args setArg(long arg) {
this.arg = arg;
setArgIsSet(true);
return this;
}
public void unsetArg() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ARG_ISSET_ID);
}
/** Returns true if field arg is set (has been assigned a value) and false otherwise */
public boolean isSetArg() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ARG_ISSET_ID);
}
public void setArgIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ARG_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ARG:
if (value == null) {
unsetArg();
} else {
setArg((java.lang.Long)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ARG:
return getArg();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case ARG:
return isSetArg();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoI64_args)
return this.equals((echoI64_args)that);
return false;
}
public boolean equals(echoI64_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_arg = true;
boolean that_present_arg = true;
if (this_present_arg || that_present_arg) {
if (!(this_present_arg && that_present_arg))
return false;
if (this.arg != that.arg)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(arg);
return hashCode;
}
@Override
public int compareTo(echoI64_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetArg()).compareTo(other.isSetArg());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetArg()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arg, other.arg);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoI64_args(");
boolean first = true;
sb.append("arg:");
sb.append(this.arg);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// alas, we cannot check 'arg' because it's a primitive and you chose the non-beans generator.
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoI64_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoI64_argsStandardScheme getScheme() {
return new echoI64_argsStandardScheme();
}
}
private static class echoI64_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoI64_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoI64_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // ARG
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.arg = iprot.readI64();
struct.setArgIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetArg()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'arg' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoI64_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(ARG_FIELD_DESC);
oprot.writeI64(struct.arg);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoI64_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoI64_argsTupleScheme getScheme() {
return new echoI64_argsTupleScheme();
}
}
private static class echoI64_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoI64_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoI64_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeI64(struct.arg);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoI64_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.arg = iprot.readI64();
struct.setArgIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class echoI64_result implements org.apache.thrift.TBase<echoI64_result, echoI64_result._Fields>, java.io.Serializable, Cloneable, Comparable<echoI64_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoI64_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoI64_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoI64_resultTupleSchemeFactory();
public long success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoI64_result.class, metaDataMap);
}
public echoI64_result() {
}
public echoI64_result(
long success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoI64_result(echoI64_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public echoI64_result deepCopy() {
return new echoI64_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = 0;
}
public long getSuccess() {
return this.success;
}
public echoI64_result setSuccess(long success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Long)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoI64_result)
return this.equals((echoI64_result)that);
return false;
}
public boolean equals(echoI64_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success);
return hashCode;
}
@Override
public int compareTo(echoI64_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoI64_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoI64_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoI64_resultStandardScheme getScheme() {
return new echoI64_resultStandardScheme();
}
}
private static class echoI64_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoI64_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoI64_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.success = iprot.readI64();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoI64_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeI64(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoI64_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoI64_resultTupleScheme getScheme() {
return new echoI64_resultTupleScheme();
}
}
private static class echoI64_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoI64_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoI64_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeI64(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoI64_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readI64();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class echoDouble_args implements org.apache.thrift.TBase<echoDouble_args, echoDouble_args._Fields>, java.io.Serializable, Cloneable, Comparable<echoDouble_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoDouble_args");
private static final org.apache.thrift.protocol.TField ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("arg", org.apache.thrift.protocol.TType.DOUBLE, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoDouble_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoDouble_argsTupleSchemeFactory();
public double arg; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ARG((short)1, "arg");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // ARG
return ARG;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __ARG_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.ARG, new org.apache.thrift.meta_data.FieldMetaData("arg", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoDouble_args.class, metaDataMap);
}
public echoDouble_args() {
}
public echoDouble_args(
double arg)
{
this();
this.arg = arg;
setArgIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoDouble_args(echoDouble_args other) {
__isset_bitfield = other.__isset_bitfield;
this.arg = other.arg;
}
public echoDouble_args deepCopy() {
return new echoDouble_args(this);
}
@Override
public void clear() {
setArgIsSet(false);
this.arg = 0.0;
}
public double getArg() {
return this.arg;
}
public echoDouble_args setArg(double arg) {
this.arg = arg;
setArgIsSet(true);
return this;
}
public void unsetArg() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ARG_ISSET_ID);
}
/** Returns true if field arg is set (has been assigned a value) and false otherwise */
public boolean isSetArg() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ARG_ISSET_ID);
}
public void setArgIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ARG_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ARG:
if (value == null) {
unsetArg();
} else {
setArg((java.lang.Double)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ARG:
return getArg();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case ARG:
return isSetArg();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoDouble_args)
return this.equals((echoDouble_args)that);
return false;
}
public boolean equals(echoDouble_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_arg = true;
boolean that_present_arg = true;
if (this_present_arg || that_present_arg) {
if (!(this_present_arg && that_present_arg))
return false;
if (this.arg != that.arg)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(arg);
return hashCode;
}
@Override
public int compareTo(echoDouble_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetArg()).compareTo(other.isSetArg());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetArg()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arg, other.arg);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoDouble_args(");
boolean first = true;
sb.append("arg:");
sb.append(this.arg);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// alas, we cannot check 'arg' because it's a primitive and you chose the non-beans generator.
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoDouble_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoDouble_argsStandardScheme getScheme() {
return new echoDouble_argsStandardScheme();
}
}
private static class echoDouble_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoDouble_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoDouble_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // ARG
if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
struct.arg = iprot.readDouble();
struct.setArgIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
if (!struct.isSetArg()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'arg' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoDouble_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(ARG_FIELD_DESC);
oprot.writeDouble(struct.arg);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoDouble_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoDouble_argsTupleScheme getScheme() {
return new echoDouble_argsTupleScheme();
}
}
private static class echoDouble_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoDouble_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoDouble_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeDouble(struct.arg);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoDouble_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.arg = iprot.readDouble();
struct.setArgIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class echoDouble_result implements org.apache.thrift.TBase<echoDouble_result, echoDouble_result._Fields>, java.io.Serializable, Cloneable, Comparable<echoDouble_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoDouble_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.DOUBLE, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoDouble_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoDouble_resultTupleSchemeFactory();
public double success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoDouble_result.class, metaDataMap);
}
public echoDouble_result() {
}
public echoDouble_result(
double success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoDouble_result(echoDouble_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public echoDouble_result deepCopy() {
return new echoDouble_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = 0.0;
}
public double getSuccess() {
return this.success;
}
public echoDouble_result setSuccess(double success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.Double)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoDouble_result)
return this.equals((echoDouble_result)that);
return false;
}
public boolean equals(echoDouble_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(success);
return hashCode;
}
@Override
public int compareTo(echoDouble_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoDouble_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoDouble_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoDouble_resultStandardScheme getScheme() {
return new echoDouble_resultStandardScheme();
}
}
private static class echoDouble_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoDouble_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoDouble_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
struct.success = iprot.readDouble();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoDouble_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeDouble(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoDouble_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoDouble_resultTupleScheme getScheme() {
return new echoDouble_resultTupleScheme();
}
}
private static class echoDouble_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoDouble_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoDouble_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeDouble(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoDouble_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readDouble();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class echoString_args implements org.apache.thrift.TBase<echoString_args, echoString_args._Fields>, java.io.Serializable, Cloneable, Comparable<echoString_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoString_args");
private static final org.apache.thrift.protocol.TField ARG_FIELD_DESC = new org.apache.thrift.protocol.TField("arg", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoString_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoString_argsTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable java.lang.String arg; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ARG((short)1, "arg");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // ARG
return ARG;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.ARG, new org.apache.thrift.meta_data.FieldMetaData("arg", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoString_args.class, metaDataMap);
}
public echoString_args() {
}
public echoString_args(
java.lang.String arg)
{
this();
this.arg = arg;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoString_args(echoString_args other) {
if (other.isSetArg()) {
this.arg = other.arg;
}
}
public echoString_args deepCopy() {
return new echoString_args(this);
}
@Override
public void clear() {
this.arg = null;
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getArg() {
return this.arg;
}
public echoString_args setArg(@org.apache.thrift.annotation.Nullable java.lang.String arg) {
this.arg = arg;
return this;
}
public void unsetArg() {
this.arg = null;
}
/** Returns true if field arg is set (has been assigned a value) and false otherwise */
public boolean isSetArg() {
return this.arg != null;
}
public void setArgIsSet(boolean value) {
if (!value) {
this.arg = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case ARG:
if (value == null) {
unsetArg();
} else {
setArg((java.lang.String)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case ARG:
return getArg();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case ARG:
return isSetArg();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoString_args)
return this.equals((echoString_args)that);
return false;
}
public boolean equals(echoString_args that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_arg = true && this.isSetArg();
boolean that_present_arg = true && that.isSetArg();
if (this_present_arg || that_present_arg) {
if (!(this_present_arg && that_present_arg))
return false;
if (!this.arg.equals(that.arg))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetArg()) ? 131071 : 524287);
if (isSetArg())
hashCode = hashCode * 8191 + arg.hashCode();
return hashCode;
}
@Override
public int compareTo(echoString_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetArg()).compareTo(other.isSetArg());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetArg()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arg, other.arg);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoString_args(");
boolean first = true;
sb.append("arg:");
if (this.arg == null) {
sb.append("null");
} else {
sb.append(this.arg);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (arg == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'arg' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoString_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoString_argsStandardScheme getScheme() {
return new echoString_argsStandardScheme();
}
}
private static class echoString_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoString_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoString_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // ARG
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.arg = iprot.readString();
struct.setArgIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoString_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.arg != null) {
oprot.writeFieldBegin(ARG_FIELD_DESC);
oprot.writeString(struct.arg);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoString_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoString_argsTupleScheme getScheme() {
return new echoString_argsTupleScheme();
}
}
private static class echoString_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoString_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoString_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeString(struct.arg);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoString_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.arg = iprot.readString();
struct.setArgIsSet(true);
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class echoString_result implements org.apache.thrift.TBase<echoString_result, echoString_result._Fields>, java.io.Serializable, Cloneable, Comparable<echoString_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("echoString_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new echoString_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new echoString_resultTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable java.lang.String success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(echoString_result.class, metaDataMap);
}
public echoString_result() {
}
public echoString_result(
java.lang.String success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public echoString_result(echoString_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public echoString_result deepCopy() {
return new echoString_result(this);
}
@Override
public void clear() {
this.success = null;
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getSuccess() {
return this.success;
}
public echoString_result setSuccess(@org.apache.thrift.annotation.Nullable java.lang.String success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((java.lang.String)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof echoString_result)
return this.equals((echoString_result)that);
return false;
}
public boolean equals(echoString_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(echoString_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("echoString_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class echoString_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoString_resultStandardScheme getScheme() {
return new echoString_resultStandardScheme();
}
}
private static class echoString_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<echoString_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, echoString_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, echoString_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeString(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class echoString_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public echoString_resultTupleScheme getScheme() {
return new echoString_resultTupleScheme();
}
}
private static class echoString_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<echoString_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, echoString_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, echoString_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
}
|
import java.util.LinkedList;
import java.util.Iterator;
import java.util.Map;
import java.util.HashMap;
public class Patch{
private String nom;
private LinkedList<ModuleAbstract> listeModules;
private LinkedList<Connexion> listeConnexions;
private Map<String, ModuleAbstract> dicoNomModule;
public Patch(String nom){
this.nom = nom;
listeModules = new LinkedList<ModuleAbstract>();
listeConnexions = new LinkedList<Connexion>();
dicoNomModule = new HashMap<String, ModuleAbstract>();
}
public void addModule(ModuleAbstract m){
listeModules.add(m);
dicoNomModule.put(m.getName(), m);
}
public ModuleAbstract trouverModule(String nom){
Iterator<ModuleAbstract> it = listeModules.iterator();
while(it.hasNext()){
ModuleAbstract a = it.next();
if(a.getName() == nom){
return a;
}
}
throw new IllegalArgumentException("Pas de Module avec ce nom");
}
public void connect(String nameOfOutputModule, int idOutputPort, String nameOfInputModule, int idInputPort){
ModuleAbstract a;
ModuleAbstract b;
/**try{
a = trouverModule(nameOfOutputModule);
b = trouverModule(nameOfInputModule);
}catch(IllegalArgumentException e){
throw new IllegalArgumentException("Un des deux modules a connecter n'existe pas");
}*/
if(dicoNomModule.containsKey(nameOfOutputModule) && dicoNomModule.containsKey(nameOfOutputModule)){
a = dicoNomModule.get(nameOfOutputModule);
b = dicoNomModule.get(nameOfInputModule);
}
else{
throw new IllegalArgumentException("Un des deux modules a connecter n'existe pas");
}
Connexion c = ModuleAbstract.connect(a, idOutputPort, b, idInputPort);
listeConnexions.add(c);
}
public void exec(){
Iterator<ModuleAbstract> it = listeModules.iterator();
while(it.hasNext()){
ModuleAbstract a = it.next();
a.exec();
}
}
public void exec(int nbStep){
for(int i = 0 ; i<nbStep ; i++){
Iterator<ModuleAbstract> it = listeModules.iterator();
while(it.hasNext()){
ModuleAbstract a = it.next();
a.exec();
}
}
}
public void reset(){
Iterator<ModuleAbstract> it = listeModules.iterator();
while(it.hasNext()){
ModuleAbstract a = it.next();
a.reset();
}
}
public LinkedList<CommunicationPort> getUnconnectedInputPorts(){
LinkedList<CommunicationPort> list = new LinkedList<CommunicationPort>();
Iterator<ModuleAbstract> it = listeModules.iterator();
while(it.hasNext()){
ModuleAbstract a = it.next();
list.addAll(a.getUnconnectedInputPorts());
}
return list;
}
public LinkedList<CommunicationPort> getUnconnectedOutputPorts(){
LinkedList<CommunicationPort> list = new LinkedList<CommunicationPort>();
Iterator<ModuleAbstract> it = listeModules.iterator();
while(it.hasNext()){
ModuleAbstract a = it.next();
list.addAll(a.getUnconnectedOutputPorts());
}
return list;
}
}
|
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch 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.elasticsearch.script.mustache;
import com.github.mustachejava.reflect.ReflectionObjectHandler;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.common.util.iterable.Iterables;
import java.lang.reflect.Array;
import java.util.AbstractMap;
import java.util.Collection;
import java.util.Set;
import java.util.Iterator;
import java.util.Map;
import java.util.HashMap;
final class CustomReflectionObjectHandler extends ReflectionObjectHandler {
@Override
public Object coerce(Object object) {
if (object == null) {
return null;
}
if (object.getClass().isArray()) {
return new ArrayMap(object);
} else if (object instanceof Collection) {
@SuppressWarnings("unchecked")
Collection<Object> collection = (Collection<Object>) object;
return new CollectionMap(collection);
} else {
return super.coerce(object);
}
}
static final class ArrayMap extends AbstractMap<Object, Object> implements Iterable<Object> {
private final Object array;
private final int length;
ArrayMap(Object array) {
this.array = array;
this.length = Array.getLength(array);
}
@Override
public Object get(Object key) {
if ("size".equals(key)) {
return size();
} else if (key instanceof Number) {
return Array.get(array, ((Number) key).intValue());
}
try {
int index = Integer.parseInt(key.toString());
return Array.get(array, index);
} catch (NumberFormatException nfe) {
// if it's not a number it is as if the key doesn't exist
return null;
}
}
@Override
public boolean containsKey(Object key) {
return get(key) != null;
}
@Override
public Set<Entry<Object, Object>> entrySet() {
Map<Object, Object> map = new HashMap<>(length);
for (int i = 0; i < length; i++) {
map.put(i, Array.get(array, i));
}
return map.entrySet();
}
@Override
public Iterator<Object> iterator() {
return new Iterator<Object>() {
int index = 0;
@Override
public boolean hasNext() {
return index < length;
}
@Override
public Object next() {
return Array.get(array, index++);
}
};
}
}
static final class CollectionMap extends AbstractMap<Object, Object> implements Iterable<Object> {
private final Collection<Object> col;
CollectionMap(Collection<Object> col) {
this.col = col;
}
@Override
public Object get(Object key) {
if ("size".equals(key)) {
return col.size();
} else if (key instanceof Number) {
return Iterables.get(col, ((Number) key).intValue());
}
try {
int index = Integer.parseInt(key.toString());
return Iterables.get(col, index);
} catch (NumberFormatException nfe) {
// if it's not a number it is as if the key doesn't exist
return null;
}
}
@Override
public boolean containsKey(Object key) {
return get(key) != null;
}
@Override
public Set<Entry<Object, Object>> entrySet() {
Map<Object, Object> map = new HashMap<>(col.size());
int i = 0;
for (Object item : col) {
map.put(i++, item);
}
return map.entrySet();
}
@Override
public Iterator<Object> iterator() {
return col.iterator();
}
}
@Override
public String stringify(Object object) {
CollectionUtils.ensureNoSelfReferences(object);
return super.stringify(object);
}
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.microsoft.azure.sdk.iot.service.jobs;
import com.microsoft.azure.sdk.iot.service.ProxyOptions;
import lombok.Builder;
import lombok.Getter;
/**
* Configurable options for all job client operations
*/
@Builder
public class JobClientOptions
{
protected static final Integer DEFAULT_HTTP_READ_TIMEOUT_MS = 24000; // 24 seconds
protected static final Integer DEFAULT_HTTP_CONNECT_TIMEOUT_MS = 24000; // 24 seconds
/**
* The options that specify what proxy to tunnel through. If null, no proxy will be used
*/
@Getter
private final ProxyOptions proxyOptions;
/**
* The http read timeout to a specified timeout, in milliseconds. A non-zero value specifies the timeout when reading from
* Input stream after a connection is established to a resource. If the timeout expires before there is data available
* for read, a java.net.SocketTimeoutException is raised. A timeout of zero is interpreted as an infinite timeout.
* By default, this value is {@link #DEFAULT_HTTP_READ_TIMEOUT_MS}. Must be a non-negative value.
*/
@Getter
private final int httpReadTimeout;
/**
* The http connect timeout value, in milliseconds, to be used when connecting to the service. If the timeout expires
* before the connection can be established, a java.net.SocketTimeoutException is thrown.
* A timeout of zero is interpreted as an infinite timeout.
* By default, this value is {@link #DEFAULT_HTTP_CONNECT_TIMEOUT_MS}. Must be a non-negative value.
*/
@Getter
private final int httpConnectTimeout;
}
|
/*
* Copyright (c) 2015-2022, Patricia Maraver
*
* 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.
*
*/
package org.neuromorpho.literature.search.service.pubmed.model.fulltext;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
@XmlAccessorType(XmlAccessType.FIELD)
public class Article {
@XmlElement(name = "ArticleTitle")
private String title;
@XmlElement(name = "Abstract")
private Abstract abstractContent;
@XmlElement(name = "AuthorList")
private AuthorList authorList;
public String getTitle() {
return title;
}
public String getAbstract() {
try {
return this.abstractContent.getAbstractText();
} catch (NullPointerException ex){
return null;
}
}
public AuthorList getAuthorList() {
return authorList;
}
}
|
package com.nhl.dflib;
import com.nhl.dflib.Series;
import com.nhl.dflib.series.IntArraySeries;
import com.nhl.dflib.unit.SeriesAsserts;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
// mirrors Series_ConcatTest
public class IntSeries_ConcatTest {
@Test
public void test_None() {
Series<Integer> s = new IntArraySeries(1, 2);
assertSame(s, s.concat());
}
@Test
public void test_Self() {
Series<Integer> s = new IntArraySeries(1, 2);
Series<Integer> c = s.concat(s);
new SeriesAsserts(c).expectData(1, 2, 1, 2);
}
@Test
public void test() {
Series<Integer> s1 = new IntArraySeries(5, 6);
Series<Integer> s2 = new IntArraySeries(1, 2);
Series<Integer> s3 = new IntArraySeries(3, 4);
Series<Integer> c = s1.concat(s2, s3);
new SeriesAsserts(c).expectData(5, 6, 1, 2, 3, 4);
}
}
|
/*
* ====================================================================
* 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.hc.client5.http.impl.classic;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.hc.client5.http.HttpRoute;
import org.apache.hc.client5.http.classic.ExecRuntime;
import org.apache.hc.client5.http.config.RequestConfig;
import org.apache.hc.client5.http.impl.ConnPoolSupport;
import org.apache.hc.client5.http.io.ConnectionEndpoint;
import org.apache.hc.client5.http.io.HttpClientConnectionManager;
import org.apache.hc.client5.http.io.LeaseRequest;
import org.apache.hc.client5.http.protocol.HttpClientContext;
import org.apache.hc.core5.concurrent.Cancellable;
import org.apache.hc.core5.concurrent.CancellableDependency;
import org.apache.hc.core5.http.ClassicHttpRequest;
import org.apache.hc.core5.http.ClassicHttpResponse;
import org.apache.hc.core5.http.ConnectionRequestTimeoutException;
import org.apache.hc.core5.http.HttpException;
import org.apache.hc.core5.http.impl.io.HttpRequestExecutor;
import org.apache.hc.core5.io.CloseMode;
import org.apache.hc.core5.util.Args;
import org.apache.hc.core5.util.TimeValue;
import org.apache.hc.core5.util.Timeout;
import org.slf4j.Logger;
class InternalExecRuntime implements ExecRuntime, Cancellable {
private final Logger log;
private final HttpClientConnectionManager manager;
private final HttpRequestExecutor requestExecutor;
private final CancellableDependency cancellableDependency;
private final AtomicReference<ConnectionEndpoint> endpointRef;
private volatile boolean reusable;
private volatile Object state;
private volatile TimeValue validDuration;
InternalExecRuntime(
final Logger log,
final HttpClientConnectionManager manager,
final HttpRequestExecutor requestExecutor,
final CancellableDependency cancellableDependency) {
super();
this.log = log;
this.manager = manager;
this.requestExecutor = requestExecutor;
this.cancellableDependency = cancellableDependency;
this.endpointRef = new AtomicReference<>(null);
this.validDuration = TimeValue.NEG_ONE_MILLISECOND;
}
@Override
public boolean isExecutionAborted() {
return cancellableDependency != null && cancellableDependency.isCancelled();
}
@Override
public boolean isEndpointAcquired() {
return endpointRef.get() != null;
}
@Override
public void acquireEndpoint(
final String id, final HttpRoute route, final Object object, final HttpClientContext context) throws IOException {
Args.notNull(route, "Route");
if (endpointRef.get() == null) {
final RequestConfig requestConfig = context.getRequestConfig();
final Timeout connectionRequestTimeout = requestConfig.getConnectionRequestTimeout();
if (log.isDebugEnabled()) {
log.debug(id + ": acquiring endpoint (" + connectionRequestTimeout + ")");
}
final LeaseRequest connRequest = manager.lease(id, route, connectionRequestTimeout, object);
state = object;
if (cancellableDependency != null) {
if (cancellableDependency.isCancelled()) {
connRequest.cancel();
throw new RequestFailedException("Request aborted");
}
cancellableDependency.setDependency(connRequest);
}
try {
final ConnectionEndpoint connectionEndpoint = connRequest.get(connectionRequestTimeout);
endpointRef.set(connectionEndpoint);
reusable = connectionEndpoint.isConnected();
if (cancellableDependency != null) {
cancellableDependency.setDependency(this);
}
if (log.isDebugEnabled()) {
log.debug(id + ": acquired endpoint " + ConnPoolSupport.getId(connectionEndpoint));
}
} catch(final TimeoutException ex) {
throw new ConnectionRequestTimeoutException(ex.getMessage());
} catch(final InterruptedException interrupted) {
Thread.currentThread().interrupt();
throw new RequestFailedException("Request aborted", interrupted);
} catch(final ExecutionException ex) {
Throwable cause = ex.getCause();
if (cause == null) {
cause = ex;
}
throw new RequestFailedException("Request execution failed", cause);
}
} else {
throw new IllegalStateException("Endpoint already acquired");
}
}
ConnectionEndpoint ensureValid() {
final ConnectionEndpoint endpoint = endpointRef.get();
if (endpoint == null) {
throw new IllegalStateException("Endpoint not acquired / already released");
}
return endpoint;
}
@Override
public boolean isEndpointConnected() {
final ConnectionEndpoint endpoint = endpointRef.get();
return endpoint != null && endpoint.isConnected();
}
private void connectEndpoint(final ConnectionEndpoint endpoint, final HttpClientContext context) throws IOException {
if (cancellableDependency != null) {
if (cancellableDependency.isCancelled()) {
throw new RequestFailedException("Request aborted");
}
}
final RequestConfig requestConfig = context.getRequestConfig();
final Timeout connectTimeout = requestConfig.getConnectTimeout();
if (log.isDebugEnabled()) {
log.debug(ConnPoolSupport.getId(endpoint) + ": connecting endpoint (" + connectTimeout + ")");
}
manager.connect(endpoint, connectTimeout, context);
if (log.isDebugEnabled()) {
log.debug(ConnPoolSupport.getId(endpoint) + ": endpoint connected");
}
}
@Override
public void connectEndpoint(final HttpClientContext context) throws IOException {
final ConnectionEndpoint endpoint = ensureValid();
if (!endpoint.isConnected()) {
connectEndpoint(endpoint, context);
}
}
@Override
public void disconnectEndpoint() throws IOException {
final ConnectionEndpoint endpoint = endpointRef.get();
if (endpoint != null) {
endpoint.close();
if (log.isDebugEnabled()) {
log.debug(ConnPoolSupport.getId(endpoint) + ": endpoint closed");
}
}
}
@Override
public void upgradeTls(final HttpClientContext context) throws IOException {
final ConnectionEndpoint endpoint = ensureValid();
final RequestConfig requestConfig = context.getRequestConfig();
final Timeout connectTimeout = requestConfig.getConnectTimeout();
if (TimeValue.isPositive(connectTimeout)) {
endpoint.setSocketTimeout(connectTimeout);
}
if (log.isDebugEnabled()) {
log.debug(ConnPoolSupport.getId(endpoint) + ": upgrading endpoint (" + connectTimeout + ")");
}
manager.upgrade(endpoint, context);
}
@Override
public ClassicHttpResponse execute(
final String id,
final ClassicHttpRequest request,
final HttpClientContext context) throws IOException, HttpException {
final ConnectionEndpoint endpoint = ensureValid();
if (!endpoint.isConnected()) {
connectEndpoint(endpoint, context);
}
final RequestConfig requestConfig = context.getRequestConfig();
final Timeout responseTimeout = requestConfig.getResponseTimeout();
if (responseTimeout != null) {
endpoint.setSocketTimeout(responseTimeout);
}
if (log.isDebugEnabled()) {
log.debug(ConnPoolSupport.getId(endpoint) + ": start execution " + id);
}
return endpoint.execute(id, request, requestExecutor, context);
}
@Override
public boolean isConnectionReusable() {
return reusable;
}
@Override
public void markConnectionReusable(final Object state, final TimeValue validDuration) {
this.reusable = true;
this.state = state;
this.validDuration = validDuration;
}
@Override
public void markConnectionNonReusable() {
reusable = false;
}
private void discardEndpoint(final ConnectionEndpoint endpoint) {
try {
endpoint.close(CloseMode.IMMEDIATE);
if (log.isDebugEnabled()) {
log.debug(ConnPoolSupport.getId(endpoint) + ": endpoint closed");
}
} finally {
if (log.isDebugEnabled()) {
log.debug(ConnPoolSupport.getId(endpoint) + ": discarding endpoint");
}
manager.release(endpoint, null, TimeValue.ZERO_MILLISECONDS);
}
}
@Override
public void releaseEndpoint() {
final ConnectionEndpoint endpoint = endpointRef.getAndSet(null);
if (endpoint != null) {
if (reusable) {
if (log.isDebugEnabled()) {
log.debug(ConnPoolSupport.getId(endpoint) + ": releasing valid endpoint");
}
manager.release(endpoint, state, validDuration);
} else {
discardEndpoint(endpoint);
}
}
}
@Override
public void discardEndpoint() {
final ConnectionEndpoint endpoint = endpointRef.getAndSet(null);
if (endpoint != null) {
discardEndpoint(endpoint);
}
}
@Override
public boolean cancel() {
final boolean alreadyReleased = endpointRef.get() == null;
final ConnectionEndpoint endpoint = endpointRef.getAndSet(null);
if (endpoint != null) {
if (log.isDebugEnabled()) {
log.debug(ConnPoolSupport.getId(endpoint) + ": cancel");
}
discardEndpoint(endpoint);
}
return !alreadyReleased;
}
@Override
public ExecRuntime fork(final CancellableDependency cancellableDependency) {
return new InternalExecRuntime(log, manager, requestExecutor, cancellableDependency);
}
}
|
package kodlamaio_game_crm.Concrete;
import java.util.List;
import Utils.Utils;
import Utils.Constants.Messages;
import kodlamaio_game_crm.Abstract.SaleService;
import kodlamaio_game_crm.Entities.Sale;
public class SaleManager implements SaleService {
@Override
public void add(Sale sale) {
Utils.MessageBox(sale.getId()+Messages.added);
}
@Override
public void update(Sale sale) {
Utils.MessageBox(sale.getId()+Messages.updated);
}
@Override
public void delete(Sale sale) {
Utils.MessageBox(sale.getId()+Messages.deleted);
}
@Override
public Sale getById(int id) {
Utils.MessageBox(id+Messages.getById);
return null;
}
@Override
public List<Sale> getAll() {
Utils.MessageBox(id+Messages.getAll);
return null;
}
}
|
/**
* 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.mahout.clustering;
import java.lang.reflect.Type;
import org.apache.mahout.clustering.canopy.Canopy;
import org.apache.mahout.clustering.dirichlet.DirichletCluster;
import org.apache.mahout.clustering.dirichlet.JsonModelAdapter;
import org.apache.mahout.clustering.dirichlet.models.AsymmetricSampledNormalModel;
import org.apache.mahout.clustering.dirichlet.models.L1Model;
import org.apache.mahout.clustering.dirichlet.models.Model;
import org.apache.mahout.clustering.dirichlet.models.NormalModel;
import org.apache.mahout.clustering.dirichlet.models.SampledNormalModel;
import org.apache.mahout.clustering.meanshift.MeanShiftCanopy;
import org.apache.mahout.common.MahoutTestCase;
import org.apache.mahout.math.DenseVector;
import org.apache.mahout.math.SequentialAccessSparseVector;
import org.apache.mahout.math.Vector;
import org.apache.mahout.math.VectorWritable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
public class TestClusterInterface extends MahoutTestCase {
private static final Type MODEL_TYPE = new TypeToken<Model<Vector>>() {}.getType();
private static final Type CLUSTER_TYPE = new TypeToken<DirichletCluster<Vector>>() {}.getType();
public void testDirichletNormalModel() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
Cluster model = new NormalModel(5, m, 0.75);
String format = model.asFormatString(null);
assertEquals("format", "nm{n=0 m=[1.100, 2.200, 3.300] sd=0.75}", format);
String json = model.asJsonString();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Model.class, new JsonModelAdapter());
Gson gson = builder.create();
NormalModel model2 = gson.fromJson(json, MODEL_TYPE);
assertEquals("Json", format, model2.asFormatString(null));
}
public void testDirichletSampledNormalModel() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
Cluster model = new SampledNormalModel(5, m, 0.75);
String format = model.asFormatString(null);
assertEquals("format", "snm{n=0 m=[1.100, 2.200, 3.300] sd=0.75}", format);
String json = model.asJsonString();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Model.class, new JsonModelAdapter());
Gson gson = builder.create();
SampledNormalModel model2 = gson.fromJson(json, MODEL_TYPE);
assertEquals("Json", format, model2.asFormatString(null));
}
public void testDirichletASNormalModel() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
Cluster model = new AsymmetricSampledNormalModel(5, m, m);
String format = model.asFormatString(null);
assertEquals("format", "asnm{n=0 m=[1.100, 2.200, 3.300] sd=[1.100, 2.200, 3.300]}", format);
String json = model.asJsonString();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Model.class, new JsonModelAdapter());
Gson gson = builder.create();
AsymmetricSampledNormalModel model2 = gson.fromJson(json, MODEL_TYPE);
assertEquals("Json", format, model2.asFormatString(null));
}
public void testDirichletL1Model() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
Cluster model = new L1Model(5, m);
String format = model.asFormatString(null);
assertEquals("format", "l1m{n=0 c=[1.100, 2.200, 3.300]}", format);
String json = model.asJsonString();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Model.class, new JsonModelAdapter());
Gson gson = builder.create();
L1Model model2 = gson.fromJson(json, MODEL_TYPE);
assertEquals("Json", format, model2.asFormatString(null));
}
public void testDirichletNormalModelClusterAsFormatString() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
NormalModel model = new NormalModel(5, m, 0.75);
Cluster cluster = new DirichletCluster<VectorWritable>(model, 35.0);
String format = cluster.asFormatString(null);
assertEquals("format", "C-5: nm{n=0 m=[1.100, 2.200, 3.300] sd=0.75}", format);
}
public void testDirichletNormalModelClusterAsJsonString() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
NormalModel model = new NormalModel(5, m, 0.75);
Cluster cluster = new DirichletCluster<VectorWritable>(model, 35.0);
String json = cluster.asJsonString();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Model.class, new JsonModelAdapter());
Gson gson = builder.create();
DirichletCluster<VectorWritable> result = gson.fromJson(json, CLUSTER_TYPE);
assertNotNull("result null", result);
assertEquals("model", cluster.asFormatString(null), result.asFormatString(null));
}
public void testDirichletAsymmetricSampledNormalModelClusterAsFormatString() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
AsymmetricSampledNormalModel model = new AsymmetricSampledNormalModel(5, m, m);
Cluster cluster = new DirichletCluster<VectorWritable>(model, 35.0);
String format = cluster.asFormatString(null);
assertEquals("format", "C-5: asnm{n=0 m=[1.100, 2.200, 3.300] sd=[1.100, 2.200, 3.300]}", format);
}
public void testDirichletAsymmetricSampledNormalModelClusterAsJsonString() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
AsymmetricSampledNormalModel model = new AsymmetricSampledNormalModel(5, m, m);
Cluster cluster = new DirichletCluster<VectorWritable>(model, 35.0);
String json = cluster.asJsonString();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Model.class, new JsonModelAdapter());
Gson gson = builder.create();
DirichletCluster<VectorWritable> result = gson.fromJson(json, CLUSTER_TYPE);
assertNotNull("result null", result);
assertEquals("model", cluster.asFormatString(null), result.asFormatString(null));
}
public void testDirichletL1ModelClusterAsFormatString() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
L1Model model = new L1Model(5, m);
Cluster cluster = new DirichletCluster<VectorWritable>(model, 35.0);
String format = cluster.asFormatString(null);
assertEquals("format", "C-5: l1m{n=0 c=[1.100, 2.200, 3.300]}", format);
}
public void testDirichletL1ModelClusterAsJsonString() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
L1Model model = new L1Model(5, m);
Cluster cluster = new DirichletCluster<VectorWritable>(model, 35.0);
String json = cluster.asJsonString();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Model.class, new JsonModelAdapter());
Gson gson = builder.create();
DirichletCluster<VectorWritable> result = gson.fromJson(json, CLUSTER_TYPE);
assertNotNull("result null", result);
assertEquals("model", cluster.asFormatString(null), result.asFormatString(null));
}
public void testCanopyAsFormatString() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
Cluster cluster = new Canopy(m, 123);
String formatString = cluster.asFormatString(null);
System.out.println(formatString);
assertEquals("format", "C-123: [1.100, 2.200, 3.300]", formatString);
}
public void testCanopyAsFormatStringSparse() {
double[] d = { 1.1, 0.0, 3.3 };
Vector m = new SequentialAccessSparseVector(3);
m.assign(d);
Cluster cluster = new Canopy(m, 123);
String formatString = cluster.asFormatString(null);
System.out.println(formatString);
assertEquals("format", "C-123: [0:1.100, 2:3.300]", formatString);
}
public void testCanopyAsFormatStringWithBindings() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
Cluster cluster = new Canopy(m, 123);
String[] bindings = { "fee", null, null };
String formatString = cluster.asFormatString(bindings);
System.out.println(formatString);
assertEquals("format", "C-123: [fee:1.100, 1:2.200, 2:3.300]", formatString);
}
public void testCanopyAsFormatStringSparseWithBindings() {
double[] d = { 1.1, 0.0, 3.3 };
Vector m = new SequentialAccessSparseVector(3);
m.assign(d);
Cluster cluster = new Canopy(m, 123);
String formatString = cluster.asFormatString(null);
System.out.println(formatString);
assertEquals("format", "C-123: [0:1.100, 2:3.300]", formatString);
}
public void testClusterAsFormatString() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
Cluster cluster = new org.apache.mahout.clustering.kmeans.Cluster(m, 123);
String formatString = cluster.asFormatString(null);
System.out.println(formatString);
assertEquals("format", "C-123: [1.100, 2.200, 3.300]", formatString);
}
public void testClusterAsFormatStringSparse() {
double[] d = { 1.1, 0.0, 3.3 };
Vector m = new SequentialAccessSparseVector(3);
m.assign(d);
Cluster cluster = new org.apache.mahout.clustering.kmeans.Cluster(m, 123);
String formatString = cluster.asFormatString(null);
System.out.println(formatString);
assertEquals("format", "C-123: [0:1.100, 2:3.300]", formatString);
}
public void testClusterAsFormatStringWithBindings() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
Cluster cluster = new org.apache.mahout.clustering.kmeans.Cluster(m, 123);
String[] bindings = { "fee", null, "foo" };
String formatString = cluster.asFormatString(bindings);
System.out.println(formatString);
assertEquals("format", "C-123: [fee:1.100, 1:2.200, foo:3.300]", formatString);
}
public void testClusterAsFormatStringSparseWithBindings() {
double[] d = { 1.1, 0.0, 3.3 };
Vector m = new SequentialAccessSparseVector(3);
m.assign(d);
Cluster cluster = new org.apache.mahout.clustering.kmeans.Cluster(m, 123);
String formatString = cluster.asFormatString(null);
System.out.println(formatString);
assertEquals("format", "C-123: [0:1.100, 2:3.300]", formatString);
}
public void testMSCanopyAsFormatString() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
Cluster cluster = new MeanShiftCanopy(m, 123);
String formatString = cluster.asFormatString(null);
System.out.println(formatString);
assertEquals("format", "C-123: [1.100, 2.200, 3.300]", formatString);
}
public void testMSCanopyAsFormatStringSparse() {
double[] d = { 1.1, 0.0, 3.3 };
Vector m = new SequentialAccessSparseVector(3);
m.assign(d);
Cluster cluster = new MeanShiftCanopy(m, 123);
String formatString = cluster.asFormatString(null);
System.out.println(formatString);
assertEquals("format", "C-123: [0:1.100, 2:3.300]", formatString);
}
public void testMSCanopyAsFormatStringWithBindings() {
double[] d = { 1.1, 2.2, 3.3 };
Vector m = new DenseVector(d);
Cluster cluster = new MeanShiftCanopy(m, 123);
String[] bindings = { "fee", null, "foo" };
String formatString = cluster.asFormatString(bindings);
System.out.println(formatString);
assertEquals("format", "C-123: [fee:1.100, 1:2.200, foo:3.300]", formatString);
}
public void testMSCanopyAsFormatStringSparseWithBindings() {
double[] d = { 1.1, 0.0, 3.3 };
Vector m = new SequentialAccessSparseVector(3);
m.assign(d);
Cluster cluster = new MeanShiftCanopy(m, 123);
String[] bindings = { "fee", null, "foo" };
String formatString = cluster.asFormatString(bindings);
System.out.println(formatString);
assertEquals("format", "C-123: [fee:1.100, foo:3.300]", formatString);
}
}
|
package edu.fiuba.algo3.modelo;
import edu.fiuba.algo3.modelo.bloques.Bloque;
import edu.fiuba.algo3.modelo.bloques.BloqueMovimiento;
import edu.fiuba.algo3.modelo.bloques.BloqueRepeticion;
import edu.fiuba.algo3.modelo.excepciones.NumeroVecesInvalidoException;
import edu.fiuba.algo3.modelo.tablero.Dibujo;
import edu.fiuba.algo3.modelo.tablero.Posicion;
import edu.fiuba.algo3.modelo.tablero.movimiento.MovimientoAbajo;
import edu.fiuba.algo3.modelo.tablero.movimiento.MovimientoArriba;
import edu.fiuba.algo3.modelo.tablero.movimiento.MovimientoDerecha;
import edu.fiuba.algo3.modelo.tablero.movimiento.MovimientoIzquierda;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
public class BloqueRepeticionTest {
BloqueRepeticion bloqueRepeticion;
Personaje personaje;
Dibujo dibujo;
List<Bloque> bloquesAEjecutar;
Posicion posicionEsperada;
@BeforeEach
public void setUp(){
personaje = new Personaje();
dibujo = new Dibujo();
bloquesAEjecutar = new ArrayList<>();
}
@Test
public void test01ElPersonajeNoCambiaDePosicionConUnBLoqueRepeticionVacio(){
bloqueRepeticion = new BloqueRepeticion(2, bloquesAEjecutar);
bloqueRepeticion.ejecutar(personaje,dibujo);
posicionEsperada = new Posicion(0,0);
assertEquals( posicionEsperada.obtenerCoordenadas(), personaje.obtenerPosicion() );
}
@Test
public void test02SeAgregarBloquesDeMovimientoALaDerechaYElPersonajeSeMueve(){
for(int i = 0; i < 10 ; i++) {
bloquesAEjecutar.add(new BloqueMovimiento(new MovimientoDerecha()));
}
bloqueRepeticion = new BloqueRepeticion(3, bloquesAEjecutar);
bloqueRepeticion.ejecutar(personaje,dibujo);
posicionEsperada = new Posicion(30, 0); // evitamos comparar vs Arrays.AsList.
assertEquals( posicionEsperada.obtenerCoordenadas(), personaje.obtenerPosicion() );
}
@Test
public void test03SeAgregarBloquesDeMovimientoALaIzquierdaYElPersonajeSeMueve(){
for(int i = 0; i < 15 ; i++) {
bloquesAEjecutar.add(new BloqueMovimiento(new MovimientoIzquierda()));
}
bloqueRepeticion = new BloqueRepeticion(2, bloquesAEjecutar);
bloqueRepeticion.ejecutar(personaje,dibujo);
posicionEsperada = new Posicion(-30, 0);
assertEquals( posicionEsperada.obtenerCoordenadas(), personaje.obtenerPosicion());
}
@Test
public void test04SeAgregarBloquesDeMovimientoEnTodasLasDireccionesYElPersonajeSeMueve(){
for(int i = 0; i < 15 ; i++) {
bloquesAEjecutar.add(new BloqueMovimiento(new MovimientoIzquierda()));
}
for(int i = 0; i < 20 ; i++) {
bloquesAEjecutar.add(new BloqueMovimiento(new MovimientoDerecha()));
}
for(int i = 0; i < 30 ; i++) {
bloquesAEjecutar.add(new BloqueMovimiento(new MovimientoArriba()));
}
for(int i = 0; i < 50 ; i++) {
bloquesAEjecutar.add(new BloqueMovimiento(new MovimientoAbajo()));
}
bloqueRepeticion = new BloqueRepeticion(3, bloquesAEjecutar);
bloqueRepeticion.ejecutar(personaje,dibujo);
posicionEsperada = new Posicion(15, -60);
assertEquals( posicionEsperada.obtenerCoordenadas(), personaje.obtenerPosicion());
}
//agregue 1 test para el bloque de lapiz, pueden ir mas aunque no se que exactamente mas probar, es muy límitado.
@Test
public void test05SeIntentaCrearBloqueRepeticionConVecesMenorADosLanzaExcepcion() {
assertThrows(NumeroVecesInvalidoException.class,() ->{bloqueRepeticion = new BloqueRepeticion(1, bloquesAEjecutar);});
}
@Test
public void test06SeIntentaCrearBloqueRepeticionConVecesMayorATresLanzaExcepcion() {
assertThrows(NumeroVecesInvalidoException.class,() ->{bloqueRepeticion = new BloqueRepeticion(5, bloquesAEjecutar);});
}
}
|
package dkstatus;
import dkstatus.requests.IUpdateRequest;
import dkstatus.world.World;
import java.io.EOFException;
import java.net.NoRouteToHostException;
import java.net.UnknownHostException;
import java.util.TimerTask;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.http.client.HttpResponseException;
import org.apache.http.conn.HttpHostConnectException;
/**
*
* @author Johny
*/
public class UpdateTask extends TimerTask {
private final World world;
private final IUpdateRequest request;
public UpdateTask(IUpdateRequest request, World world) {
this.world = world;
this.request = request;
}
@Override
public void run() {
try {
request.updateData(world);
} catch (EOFException ex) {
// request error (timeout?)
// Unexpected end of ZLIB input stream
Logger.getLogger(UpdateTask.class.getName()).log(Level.INFO, "Exception in {0}: {1} - rescheduling",
new Object[]{request.getClass().getName(), ex.toString()});
request.reschedule();
} catch (UnknownHostException | HttpHostConnectException | NoRouteToHostException | HttpResponseException ex) {
// without internet connection
Logger.getLogger(UpdateTask.class.getName()).log(Level.INFO, "Exception in {0}: {1} - rescheduling",
new Object[]{request.getClass().getName(), ex.toString()});
world.getPlayer().setName("Offline");
request.reschedule();
} catch (Exception ex) { // prevents silent thread termination
Logger.getLogger(UpdateTask.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
|
/*
* Copyright 2017 Luke Sosnicki
*
* 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 ljpf;
import java.util.Collection;
import java.util.Optional;
/**
* Created by souzen on 25.03.2017.
*/
public interface PluginManager {
Collection<PluginDescriptor> getAvailablePlugins();
Collection<PluginDescriptor> getLoadedPlugins();
Optional<PluginDescriptor> getAvailablePlugin(final String id);
Optional<PluginDescriptor> getLoadedPlugin(final String id);
void load(final String id);
void load(final String id, final PluginConfig config);
void unload(final String id);
void unloadAll();
}
|
package systems.reformcloud.reformcloud2.executor.node.network.packet.in.cluster;
import com.google.gson.reflect.TypeToken;
import systems.reformcloud.reformcloud2.executor.api.common.groups.ProcessGroup;
import systems.reformcloud.reformcloud2.executor.api.common.network.NetworkUtil;
import systems.reformcloud.reformcloud2.executor.api.common.network.channel.PacketSender;
import systems.reformcloud.reformcloud2.executor.api.common.network.channel.handler.NetworkHandler;
import systems.reformcloud.reformcloud2.executor.api.common.network.packet.Packet;
import systems.reformcloud.reformcloud2.executor.api.node.cluster.SyncAction;
import systems.reformcloud.reformcloud2.executor.node.NodeExecutor;
import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.function.Consumer;
public class PacketInSyncProcessGroups implements NetworkHandler {
@Override
public int getHandlingPacketID() {
return NetworkUtil.NODE_TO_NODE_BUS + 3;
}
@Override
public void handlePacket(@Nonnull PacketSender packetSender, @Nonnull Packet packet, @Nonnull Consumer<Packet> responses) {
Collection<ProcessGroup> groups = packet.content().get("info", new TypeToken<Collection<ProcessGroup>>() {});
SyncAction action = packet.content().get("action", SyncAction.class);
NodeExecutor.getInstance().getClusterSyncManager().handleProcessGroupSync(groups, action);
}
}
|
/*
* Jython Database Specification API 2.0
*
*
* Copyright (c) 2001 brian zimmer <bzimmer@ziclix.com>
*
*/
package com.ziclix.python.sql;
import org.python.core.Py;
import org.python.core.PyInteger;
import org.python.core.PyList;
import org.python.core.PyObject;
import org.python.core.PyString;
import java.sql.CallableStatement;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.util.BitSet;
/**
* This class provides the necessary functionality to call stored
* procedures. It handles managing the database metadata and binding
* the appropriate parameters.
*
* @author brian zimmer
*/
public class Procedure extends Object {
/**
* Field NAME
*/
protected static final int NAME = 3;
/**
* Field COLUMN_TYPE
*/
protected static final int COLUMN_TYPE = 4;
/**
* Field DATA_TYPE
*/
protected static final int DATA_TYPE = 5;
/**
* Field DATA_TYPE_NAME
*/
protected static final int DATA_TYPE_NAME = 6;
/**
* Field PRECISION
*/
protected static final int PRECISION = 7;
/**
* Field LENGTH
*/
protected static final int LENGTH = 8;
/**
* Field SCALE
*/
protected static final int SCALE = 9;
/**
* Field NULLABLE
*/
protected static final int NULLABLE = 11;
/**
* Field cursor
*/
protected PyCursor cursor;
/**
* Field columns
*/
protected PyObject columns;
/**
* Field procedureCatalog
*/
protected PyObject procedureCatalog;
/**
* Field procedureSchema
*/
protected PyObject procedureSchema;
/**
* Field procedureName
*/
protected PyObject procedureName;
/**
* Field inputSet
*/
protected BitSet inputSet;
/**
* Constructor Procedure
*
* @param cursor cursor an open cursor
* @param name name a string or tuple representing the name
* @throws SQLException
*/
public Procedure(PyCursor cursor, PyObject name) throws SQLException {
this.cursor = cursor;
this.inputSet = new BitSet();
if (name instanceof PyString) {
this.procedureCatalog = getDefault();
this.procedureSchema = getDefault();
this.procedureName = name;
} else if (PyCursor.isSeq(name)) {
if (name.__len__() == 3) {
this.procedureCatalog = name.__getitem__(0);
this.procedureSchema = name.__getitem__(1);
this.procedureName = name.__getitem__(2);
} else {
// throw an exception
}
} else {
// throw an exception
}
fetchColumns();
}
/**
* Prepares the statement and registers the OUT/INOUT parameters (if any).
*
* @return CallableStatement
* @throws SQLException
*/
public CallableStatement prepareCall() throws SQLException {
return prepareCall(Py.None, Py.None);
}
/**
* Prepares the statement and registers the OUT/INOUT parameters (if any).
*
* @param rsType the value of to be created ResultSet type
* @param rsConcur the value of the to be created ResultSet concurrency
* @return CallableStatement
* @throws SQLException
*/
public CallableStatement prepareCall(PyObject rsType, PyObject rsConcur) throws SQLException {
// prepare the statement
CallableStatement statement = null;
boolean normal = ((rsType == Py.None) && (rsConcur == Py.None));
try {
// build the full call syntax
String sqlString = toSql();
if (normal) {
statement = cursor.connection.connection.prepareCall(sqlString);
} else {
int t = rsType.asInt();
int c = rsConcur.asInt();
statement = cursor.connection.connection.prepareCall(sqlString, t, c);
}
// prepare the OUT parameters
registerOutParameters(statement);
} catch (SQLException e) {
if (statement != null) {
try {
statement.close();
} catch (Exception ex) {
}
}
throw e;
}
return statement;
}
/**
* Prepare the binding dictionary with the correct datatypes.
*
* @param params a non-None list of params
* @param bindings a dictionary of bindings
*/
public void normalizeInput(PyObject params, PyObject bindings) throws SQLException {
if (this.columns == Py.None) {
return;
}
// do nothing with params at the moment
for (int i = 0, len = this.columns.__len__(), binding = 0; i < len; i++) {
PyObject column = this.columns.__getitem__(i);
int colType = column.__getitem__(COLUMN_TYPE).asInt();
switch (colType) {
case DatabaseMetaData.procedureColumnIn:
case DatabaseMetaData.procedureColumnInOut:
// bindings are Python-indexed
PyInteger key = Py.newInteger(binding++);
if (bindings.__finditem__(key) == null) {
int dataType = column.__getitem__(DATA_TYPE).asInt();
bindings.__setitem__(key, Py.newInteger(dataType));
}
// inputs are JDBC-indexed
this.inputSet.set(i + 1);
break;
}
}
}
/**
* This method determines whether the param at the specified index is an
* IN or INOUT param for a stored procedure. This is only configured properly
* AFTER a call to normalizeInput().
*
* @param index JDBC indexed column index (1, 2, ...)
* @return true if the column is an input, false otherwise
* @throws SQLException
*/
public boolean isInput(int index) throws SQLException {
return this.inputSet.get(index);
}
/**
* Returns the call in the syntax: <pre>{@literal
* {? = call <procedure-name>(?, ?, ...)}
* {call <procedure-name>(?, ?, ...)}
* }</pre>
*
* As of now, all parameters variables are created and no support for named variable calling is
* supported.
*
* @return String
*/
public String toSql() throws SQLException {
int colParam = 0;
int colReturn = 0;
if (this.columns != Py.None) {
for (int i = 0, len = this.columns.__len__(); i < len; i++) {
PyObject column = this.columns.__getitem__(i);
int colType = column.__getitem__(COLUMN_TYPE).asInt();
switch (colType) {
case DatabaseMetaData.procedureColumnUnknown:
throw zxJDBC.makeException(zxJDBC.NotSupportedError, "procedureColumnUnknown");
case DatabaseMetaData.procedureColumnResult:
throw zxJDBC.makeException(zxJDBC.NotSupportedError, "procedureColumnResult");
// these go on the right hand side
case DatabaseMetaData.procedureColumnIn:
case DatabaseMetaData.procedureColumnInOut:
case DatabaseMetaData.procedureColumnOut:
colParam++;
break;
// these go on the left hand side
case DatabaseMetaData.procedureColumnReturn:
colReturn++;
break;
default :
throw zxJDBC.makeException(zxJDBC.DataError, "unknown column type [" + colType + "]");
}
}
}
StringBuffer sql = new StringBuffer("{");
if (colReturn > 0) {
PyList list = new PyList();
for (; colReturn > 0; colReturn--) {
list.append(Py.newString("?"));
}
sql.append(Py.newString(",").join(list)).append(" = ");
}
String name = this.getProcedureName();
sql.append("call ").append(name).append("(");
if (colParam > 0) {
PyList list = new PyList();
for (; colParam > 0; colParam--) {
list.append(Py.newString("?"));
}
sql.append(Py.newString(",").join(list));
}
return sql.append(")}").toString();
}
/**
* Registers the OUT/INOUT parameters of the statement.
*
* @param statement statement
* @throws SQLException
*/
protected void registerOutParameters(CallableStatement statement) throws SQLException {
if (this.columns == Py.None) {
return;
}
for (int i = 0, len = this.columns.__len__(); i < len; i++) {
PyObject column = this.columns.__getitem__(i);
int colType = column.__getitem__(COLUMN_TYPE).asInt();
int dataType = column.__getitem__(DATA_TYPE).asInt();
String dataTypeName = column.__getitem__(DATA_TYPE_NAME).toString();
switch (colType) {
case DatabaseMetaData.procedureColumnInOut:
case DatabaseMetaData.procedureColumnOut:
case DatabaseMetaData.procedureColumnReturn:
cursor.datahandler.registerOut(statement, i + 1, colType, dataType, dataTypeName);
break;
}
}
}
/**
* Get the columns for the stored procedure.
*
* @throws SQLException
*/
protected void fetchColumns() throws SQLException {
PyExtendedCursor pec = (PyExtendedCursor) cursor.connection.cursor();
try {
pec.datahandler = this.cursor.datahandler;
pec.procedurecolumns(procedureCatalog, procedureSchema, procedureName, Py.None);
this.columns = pec.fetchall();
} finally {
pec.close();
}
}
/**
* The value for a missing schema or catalog. This value is used to find
* the column names for the procedure. Not all DBMS use the same default
* value; for instance Oracle uses an empty string and SQLServer a null.
* This implementation returns the empty string.
*
* @return the default value (the empty string)
* @see java.sql.DatabaseMetaData#getProcedureColumns
*/
protected PyObject getDefault() {
return Py.EmptyString;
}
/**
* Construct a procedure name for the relevant schema and catalog information.
*/
protected String getProcedureName() {
StringBuffer proc = new StringBuffer();
if (this.procedureCatalog.__nonzero__()) {
proc.append(this.procedureCatalog.toString()).append(".");
}
return proc.append(this.procedureName.toString()).toString();
}
}
|
package com.github.yusufcanb.micromamba4j;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.filefilter.DirectoryFileFilter;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
@NoArgsConstructor
@Slf4j
public class Micromamba implements PrefixOptions, ConfigurationOptions, SubCommands {
private final Runtime runtime = Runtime.getRuntime();
@Getter
@Setter
private File mambaExecutable;
@Getter
@Setter
private Path rootPrefix;
@Getter
@Setter
private Path prefix;
@Getter
@Setter
private String activeEnvironment;
public Micromamba(Path executable) {
this.mambaExecutable = executable.toFile();
}
private void checkActiveEnvironment() throws NoActiveEnvironmentException {
if (activeEnvironment == null) {
throw new NoActiveEnvironmentException("No environment selected");
}
}
@Override
public void shell(Shell shell) {
throw new UnsupportedOperationException();
}
@Override
public void create(String name) throws IOException {
String cmd = new CommandBuilder()
.withExecutable(mambaExecutable.toString())
.withRoot(rootPrefix.toString())
.withEnvironment(activeEnvironment)
.withAction(SubCommands.CREATE)
.withArgs(new String[]{"-n", name})
.build();
Process p = runtime.exec(cmd);
try {
p.waitFor();
if (p.exitValue() != 0) {
String stderr = IOUtils.toString(p.getErrorStream(), Charset.defaultCharset());
log.error(stderr);
throw new IOException(stderr);
} else {
String stdout = IOUtils.toString(p.getInputStream(), Charset.defaultCharset());
log.info(stdout);
}
} catch (InterruptedException e) {
throw new IOException("Process interrupted");
}
}
@Override
public void install(String[] packages) throws IOException {
this.install(packages, "conda-forge");
}
@Override
public void install(String[] packages, String channel) throws IOException {
this.checkActiveEnvironment();
String cmd = new CommandBuilder()
.withExecutable(mambaExecutable.toString())
.withRoot(rootPrefix.toString())
.withEnvironment(activeEnvironment)
.withAction(SubCommands.INSTALL)
.withArgs(packages)
.withChannel(channel)
.build();
System.out.println(cmd);
Process p = runtime.exec(cmd);
try {
p.waitFor();
if (p.exitValue() != 0) {
String stderr = IOUtils.toString(p.getErrorStream(), Charset.defaultCharset());
log.error(stderr);
throw new IOException(stderr);
} else {
String stdout = IOUtils.toString(p.getInputStream(), Charset.defaultCharset());
log.info(stdout);
}
} catch (InterruptedException e) {
throw new IOException("Process interrupted");
}
}
@Override
public void update() throws IOException {
throw new UnsupportedOperationException();
}
@Override
public void remove(String[] packages) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public List<MambaPackage> list() throws IOException {
if (activeEnvironment == null) {
throw new RuntimeException("No environment selected");
}
String cmd = new CommandBuilder()
.withExecutable(mambaExecutable.toString())
.withAction(SubCommands.LIST)
.withRoot(rootPrefix.toString())
.withEnvironment(activeEnvironment)
.build();
Process p = runtime.exec(cmd);
List<MambaPackage> packages = new ArrayList<>();
String stdout = IOUtils.toString(p.getInputStream(), Charset.defaultCharset());
int i = 0;
for (String line : stdout.split("\n")) {
if (i > 2) {
String result[] = line.split("\\s+");
MambaPackage mambaPackage = new MambaPackage();
mambaPackage.setName(result[1]);
mambaPackage.setVersion(result[2]);
mambaPackage.setBuild(result[3]);
mambaPackage.setChannel(result[4]);
packages.add(mambaPackage);
}
i++;
}
return packages;
}
@Override
public void clean() throws IOException {
throw new UnsupportedOperationException();
}
@Override
public void config() throws IOException {
throw new UnsupportedOperationException();
}
@Override
public void info() throws IOException {
throw new UnsupportedOperationException();
}
@Override
public List<String> listEnvironments() throws IOException {
List<String> environmentNames = new ArrayList<>();
Path envPath = Paths.get(rootPrefix.toFile().getAbsolutePath(), "envs");
File[] envs = envPath.toFile().listFiles((FileFilter) DirectoryFileFilter.DIRECTORY);
for (File env : envs) {
environmentNames.add(env.getName());
}
return environmentNames;
}
@Override
public void setConfigurationFile(File file) {
}
@Override
public void useConfiguration(boolean flag) {
}
@Override
public void useEnvironment(boolean flag) {
}
@Override
public void setRootPrefix() {
}
@Override
public void setPrefix() {
}
@Override
public void setName() {
}
public File getPythonInterpreter() {
String name = "python";
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
return Paths.get(rootPrefix.toFile().getAbsolutePath(), "envs", activeEnvironment, name + ".exe").toFile();
} else {
return Paths.get(rootPrefix.toFile().getAbsolutePath(), "envs", activeEnvironment, name).toFile();
}
}
public File getExecutable(String name) {
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
return Paths.get(rootPrefix.toFile().getAbsolutePath(), "envs", activeEnvironment, "Scripts", name + ".exe").toFile();
} else {
return Paths.get(rootPrefix.toFile().getAbsolutePath(), "envs", activeEnvironment, "bin", name).toFile();
}
}
}
|
// Targeted by JavaCPP version 1.5.5-SNAPSHOT: DO NOT EDIT THIS FILE
package org.bytedeco.dnnl;
import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;
import static org.bytedeco.javacpp.presets.javacpp.*;
import static org.bytedeco.dnnl.global.dnnl.*;
/** Inner product weights gradient primitive. */
@Namespace("dnnl") @Properties(inherit = org.bytedeco.dnnl.presets.dnnl.class)
public class inner_product_backward_weights extends primitive {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public inner_product_backward_weights(Pointer p) { super(p); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public inner_product_backward_weights(long size) { super((Pointer)null); allocateArray(size); }
private native void allocateArray(long size);
@Override public inner_product_backward_weights position(long position) {
return (inner_product_backward_weights)super.position(position);
}
@Override public inner_product_backward_weights getPointer(long i) {
return new inner_product_backward_weights(this).position(position + i);
}
/** Descriptor for an inner product weights gradient primitive. */
@NoOffset public static class desc extends Pointer {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public desc(Pointer p) { super(p); }
///
///
public native @ByRef dnnl_inner_product_desc_t data(); public native desc data(dnnl_inner_product_desc_t setter);
/** Constructs a descriptor for an inner product descriptor weights
* update primitive with bias.
*
* \note
* All the memory descriptors may be initialized with the
* #dnnl::memory::format_tag::any value of \p format_tag.
*
* @param src_desc Memory descriptor for src.
* @param diff_weights_desc Memory descriptor for diff weights.
* @param diff_bias_desc Memory descriptor for diff bias.
* @param diff_dst_desc Memory descriptor for diff dst. */
///
///
public desc(@Const @ByRef memory.desc src_desc,
@Const @ByRef memory.desc diff_weights_desc,
@Const @ByRef memory.desc diff_bias_desc,
@Const @ByRef memory.desc diff_dst_desc) { super((Pointer)null); allocate(src_desc, diff_weights_desc, diff_bias_desc, diff_dst_desc); }
private native void allocate(@Const @ByRef memory.desc src_desc,
@Const @ByRef memory.desc diff_weights_desc,
@Const @ByRef memory.desc diff_bias_desc,
@Const @ByRef memory.desc diff_dst_desc);
/** Constructs a descriptor for an inner product descriptor weights
* update primitive without bias.
*
* \note
* All the memory descriptors may be initialized with the
* #dnnl::memory::format_tag::any value of \p format_tag.
*
* @param src_desc Memory descriptor for src.
* @param diff_weights_desc Memory descriptor for diff weights.
* @param diff_dst_desc Memory descriptor for diff dst. */
public desc(@Const @ByRef memory.desc src_desc,
@Const @ByRef memory.desc diff_weights_desc,
@Const @ByRef memory.desc diff_dst_desc) { super((Pointer)null); allocate(src_desc, diff_weights_desc, diff_dst_desc); }
private native void allocate(@Const @ByRef memory.desc src_desc,
@Const @ByRef memory.desc diff_weights_desc,
@Const @ByRef memory.desc diff_dst_desc);
}
/** Primitive descriptor for an inner product weights gradient primitive. */
public static class primitive_desc extends org.bytedeco.dnnl.primitive_desc {
static { Loader.load(); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public primitive_desc(Pointer p) { super(p); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public primitive_desc(long size) { super((Pointer)null); allocateArray(size); }
private native void allocateArray(long size);
@Override public primitive_desc position(long position) {
return (primitive_desc)super.position(position);
}
@Override public primitive_desc getPointer(long i) {
return new primitive_desc(this).position(position + i);
}
/** Default constructor. Produces an empty object. */
///
public primitive_desc() { super((Pointer)null); allocate(); }
private native void allocate();
/** Constructs a primitive descriptor for an inner product weights
* update primitive.
*
* @param adesc Descriptor for an inner product weights gradient
* primitive.
* @param aengine Engine to use.
* @param hint_fwd_pd Primitive descriptor for an inner product
* forward propagation primitive. It is used as a hint for
* deciding which memory format to use.
* @param allow_empty A flag signifying whether construction is
* allowed to fail without throwing an exception. In this case an
* empty object will be produced. This flag is optional and
* defaults to false. */
///
public primitive_desc(@Const @ByRef desc adesc, @Const @ByRef engine aengine,
@Const @ByRef inner_product_forward.primitive_desc hint_fwd_pd,
@Cast("bool") boolean allow_empty/*=false*/) { super((Pointer)null); allocate(adesc, aengine, hint_fwd_pd, allow_empty); }
private native void allocate(@Const @ByRef desc adesc, @Const @ByRef engine aengine,
@Const @ByRef inner_product_forward.primitive_desc hint_fwd_pd,
@Cast("bool") boolean allow_empty/*=false*/);
public primitive_desc(@Const @ByRef desc adesc, @Const @ByRef engine aengine,
@Const @ByRef inner_product_forward.primitive_desc hint_fwd_pd) { super((Pointer)null); allocate(adesc, aengine, hint_fwd_pd); }
private native void allocate(@Const @ByRef desc adesc, @Const @ByRef engine aengine,
@Const @ByRef inner_product_forward.primitive_desc hint_fwd_pd);
/** Constructs a primitive descriptor for an inner product weights
* update primitive.
*
* @param adesc Descriptor for an inner product weights gradient
* primitive.
* @param attr Primitive attributes to use.
* @param aengine Engine to use.
* @param hint_fwd_pd Primitive descriptor for an inner product
* forward propagation primitive. It is used as a hint for
* deciding which memory format to use.
* @param allow_empty A flag signifying whether construction is
* allowed to fail without throwing an exception. In this case an
* empty object will be produced. This flag is optional and
* defaults to false. */
///
public primitive_desc(@Const @ByRef desc adesc, @Const @ByRef primitive_attr attr,
@Const @ByRef engine aengine,
@Const @ByRef inner_product_forward.primitive_desc hint_fwd_pd,
@Cast("bool") boolean allow_empty/*=false*/) { super((Pointer)null); allocate(adesc, attr, aengine, hint_fwd_pd, allow_empty); }
private native void allocate(@Const @ByRef desc adesc, @Const @ByRef primitive_attr attr,
@Const @ByRef engine aengine,
@Const @ByRef inner_product_forward.primitive_desc hint_fwd_pd,
@Cast("bool") boolean allow_empty/*=false*/);
public primitive_desc(@Const @ByRef desc adesc, @Const @ByRef primitive_attr attr,
@Const @ByRef engine aengine,
@Const @ByRef inner_product_forward.primitive_desc hint_fwd_pd) { super((Pointer)null); allocate(adesc, attr, aengine, hint_fwd_pd); }
private native void allocate(@Const @ByRef desc adesc, @Const @ByRef primitive_attr attr,
@Const @ByRef engine aengine,
@Const @ByRef inner_product_forward.primitive_desc hint_fwd_pd);
/** Constructs a primitive descriptor for an inner product weights
* update primitive from a C API primitive descriptor that must
* have a matching kind.
*
* @param pd C API primitive descriptor for an inner product weights
* gradient primitive. */
public primitive_desc(dnnl_primitive_desc pd) { super((Pointer)null); allocate(pd); }
private native void allocate(dnnl_primitive_desc pd);
/** \copydoc dnnl::primitive_desc_base::src_desc()const */
public native @ByVal memory.desc src_desc();
/** \copydoc dnnl::primitive_desc_base::diff_weights_desc()const */
public native @ByVal memory.desc diff_weights_desc();
/** \copydoc dnnl::primitive_desc_base::diff_dst_desc()const */
public native @ByVal memory.desc diff_dst_desc();
/** \copydoc dnnl::convolution_backward_weights::primitive_desc::diff_bias_desc()const */
public native @ByVal memory.desc diff_bias_desc();
}
/** Default constructor. Produces an empty object. */
public inner_product_backward_weights() { super((Pointer)null); allocate(); }
private native void allocate();
/** Constructs an inner product weights gradient primitive.
* @param pd Primitive descriptor for an inner product weights gradient
* primitive. */
public inner_product_backward_weights(@Const @ByRef primitive_desc pd) { super((Pointer)null); allocate(pd); }
private native void allocate(@Const @ByRef primitive_desc pd);
}
|
/*
Copyright 2006 by Sean Luke
Licensed under the Academic Free License version 3.0
See the file "LICENSE" for more information
*/
package ec.gp;
import ec.*;
import ec.util.*;
import java.io.*;
/*
* ADF.java
*
* Created: Mon Oct 25 18:42:09 1999
* By: Sean Luke
*/
/**
* An ADF is a GPNode which implements an "Automatically Defined Function",
* as described in Koza II.
*
* <p>In this system, the ADF facility consists of several classes: ADF,
* ADM, ADFStack, ADFContext, and ADFArgument. ADFs, and their cousins
* ADMs ("Automatically Defined Macros [Lee Spector]"), appear as
* typical function nodes in a GP tree. However, they have a special
* <i>associated tree</i> in the individual's tree forest which
* they evaluate as a kind of a "subfunction".
*
* <p>When an ADF is evaluated, it first evaluates all of its children
* and stores away their results. It then evaluates its associated tree.
* In the associated tree may exist one or more <i>ADF Argument Terminals</i>,
* defined by the ADFArgument class. These terminal nodes are associated
* with a single number which represents the "argument" in the original ADF
* which evaluated their tree. When an Argument Terminal is evaluated,
* it returns the stored result for that child number in the parent ADF.
* Ultimately, when the associated tree completes its evaluation, the ADF
* returns that value.
*
* <p>ADMs work slightly differently. When an ADM is evaluated, it
* immediately evaluates its associated tree without first evaluating
* any children. When an Argument Terminal is evaluated, it evaluates
* the subtree of the appropriate child number in the parent ADM and returns
* that result. These subtrees can be evaluated many times. When the
* associated tree completes its evaluation, the ADM returns that value.
*
* <p>Obviously, if you have Argument Terminals in a tree, that tree must
* be only callable by ADFs and ADMs, otherwise the Argument Terminals
* won't have anything to return. Furthermore, you must make sure that
* you don't have an Argument Terminal in a tree whose number is higher
* than the smallest arity (number of arguments) of a calling ADF or ADM.
*
* <p>The mechanism behind ADFs and ADMs is complex, requiring two specially-
* stored stacks (contained in the ADFStack object) of ADFContexts. For
* information on how this mechanism works, see ADFStack.
*
*
<p><b>Parameters</b><br>
<table>
<tr><td valign=top><i>base</i>.<tt>tree</tt><br>
<font size=-1>int >= 0</font></td>
<td valign=top>(The "associated tree" of the ADF)</td></tr>
<tr><td valign=top><i>base</i>.<tt>name</tt><br>
<font size=-1>String, can be undefined</font></td>
<td valign=top>(A simple "name" of the ADF to distinguish it from other ADF function in your function set. Use only letters, numbers, hyphens, and underscores. Lowercase is best.)</td></tr>
</table>
<p><b>Default Base</b><br>
gp.adf
* @see ec.gp.ADFStack
* @author Sean Luke
* @version 1.0
*/
public class ADF extends GPNode
{
public static final String P_ADF = "adf";
public static final String P_ASSOCIATEDTREE = "tree";
public static final String P_FUNCTIONNAME = "name";
/** The ADF's associated tree */
public int associatedTree;
/** The "function name" of the ADF, to distinguish it from other GP
function you might provide. */
public String name;
public String name() { return name; }
public Parameter defaultBase()
{
return GPDefaults.base().push(P_ADF);
}
public void writeNode(final EvolutionState state, final DataOutput dataOutput) throws IOException
{
dataOutput.writeInt(associatedTree);
dataOutput.writeUTF(name);
}
public void readNode(final EvolutionState state, final DataInput dataInput) throws IOException
{
associatedTree = dataInput.readInt();
name = dataInput.readUTF();
}
/** Returns name.hashCode() + class.hashCode() + associatedTree. Hope
that's reasonably random. */
public int nodeHashCode()
{
return (this.getClass().hashCode() + name.hashCode() + associatedTree);
}
/** Determines node equality by comparing the class, associated tree, and
function name of the nodes. */
public boolean nodeEquals(final GPNode node)
{
if (!this.getClass().equals(node.getClass()) ||
children.length != node.children.length) return false;
ADF adf = (ADF)node;
return (associatedTree==adf.associatedTree && name.equals(adf.name));
}
/** Checks type-compatibility constraints between the ADF, its argument terminal, and the tree type of its associated tree, and also checks to make sure the tree exists, there aren't invalid argument terminal in it, and there are sufficient argument terminal (a warning). Whew! */
public void checkConstraints(final EvolutionState state,
final int tree,
final GPIndividual typicalIndividual,
final Parameter individualBase)
{
super.checkConstraints(state,tree,typicalIndividual,individualBase);
// does the associated tree exist?
if (associatedTree < 0 || associatedTree >= typicalIndividual.trees.length)
state.output.error("The node " + toStringForError() + " of individual " +
individualBase + " must have an associated tree that is >= 0 and < " + typicalIndividual.trees.length + ". Value provided was: " + associatedTree);
else
{
// is the associated tree of the correct type? Issue an error.
GPInitializer initializer = ((GPInitializer)state.initializer);
if (!constraints(initializer).returntype.compatibleWith(initializer,
typicalIndividual.trees[associatedTree].constraints(initializer).treetype))
state.output.error("The return type of the node " + toStringForError()
+ " of individual " +
individualBase + "is not type-compatible with the tree type of its associated tree.");
GPNode[][] funcs =
typicalIndividual.trees[associatedTree].
constraints(initializer).functionset.nodes;
ADFArgument validArgument[] = new ADFArgument[children.length];
for(int w=0;w<funcs.length;w++)
{
// does the tree's function set have argument terminal
// that are beyond what I can provide? (issue an error)
GPNode[] gpfi = funcs[w];
for (int x=0;x<gpfi.length;x++)
if (gpfi[x] instanceof ADFArgument)
{
ADFArgument argument = (ADFArgument)(gpfi[x]);
int arg = argument.argument;
if (arg >= children.length) // uh oh
state.output.error("The node " +
toStringForError() +
" in individual " +
individualBase + " would call its associated tree, which has an argument terminal with an argument number (" + arg + ") >= the ADF/ADM's arity (" + children.length +"). The argument terminal in question is "
+ gpfi[x].toStringForError());
else
{
if (validArgument[arg]!=null && validArgument[arg]!=argument) // got one already
state.output.warning("There exists more than one Argument terminal for argument #"
+ arg + " for the node " +
toStringForError() +
" in individual " +
individualBase);
else validArgument[arg] = argument;
// is the argument terminal of the correct return type? Issue an error.
if (!gpfi[x].constraints(initializer).returntype.compatibleWith(initializer,
constraints(initializer).childtypes[arg]))
state.output.error("The node " +
toStringForError() +
" in individual " +
individualBase + " would call its associated tree, which has an argument terminal which is not type-compatible with the related argument position of the ADF/ADM. The argument terminal in question is "
+ gpfi[x].toStringForError());
}
}
}
// does the tree's function set have fewer argument terminal
// than I can provide? (issue a warning)
for (int x=0;x<children.length;x++)
if (validArgument[x] == null)
state.output.warning("There is no argument terminal for argument #"
+ x + " for the node "
+ toStringForError() + " in individual " +
individualBase);
}
}
public void setup(final EvolutionState state, final Parameter base)
{
// we don't know our name yet, (used in toStringForError(),
// which is used in GPNode's setup(...) method),
// so WE load parameters before our parent does.
Parameter def = defaultBase();
associatedTree =
state.parameters.getInt(base.push(P_ASSOCIATEDTREE),def.push(P_FUNCTIONNAME),0);
if (associatedTree < 0)
state.output.fatal(
"ADF/ADM node must have a positive-numbered associated tree.",
base.push(P_ASSOCIATEDTREE),def.push(P_FUNCTIONNAME));
name = state.parameters.getString(base.push(P_FUNCTIONNAME),def.push(P_FUNCTIONNAME));
if (name == null || name.equals(""))
{
name = "ADF" + (associatedTree - 1);
state.output.warning("ADF/ADM node for Tree " + associatedTree + " has no function name. Using the name " + name(),
base.push(P_FUNCTIONNAME),def.push(P_FUNCTIONNAME));
}
if (name.length() == 1)
{
state.output.warning("Using old-style ADF/ADM name. You should change it to something longer and more descriptive, such as ADF" + name,
base.push(P_FUNCTIONNAME),def.push(P_FUNCTIONNAME));
}
// now we let our parent set up.
super.setup(state,base);
}
public String toString() { return name(); }
public void eval(final EvolutionState state,
final int thread,
final GPData input,
final ADFStack stack,
final GPIndividual individual,
final Problem problem)
{
// get a context and prepare it
ADFContext c = stack.get();
c.prepareADF(this, (GPProblem) problem);
// evaluate my arguments and load 'em in
for(int x=0;x<children.length;x++)
{
input.copyTo(c.arguments[x]);
children[x].eval(state,thread,c.arguments[x],
stack,individual,problem);
}
// Now push the context onto the stack.
stack.push(c);
// evaluate the top of the associatedTree
individual.trees[associatedTree].child.eval(
state,thread,input,stack,individual,problem);
// pop the context off, and we're done!
if (stack.pop(1) != 1)
state.output.fatal("Stack prematurely empty for " + toStringForError());
}
}
|
package io.github.Leonardo0013YT.UltraCTW.managers;
import io.github.Leonardo0013YT.UltraCTW.UltraCTW;
import io.github.Leonardo0013YT.UltraCTW.cosmetics.wineffects.*;
import io.github.Leonardo0013YT.UltraCTW.game.GameFlag;
import io.github.Leonardo0013YT.UltraCTW.interfaces.CTWPlayer;
import io.github.Leonardo0013YT.UltraCTW.interfaces.Game;
import io.github.Leonardo0013YT.UltraCTW.interfaces.WinEffect;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import java.util.HashMap;
public class WinEffectsManager {
private HashMap<Integer, UltraWinEffect> winEffects = new HashMap<>();
private UltraCTW plugin;
private int lastPage;
public WinEffectsManager(UltraCTW plugin) {
this.plugin = plugin;
}
public void loadWinEffects() {
winEffects.clear();
if (plugin.getWineffect().isSet("wineffects")) {
ConfigurationSection conf = plugin.getWineffect().getConfig().getConfigurationSection("wineffects");
for (String c : conf.getKeys(false)) {
int id = plugin.getWineffect().getInt("wineffects." + c + ".id");
winEffects.put(id, new UltraWinEffect(plugin, "wineffects." + c));
}
}
}
public void execute(Game game, Player p, int id) {
UltraWinEffect uwe = winEffects.get(id);
if (uwe == null || uwe.getType().equals("none")) {
return;
}
WinEffect we;
switch (uwe.getType()) {
case "fireworks":
we = new WinEffectFireworks();
we.start(p, game);
break;
case "vulcanfire":
we = new WinEffectVulcanFire();
we.start(p, game);
break;
case "icewalker":
we = new WinEffectIceWalker();
we.start(p, game);
break;
case "notes":
we = new WinEffectNotes();
we.start(p, game);
break;
case "chickens":
we = new WinEffectChicken();
we.start(p, game);
break;
case "guardian":
we = new WinEffectGuardians();
we.start(p, game);
break;
case "dragon":
we = new WinEffectDragonRider();
we.start(p, game);
break;
default:
we = new WinEffectVulcanWool();
we.start(p, game);
break;
}
game.addWinEffects(we);
}
public void execute(GameFlag game, Player p, int id) {
UltraWinEffect uwe = winEffects.get(id);
if (uwe == null || uwe.getType().equals("none")) {
return;
}
WinEffect we;
switch (uwe.getType()) {
case "fireworks":
we = new WinEffectFireworks();
we.start(p, game);
break;
case "vulcanfire":
we = new WinEffectVulcanFire();
we.start(p, game);
break;
case "icewalker":
we = new WinEffectIceWalker();
we.start(p, game);
break;
case "notes":
we = new WinEffectNotes();
we.start(p, game);
break;
case "chickens":
we = new WinEffectChicken();
we.start(p, game);
break;
case "guardian":
we = new WinEffectGuardians();
we.start(p, game);
break;
case "dragon":
we = new WinEffectDragonRider();
we.start(p, game);
break;
default:
we = new WinEffectVulcanWool();
we.start(p, game);
break;
}
game.addWinEffects(we);
}
public UltraWinEffect getWinEffectByItem(Player p, ItemStack item) {
for (UltraWinEffect k : winEffects.values()) {
if (k.getIcon(p).getItemMeta().getDisplayName().equals(item.getItemMeta().getDisplayName())) {
return k;
}
}
return null;
}
public HashMap<Integer, UltraWinEffect> getWinEffects() {
return winEffects;
}
public int getWinEffectsSize() {
return winEffects.size();
}
public String getSelected(CTWPlayer sw) {
if (winEffects.containsKey(sw.getWinEffect())) {
return winEffects.get(sw.getWinEffect()).getName();
}
return plugin.getLang().get(null, "messages.noSelected");
}
public int getLastPage() {
return lastPage;
}
public void setLastPage(int lastPage) {
if (getLastPage() < lastPage) {
this.lastPage = lastPage;
}
}
}
|
/*
* 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.qpid.server.logging.messages;
import static org.apache.qpid.server.logging.AbstractMessageLogger.DEFAULT_LOG_HIERARCHY_PREFIX;
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
import org.slf4j.LoggerFactory;
import org.apache.qpid.server.logging.LogMessage;
/**
* DO NOT EDIT DIRECTLY, THIS FILE WAS GENERATED.
*
* Generated using GenerateLogMessages and LogMessages.vm
* This file is based on the content of Broker_logmessages.properties
*
* To regenerate, use Maven lifecycle generates-sources with -Dgenerate=true
*/
public class BrokerMessages
{
private static ResourceBundle _messages;
private static Locale _currentLocale;
static
{
Locale locale = Locale.US;
String localeSetting = System.getProperty("qpid.broker_locale");
if (localeSetting != null)
{
String[] localeParts = localeSetting.split("_");
String language = (localeParts.length > 0 ? localeParts[0] : "");
String country = (localeParts.length > 1 ? localeParts[1] : "");
String variant = "";
if (localeParts.length > 2)
{
variant = localeSetting.substring(language.length() + 1 + country.length() + 1);
}
locale = new Locale(language, country, variant);
}
_currentLocale = locale;
}
public static final String BROKER_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker";
public static final String CONFIG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.config";
public static final String FAILED_CHILDREN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.failed_children";
public static final String FATAL_ERROR_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.fatal_error";
public static final String LISTENING_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.listening";
public static final String MANAGEMENT_MODE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.management_mode";
public static final String MAX_MEMORY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.max_memory";
public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.operation";
public static final String PLATFORM_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.platform";
public static final String PROCESS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.process";
public static final String READY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.ready";
public static final String SHUTTING_DOWN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.shutting_down";
public static final String STARTUP_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.startup";
public static final String STATS_DATA_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_data";
public static final String STATS_MSGS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_msgs";
public static final String STOPPED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stopped";
static
{
LoggerFactory.getLogger(BROKER_LOG_HIERARCHY);
LoggerFactory.getLogger(CONFIG_LOG_HIERARCHY);
LoggerFactory.getLogger(FAILED_CHILDREN_LOG_HIERARCHY);
LoggerFactory.getLogger(FATAL_ERROR_LOG_HIERARCHY);
LoggerFactory.getLogger(LISTENING_LOG_HIERARCHY);
LoggerFactory.getLogger(MANAGEMENT_MODE_LOG_HIERARCHY);
LoggerFactory.getLogger(MAX_MEMORY_LOG_HIERARCHY);
LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
LoggerFactory.getLogger(PLATFORM_LOG_HIERARCHY);
LoggerFactory.getLogger(PROCESS_LOG_HIERARCHY);
LoggerFactory.getLogger(READY_LOG_HIERARCHY);
LoggerFactory.getLogger(SHUTTING_DOWN_LOG_HIERARCHY);
LoggerFactory.getLogger(STARTUP_LOG_HIERARCHY);
LoggerFactory.getLogger(STATS_DATA_LOG_HIERARCHY);
LoggerFactory.getLogger(STATS_MSGS_LOG_HIERARCHY);
LoggerFactory.getLogger(STOPPED_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Broker_logmessages", _currentLocale);
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1006 : Using configuration : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage CONFIG(String param1)
{
String rawMessage = _messages.getString("CONFIG");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return CONFIG_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1019 : WARNING - some services were unable to start. The following components are in the ERRORed state {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage FAILED_CHILDREN(String param1)
{
String rawMessage = _messages.getString("FAILED_CHILDREN");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return FAILED_CHILDREN_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1016 : Fatal error : {0} : See log file for more information</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage FATAL_ERROR(String param1)
{
String rawMessage = _messages.getString("FATAL_ERROR");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return FATAL_ERROR_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1002 : Starting : Listening on {0} port {1,number,#}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage LISTENING(String param1, Number param2)
{
String rawMessage = _messages.getString("LISTENING");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return LISTENING_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1012 : Management Mode : User Details : {0} / {1}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage MANAGEMENT_MODE(String param1, String param2)
{
String rawMessage = _messages.getString("MANAGEMENT_MODE");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return MANAGEMENT_MODE_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1011 : Maximum Memory : Heap : {0,number} bytes Direct : {1,number} bytes</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage MAX_MEMORY(Number param1, Number param2)
{
String rawMessage = _messages.getString("MAX_MEMORY");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return MAX_MEMORY_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1018 : Operation : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage OPERATION(String param1)
{
String rawMessage = _messages.getString("OPERATION");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return OPERATION_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1010 : Platform : JVM : {0} version: {1} OS : {2} version: {3} arch: {4} cores: {5}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage PLATFORM(String param1, String param2, String param3, String param4, String param5, String param6)
{
String rawMessage = _messages.getString("PLATFORM");
final Object[] messageArguments = {param1, param2, param3, param4, param5, param6};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return PLATFORM_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1017 : Process : PID : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage PROCESS(String param1)
{
String rawMessage = _messages.getString("PROCESS");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return PROCESS_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1004 : Qpid Broker Ready</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage READY()
{
String rawMessage = _messages.getString("READY");
final String message = rawMessage;
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return READY_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1003 : Shutting down : {0} port {1,number,#}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage SHUTTING_DOWN(String param1, Number param2)
{
String rawMessage = _messages.getString("SHUTTING_DOWN");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return SHUTTING_DOWN_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1001 : Startup : Version: {0} Build: {1}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage STARTUP(String param1, String param2)
{
String rawMessage = _messages.getString("STARTUP");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return STARTUP_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1008 : {0,choice,0#delivered|1#received} : {1,number,#.###} kB/s peak : {2,number,#} bytes total</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage STATS_DATA(Number param1, Number param2, Number param3)
{
String rawMessage = _messages.getString("STATS_DATA");
final Object[] messageArguments = {param1, param2, param3};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return STATS_DATA_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1009 : {0,choice,0#delivered|1#received} : {1,number,#.###} msg/s peak : {2,number,#} msgs total</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage STATS_MSGS(Number param1, Number param2, Number param3)
{
String rawMessage = _messages.getString("STATS_MSGS");
final Object[] messageArguments = {param1, param2, param3};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
final String message = formatter.format(messageArguments);
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return STATS_MSGS_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
/**
* Log a Broker message of the Format:
* <pre>BRK-1005 : Stopped</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
public static LogMessage STOPPED()
{
String rawMessage = _messages.getString("STOPPED");
final String message = rawMessage;
return new LogMessage()
{
@Override
public String toString()
{
return message;
}
@Override
public String getLogHierarchy()
{
return STOPPED_LOG_HIERARCHY;
}
@Override
public boolean equals(final Object o)
{
if (this == o)
{
return true;
}
if (o == null || getClass() != o.getClass())
{
return false;
}
final LogMessage that = (LogMessage) o;
return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
}
@Override
public int hashCode()
{
int result = toString().hashCode();
result = 31 * result + getLogHierarchy().hashCode();
return result;
}
};
}
private BrokerMessages()
{
}
}
|
/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* The Apereo Foundation 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 com.tle.upgrade.upgraders;
import com.tle.upgrade.PropertyFileModifier;
import com.tle.upgrade.UpgradeDepends;
import com.tle.upgrade.UpgradeResult;
import java.io.File;
import java.util.Collections;
import java.util.List;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
/**
* Changes eventService.x = blah and userSessionService.x = blah to channelService.x = blah Always
* uses values in the event service in preference to ones found in user session service. (It's more
* likely to have been fixed if there were any cluster mis-configurations)
*
* @author aholland
*/
public class UpdateClusterConfig extends AbstractUpgrader {
private static final String BIND_ADDRESS = "bindAddress"; // $NON-NLS-1$
private static final String MULTICAST_ADDRESS = "multicastAddress"; // $NON-NLS-1$
private static final String MULTICAST_PORT = "multicastPort"; // $NON-NLS-1$
private static final String CONNECTION_STRING = "connectionString"; // $NON-NLS-1$
private static final String DEBUG = "debug"; // $NON-NLS-1$
private static final String CLUSTER_NODE_ID = "clusterNodeId"; // $NON-NLS-1$
private static final String EVENT_SERVICE_PREFIX = "eventService."; // $NON-NLS-1$
private static final String USER_SESSION_SERVICE_PREFIX = "userSessionService."; // $NON-NLS-1$
private static final String CHANNEL_SERVICE_PREFIX = "channelService."; // $NON-NLS-1$
@Override
public String getId() {
return "UpdateClusterConfig"; //$NON-NLS-1$
}
@Override
public List<UpgradeDepends> getDepends() {
return Collections.emptyList();
}
@Override
public boolean isBackwardsCompatible() {
return false;
}
@Override
public void upgrade(UpgradeResult result, File tleInstallDir) throws Exception {
new ClusterPropertyModifier(tleInstallDir).updateProperties();
}
public static class ClusterPropertyModifier extends PropertyFileModifier {
protected ClusterPropertyModifier(File installDir) throws ConfigurationException {
super(new File(new File(installDir, CONFIG_FOLDER), OPTIONAL_CONFIG));
}
@Override
protected boolean modifyProperties(PropertiesConfiguration props) {
boolean changed = false;
changed |= changeKey(props, BIND_ADDRESS);
changed |= changeKey(props, MULTICAST_ADDRESS);
changed |= changeKey(props, MULTICAST_PORT);
changed |= changeKey(props, CONNECTION_STRING, true);
changed |= changeKey(props, DEBUG);
changed |= changeKey(props, CLUSTER_NODE_ID);
return changed;
}
private boolean changeKey(PropertiesConfiguration props, String suffix) {
return changeKey(props, suffix, false);
}
private boolean changeKey(PropertiesConfiguration props, String suffix, boolean clearOnly) {
String eventServiceVal = props.getString(EVENT_SERVICE_PREFIX + suffix);
String sessionServiceVal = props.getString(USER_SESSION_SERVICE_PREFIX + suffix);
String useVal = (eventServiceVal == null ? sessionServiceVal : eventServiceVal);
if (useVal != null) {
if (!clearOnly) {
props.setProperty(CHANNEL_SERVICE_PREFIX + suffix, useVal);
}
props.clearProperty(EVENT_SERVICE_PREFIX + suffix);
props.clearProperty(USER_SESSION_SERVICE_PREFIX + suffix);
return true;
}
return false;
}
}
}
|
package br.org.arquitetura.model.business;
import java.io.Serializable;
import java.util.List;
import javax.inject.Inject;
import br.org.arquitetura.excecao.EntidadeJaExisteExcecao;
import br.org.arquitetura.excecao.EntidadeNaoEncontradaExcecao;
import br.org.arquitetura.model.persistence.dao.IDao;
/**
* Classe abstrata que contém implementação de comportamento padrão da camada
* negocial de um módulo.
*
* @param <E>
* tipo da Entidade.
* @param <P>
* tipo da chave primária da Entidade.
*
* @see br.org.arquitetura.model.business.IBusiness
*/
public abstract class AbstractBusiness<E, P extends Serializable> implements IBusiness<E, P>, Serializable {
private static final long serialVersionUID = 1L;
@Inject
private IDao<E, P> dao;
@Override
public E adicionar(E entidade) throws EntidadeJaExisteExcecao, EntidadeNaoEncontradaExcecao {
return dao.adicionar(entidade);
}
@Override
public void remover(E entidade) throws EntidadeNaoEncontradaExcecao {
dao.remover(entidade);
}
@Override
public void remover(P chavePrimaria) throws EntidadeNaoEncontradaExcecao {
dao.remover(chavePrimaria);
}
@Override
public E atualizar(E entidade) throws EntidadeNaoEncontradaExcecao, EntidadeJaExisteExcecao {
return dao.atualizar(entidade);
}
@Override
public List<E> listar() {
return dao.listar();
}
@Override
public E recuperar(P chavePrimaria) throws EntidadeNaoEncontradaExcecao {
return dao.recuperar(chavePrimaria);
}
}
|
/*
Copyright 2016-2018 Jan Henzel, Patrick Jauernig, Dennis Werner
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.secuso.privacyfriendlywifimanager.view.adapter;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import org.secuso.privacyfriendlywifimanager.logic.types.ScheduleEntry;
import org.secuso.privacyfriendlywifimanager.logic.util.IListHandler;
import org.secuso.privacyfriendlywifimanager.view.viewholder.ScheduleItemViewHolder;
import secuso.org.privacyfriendlywifi.R;
/**
* Adapter for ScheduleEntry.
*/
public class ScheduleAdapter extends RemovableRecyclerViewAdapter<ScheduleEntry> {
public ScheduleAdapter(int layoutResId, IListHandler<ScheduleEntry> scheduleListHandler, RecyclerView recyclerView, FloatingActionButton fab) {
super(layoutResId, scheduleListHandler, recyclerView, fab);
}
@Override
public ScheduleItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_item_schedule, parent, false);
return new ScheduleItemViewHolder(v);
}
}
|
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
* Licensed under the Zeebe Community License 1.0. You may not use this file
* except in compliance with the Zeebe Community License 1.0.
*/
package io.zeebe.gateway.impl.broker;
@FunctionalInterface
public interface BrokerResponseConsumer<T> {
void accept(long key, T response);
}
|
/*
* 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 io.trino.sql.planner.optimizations;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSetMultimap;
import com.google.common.collect.SetMultimap;
import io.trino.Session;
import io.trino.SystemSessionProperties;
import io.trino.execution.warnings.WarningCollector;
import io.trino.metadata.Metadata;
import io.trino.spi.connector.GroupingProperty;
import io.trino.spi.connector.LocalProperty;
import io.trino.spi.type.TypeOperators;
import io.trino.sql.planner.DomainTranslator;
import io.trino.sql.planner.Partitioning;
import io.trino.sql.planner.PartitioningScheme;
import io.trino.sql.planner.PlanNodeIdAllocator;
import io.trino.sql.planner.Symbol;
import io.trino.sql.planner.SymbolAllocator;
import io.trino.sql.planner.TypeAnalyzer;
import io.trino.sql.planner.TypeProvider;
import io.trino.sql.planner.iterative.rule.PushPredicateIntoTableScan;
import io.trino.sql.planner.plan.AggregationNode;
import io.trino.sql.planner.plan.ApplyNode;
import io.trino.sql.planner.plan.Assignments;
import io.trino.sql.planner.plan.ChildReplacer;
import io.trino.sql.planner.plan.CorrelatedJoinNode;
import io.trino.sql.planner.plan.DistinctLimitNode;
import io.trino.sql.planner.plan.EnforceSingleRowNode;
import io.trino.sql.planner.plan.ExchangeNode;
import io.trino.sql.planner.plan.ExplainAnalyzeNode;
import io.trino.sql.planner.plan.FilterNode;
import io.trino.sql.planner.plan.GroupIdNode;
import io.trino.sql.planner.plan.IndexJoinNode;
import io.trino.sql.planner.plan.IndexSourceNode;
import io.trino.sql.planner.plan.JoinNode;
import io.trino.sql.planner.plan.LimitNode;
import io.trino.sql.planner.plan.MarkDistinctNode;
import io.trino.sql.planner.plan.OutputNode;
import io.trino.sql.planner.plan.PlanNode;
import io.trino.sql.planner.plan.PlanVisitor;
import io.trino.sql.planner.plan.ProjectNode;
import io.trino.sql.planner.plan.RowNumberNode;
import io.trino.sql.planner.plan.SemiJoinNode;
import io.trino.sql.planner.plan.SortNode;
import io.trino.sql.planner.plan.SpatialJoinNode;
import io.trino.sql.planner.plan.StatisticsWriterNode;
import io.trino.sql.planner.plan.TableDeleteNode;
import io.trino.sql.planner.plan.TableFinishNode;
import io.trino.sql.planner.plan.TableScanNode;
import io.trino.sql.planner.plan.TableWriterNode;
import io.trino.sql.planner.plan.TopNNode;
import io.trino.sql.planner.plan.TopNRankingNode;
import io.trino.sql.planner.plan.UnionNode;
import io.trino.sql.planner.plan.UnnestNode;
import io.trino.sql.planner.plan.ValuesNode;
import io.trino.sql.planner.plan.WindowNode;
import io.trino.sql.tree.Expression;
import io.trino.sql.tree.SymbolReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Verify.verify;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.collect.Iterables.getOnlyElement;
import static io.trino.SystemSessionProperties.ignoreDownStreamPreferences;
import static io.trino.SystemSessionProperties.isColocatedJoinEnabled;
import static io.trino.SystemSessionProperties.isDistributedSortEnabled;
import static io.trino.SystemSessionProperties.isForceSingleNodeOutput;
import static io.trino.sql.planner.FragmentTableScanCounter.countSources;
import static io.trino.sql.planner.FragmentTableScanCounter.hasMultipleSources;
import static io.trino.sql.planner.SystemPartitioningHandle.FIXED_ARBITRARY_DISTRIBUTION;
import static io.trino.sql.planner.SystemPartitioningHandle.FIXED_HASH_DISTRIBUTION;
import static io.trino.sql.planner.SystemPartitioningHandle.SCALED_WRITER_DISTRIBUTION;
import static io.trino.sql.planner.SystemPartitioningHandle.SINGLE_DISTRIBUTION;
import static io.trino.sql.planner.optimizations.ActualProperties.Global.partitionedOn;
import static io.trino.sql.planner.optimizations.ActualProperties.Global.singleStreamPartition;
import static io.trino.sql.planner.optimizations.LocalProperties.grouped;
import static io.trino.sql.planner.optimizations.PreferredProperties.partitionedWithLocal;
import static io.trino.sql.planner.plan.ExchangeNode.Scope.REMOTE;
import static io.trino.sql.planner.plan.ExchangeNode.Type.GATHER;
import static io.trino.sql.planner.plan.ExchangeNode.Type.REPARTITION;
import static io.trino.sql.planner.plan.ExchangeNode.gatheringExchange;
import static io.trino.sql.planner.plan.ExchangeNode.mergingExchange;
import static io.trino.sql.planner.plan.ExchangeNode.partitionedExchange;
import static io.trino.sql.planner.plan.ExchangeNode.replicatedExchange;
import static io.trino.sql.planner.plan.ExchangeNode.roundRobinExchange;
import static java.lang.String.format;
import static java.util.stream.Collectors.toList;
public class AddExchanges
implements PlanOptimizer
{
private final TypeAnalyzer typeAnalyzer;
private final Metadata metadata;
private final TypeOperators typeOperators;
private final DomainTranslator domainTranslator;
public AddExchanges(Metadata metadata, TypeOperators typeOperators, TypeAnalyzer typeAnalyzer)
{
this.metadata = metadata;
this.typeOperators = typeOperators;
this.domainTranslator = new DomainTranslator(metadata);
this.typeAnalyzer = typeAnalyzer;
}
@Override
public PlanNode optimize(PlanNode plan, Session session, TypeProvider types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator, WarningCollector warningCollector)
{
PlanWithProperties result = plan.accept(new Rewriter(idAllocator, symbolAllocator, session), PreferredProperties.any());
return result.getNode();
}
private class Rewriter
extends PlanVisitor<PlanWithProperties, PreferredProperties>
{
private final PlanNodeIdAllocator idAllocator;
private final SymbolAllocator symbolAllocator;
private final TypeProvider types;
private final Session session;
private final boolean distributedIndexJoins;
private final boolean preferStreamingOperators;
private final boolean redistributeWrites;
private final boolean scaleWriters;
public Rewriter(PlanNodeIdAllocator idAllocator, SymbolAllocator symbolAllocator, Session session)
{
this.idAllocator = idAllocator;
this.symbolAllocator = symbolAllocator;
this.types = symbolAllocator.getTypes();
this.session = session;
this.distributedIndexJoins = SystemSessionProperties.isDistributedIndexJoinEnabled(session);
this.redistributeWrites = SystemSessionProperties.isRedistributeWrites(session);
this.scaleWriters = SystemSessionProperties.isScaleWriters(session);
this.preferStreamingOperators = SystemSessionProperties.preferStreamingOperators(session);
}
@Override
protected PlanWithProperties visitPlan(PlanNode node, PreferredProperties preferredProperties)
{
return rebaseAndDeriveProperties(node, planChild(node, preferredProperties));
}
@Override
public PlanWithProperties visitProject(ProjectNode node, PreferredProperties preferredProperties)
{
Map<Symbol, Symbol> identities = computeIdentityTranslations(node.getAssignments());
PreferredProperties translatedPreferred = preferredProperties.translate(symbol -> Optional.ofNullable(identities.get(symbol)));
return rebaseAndDeriveProperties(node, planChild(node, translatedPreferred));
}
@Override
public PlanWithProperties visitOutput(OutputNode node, PreferredProperties preferredProperties)
{
PlanWithProperties child = planChild(node, PreferredProperties.undistributed());
if (!child.getProperties().isSingleNode() && isForceSingleNodeOutput(session)) {
child = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()),
child.getProperties());
}
return rebaseAndDeriveProperties(node, child);
}
@Override
public PlanWithProperties visitEnforceSingleRow(EnforceSingleRowNode node, PreferredProperties preferredProperties)
{
PlanWithProperties child = planChild(node, PreferredProperties.any());
if (!child.getProperties().isSingleNode()) {
child = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()),
child.getProperties());
}
return rebaseAndDeriveProperties(node, child);
}
@Override
public PlanWithProperties visitAggregation(AggregationNode node, PreferredProperties parentPreferredProperties)
{
Set<Symbol> partitioningRequirement = ImmutableSet.copyOf(node.getGroupingKeys());
boolean preferSingleNode = node.hasSingleNodeExecutionPreference(metadata);
PreferredProperties preferredProperties = preferSingleNode ? PreferredProperties.undistributed() : PreferredProperties.any();
if (!node.getGroupingKeys().isEmpty()) {
preferredProperties = computePreference(
partitionedWithLocal(
partitioningRequirement,
grouped(node.getGroupingKeys())),
parentPreferredProperties);
}
PlanWithProperties child = planChild(node, preferredProperties);
if (child.getProperties().isSingleNode()) {
// If already unpartitioned, just drop the single aggregation back on
return rebaseAndDeriveProperties(node, child);
}
if (preferSingleNode) {
child = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()),
child.getProperties());
}
else if ((!child.getProperties().isStreamPartitionedOn(partitioningRequirement) && !child.getProperties().isNodePartitionedOn(partitioningRequirement)) ||
node.hasEmptyGroupingSet()) {
child = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, child.getNode(), node.getGroupingKeys(), node.getHashSymbol()),
child.getProperties());
}
return rebaseAndDeriveProperties(node, child);
}
@Override
public PlanWithProperties visitGroupId(GroupIdNode node, PreferredProperties preferredProperties)
{
PreferredProperties childPreference = preferredProperties.translate(translateGroupIdSymbols(node));
PlanWithProperties child = planChild(node, childPreference);
return rebaseAndDeriveProperties(node, child);
}
private Function<Symbol, Optional<Symbol>> translateGroupIdSymbols(GroupIdNode node)
{
return symbol -> {
if (node.getAggregationArguments().contains(symbol)) {
return Optional.of(symbol);
}
if (node.getCommonGroupingColumns().contains(symbol)) {
return Optional.of(node.getGroupingColumns().get(symbol));
}
return Optional.empty();
};
}
@Override
public PlanWithProperties visitMarkDistinct(MarkDistinctNode node, PreferredProperties preferredProperties)
{
PreferredProperties preferredChildProperties = computePreference(
partitionedWithLocal(ImmutableSet.copyOf(node.getDistinctSymbols()), grouped(node.getDistinctSymbols())),
preferredProperties);
PlanWithProperties child = node.getSource().accept(this, preferredChildProperties);
if (child.getProperties().isSingleNode() ||
!child.getProperties().isStreamPartitionedOn(node.getDistinctSymbols())) {
child = withDerivedProperties(
partitionedExchange(
idAllocator.getNextId(),
REMOTE,
child.getNode(),
node.getDistinctSymbols(),
node.getHashSymbol()),
child.getProperties());
}
return rebaseAndDeriveProperties(node, child);
}
@Override
public PlanWithProperties visitWindow(WindowNode node, PreferredProperties preferredProperties)
{
List<LocalProperty<Symbol>> desiredProperties = new ArrayList<>();
if (!node.getPartitionBy().isEmpty()) {
desiredProperties.add(new GroupingProperty<>(node.getPartitionBy()));
}
node.getOrderingScheme().ifPresent(orderingScheme -> desiredProperties.addAll(orderingScheme.toLocalProperties()));
PlanWithProperties child = planChild(
node,
computePreference(
partitionedWithLocal(ImmutableSet.copyOf(node.getPartitionBy()), desiredProperties),
preferredProperties));
if (!child.getProperties().isStreamPartitionedOn(node.getPartitionBy()) &&
!child.getProperties().isNodePartitionedOn(node.getPartitionBy())) {
if (node.getPartitionBy().isEmpty()) {
child = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()),
child.getProperties());
}
else {
child = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, child.getNode(), node.getPartitionBy(), node.getHashSymbol()),
child.getProperties());
}
}
return rebaseAndDeriveProperties(node, child);
}
@Override
public PlanWithProperties visitRowNumber(RowNumberNode node, PreferredProperties preferredProperties)
{
if (node.getPartitionBy().isEmpty()) {
PlanWithProperties child = planChild(node, PreferredProperties.undistributed());
if (!child.getProperties().isSingleNode()) {
child = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()),
child.getProperties());
}
return rebaseAndDeriveProperties(node, child);
}
PlanWithProperties child = planChild(
node,
computePreference(partitionedWithLocal(ImmutableSet.copyOf(node.getPartitionBy()), grouped(node.getPartitionBy())),
preferredProperties));
// TODO: add config option/session property to force parallel plan if child is unpartitioned and window has a PARTITION BY clause
if (!child.getProperties().isStreamPartitionedOn(node.getPartitionBy())
&& !child.getProperties().isNodePartitionedOn(node.getPartitionBy())) {
child = withDerivedProperties(
partitionedExchange(
idAllocator.getNextId(),
REMOTE,
child.getNode(),
node.getPartitionBy(),
node.getHashSymbol()),
child.getProperties());
}
// TODO: streaming
return rebaseAndDeriveProperties(node, child);
}
@Override
public PlanWithProperties visitTopNRanking(TopNRankingNode node, PreferredProperties preferredProperties)
{
PreferredProperties preferredChildProperties;
Function<PlanNode, PlanNode> addExchange;
if (node.getPartitionBy().isEmpty()) {
preferredChildProperties = PreferredProperties.any();
addExchange = partial -> gatheringExchange(idAllocator.getNextId(), REMOTE, partial);
}
else {
preferredChildProperties = computePreference(
partitionedWithLocal(ImmutableSet.copyOf(node.getPartitionBy()), grouped(node.getPartitionBy())),
preferredProperties);
addExchange = partial -> partitionedExchange(idAllocator.getNextId(), REMOTE, partial, node.getPartitionBy(), node.getHashSymbol());
}
PlanWithProperties child = planChild(node, preferredChildProperties);
if (!child.getProperties().isStreamPartitionedOn(node.getPartitionBy())
&& !child.getProperties().isNodePartitionedOn(node.getPartitionBy())) {
// add exchange + push function to child
child = withDerivedProperties(
new TopNRankingNode(
idAllocator.getNextId(),
child.getNode(),
node.getSpecification(),
node.getRankingType(),
node.getRankingSymbol(),
node.getMaxRankingPerPartition(),
true,
node.getHashSymbol()),
child.getProperties());
child = withDerivedProperties(addExchange.apply(child.getNode()), child.getProperties());
}
return rebaseAndDeriveProperties(node, child);
}
@Override
public PlanWithProperties visitTopN(TopNNode node, PreferredProperties preferredProperties)
{
PlanWithProperties child;
switch (node.getStep()) {
case SINGLE:
case FINAL:
child = planChild(node, PreferredProperties.undistributed());
if (!child.getProperties().isSingleNode()) {
child = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()),
child.getProperties());
}
return rebaseAndDeriveProperties(node, child);
case PARTIAL:
child = planChild(node, PreferredProperties.any());
return rebaseAndDeriveProperties(node, child);
}
throw new UnsupportedOperationException(format("Unsupported step for TopN [%s]", node.getStep()));
}
@Override
public PlanWithProperties visitSort(SortNode node, PreferredProperties preferredProperties)
{
PlanWithProperties child = planChild(node, PreferredProperties.undistributed());
if (child.getProperties().isSingleNode()) {
// current plan so far is single node, so local properties are effectively global properties
// skip the SortNode if the local properties guarantee ordering on Sort keys
// TODO: This should be extracted as a separate optimizer once the planner is able to reason about the ordering of each operator
List<LocalProperty<Symbol>> desiredProperties = node.getOrderingScheme().toLocalProperties();
if (LocalProperties.match(child.getProperties().getLocalProperties(), desiredProperties).stream()
.noneMatch(Optional::isPresent)) {
return child;
}
}
if (isDistributedSortEnabled(session)) {
child = planChild(node, PreferredProperties.any());
// insert round robin exchange to eliminate skewness issues
PlanNode source = roundRobinExchange(idAllocator.getNextId(), REMOTE, child.getNode());
return withDerivedProperties(
mergingExchange(
idAllocator.getNextId(),
REMOTE,
new SortNode(
idAllocator.getNextId(),
source,
node.getOrderingScheme(),
true),
node.getOrderingScheme()),
child.getProperties());
}
if (!child.getProperties().isSingleNode()) {
child = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()),
child.getProperties());
}
return rebaseAndDeriveProperties(node, child);
}
@Override
public PlanWithProperties visitLimit(LimitNode node, PreferredProperties preferredProperties)
{
if (node.isWithTies()) {
throw new IllegalStateException("Unexpected node: LimitNode with ties");
}
PlanWithProperties child = planChild(node, PreferredProperties.any());
if (!child.getProperties().isSingleNode()) {
child = withDerivedProperties(
new LimitNode(idAllocator.getNextId(), child.getNode(), node.getCount(), true),
child.getProperties());
child = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()),
child.getProperties());
}
return rebaseAndDeriveProperties(node, child);
}
@Override
public PlanWithProperties visitDistinctLimit(DistinctLimitNode node, PreferredProperties preferredProperties)
{
PlanWithProperties child = planChild(node, PreferredProperties.any());
if (!child.getProperties().isSingleNode()) {
child = withDerivedProperties(
gatheringExchange(
idAllocator.getNextId(),
REMOTE,
new DistinctLimitNode(idAllocator.getNextId(), child.getNode(), node.getLimit(), true, node.getDistinctSymbols(), node.getHashSymbol())),
child.getProperties());
}
return rebaseAndDeriveProperties(node, child);
}
@Override
public PlanWithProperties visitFilter(FilterNode node, PreferredProperties preferredProperties)
{
if (node.getSource() instanceof TableScanNode) {
Optional<PlanNode> plan = PushPredicateIntoTableScan.pushFilterIntoTableScan(
(TableScanNode) node.getSource(),
node.getPredicate(),
true,
session,
types,
idAllocator,
metadata,
typeOperators,
typeAnalyzer,
domainTranslator);
if (plan.isPresent()) {
return new PlanWithProperties(plan.get(), derivePropertiesRecursively(plan.get()));
}
}
return rebaseAndDeriveProperties(node, planChild(node, preferredProperties));
}
@Override
public PlanWithProperties visitTableScan(TableScanNode node, PreferredProperties preferredProperties)
{
return new PlanWithProperties(node, deriveProperties(node, ImmutableList.of()));
}
@Override
public PlanWithProperties visitTableWriter(TableWriterNode node, PreferredProperties preferredProperties)
{
PlanWithProperties source = node.getSource().accept(this, preferredProperties);
Optional<PartitioningScheme> partitioningScheme = node.getPartitioningScheme();
if (partitioningScheme.isEmpty()) {
if (scaleWriters) {
partitioningScheme = Optional.of(new PartitioningScheme(Partitioning.create(SCALED_WRITER_DISTRIBUTION, ImmutableList.of()), source.getNode().getOutputSymbols()));
}
else if (redistributeWrites) {
partitioningScheme = Optional.of(new PartitioningScheme(Partitioning.create(FIXED_ARBITRARY_DISTRIBUTION, ImmutableList.of()), source.getNode().getOutputSymbols()));
}
}
if (partitioningScheme.isPresent() && !source.getProperties().isCompatibleTablePartitioningWith(partitioningScheme.get().getPartitioning(), false, metadata, session)) {
source = withDerivedProperties(
partitionedExchange(
idAllocator.getNextId(),
REMOTE,
source.getNode(),
partitioningScheme.get()),
source.getProperties());
}
return rebaseAndDeriveProperties(node, source);
}
@Override
public PlanWithProperties visitValues(ValuesNode node, PreferredProperties preferredProperties)
{
return new PlanWithProperties(
node,
ActualProperties.builder()
.global(singleStreamPartition())
.build());
}
@Override
public PlanWithProperties visitTableDelete(TableDeleteNode node, PreferredProperties context)
{
return new PlanWithProperties(
node,
ActualProperties.builder()
.global(singleStreamPartition())
.build());
}
@Override
public PlanWithProperties visitExplainAnalyze(ExplainAnalyzeNode node, PreferredProperties preferredProperties)
{
PlanWithProperties child = planChild(node, PreferredProperties.any());
// if the child is already a gathering exchange, don't add another
if ((child.getNode() instanceof ExchangeNode) && ((ExchangeNode) child.getNode()).getType() == ExchangeNode.Type.GATHER) {
return rebaseAndDeriveProperties(node, child);
}
// Always add an exchange because ExplainAnalyze should be in its own stage
child = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()),
child.getProperties());
return rebaseAndDeriveProperties(node, child);
}
@Override
public PlanWithProperties visitStatisticsWriterNode(StatisticsWriterNode node, PreferredProperties context)
{
PlanWithProperties child = planChild(node, PreferredProperties.any());
// if the child is already a gathering exchange, don't add another
if ((child.getNode() instanceof ExchangeNode) && ((ExchangeNode) child.getNode()).getType() == GATHER) {
return rebaseAndDeriveProperties(node, child);
}
if (!child.getProperties().isCoordinatorOnly()) {
child = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()),
child.getProperties());
}
return rebaseAndDeriveProperties(node, child);
}
@Override
public PlanWithProperties visitTableFinish(TableFinishNode node, PreferredProperties preferredProperties)
{
PlanWithProperties child = planChild(node, PreferredProperties.any());
// if the child is already a gathering exchange, don't add another
if ((child.getNode() instanceof ExchangeNode) && ((ExchangeNode) child.getNode()).getType() == GATHER) {
return rebaseAndDeriveProperties(node, child);
}
if (!child.getProperties().isCoordinatorOnly()) {
child = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, child.getNode()),
child.getProperties());
}
return rebaseAndDeriveProperties(node, child);
}
private <T> SetMultimap<T, T> createMapping(List<T> keys, List<T> values)
{
checkArgument(keys.size() == values.size(), "Inputs must have the same size");
ImmutableSetMultimap.Builder<T, T> builder = ImmutableSetMultimap.builder();
for (int i = 0; i < keys.size(); i++) {
builder.put(keys.get(i), values.get(i));
}
return builder.build();
}
private <T> Function<T, Optional<T>> createTranslator(SetMultimap<T, T> inputToOutput)
{
return input -> inputToOutput.get(input).stream().findAny();
}
private <T> Function<T, T> createDirectTranslator(SetMultimap<T, T> inputToOutput)
{
return input -> inputToOutput.get(input).iterator().next();
}
@Override
public PlanWithProperties visitJoin(JoinNode node, PreferredProperties preferredProperties)
{
List<Symbol> leftSymbols = node.getCriteria().stream()
.map(JoinNode.EquiJoinClause::getLeft)
.collect(toImmutableList());
List<Symbol> rightSymbols = node.getCriteria().stream()
.map(JoinNode.EquiJoinClause::getRight)
.collect(toImmutableList());
JoinNode.DistributionType distributionType = node.getDistributionType().orElseThrow(() -> new IllegalArgumentException("distributionType not yet set"));
if (distributionType == JoinNode.DistributionType.REPLICATED) {
PlanWithProperties left = node.getLeft().accept(this, PreferredProperties.any());
// use partitioned join if probe side is naturally partitioned on join symbols (e.g: because of aggregation)
if (!node.getCriteria().isEmpty()
&& left.getProperties().isNodePartitionedOn(leftSymbols) && !left.getProperties().isSingleNode()) {
return planPartitionedJoin(node, leftSymbols, rightSymbols, left);
}
return planReplicatedJoin(node, left);
}
else {
return planPartitionedJoin(node, leftSymbols, rightSymbols);
}
}
private PlanWithProperties planPartitionedJoin(JoinNode node, List<Symbol> leftSymbols, List<Symbol> rightSymbols)
{
return planPartitionedJoin(node, leftSymbols, rightSymbols, node.getLeft().accept(this, PreferredProperties.partitioned(ImmutableSet.copyOf(leftSymbols))));
}
private PlanWithProperties planPartitionedJoin(JoinNode node, List<Symbol> leftSymbols, List<Symbol> rightSymbols, PlanWithProperties left)
{
SetMultimap<Symbol, Symbol> rightToLeft = createMapping(rightSymbols, leftSymbols);
SetMultimap<Symbol, Symbol> leftToRight = createMapping(leftSymbols, rightSymbols);
PlanWithProperties right;
if (left.getProperties().isNodePartitionedOn(leftSymbols) && !left.getProperties().isSingleNode()) {
Partitioning rightPartitioning = left.getProperties().translate(createTranslator(leftToRight)).getNodePartitioning().get();
right = node.getRight().accept(this, PreferredProperties.partitioned(rightPartitioning));
if (!right.getProperties().isCompatibleTablePartitioningWith(left.getProperties(), rightToLeft::get, metadata, session)) {
right = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, right.getNode(), new PartitioningScheme(rightPartitioning, right.getNode().getOutputSymbols())),
right.getProperties());
}
}
else {
right = node.getRight().accept(this, PreferredProperties.partitioned(ImmutableSet.copyOf(rightSymbols)));
if (right.getProperties().isNodePartitionedOn(rightSymbols) && !right.getProperties().isSingleNode()) {
Partitioning leftPartitioning = right.getProperties().translate(createTranslator(rightToLeft)).getNodePartitioning().get();
left = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, left.getNode(), new PartitioningScheme(leftPartitioning, left.getNode().getOutputSymbols())),
left.getProperties());
}
else {
left = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, left.getNode(), leftSymbols, Optional.empty()),
left.getProperties());
right = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, right.getNode(), rightSymbols, Optional.empty()),
right.getProperties());
}
}
verify(left.getProperties().isCompatibleTablePartitioningWith(right.getProperties(), leftToRight::get, metadata, session));
// if colocated joins are disabled, force redistribute when using a custom partitioning
if (!isColocatedJoinEnabled(session) && hasMultipleSources(left.getNode(), right.getNode())) {
Partitioning rightPartitioning = left.getProperties().translate(createTranslator(leftToRight)).getNodePartitioning().get();
right = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, right.getNode(), new PartitioningScheme(rightPartitioning, right.getNode().getOutputSymbols())),
right.getProperties());
}
return buildJoin(node, left, right, JoinNode.DistributionType.PARTITIONED);
}
private PlanWithProperties planReplicatedJoin(JoinNode node, PlanWithProperties left)
{
// Broadcast Join
PlanWithProperties right = node.getRight().accept(this, PreferredProperties.any());
if (left.getProperties().isSingleNode()) {
if (!right.getProperties().isSingleNode() ||
(!isColocatedJoinEnabled(session) && hasMultipleSources(left.getNode(), right.getNode()))) {
right = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, right.getNode()),
right.getProperties());
}
}
else {
right = withDerivedProperties(
replicatedExchange(idAllocator.getNextId(), REMOTE, right.getNode()),
right.getProperties());
}
return buildJoin(node, left, right, JoinNode.DistributionType.REPLICATED);
}
private PlanWithProperties buildJoin(JoinNode node, PlanWithProperties newLeft, PlanWithProperties newRight, JoinNode.DistributionType newDistributionType)
{
JoinNode result = new JoinNode(
node.getId(),
node.getType(),
newLeft.getNode(),
newRight.getNode(),
node.getCriteria(),
node.getLeftOutputSymbols(),
node.getRightOutputSymbols(),
node.isMaySkipOutputDuplicates(),
node.getFilter(),
node.getLeftHashSymbol(),
node.getRightHashSymbol(),
Optional.of(newDistributionType),
node.isSpillable(),
node.getDynamicFilters(),
node.getReorderJoinStatsAndCost());
return new PlanWithProperties(result, deriveProperties(result, ImmutableList.of(newLeft.getProperties(), newRight.getProperties())));
}
@Override
public PlanWithProperties visitSpatialJoin(SpatialJoinNode node, PreferredProperties preferredProperties)
{
SpatialJoinNode.DistributionType distributionType = node.getDistributionType();
PlanWithProperties left = node.getLeft().accept(this, PreferredProperties.any());
PlanWithProperties right = node.getRight().accept(this, PreferredProperties.any());
if (distributionType == SpatialJoinNode.DistributionType.REPLICATED) {
if (left.getProperties().isSingleNode()) {
if (!right.getProperties().isSingleNode()) {
right = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, right.getNode()),
right.getProperties());
}
}
else {
right = withDerivedProperties(
replicatedExchange(idAllocator.getNextId(), REMOTE, right.getNode()),
right.getProperties());
}
}
else {
left = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, left.getNode(), ImmutableList.of(node.getLeftPartitionSymbol().get()), Optional.empty()),
left.getProperties());
right = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, right.getNode(), ImmutableList.of(node.getRightPartitionSymbol().get()), Optional.empty()),
right.getProperties());
}
PlanNode newJoinNode = node.replaceChildren(ImmutableList.of(left.getNode(), right.getNode()));
return new PlanWithProperties(newJoinNode, deriveProperties(newJoinNode, ImmutableList.of(left.getProperties(), right.getProperties())));
}
@Override
public PlanWithProperties visitUnnest(UnnestNode node, PreferredProperties preferredProperties)
{
PreferredProperties translatedPreferred = preferredProperties.translate(symbol -> node.getReplicateSymbols().contains(symbol) ? Optional.of(symbol) : Optional.empty());
return rebaseAndDeriveProperties(node, planChild(node, translatedPreferred));
}
@Override
public PlanWithProperties visitSemiJoin(SemiJoinNode node, PreferredProperties preferredProperties)
{
PlanWithProperties source;
PlanWithProperties filteringSource;
SemiJoinNode.DistributionType distributionType = node.getDistributionType().orElseThrow(() -> new IllegalArgumentException("distributionType not yet set"));
if (distributionType == SemiJoinNode.DistributionType.PARTITIONED) {
List<Symbol> sourceSymbols = ImmutableList.of(node.getSourceJoinSymbol());
List<Symbol> filteringSourceSymbols = ImmutableList.of(node.getFilteringSourceJoinSymbol());
SetMultimap<Symbol, Symbol> sourceToFiltering = createMapping(sourceSymbols, filteringSourceSymbols);
SetMultimap<Symbol, Symbol> filteringToSource = createMapping(filteringSourceSymbols, sourceSymbols);
source = node.getSource().accept(this, PreferredProperties.partitioned(ImmutableSet.copyOf(sourceSymbols)));
if (source.getProperties().isNodePartitionedOn(sourceSymbols) && !source.getProperties().isSingleNode()) {
Partitioning filteringPartitioning = source.getProperties().translate(createTranslator(sourceToFiltering)).getNodePartitioning().get();
filteringSource = node.getFilteringSource().accept(this, PreferredProperties.partitionedWithNullsAndAnyReplicated(filteringPartitioning));
if (!source.getProperties().withReplicatedNulls(true).isCompatibleTablePartitioningWith(filteringSource.getProperties(), sourceToFiltering::get, metadata, session)) {
filteringSource = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, filteringSource.getNode(), new PartitioningScheme(
filteringPartitioning,
filteringSource.getNode().getOutputSymbols(),
Optional.empty(),
true,
Optional.empty())),
filteringSource.getProperties());
}
}
else {
filteringSource = node.getFilteringSource().accept(this, PreferredProperties.partitionedWithNullsAndAnyReplicated(ImmutableSet.copyOf(filteringSourceSymbols)));
if (filteringSource.getProperties().isNodePartitionedOn(filteringSourceSymbols, true) && !filteringSource.getProperties().isSingleNode()) {
Partitioning sourcePartitioning = filteringSource.getProperties().translate(createTranslator(filteringToSource)).getNodePartitioning().get();
source = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, source.getNode(), new PartitioningScheme(sourcePartitioning, source.getNode().getOutputSymbols())),
source.getProperties());
}
else {
source = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, source.getNode(), sourceSymbols, Optional.empty()),
source.getProperties());
filteringSource = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, filteringSource.getNode(), filteringSourceSymbols, Optional.empty(), true),
filteringSource.getProperties());
}
}
verify(source.getProperties().withReplicatedNulls(true).isCompatibleTablePartitioningWith(filteringSource.getProperties(), sourceToFiltering::get, metadata, session));
// if colocated joins are disabled, force redistribute when using a custom partitioning
if (!isColocatedJoinEnabled(session) && hasMultipleSources(source.getNode(), filteringSource.getNode())) {
Partitioning filteringPartitioning = source.getProperties().translate(createTranslator(sourceToFiltering)).getNodePartitioning().get();
filteringSource = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, filteringSource.getNode(), new PartitioningScheme(
filteringPartitioning,
filteringSource.getNode().getOutputSymbols(),
Optional.empty(),
true,
Optional.empty())),
filteringSource.getProperties());
}
}
else {
source = node.getSource().accept(this, PreferredProperties.any());
// Delete operator works fine even if TableScans on the filtering (right) side is not co-located with itself. It only cares about the corresponding TableScan,
// which is always on the source (left) side. Therefore, hash-partitioned semi-join is always allowed on the filtering side.
filteringSource = node.getFilteringSource().accept(this, PreferredProperties.any());
// make filtering source match requirements of source
if (source.getProperties().isSingleNode()) {
if (!filteringSource.getProperties().isSingleNode() ||
(!isColocatedJoinEnabled(session) && hasMultipleSources(source.getNode(), filteringSource.getNode()))) {
filteringSource = withDerivedProperties(
gatheringExchange(idAllocator.getNextId(), REMOTE, filteringSource.getNode()),
filteringSource.getProperties());
}
}
else {
filteringSource = withDerivedProperties(
replicatedExchange(idAllocator.getNextId(), REMOTE, filteringSource.getNode()),
filteringSource.getProperties());
}
}
return rebaseAndDeriveProperties(node, ImmutableList.of(source, filteringSource));
}
@Override
public PlanWithProperties visitIndexJoin(IndexJoinNode node, PreferredProperties preferredProperties)
{
List<Symbol> joinColumns = node.getCriteria().stream()
.map(IndexJoinNode.EquiJoinClause::getProbe)
.collect(toImmutableList());
// Only prefer grouping on join columns if no parent local property preferences
List<LocalProperty<Symbol>> desiredLocalProperties = preferredProperties.getLocalProperties().isEmpty() ? grouped(joinColumns) : ImmutableList.of();
PlanWithProperties probeSource = node.getProbeSource().accept(
this,
computePreference(
partitionedWithLocal(ImmutableSet.copyOf(joinColumns), desiredLocalProperties),
preferredProperties));
ActualProperties probeProperties = probeSource.getProperties();
PlanWithProperties indexSource = node.getIndexSource().accept(this, PreferredProperties.any());
// TODO: allow repartitioning if unpartitioned to increase parallelism
if (shouldRepartitionForIndexJoin(joinColumns, preferredProperties, probeProperties)) {
probeSource = withDerivedProperties(
partitionedExchange(idAllocator.getNextId(), REMOTE, probeSource.getNode(), joinColumns, node.getProbeHashSymbol()),
probeProperties);
}
// TODO: if input is grouped, create streaming join
// index side is really a nested-loops plan, so don't add exchanges
PlanNode result = ChildReplacer.replaceChildren(node, ImmutableList.of(probeSource.getNode(), node.getIndexSource()));
return new PlanWithProperties(result, deriveProperties(result, ImmutableList.of(probeSource.getProperties(), indexSource.getProperties())));
}
private boolean shouldRepartitionForIndexJoin(List<Symbol> joinColumns, PreferredProperties parentPreferredProperties, ActualProperties probeProperties)
{
// See if distributed index joins are enabled
if (!distributedIndexJoins) {
return false;
}
// No point in repartitioning if the plan is not distributed
if (probeProperties.isSingleNode()) {
return false;
}
Optional<PreferredProperties.PartitioningProperties> parentPartitioningPreferences = parentPreferredProperties.getGlobalProperties()
.flatMap(PreferredProperties.Global::getPartitioningProperties);
// Disable repartitioning if it would disrupt a parent's partitioning preference when streaming is enabled
boolean parentAlreadyPartitionedOnChild = parentPartitioningPreferences
.map(partitioning -> probeProperties.isStreamPartitionedOn(partitioning.getPartitioningColumns()))
.orElse(false);
if (preferStreamingOperators && parentAlreadyPartitionedOnChild) {
return false;
}
// Otherwise, repartition if we need to align with the join columns
if (!probeProperties.isStreamPartitionedOn(joinColumns)) {
return true;
}
// If we are already partitioned on the join columns because the data has been forced effectively into one stream,
// then we should repartition if that would make a difference (from the single stream state).
return probeProperties.isEffectivelySingleStream() && probeProperties.isStreamRepartitionEffective(joinColumns);
}
@Override
public PlanWithProperties visitIndexSource(IndexSourceNode node, PreferredProperties preferredProperties)
{
return new PlanWithProperties(
node,
ActualProperties.builder()
.global(singleStreamPartition())
.build());
}
private Function<Symbol, Optional<Symbol>> outputToInputTranslator(UnionNode node, int sourceIndex)
{
return symbol -> Optional.of(node.getSymbolMapping().get(symbol).get(sourceIndex));
}
private Partitioning selectUnionPartitioning(UnionNode node, PreferredProperties.PartitioningProperties parentPreference)
{
// Use the parent's requested partitioning if available
if (parentPreference.getPartitioning().isPresent()) {
return parentPreference.getPartitioning().get();
}
// Try planning the children to see if any of them naturally produce a partitioning (for now, just select the first)
boolean nullsAndAnyReplicated = parentPreference.isNullsAndAnyReplicated();
for (int sourceIndex = 0; sourceIndex < node.getSources().size(); sourceIndex++) {
PreferredProperties.PartitioningProperties childPartitioning = parentPreference.translate(outputToInputTranslator(node, sourceIndex)).get();
PreferredProperties childPreferred = PreferredProperties.builder()
.global(PreferredProperties.Global.distributed(childPartitioning.withNullsAndAnyReplicated(nullsAndAnyReplicated)))
.build();
PlanWithProperties child = node.getSources().get(sourceIndex).accept(this, childPreferred);
// Don't select a single node partitioning so that we maintain query parallelism
// Theoretically, if all children are single partitioned on the same node we could choose a single
// partitioning, but as this only applies to a union of two values nodes, it isn't worth the added complexity
if (child.getProperties().isNodePartitionedOn(childPartitioning.getPartitioningColumns(), nullsAndAnyReplicated) && !child.getProperties().isSingleNode()) {
Function<Symbol, Optional<Symbol>> childToParent = createTranslator(createMapping(node.sourceOutputLayout(sourceIndex), node.getOutputSymbols()));
return child.getProperties().translate(childToParent).getNodePartitioning().get();
}
}
// Otherwise, choose an arbitrary partitioning over the columns
return Partitioning.create(FIXED_HASH_DISTRIBUTION, ImmutableList.copyOf(parentPreference.getPartitioningColumns()));
}
@Override
public PlanWithProperties visitUnion(UnionNode node, PreferredProperties parentPreference)
{
Optional<PreferredProperties.Global> parentGlobal = parentPreference.getGlobalProperties();
if (parentGlobal.isPresent() && parentGlobal.get().isDistributed() && parentGlobal.get().getPartitioningProperties().isPresent()) {
PreferredProperties.PartitioningProperties parentPartitioningPreference = parentGlobal.get().getPartitioningProperties().get();
boolean nullsAndAnyReplicated = parentPartitioningPreference.isNullsAndAnyReplicated();
Partitioning desiredParentPartitioning = selectUnionPartitioning(node, parentPartitioningPreference);
ImmutableList.Builder<PlanNode> partitionedSources = ImmutableList.builder();
ImmutableListMultimap.Builder<Symbol, Symbol> outputToSourcesMapping = ImmutableListMultimap.builder();
for (int sourceIndex = 0; sourceIndex < node.getSources().size(); sourceIndex++) {
Partitioning childPartitioning = desiredParentPartitioning.translate(createDirectTranslator(createMapping(node.getOutputSymbols(), node.sourceOutputLayout(sourceIndex))));
PreferredProperties childPreferred = PreferredProperties.builder()
.global(PreferredProperties.Global.distributed(PreferredProperties.PartitioningProperties.partitioned(childPartitioning)
.withNullsAndAnyReplicated(nullsAndAnyReplicated)))
.build();
PlanWithProperties source = node.getSources().get(sourceIndex).accept(this, childPreferred);
if (!source.getProperties().isCompatibleTablePartitioningWith(childPartitioning, nullsAndAnyReplicated, metadata, session)) {
source = withDerivedProperties(
partitionedExchange(
idAllocator.getNextId(),
REMOTE,
source.getNode(),
new PartitioningScheme(
childPartitioning,
source.getNode().getOutputSymbols(),
Optional.empty(),
nullsAndAnyReplicated,
Optional.empty())),
source.getProperties());
}
partitionedSources.add(source.getNode());
for (int column = 0; column < node.getOutputSymbols().size(); column++) {
outputToSourcesMapping.put(node.getOutputSymbols().get(column), node.sourceOutputLayout(sourceIndex).get(column));
}
}
UnionNode newNode = new UnionNode(
node.getId(),
partitionedSources.build(),
outputToSourcesMapping.build(),
ImmutableList.copyOf(outputToSourcesMapping.build().keySet()));
return new PlanWithProperties(
newNode,
ActualProperties.builder()
.global(partitionedOn(desiredParentPartitioning, Optional.of(desiredParentPartitioning)))
.build()
.withReplicatedNulls(parentPartitioningPreference.isNullsAndAnyReplicated()));
}
// first, classify children into partitioned and unpartitioned
List<PlanNode> unpartitionedChildren = new ArrayList<>();
List<List<Symbol>> unpartitionedOutputLayouts = new ArrayList<>();
List<PlanNode> partitionedChildren = new ArrayList<>();
List<List<Symbol>> partitionedOutputLayouts = new ArrayList<>();
for (int i = 0; i < node.getSources().size(); i++) {
PlanWithProperties child = node.getSources().get(i).accept(this, PreferredProperties.any());
if (child.getProperties().isSingleNode()) {
unpartitionedChildren.add(child.getNode());
unpartitionedOutputLayouts.add(node.sourceOutputLayout(i));
}
else {
partitionedChildren.add(child.getNode());
// union may drop or duplicate symbols from the input so we must provide an exact mapping
partitionedOutputLayouts.add(node.sourceOutputLayout(i));
}
}
PlanNode result;
if (!partitionedChildren.isEmpty() && unpartitionedChildren.isEmpty()) {
// parent does not have preference or prefers some partitioning without any explicit partitioning - just use
// children partitioning and don't GATHER partitioned inputs
// TODO: add FIXED_ARBITRARY_DISTRIBUTION support on non empty unpartitionedChildren
if (parentGlobal.isEmpty() || parentGlobal.get().isDistributed()) {
return arbitraryDistributeUnion(node, partitionedChildren, partitionedOutputLayouts);
}
// add a gathering exchange above partitioned inputs
result = new ExchangeNode(
idAllocator.getNextId(),
GATHER,
REMOTE,
new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), node.getOutputSymbols()),
partitionedChildren,
partitionedOutputLayouts,
Optional.empty());
}
else if (!unpartitionedChildren.isEmpty()) {
if (!partitionedChildren.isEmpty()) {
// add a gathering exchange above partitioned inputs and fold it into the set of unpartitioned inputs
// NOTE: new symbols for ExchangeNode output are required in order to keep plan logically correct with new local union below
List<Symbol> exchangeOutputLayout = node.getOutputSymbols().stream()
.map(outputSymbol -> symbolAllocator.newSymbol(outputSymbol.getName(), types.get(outputSymbol)))
.collect(toImmutableList());
result = new ExchangeNode(
idAllocator.getNextId(),
GATHER,
REMOTE,
new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), exchangeOutputLayout),
partitionedChildren,
partitionedOutputLayouts,
Optional.empty());
unpartitionedChildren.add(result);
unpartitionedOutputLayouts.add(result.getOutputSymbols());
}
ImmutableListMultimap.Builder<Symbol, Symbol> mappings = ImmutableListMultimap.builder();
for (int i = 0; i < node.getOutputSymbols().size(); i++) {
for (List<Symbol> outputLayout : unpartitionedOutputLayouts) {
mappings.put(node.getOutputSymbols().get(i), outputLayout.get(i));
}
}
// add local union for all unpartitioned inputs
result = new UnionNode(node.getId(), unpartitionedChildren, mappings.build(), ImmutableList.copyOf(mappings.build().keySet()));
}
else {
throw new IllegalStateException("both unpartitionedChildren partitionedChildren are empty");
}
return new PlanWithProperties(
result,
ActualProperties.builder()
.global(singleStreamPartition())
.build());
}
private PlanWithProperties arbitraryDistributeUnion(
UnionNode node,
List<PlanNode> partitionedChildren,
List<List<Symbol>> partitionedOutputLayouts)
{
// TODO: can we insert LOCAL exchange for one child SOURCE distributed and another HASH distributed?
if (countSources(partitionedChildren) == 0) {
// No source distributed child, we can use insert LOCAL exchange
// TODO: if all children have the same partitioning, pass this partitioning to the parent
// instead of "arbitraryPartition".
return new PlanWithProperties(node.replaceChildren(partitionedChildren));
}
else {
// Trino currently cannot execute stage that has multiple table scans, so in that case
// we have to insert REMOTE exchange with FIXED_ARBITRARY_DISTRIBUTION instead of local exchange
return new PlanWithProperties(
new ExchangeNode(
idAllocator.getNextId(),
REPARTITION,
REMOTE,
new PartitioningScheme(Partitioning.create(FIXED_ARBITRARY_DISTRIBUTION, ImmutableList.of()), node.getOutputSymbols()),
partitionedChildren,
partitionedOutputLayouts,
Optional.empty()));
}
}
@Override
public PlanWithProperties visitApply(ApplyNode node, PreferredProperties preferredProperties)
{
throw new IllegalStateException("Unexpected node: " + node.getClass().getName());
}
@Override
public PlanWithProperties visitCorrelatedJoin(CorrelatedJoinNode node, PreferredProperties preferredProperties)
{
throw new IllegalStateException("Unexpected node: " + node.getClass().getName());
}
private PlanWithProperties planChild(PlanNode node, PreferredProperties preferredProperties)
{
return getOnlyElement(node.getSources()).accept(this, preferredProperties);
}
private PlanWithProperties rebaseAndDeriveProperties(PlanNode node, PlanWithProperties child)
{
return withDerivedProperties(
ChildReplacer.replaceChildren(node, ImmutableList.of(child.getNode())),
child.getProperties());
}
private PlanWithProperties rebaseAndDeriveProperties(PlanNode node, List<PlanWithProperties> children)
{
PlanNode result = node.replaceChildren(
children.stream()
.map(PlanWithProperties::getNode)
.collect(toList()));
return new PlanWithProperties(result, deriveProperties(result, children.stream().map(PlanWithProperties::getProperties).collect(toList())));
}
private PlanWithProperties withDerivedProperties(PlanNode node, ActualProperties inputProperties)
{
return new PlanWithProperties(node, deriveProperties(node, inputProperties));
}
private ActualProperties deriveProperties(PlanNode result, ActualProperties inputProperties)
{
return deriveProperties(result, ImmutableList.of(inputProperties));
}
private ActualProperties deriveProperties(PlanNode result, List<ActualProperties> inputProperties)
{
// TODO: move this logic to PlanSanityChecker once PropertyDerivations.deriveProperties fully supports local exchanges
ActualProperties outputProperties = PropertyDerivations.deriveProperties(result, inputProperties, metadata, typeOperators, session, types, typeAnalyzer);
verify(result instanceof SemiJoinNode || inputProperties.stream().noneMatch(ActualProperties::isNullsAndAnyReplicated) || outputProperties.isNullsAndAnyReplicated(),
"SemiJoinNode is the only node that can strip null replication");
return outputProperties;
}
private ActualProperties derivePropertiesRecursively(PlanNode result)
{
return PropertyDerivations.derivePropertiesRecursively(result, metadata, typeOperators, session, types, typeAnalyzer);
}
private PreferredProperties computePreference(PreferredProperties preferredProperties, PreferredProperties parentPreferredProperties)
{
if (!ignoreDownStreamPreferences(session)) {
return preferredProperties.mergeWithParent(parentPreferredProperties);
}
return preferredProperties;
}
}
private static Map<Symbol, Symbol> computeIdentityTranslations(Assignments assignments)
{
Map<Symbol, Symbol> outputToInput = new HashMap<>();
for (Map.Entry<Symbol, Expression> assignment : assignments.getMap().entrySet()) {
if (assignment.getValue() instanceof SymbolReference) {
outputToInput.put(assignment.getKey(), Symbol.from(assignment.getValue()));
}
}
return outputToInput;
}
@VisibleForTesting
static class PlanWithProperties
{
private final PlanNode node;
private final ActualProperties properties;
public PlanWithProperties(PlanNode node)
{
this(node, ActualProperties.builder().build());
}
public PlanWithProperties(PlanNode node, ActualProperties properties)
{
this.node = node;
this.properties = properties;
}
public PlanNode getNode()
{
return node;
}
public ActualProperties getProperties()
{
return properties;
}
}
}
|
/**
* Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.component;
import java.net.URI;
import java.util.Map.Entry;
import org.fudgemsg.FudgeField;
import org.fudgemsg.FudgeMsg;
import org.fudgemsg.MutableFudgeMsg;
import org.fudgemsg.mapping.FudgeBuilder;
import org.fudgemsg.mapping.FudgeBuilderFor;
import org.fudgemsg.mapping.FudgeDeserializer;
import org.fudgemsg.mapping.FudgeSerializer;
import com.opengamma.util.fudgemsg.AbstractFudgeBuilder;
/**
* A Fudge builder for {@code ComponentInfo}.
* <p>
* This converts the data to and from the Fudge message protocol format.
*/
@FudgeBuilderFor(ComponentInfo.class)
public class ComponentInfoFudgeBuilder extends AbstractFudgeBuilder implements FudgeBuilder<ComponentInfo> {
/** Field name. */
public static final String TYPE_FIELD_NAME = "type";
/** Field name. */
public static final String CLASSIFIER_FIELD_NAME = "classifier";
/** Field name. */
public static final String URI_FIELD_NAME = "uri";
/** Field name. */
public static final String ATTRIBUTES_FIELD_NAME = "attributes";
@Override
public MutableFudgeMsg buildMessage(FudgeSerializer serializer, ComponentInfo object) {
final MutableFudgeMsg msg = serializer.newMessage();
ComponentInfoFudgeBuilder.toFudgeMsg(serializer, object, msg);
return msg;
}
public static MutableFudgeMsg toFudgeMsg(FudgeSerializer serializer, ComponentInfo object) {
final MutableFudgeMsg msg = serializer.newMessage();
ComponentInfoFudgeBuilder.toFudgeMsg(serializer, object, msg);
return msg;
}
public static void toFudgeMsg(FudgeSerializer serializer, ComponentInfo object, final MutableFudgeMsg msg) {
addToMessage(msg, TYPE_FIELD_NAME, object.getType().getName());
addToMessage(msg, CLASSIFIER_FIELD_NAME, object.getClassifier());
if (object.getUri() != null) {
addToMessage(msg, URI_FIELD_NAME, object.getUri().toString());
}
MutableFudgeMsg attributesMsg = serializer.newMessage();
for (Entry<String, String> entry : object.getAttributes().entrySet()) {
attributesMsg.add(entry.getKey(), entry.getValue());
}
addToMessage(msg, ATTRIBUTES_FIELD_NAME, attributesMsg);
}
@Override
public ComponentInfo buildObject(FudgeDeserializer deserializer, FudgeMsg msg) {
ComponentInfo object = new ComponentInfo();
ComponentInfoFudgeBuilder.fromFudgeMsg(deserializer, msg, object);
return object;
}
public static ComponentInfo fromFudgeMsg(FudgeDeserializer deserializer, FudgeMsg msg) {
ComponentInfo object = new ComponentInfo();
ComponentInfoFudgeBuilder.fromFudgeMsg(deserializer, msg, object);
return object;
}
public static void fromFudgeMsg(FudgeDeserializer deserializer, FudgeMsg msg, ComponentInfo object) {
String typeStr = msg.getString(TYPE_FIELD_NAME);
try {
object.setType(ComponentInfoFudgeBuilder.class.getClassLoader().loadClass(typeStr));
} catch (ClassNotFoundException ex) {
// ignore, as server may have classes that are not in the client classpath
object.setType(ClassNotFoundException.class);
object.addAttribute(ClassNotFoundException.class.getName(), typeStr);
}
object.setClassifier(msg.getString(CLASSIFIER_FIELD_NAME));
String uriStr = msg.getString(URI_FIELD_NAME);
if (uriStr != null) {
object.setUri(URI.create(uriStr));
}
FudgeMsg attributes = msg.getMessage(ATTRIBUTES_FIELD_NAME);
for (FudgeField field : attributes) {
object.addAttribute(field.getName(), field.getValue().toString());
}
}
}
|
package com.turn_based_game.view.cli;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Scanner;
public class Menu {
// Instance Variables
private PrintWriter out;
private Scanner in;
// Constructor
public Menu(InputStream input, OutputStream output) {
this.out = new PrintWriter(output);
this.in = new Scanner(input);
}
// Getters for derived attributes & other behavior methods
public Object getChoiceFromOptions(Object[] options) {
Object choice = null;
while (choice == null) {
displayMenuOptions(options);
choice = getChoiceFromUserInput(options);
}
return choice;
}
private Object getChoiceFromUserInput(Object[] options) {
Object choice = null;
String userInput = in.nextLine();
try {
int selectedOption = Integer.valueOf(userInput);
if (selectedOption > 0 && selectedOption <= options.length) {
choice = options[selectedOption - 1];
}
} catch (NumberFormatException e) {
// eat the exception, an error message will be displayed below since choice will be null
}
if (choice == null) {
out.println(System.lineSeparator() + "*** " + userInput + " is not a valid option ***" + System.lineSeparator());
}
return choice;
}
private void displayMenuOptions(Object[] options) {
out.println();
for (int i = 0; i < options.length; i++) {
int optionNum = i + 1;
out.println(optionNum + ") " + options[i]);
}
out.print(System.lineSeparator() + "Please choose an option >>> ");
out.flush();
}
}
|
/*
* MIT License
*
* Copyright (c) 2021 MASES s.r.l.
*
* 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.
*/
/**************************************************************************************
* <auto-generated>
* This code was generated from a template using JCOReflector
*
* Manual changes to this file may cause unexpected behavior in your application.
* Manual changes to this file will be overwritten if the code is regenerated.
* </auto-generated>
*************************************************************************************/
package system.web.ui.webcontrols;
import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;
// Import section
import system.web.ui.StateManagedCollection;
import system.web.ui.webcontrols.DataControlField;
import system.web.ui.webcontrols.DataControlFieldCollection;
import system.EventHandler;
/**
* The base .NET class managing System.Web.UI.WebControls.DataControlFieldCollection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
* <p>
*
* See: <a href="https://docs.microsoft.com/en-us/dotnet/api/System.Web.UI.WebControls.DataControlFieldCollection" target="_top">https://docs.microsoft.com/en-us/dotnet/api/System.Web.UI.WebControls.DataControlFieldCollection</a>
*/
public class DataControlFieldCollection extends StateManagedCollection {
/**
* Fully assembly qualified name: System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
*/
public static final String assemblyFullName = "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
/**
* Assembly name: System.Web
*/
public static final String assemblyShortName = "System.Web";
/**
* Qualified class name: System.Web.UI.WebControls.DataControlFieldCollection
*/
public static final String className = "System.Web.UI.WebControls.DataControlFieldCollection";
static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName);
/**
* The type managed from JCOBridge. See {@link JCType}
*/
public static JCType classType = createType();
static JCEnum enumInstance = null;
JCObject classInstance = null;
static JCType createType() {
try {
String classToCreate = className + ", "
+ (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
if (JCOReflector.getDebug())
JCOReflector.writeLog("Creating %s", classToCreate);
JCType typeCreated = bridge.GetType(classToCreate);
if (JCOReflector.getDebug())
JCOReflector.writeLog("Created: %s",
(typeCreated != null) ? typeCreated.toString() : "Returned null value");
return typeCreated;
} catch (JCException e) {
JCOReflector.writeLog(e);
return null;
}
}
void addReference(String ref) throws Throwable {
try {
bridge.AddReference(ref);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
/**
* Internal constructor. Use with caution
*/
public DataControlFieldCollection(java.lang.Object instance) throws Throwable {
super(instance);
if (instance instanceof JCObject) {
classInstance = (JCObject) instance;
} else
throw new Exception("Cannot manage object, it is not a JCObject");
}
public String getJCOAssemblyName() {
return assemblyFullName;
}
public String getJCOClassName() {
return className;
}
public String getJCOObjectName() {
return className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
}
public java.lang.Object getJCOInstance() {
return classInstance;
}
public void setJCOInstance(JCObject instance) {
classInstance = instance;
super.setJCOInstance(classInstance);
}
public JCType getJCOType() {
return classType;
}
/**
* Try to cast the {@link IJCOBridgeReflected} instance into {@link DataControlFieldCollection}, a cast assert is made to check if types are compatible.
* @param from {@link IJCOBridgeReflected} instance to be casted
* @return {@link DataControlFieldCollection} instance
* @throws java.lang.Throwable in case of error during cast operation
*/
public static DataControlFieldCollection cast(IJCOBridgeReflected from) throws Throwable {
NetType.AssertCast(classType, from);
return new DataControlFieldCollection(from.getJCOInstance());
}
// Constructors section
public DataControlFieldCollection() throws Throwable {
try {
// add reference to assemblyName.dll file
addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName);
setJCOInstance((JCObject)classType.NewObject());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Methods section
public boolean Contains(DataControlField field) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (boolean)classInstance.Invoke("Contains", field == null ? null : field.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public int IndexOf(DataControlField field) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
return (int)classInstance.Invoke("IndexOf", field == null ? null : field.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public DataControlFieldCollection CloneFields() throws Throwable, system.ArgumentNullException, system.ArgumentException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.NullReferenceException {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
JCObject objCloneFields = (JCObject)classInstance.Invoke("CloneFields");
return new DataControlFieldCollection(objCloneFields);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void Add(DataControlField field) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("Add", field == null ? null : field.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void CopyTo(DataControlField[] array, int index) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("CopyTo", toObjectFromArray(array), index);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void Insert(int index, DataControlField field) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("Insert", index, field == null ? null : field.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void Remove(DataControlField field) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("Remove", field == null ? null : field.getJCOInstance());
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void RemoveAt(int index) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.Invoke("RemoveAt", index);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
// Properties section
// Instance Events section
public void addFieldsChanged(EventHandler handler) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.RegisterEventListener("FieldsChanged", handler);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
public void removeFieldsChanged(EventHandler handler) throws Throwable {
if (classInstance == null)
throw new UnsupportedOperationException("classInstance is null.");
try {
classInstance.UnregisterEventListener("FieldsChanged", handler);
} catch (JCNativeException jcne) {
throw translateException(jcne);
}
}
}
|
/*
* Copyright (C) 2015, 程序亦非猿
*
* 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 me.yifeiyuan.transformers;
import android.support.v4.view.ViewPager;
import android.view.View;
/**
* Created by 程序亦非猿 on 16/5/10.
*
* -1 0 1 2
* 负无穷|left|手机屏幕|right|正无穷
*/
public abstract class BasePageTransformer implements ViewPager.PageTransformer ,Transformer{
@Override
public void transformPage(View page, float position) {
if (position < -1) { //[-infinity,-1)
onScreenOffToLeft(page, position);
} else if (position <= 0) { //[-1,0]
onLeftRange(page, position);
} else if (position <= 1) { //(0,1]
onRightRange(page, position);
} else { //(1,infinity]
onScreenOffToRight(page, position);
}
}
/**
* page在屏幕的左边 并且已经不可见了
*
* @param page
* @param position [-infinity,-1)
*/
public abstract void onScreenOffToLeft(View page, float position);
/**
* 在左边第一个屏幕以及手机屏幕之间移动
*
* @param page
* @param position [-1,0]
*/
public abstract void onLeftRange(View page, float position);
/**
* 在右边第一个屏幕以及手机屏幕之间移动
*
* @param page
* @param position (0,1]
*/
public abstract void onRightRange(View page, float position);
/**
* page在屏幕的右边 并且已经不可见了
*
* @param page
* @param position (1,infinity]
*/
public abstract void onScreenOffToRight(View page, float position);
}
|
/*
* Copyright 2018-2019 the original author or authors.
*
* 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.
*/
package org.springframework.cloud.sleuth.instrument.grpc.stubs;
public final class HelloServiceOuterClass {
static final com.google.protobuf.Descriptors.Descriptor internal_static_sample_grpc_HelloRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_sample_grpc_HelloRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor internal_static_sample_grpc_HelloReply_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_sample_grpc_HelloReply_fieldAccessorTable;
private static com.google.protobuf.Descriptors.FileDescriptor descriptor;
static {
java.lang.String[] descriptorData = {
"\n\022HelloService.proto\022\013sample.grpc\"\034\n\014Hel"
+ "loRequest\022\014\n\004name\030\001 \001(\t\"\035\n\nHelloReply\022\017\n"
+ "\007message\030\001 \001(\t2P\n\014HelloService\022@\n\010SayHel"
+ "lo\022\031.sample.grpc.HelloRequest\032\027.sample.g"
+ "rpc.HelloReply\"\000B\002P\001b\006proto3" };
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@Override
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {},
assigner);
internal_static_sample_grpc_HelloRequest_descriptor = getDescriptor()
.getMessageTypes().get(0);
internal_static_sample_grpc_HelloRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_sample_grpc_HelloRequest_descriptor,
new java.lang.String[] { "Name", });
internal_static_sample_grpc_HelloReply_descriptor = getDescriptor()
.getMessageTypes().get(1);
internal_static_sample_grpc_HelloReply_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_sample_grpc_HelloReply_descriptor,
new java.lang.String[] { "Message", });
}
private HelloServiceOuterClass() {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
}
public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
return descriptor;
}
// @@protoc_insertion_point(outer_class_scope)
}
|
package org.bian.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.Valid;
/**
* SDAccountRecoveryRetrieveOutputModelServiceDomainRetrieveActionRecordServiceDomainActivityAnalysis
*/
public class SDAccountRecoveryRetrieveOutputModelServiceDomainRetrieveActionRecordServiceDomainActivityAnalysis {
private String activityAnalysisReference = null;
private String activityAnalysisResult = null;
private String activityAnalysisReportType = null;
private Object activityAnalysisReport = null;
/**
* `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::ISO20022andUNCEFACT::Identifier general-info: Reference to the internal activity analysis view maintained by the service center
* @return activityAnalysisReference
**/
public String getActivityAnalysisReference() {
return activityAnalysisReference;
}
public void setActivityAnalysisReference(String activityAnalysisReference) {
this.activityAnalysisReference = activityAnalysisReference;
}
/**
* `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Text general-info: The results of the activity analysis that can be on-going, periodic and actual and projected
* @return activityAnalysisResult
**/
public String getActivityAnalysisResult() {
return activityAnalysisResult;
}
public void setActivityAnalysisResult(String activityAnalysisResult) {
this.activityAnalysisResult = activityAnalysisResult;
}
/**
* `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Code general-info: The type of activity analysis report available
* @return activityAnalysisReportType
**/
public String getActivityAnalysisReportType() {
return activityAnalysisReportType;
}
public void setActivityAnalysisReportType(String activityAnalysisReportType) {
this.activityAnalysisReportType = activityAnalysisReportType;
}
/**
* `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The activity analysis report in any suitable form including selection filters where appropriate
* @return activityAnalysisReport
**/
public Object getActivityAnalysisReport() {
return activityAnalysisReport;
}
public void setActivityAnalysisReport(Object activityAnalysisReport) {
this.activityAnalysisReport = activityAnalysisReport;
}
}
|
/*
* Token Requestor ID API
* An API that allows On-behalf of Token Requestors such as Payment Service Providers to bulk request TRIDs for their merchants.
*
* OpenAPI spec version: 1.0.0
* Contact: apisupport@mastercard.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.wallee.sdk.trid.auth;
import com.wallee.sdk.trid.Pair;
import java.util.Map;
import java.util.List;
public interface Authentication {
/**
* Apply authentication settings to header and query params.
*
* @param queryParams List of query parameters
* @param headerParams Map of header parameters
*/
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams);
}
|
package io.gomint.inventory.item;
import io.gomint.GoMint;
/**
* @author geNAZt
* @version 1.0
*/
public interface ItemPumpkinStem extends ItemStack {
/**
* Create a new item stack with given class and amount
*
* @param amount which is used for the creation
*/
static ItemPumpkinStem create( int amount ) {
return GoMint.instance().createItemStack( ItemPumpkinStem.class, amount );
}
}
|
// Copyright: Peter Sanders. All rights reserved.
// Date: 2017-10-11
package me.psanders.graph.path;
import me.psanders.graph.Graph;
public class HCycleFinder {
private Graph<String, Long> graph;
private OptimizationStrategy strategy;
public HCycleFinder(Graph<String, Long> graph, OptimizationStrategy strategy) {
this.graph = graph;
this.strategy = strategy;
}
public Cycle getOptimalCycle() {
if (graph == null) {
return null;
}
return strategy.getOptimalCycle(this.graph);
}
}
|
package org.ovirt.engine.ui.uicommonweb.models.datacenters;
import org.ovirt.engine.core.common.businessentities.StoragePool;
import org.ovirt.engine.core.common.businessentities.network.NetworkQoS;
import org.ovirt.engine.core.common.queries.ConfigurationValues;
import org.ovirt.engine.core.compat.Guid;
import org.ovirt.engine.ui.uicommonweb.UICommand;
import org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider;
import org.ovirt.engine.ui.uicommonweb.models.EntityModel;
import org.ovirt.engine.ui.uicommonweb.models.ListModel;
import org.ovirt.engine.ui.uicommonweb.models.Model;
import org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation;
import org.ovirt.engine.ui.uicommonweb.validation.IValidation;
import org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation;
import org.ovirt.engine.ui.uicompat.ConstantsManager;
public abstract class NetworkQoSModel extends BaseNetworkQosModel {
public static final NetworkQoS EMPTY_QOS;
static {
EMPTY_QOS = new NetworkQoS();
EMPTY_QOS.setName(ConstantsManager.getInstance().getConstants().unlimitedQoSTitle());
EMPTY_QOS.setId(Guid.Empty);
}
private final Model sourceModel;
private ListModel<StoragePool> dataCenters;
private EntityModel<String> name;
public NetworkQoSModel(Model sourceModel, StoragePool dataCenter) {
this.sourceModel = sourceModel;
setName(new EntityModel<String>());
setDataCenters(new ListModel<StoragePool>());
getDataCenters().setSelectedItem(dataCenter);
getDataCenters().setIsChangable(false);
getInbound().getAverage()
.setEntity((Integer) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSInboundAverageDefaultValue));
getInbound().getPeak()
.setEntity((Integer) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSInboundPeakDefaultValue));
getInbound().getBurst()
.setEntity((Integer) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSInboundBurstDefaultValue));
getOutbound().getAverage()
.setEntity((Integer) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSOutboundAverageDefaultValue));
getOutbound().getPeak()
.setEntity((Integer) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSOutboundPeakDefaultValue));
getOutbound().getBurst()
.setEntity((Integer) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.QoSOutboundBurstDefaultValue));
addCommands();
}
@Override
public boolean validate() {
super.validate();
getName().validateEntity(new IValidation[] { new NotEmptyValidation(), new AsciiNameValidation() });
setIsValid(getIsValid() && getName().getIsValid());
return getIsValid();
}
protected void addCommands() {
UICommand tempVar2 = new UICommand("OnSave", this); //$NON-NLS-1$
tempVar2.setTitle(ConstantsManager.getInstance().getConstants().ok());
tempVar2.setIsDefault(true);
getCommands().add(tempVar2);
UICommand tempVar3 = new UICommand("Cancel", this); //$NON-NLS-1$
tempVar3.setTitle(ConstantsManager.getInstance().getConstants().cancel());
tempVar3.setIsCancel(true);
getCommands().add(tempVar3);
}
public StoragePool getSelectedDc() {
return getDataCenters().getSelectedItem();
}
@Override
public NetworkQoS flush() {
super.flush();
networkQoS.setName((String) getName().getEntity());
networkQoS.setStoragePoolId(((StoragePool)getDataCenters().getSelectedItem()).getId());
return networkQoS;
}
protected abstract void executeSave();
protected void cancel() {
sourceModel.setWindow(null);
sourceModel.setConfirmWindow(null);
}
public void onSave() {
if (!validate()) {
return;
}
// Save changes.
flush();
// Execute all the required commands (detach, attach, update) to save the updates
executeSave();
}
@Override
public void executeCommand(UICommand command) {
super.executeCommand(command);
if ("OnSave".equals(command.getName())) { //$NON-NLS-1$
onSave();
} else if ("Cancel".equals(command.getName())) { //$NON-NLS-1$
cancel();
}
}
protected void postSaveAction(boolean succeeded) {
if (succeeded) {
cancel();
}
stopProgress();
}
public ListModel<StoragePool> getDataCenters() {
return dataCenters;
}
public void setDataCenters(ListModel<StoragePool> dataCenters) {
this.dataCenters = dataCenters;
}
public EntityModel<String> getName() {
return name;
}
public void setName(EntityModel<String> name) {
this.name = name;
}
}
|
package com.sphenon.basics.operations.classes;
/****************************************************************************
Copyright 2001-2018 Sphenon GmbH
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.
*****************************************************************************/
import com.sphenon.basics.context.*;
import com.sphenon.basics.debug.*;
import com.sphenon.basics.monitoring.*;
import com.sphenon.basics.processing.*;
import com.sphenon.ui.annotations.*;
import com.sphenon.basics.operations.*;
import java.io.PrintStream;
public class Execution_Basic implements Execution, Dumpable {
// static protected long all = 0;
public Execution_Basic (CallContext context) {
// all++;
// System.err.println("Basic: " + all);
}
public Execution_Basic (CallContext context, Instruction instruction, ProblemState problem_state, Problem problem, ActivityState activity_state, Progression progression, Record record) {
this.instruction = instruction;
this.problem_state = problem_state;
this.problem = problem;
this.activity_state = activity_state;
this.progression = progression;
this.record = record;
}
public Execution_Basic (CallContext context, Instruction instruction, ProblemState problem_state, Problem problem, ActivityState activity_state, Progression progression) {
this.instruction = instruction;
this.problem_state = problem_state;
this.problem = problem;
this.activity_state = activity_state;
this.progression = progression;
this.record = null;
}
public Execution_Basic (CallContext context, Instruction instruction, ProblemState problem_state, Problem problem, ActivityState activity_state) {
this.instruction = instruction;
this.problem_state = problem_state;
this.problem = problem;
this.activity_state = activity_state;
this.progression = null;
this.record = null;
}
static public Execution_Basic createExecutionSuccess(CallContext context) {
return new Execution_Basic (context, null, ProblemState.OK, (Problem) null, ActivityState.COMPLETED);
}
// static public Execution_Basic createExecutionSuccess(CallContext context, String instruction_description) {
// return new Execution_Basic (context, new Class_Instruction(context, instruction_description), ProblemState.OK, (Problem) null, ActivityState.COMPLETED);
// }
static public Execution_Basic createExecutionFailure(CallContext context, Throwable exception) {
return new Execution_Basic (context, null, ProblemState.ERROR, new ProblemException(context, exception), ActivityState.ABORTED);
}
static public Execution_Basic createExecutionFailure(CallContext context, ProblemState problem_state, Problem problem) {
return new Execution_Basic (context, null, problem_state, problem, ActivityState.ABORTED);
}
static public Execution_Basic createExecutionFailure(CallContext context, String problem_description) {
return new Execution_Basic (context, null, ProblemState.ERROR, new ProblemMessage(context, problem_description), ActivityState.ABORTED);
}
// static public Execution_Basic createExecutionFailure(CallContext context, String instruction_description, Throwable exception) {
// return new Execution_Basic (context, new Class_Instruction(context, instruction_description), ProblemState.ERROR, new ProblemException(context, exception), ActivityState.ABORTED);
// }
// static public Execution_Basic createExecutionSkipped(CallContext context) {
// return new Execution_Basic (context, null, ProblemState.IDLE_INCOMPLETE, (Problem) null, ActivityState.UNREADY, Class_Progression.NO_PROGRESS);
// }
// static public Execution_Basic createExecutionSkipped(CallContext context, String instruction_description) {
// return new Execution_Basic (context, new Class_Instruction(context, instruction_description), ProblemState.IDLE_INCOMPLETE, (Problem) null, ActivityState.UNREADY, Class_Progression.NO_PROGRESS);
// }
// static public Execution_Basic createExecutionInProgress(CallContext context) {
// return new Execution_Basic (context, null, ProblemState.IDLE_INCOMPLETE, (Problem) null, ActivityState.INPROGRESS, Class_Progression.NO_PROGRESS);
// }
// static public Execution_Basic createExecutionInProgress(CallContext context, String instruction_description) {
// return new Execution_Basic (context, new Class_Instruction(context, instruction_description), ProblemState.IDLE_INCOMPLETE, (Problem) null, ActivityState.INPROGRESS, Class_Progression.NO_PROGRESS);
// }
static public Execution_Basic createExecution(CallContext context, Instruction instruction, ProblemState problem_state, Problem problem, ActivityState activity_state, Progression progression, Record record) {
return new Execution_Basic(context, instruction, problem_state, problem, activity_state, progression, record);
}
// static public Execution_Basic createExecution(CallContext context, String instruction_description, ProblemState problem_state, Problem problem, ActivityState activity_state, Progression progression, Record record) {
// return new Execution_Basic(context, new Class_Instruction(context, instruction_description), problem_state, problem, activity_state, progression, record);
// }
public void setSuccess(CallContext context) {
this.setProblemState(context, ProblemState.OK);
this.setProblem(context, null);
this.setActivityState(context, ActivityState.COMPLETED);
}
public void setFailure(CallContext context, Throwable exception) {
this.setProblemState(context, ProblemState.ERROR);
this.setProblem(context, new ProblemException(context, exception));
this.setActivityState(context, ActivityState.ABORTED);
}
protected Instruction instruction;
public Instruction getInstruction (CallContext context) {
return this.instruction;
}
public void setInstruction (CallContext context, Instruction instruction) {
this.instruction = instruction;
}
protected ProblemState problem_state;
@UIAttribute(Name="ProblemState",Classifier="ProblemState")
public ProblemState getProblemState (CallContext context) {
return this.problem_state;
}
public void setProblemState (CallContext context, ProblemState problem_state) {
this.problem_state = problem_state;
}
protected Problem problem;
@UIAttribute(Name="Problem",Value="js:var value = instance.getProblem(context); Packages.com.sphenon.basics.debug.Dumper.dumpToString(context, null, value == null ? '' : value)",Classifier="Problem")
public Problem getProblem (CallContext context) {
return this.problem;
}
public void setProblem (CallContext context, Problem problem) {
this.problem = problem;
}
protected ActivityState activity_state;
@UIAttribute(Name="ActivityState",Classifier="ActivityState")
public ActivityState getActivityState (CallContext context) {
return this.activity_state;
}
public void setActivityState (CallContext context, ActivityState activity_state) {
this.activity_state = activity_state;
}
protected Progression progression;
@UIAttribute(Name="Progression",Classifier="Progression")
public Progression getProgression (CallContext context) {
return this.progression;
}
public void setProgression (CallContext context, Progression progression) {
this.progression = progression;
}
protected Record record;
@UIAttribute(Name="Record",Classifier="Record")
public Record getRecord (CallContext context) {
return this.record;
}
public void setRecord (CallContext context, Record record) {
this.record = record;
}
protected Performance performance;
@UIAttribute(Name="Performance",Value="js:var value = instance.getPerformance(context); Packages.com.sphenon.basics.debug.Dumper.dumpToString(context, null, value == null ? '' : value)",Classifier="Performance")
public Performance getPerformance (CallContext context) {
return this.performance;
}
public Execution wait (CallContext context) {
return this;
}
public String toString() {
return (this.instruction == null ? "" : this.instruction) + ":" + this.problem_state + "/" + this.activity_state + (this.progression != null ? ("/" + this.progression) : "") + (this.record != null ? ("/" + this.record) : "");
}
public void dump(CallContext context, DumpNode dump_node) {
dump_node.dump(context, "Execution ", this.problem_state + "/" + this.activity_state);
if (this.instruction != null) {
dump_node.dump(context, " Instruction ", this.instruction);
}
if (this.problem != null) {
dump_node.dump(context, " Problem ", this.problem);
}
if (this.progression != null) {
dump_node.dump(context, " Progression ", this.progression);
}
if (this.record != null) {
dump_node.dump(context, " Record ", this.record);
}
}
}
|
package com.apoem.mmxx.eventtracking.interfaces.dto.agent;
import com.apoem.mmxx.eventtracking.BaseConstants;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
/**
* <p>Project: Event Tracking </p>
* <p>Name: HouseRankingRequestDto </p>
* <p>Description: 经纪人房源排名DTO </p>
* <p>Date: 2020/8/10 8:54 </p>
* <p>Company: Apoem, Co. All Rights Reserved. </p>
*
* @author papafan
* @version v1.0
*/
@Data
public class HouseRankingRequestDto {
@ApiModelProperty(value = "经纪人", required = true, example = "909441")
@NotEmpty(message = "经纪人")
private String agentId;
@ApiModelProperty(value = "小区", required = true, example = "123")
@NotEmpty(message = "小区")
private String communityId;
/**
* 请求的时间(yyyy-MM-dd HH:mm:ss.SSS)
*/
@ApiModelProperty(value = "请求的时间(yyyy-MM-dd HH:mm:ss.SSS)", required = true, example = "2020-09-14 12:13:14.000")
@NotEmpty(message = "请求的时间(yyyy-MM-dd HH:mm:ss.SSS)")
@Pattern(regexp = BaseConstants.DATE_REGEX, message = "请求的时间(yyyy-MM-dd HH:mm:ss.SSS)")
private String acquireDate;
/**
* 范围
*/
@ApiModelProperty(value = "范围(全部-WHOLE、新房-NWHS、二手房-SHHS、租房-RTHS)", required = true, example = "SHHS")
@NotEmpty(message = "范围(全部-WHOLE、新房-NWHS、二手房-SHHS、租房-RTHS)")
private String scope;
/**
* 周期
*/
@ApiModelProperty(value = "周期(昨日-DAY1、七日-DAY7、三十日-DAY30)", required = true, example = "DAY1")
@NotEmpty(message = "周期(昨日-DAY1、七日-DAY7、三十日-DAY30)")
private String period;
/**
* 域
*/
@ApiModelProperty(value = "域(访问量-PVA、访问数-UVA、收藏-COLA、转发-RPSA)", required = true, example = "UVA")
@NotEmpty(message = "域(访问量-PVA、访问数-UVA、收藏-COLA、转发-RPSA)")
private String field;
/**
* 城市
*/
@ApiModelProperty(value = "城市", required = true, example = "fz")
@NotEmpty(message = "城市")
private String city;
}
|
package com.stylefeng.guns.rest.alipay.service;
import com.alipay.api.response.MonitorHeartbeatSynResponse;
import com.stylefeng.guns.rest.alipay.model.builder.AlipayHeartbeatSynRequestBuilder;
/**
* Created by liuyangkly on 15/10/22.
*/
public interface AlipayMonitorService {
// 交易保障接口 https://openhome.alipay.com/platform/document.htm#mobileApp-barcodePay-API-heartBeat
// 可以提供给系统商/pos厂商使用
public MonitorHeartbeatSynResponse heartbeatSyn(AlipayHeartbeatSynRequestBuilder builder);
}
|
package com.example.jooff.shuyi;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
|
package net.codeoftheday.uaa.util;
import org.apache.commons.lang3.RandomStringUtils;
public final class CodeGeneratorUtils {
private CodeGeneratorUtils() {
}
public static String generateActivationCode() {
return RandomStringUtils.randomAlphanumeric(16);
}
public static String generatePasswordResetCode() {
return RandomStringUtils.randomAlphanumeric(16);
}
public static String generatePassword() {
return RandomStringUtils.randomAlphanumeric(10);
}
}
|
/*
* 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 websocket.tc7.echo;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import org.apache.catalina.websocket.MessageInbound;
import org.apache.catalina.websocket.StreamInbound;
import org.apache.catalina.websocket.WebSocketServlet;
/**
* @deprecated See {@link websocket.echo.EchoAnnotation}
*/
@Deprecated
public class EchoMessage extends WebSocketServlet {
private static final long serialVersionUID = 1L;
private volatile int byteBufSize;
private volatile int charBufSize;
@Override
public void init() throws ServletException {
super.init();
byteBufSize = getInitParameterIntValue("byteBufferMaxSize", 2097152);
charBufSize = getInitParameterIntValue("charBufferMaxSize", 2097152);
}
public int getInitParameterIntValue(String name, int defaultValue) {
String val = this.getInitParameter(name);
int result;
if (null != val) {
try {
result = Integer.parseInt(val);
} catch (Exception x) {
result = defaultValue;
}
} else {
result = defaultValue;
}
return result;
}
@Override
protected StreamInbound createWebSocketInbound(String subProtocol, HttpServletRequest request) {
return new EchoMessageInbound(byteBufSize, charBufSize);
}
private static final class EchoMessageInbound extends MessageInbound {
public EchoMessageInbound(int byteBufferMaxSize, int charBufferMaxSize) {
super();
setByteBufferMaxSize(byteBufferMaxSize);
setCharBufferMaxSize(charBufferMaxSize);
}
@Override
protected void onBinaryMessage(ByteBuffer message) throws IOException {
getWsOutbound().writeBinaryMessage(message);
}
@Override
protected void onTextMessage(CharBuffer message) throws IOException {
getWsOutbound().writeTextMessage(message);
}
}
}
|
package edu.mssm.pharm.maayanlab.Harmonizome.util;
import java.util.Comparator;
import edu.mssm.pharm.maayanlab.Harmonizome.model.Download;
public class DownloadComparator implements Comparator<Download> {
@Override
public int compare(Download d1, Download d2) {
return d1.getDownloadType().getOrdering() > d2.getDownloadType().getOrdering() ? 1 : 0;
}
}
|
/*
* (C) Copyright 2018 Nuxeo (http://nuxeo.com/) and others.
*
* 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.
*
* Contributors:
* Funsho David
*/
package org.nuxeo.ecm.core.bulk.io;
/**
* Bulk constants for serialization.
*
* @since 10.3
*/
public class BulkConstants {
// BulkStatus
public static final String STATUS_ENTITY_TYPE = "bulkStatus";
public static final String STATUS_COMMAND_ID = "commandId";
public static final String STATUS_STATE = "state";
public static final String STATUS_SUBMIT_TIME = "submitted";
public static final String STATUS_SCROLL_START_TIME = "scrollStart";
public static final String STATUS_SCROLL_END_TIME = "scrollEnd";
public static final String STATUS_COMPLETED_TIME = "completed";
public static final String STATUS_PROCESSING_START_TIME = "processingStart";
public static final String STATUS_PROCESSING_END_TIME = "processingEnd";
public static final String STATUS_PROCESSING_MILLIS = "processingMillis";
public static final String STATUS_TOTAL = "total";
public static final String STATUS_ACTION = "action";
public static final String STATUS_PROCESSED = "processed";
public static final String STATUS_RESULT = "result";
public static final String STATUS_USERNAME = "username";
public static final String STATUS_HAS_ERROR = "error";
public static final String STATUS_ERROR_COUNT = "errorCount";
public static final String STATUS_ERROR_MESSAGE = "errorMessage";
// BulkCommand
public static final String COMMAND_ENTITY_TYPE = "bulkCommand";
public static final String COMMAND_USERNAME = STATUS_USERNAME;
public static final String COMMAND_REPOSITORY = "repository";
public static final String COMMAND_QUERY = "query";
public static final String COMMAND_ACTION = STATUS_ACTION;
public static final String COMMAND_PARAMS = "params";
public static final String COMMAND_BUCKET_SIZE = "bucket";
public static final String COMMAND_BATCH_SIZE = "batch";
private BulkConstants() {
// constants class
}
}
|
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.hardware.Servo;
import org.firstinspires.ftc.teamcode.lib.AutoController;
import org.firstinspires.ftc.teamcode.lib.Configurator;
import org.firstinspires.ftc.teamcode.lib.Timeout;
import org.firstinspires.ftc.teamcode.lib.WheelController;
import org.firstinspires.ftc.teamcode.lib.util.BooleanCommand;
@Autonomous(name="NearDepotSquare")
public class NearDepotSquare extends LinearOpMode {
Configurator config;
WheelController wheelController;
public void runOpMode(){
config = new Configurator(this);
wheelController = new WheelController(config);
Servo foundationGrabber;
foundationGrabber = hardwareMap.servo.get("foundationGrabber");
foundationGrabber.setPosition(1);
waitForStart();
//moves to the skybridge
wheelController.moveXY(0,0.5);
Timeout.waitUnlessInterrupt(1150, () -> (!opModeIsActive()));
//park
wheelController.stopWheels();
}
}
|
package org.codehaus.jackson.map.deser;
import java.util.concurrent.atomic.*;
import org.codehaus.jackson.map.ObjectMapper;
public class TestSimpleAtomicTypes
extends org.codehaus.jackson.map.BaseMapTest
{
public void testAtomicBoolean() throws Exception
{
ObjectMapper mapper = new ObjectMapper();
AtomicBoolean b = mapper.readValue("true", AtomicBoolean.class);
assertTrue(b.get());
}
public void testAtomicInt() throws Exception
{
ObjectMapper mapper = new ObjectMapper();
AtomicInteger value = mapper.readValue("13", AtomicInteger.class);
assertEquals(13, value.get());
}
public void testAtomicLong() throws Exception
{
ObjectMapper mapper = new ObjectMapper();
AtomicLong value = mapper.readValue("12345678901", AtomicLong.class);
assertEquals(12345678901L, value.get());
}
public void testAtomicReference() throws Exception
{
ObjectMapper mapper = new ObjectMapper();
AtomicReference<long[]> value = mapper.readValue("[1,2]",
new org.codehaus.jackson.type.TypeReference<AtomicReference<long[]>>() { });
Object ob = value.get();
assertNotNull(ob);
assertEquals(long[].class, ob.getClass());
long[] longs = (long[]) ob;
assertNotNull(longs);
assertEquals(2, longs.length);
assertEquals(1, longs[0]);
assertEquals(2, longs[1]);
}
}
|
package cz.cuni.mff.perestroika.perestroika_problem_25_3_0_3_0_2_1;
import cz.cuni.mff.jpddl.PDDLDeadEnd;
import cz.cuni.mff.perestroika.domain.Domain;
import cz.cuni.mff.perestroika.domain.State;
import cz.cuni.mff.perestroika.problem.PerestroikaProblem;
import cz.cuni.mff.perestroika.problem1.DeadEnd;
public final class Problem extends PerestroikaProblem {
static {
// ENSURE STATIC INITIALIZATION OF THE CLASSES
new E_Locations();
new E_Resources();
}
public Domain domain;
public State state;
public Goal goal;
public DeadEnd deadEnd;
public Problem() {
domain = new Domain();
state = new State();
goal = new Goal();
deadEnd = new DeadEnd();
state.p_ActRound.set();
state.p_Alive.set();
state.p_AtAgent.set(E_Locations.l_1_1);
state.p_AtRes.set(E_Resources.r97, E_Locations.l_18_8);
state.p_AtRes.set(E_Resources.r65, E_Locations.l_13_7);
state.p_AtRes.set(E_Resources.r10, E_Locations.l_3_3);
state.p_AtRes.set(E_Resources.r85, E_Locations.l_16_7);
state.p_AtRes.set(E_Resources.r115, E_Locations.l_21_18);
state.p_AtRes.set(E_Resources.r36, E_Locations.l_7_18);
state.p_AtRes.set(E_Resources.r84, E_Locations.l_16_3);
state.p_AtRes.set(E_Resources.r131, E_Locations.l_24_13);
state.p_AtRes.set(E_Resources.r3, E_Locations.l_1_9);
state.p_AtRes.set(E_Resources.r48, E_Locations.l_10_4);
state.p_AtRes.set(E_Resources.r68, E_Locations.l_13_22);
state.p_AtRes.set(E_Resources.r114, E_Locations.l_21_15);
state.p_AtRes.set(E_Resources.r111, E_Locations.l_20_9);
state.p_AtRes.set(E_Resources.r67, E_Locations.l_13_21);
state.p_AtRes.set(E_Resources.r58, E_Locations.l_12_4);
state.p_AtRes.set(E_Resources.r47, E_Locations.l_9_18);
state.p_AtRes.set(E_Resources.r32, E_Locations.l_7_2);
state.p_AtRes.set(E_Resources.r53, E_Locations.l_11_4);
state.p_AtRes.set(E_Resources.r1, E_Locations.l_1_2);
state.p_AtRes.set(E_Resources.r66, E_Locations.l_13_12);
state.p_AtRes.set(E_Resources.r125, E_Locations.l_23_13);
state.p_AtRes.set(E_Resources.r39, E_Locations.l_8_7);
state.p_AtRes.set(E_Resources.r105, E_Locations.l_19_2);
state.p_AtRes.set(E_Resources.r83, E_Locations.l_16_2);
state.p_AtRes.set(E_Resources.r122, E_Locations.l_22_23);
state.p_AtRes.set(E_Resources.r126, E_Locations.l_23_17);
state.p_AtRes.set(E_Resources.r15, E_Locations.l_4_1);
state.p_AtRes.set(E_Resources.r20, E_Locations.l_5_4);
state.p_AtRes.set(E_Resources.r106, E_Locations.l_19_11);
state.p_AtRes.set(E_Resources.r50, E_Locations.l_10_15);
state.p_AtRes.set(E_Resources.r136, E_Locations.l_25_9);
state.p_AtRes.set(E_Resources.r121, E_Locations.l_22_22);
state.p_AtRes.set(E_Resources.r54, E_Locations.l_11_7);
state.p_AtRes.set(E_Resources.r18, E_Locations.l_4_15);
state.p_AtRes.set(E_Resources.r89, E_Locations.l_16_20);
state.p_AtRes.set(E_Resources.r119, E_Locations.l_22_8);
state.p_AtRes.set(E_Resources.r12, E_Locations.l_3_13);
state.p_AtRes.set(E_Resources.r81, E_Locations.l_15_22);
state.p_AtRes.set(E_Resources.r74, E_Locations.l_14_18);
state.p_AtRes.set(E_Resources.r29, E_Locations.l_6_14);
state.p_AtRes.set(E_Resources.r22, E_Locations.l_5_12);
state.p_AtRes.set(E_Resources.r134, E_Locations.l_25_2);
state.p_AtRes.set(E_Resources.r71, E_Locations.l_14_6);
state.p_AtRes.set(E_Resources.r103, E_Locations.l_18_24);
state.p_AtRes.set(E_Resources.r61, E_Locations.l_12_13);
state.p_AtRes.set(E_Resources.r104, E_Locations.l_19_1);
state.p_AtRes.set(E_Resources.r109, E_Locations.l_19_24);
state.p_AtRes.set(E_Resources.r100, E_Locations.l_18_14);
state.p_AtRes.set(E_Resources.r46, E_Locations.l_9_9);
state.p_AtRes.set(E_Resources.r7, E_Locations.l_2_16);
state.p_AtRes.set(E_Resources.r23, E_Locations.l_5_14);
state.p_AtRes.set(E_Resources.r45, E_Locations.l_8_22);
state.p_AtRes.set(E_Resources.r52, E_Locations.l_10_22);
state.p_AtRes.set(E_Resources.r5, E_Locations.l_2_12);
state.p_AtRes.set(E_Resources.r112, E_Locations.l_21_2);
state.p_AtRes.set(E_Resources.r24, E_Locations.l_5_18);
state.p_AtRes.set(E_Resources.r44, E_Locations.l_8_15);
state.p_AtRes.set(E_Resources.r55, E_Locations.l_11_12);
state.p_AtRes.set(E_Resources.r73, E_Locations.l_14_15);
state.p_AtRes.set(E_Resources.r99, E_Locations.l_18_12);
state.p_AtRes.set(E_Resources.r34, E_Locations.l_7_14);
state.p_AtRes.set(E_Resources.r108, E_Locations.l_19_23);
state.p_AtRes.set(E_Resources.r27, E_Locations.l_6_9);
state.p_AtRes.set(E_Resources.r129, E_Locations.l_24_5);
state.p_AtRes.set(E_Resources.r14, E_Locations.l_3_22);
state.p_AtRes.set(E_Resources.r96, E_Locations.l_18_3);
state.p_AtRes.set(E_Resources.r133, E_Locations.l_24_25);
state.p_AtRes.set(E_Resources.r113, E_Locations.l_21_3);
state.p_AtRes.set(E_Resources.r110, E_Locations.l_19_25);
state.p_AtRes.set(E_Resources.r69, E_Locations.l_13_24);
state.p_AtRes.set(E_Resources.r30, E_Locations.l_6_15);
state.p_AtRes.set(E_Resources.r11, E_Locations.l_3_10);
state.p_AtRes.set(E_Resources.r28, E_Locations.l_6_12);
state.p_AtRes.set(E_Resources.r64, E_Locations.l_12_19);
state.p_AtRes.set(E_Resources.r77, E_Locations.l_15_7);
state.p_AtRes.set(E_Resources.r123, E_Locations.l_23_2);
state.p_AtRes.set(E_Resources.r135, E_Locations.l_25_8);
state.p_AtRes.set(E_Resources.r31, E_Locations.l_6_18);
state.p_AtRes.set(E_Resources.r98, E_Locations.l_18_9);
state.p_AtRes.set(E_Resources.r19, E_Locations.l_5_2);
state.p_AtRes.set(E_Resources.r13, E_Locations.l_3_16);
state.p_AtRes.set(E_Resources.r33, E_Locations.l_7_4);
state.p_AtRes.set(E_Resources.r86, E_Locations.l_16_8);
state.p_AtRes.set(E_Resources.r92, E_Locations.l_17_2);
state.p_AtRes.set(E_Resources.r124, E_Locations.l_23_5);
state.p_AtRes.set(E_Resources.r62, E_Locations.l_12_15);
state.p_AtRes.set(E_Resources.r72, E_Locations.l_14_11);
state.p_AtRes.set(E_Resources.r63, E_Locations.l_12_17);
state.p_AtRes.set(E_Resources.r78, E_Locations.l_15_13);
state.p_AtRes.set(E_Resources.r51, E_Locations.l_10_17);
state.p_AtRes.set(E_Resources.r43, E_Locations.l_8_12);
state.p_AtRes.set(E_Resources.r137, E_Locations.l_25_21);
state.p_AtRes.set(E_Resources.r2, E_Locations.l_1_6);
state.p_AtRes.set(E_Resources.r16, E_Locations.l_4_3);
state.p_AtRes.set(E_Resources.r35, E_Locations.l_7_17);
state.p_AtRes.set(E_Resources.r8, E_Locations.l_2_22);
state.p_AtRes.set(E_Resources.r26, E_Locations.l_5_24);
state.p_AtRes.set(E_Resources.r38, E_Locations.l_7_25);
state.p_AtRes.set(E_Resources.r87, E_Locations.l_16_16);
state.p_AtRes.set(E_Resources.r118, E_Locations.l_22_5);
state.p_AtRes.set(E_Resources.r56, E_Locations.l_11_18);
state.p_AtRes.set(E_Resources.r117, E_Locations.l_22_4);
state.p_AtRes.set(E_Resources.r76, E_Locations.l_15_4);
state.p_AtRes.set(E_Resources.r4, E_Locations.l_2_3);
state.p_AtRes.set(E_Resources.r120, E_Locations.l_22_21);
state.p_AtRes.set(E_Resources.r91, E_Locations.l_16_22);
state.p_AtRes.set(E_Resources.r40, E_Locations.l_8_8);
state.p_AtRes.set(E_Resources.r132, E_Locations.l_24_21);
state.p_AtRes.set(E_Resources.r90, E_Locations.l_16_21);
state.p_AtRes.set(E_Resources.r128, E_Locations.l_24_2);
state.p_AtRes.set(E_Resources.r59, E_Locations.l_12_9);
state.p_AtRes.set(E_Resources.r138, E_Locations.l_25_25);
state.p_AtRes.set(E_Resources.r49, E_Locations.l_10_8);
state.p_AtRes.set(E_Resources.r37, E_Locations.l_7_24);
state.p_AtRes.set(E_Resources.r82, E_Locations.l_15_25);
state.p_AtRes.set(E_Resources.r6, E_Locations.l_2_13);
state.p_AtRes.set(E_Resources.r21, E_Locations.l_5_9);
state.p_AtRes.set(E_Resources.r25, E_Locations.l_5_22);
state.p_AtRes.set(E_Resources.r42, E_Locations.l_8_11);
state.p_AtRes.set(E_Resources.r75, E_Locations.l_14_25);
state.p_AtRes.set(E_Resources.r107, E_Locations.l_19_12);
state.p_AtRes.set(E_Resources.r57, E_Locations.l_12_2);
state.p_AtRes.set(E_Resources.r101, E_Locations.l_18_16);
state.p_AtRes.set(E_Resources.r93, E_Locations.l_17_5);
state.p_AtRes.set(E_Resources.r17, E_Locations.l_4_6);
state.p_AtRes.set(E_Resources.r9, E_Locations.l_2_25);
state.p_AtRes.set(E_Resources.r130, E_Locations.l_24_10);
state.p_AtRes.set(E_Resources.r88, E_Locations.l_16_19);
state.p_AtRes.set(E_Resources.r95, E_Locations.l_17_19);
state.p_AtRes.set(E_Resources.r102, E_Locations.l_18_22);
state.p_AtRes.set(E_Resources.r79, E_Locations.l_15_15);
state.p_AtRes.set(E_Resources.r127, E_Locations.l_23_23);
state.p_AtRes.set(E_Resources.r60, E_Locations.l_12_10);
state.p_AtRes.set(E_Resources.r70, E_Locations.l_14_3);
state.p_AtRes.set(E_Resources.r41, E_Locations.l_8_10);
state.p_AtRes.set(E_Resources.r94, E_Locations.l_17_10);
state.p_AtRes.set(E_Resources.r80, E_Locations.l_15_19);
state.p_AtRes.set(E_Resources.r116, E_Locations.l_22_3);
state.p_Connected.set(E_Locations.l_9_9, E_Locations.l_10_9);
state.p_Connected.set(E_Locations.l_2_19, E_Locations.l_2_20);
state.p_Connected.set(E_Locations.l_2_22, E_Locations.l_2_21);
state.p_Connected.set(E_Locations.l_1_1, E_Locations.l_2_1);
state.p_Connected.set(E_Locations.l_8_3, E_Locations.l_8_2);
state.p_Connected.set(E_Locations.l_23_9, E_Locations.l_23_8);
state.p_Connected.set(E_Locations.l_10_20, E_Locations.l_11_20);
state.p_Connected.set(E_Locations.l_23_14, E_Locations.l_24_14);
state.p_Connected.set(E_Locations.l_15_2, E_Locations.l_15_3);
state.p_Connected.set(E_Locations.l_13_6, E_Locations.l_13_5);
state.p_Connected.set(E_Locations.l_15_13, E_Locations.l_16_13);
state.p_Connected.set(E_Locations.l_14_19, E_Locations.l_13_19);
state.p_Connected.set(E_Locations.l_18_18, E_Locations.l_18_17);
state.p_Connected.set(E_Locations.l_5_5, E_Locations.l_5_6);
state.p_Connected.set(E_Locations.l_21_16, E_Locations.l_20_16);
state.p_Connected.set(E_Locations.l_23_23, E_Locations.l_23_22);
state.p_Connected.set(E_Locations.l_17_15, E_Locations.l_17_14);
state.p_Connected.set(E_Locations.l_9_6, E_Locations.l_9_7);
state.p_Connected.set(E_Locations.l_24_22, E_Locations.l_24_21);
state.p_Connected.set(E_Locations.l_13_8, E_Locations.l_13_9);
state.p_Connected.set(E_Locations.l_21_12, E_Locations.l_21_13);
state.p_Connected.set(E_Locations.l_8_8, E_Locations.l_8_9);
state.p_Connected.set(E_Locations.l_7_17, E_Locations.l_6_17);
state.p_Connected.set(E_Locations.l_16_14, E_Locations.l_16_15);
state.p_Connected.set(E_Locations.l_25_3, E_Locations.l_25_4);
state.p_Connected.set(E_Locations.l_13_22, E_Locations.l_13_21);
state.p_Connected.set(E_Locations.l_22_1, E_Locations.l_21_1);
state.p_Connected.set(E_Locations.l_5_6, E_Locations.l_5_7);
state.p_Connected.set(E_Locations.l_13_15, E_Locations.l_13_16);
state.p_Connected.set(E_Locations.l_14_24, E_Locations.l_15_24);
state.p_Connected.set(E_Locations.l_11_4, E_Locations.l_11_3);
state.p_Connected.set(E_Locations.l_11_7, E_Locations.l_11_8);
state.p_Connected.set(E_Locations.l_25_22, E_Locations.l_24_22);
state.p_Connected.set(E_Locations.l_7_13, E_Locations.l_6_13);
state.p_Connected.set(E_Locations.l_11_24, E_Locations.l_11_23);
state.p_Connected.set(E_Locations.l_24_20, E_Locations.l_23_20);
state.p_Connected.set(E_Locations.l_21_16, E_Locations.l_21_17);
state.p_Connected.set(E_Locations.l_1_3, E_Locations.l_2_3);
state.p_Connected.set(E_Locations.l_24_2, E_Locations.l_24_1);
state.p_Connected.set(E_Locations.l_25_4, E_Locations.l_25_5);
state.p_Connected.set(E_Locations.l_22_14, E_Locations.l_22_13);
state.p_Connected.set(E_Locations.l_6_18, E_Locations.l_5_18);
state.p_Connected.set(E_Locations.l_9_1, E_Locations.l_9_2);
state.p_Connected.set(E_Locations.l_7_11, E_Locations.l_7_12);
state.p_Connected.set(E_Locations.l_12_22, E_Locations.l_12_23);
state.p_Connected.set(E_Locations.l_19_25, E_Locations.l_20_25);
state.p_Connected.set(E_Locations.l_20_22, E_Locations.l_19_22);
state.p_Connected.set(E_Locations.l_6_24, E_Locations.l_6_25);
state.p_Connected.set(E_Locations.l_24_22, E_Locations.l_23_22);
state.p_Connected.set(E_Locations.l_13_8, E_Locations.l_14_8);
state.p_Connected.set(E_Locations.l_11_2, E_Locations.l_11_3);
state.p_Connected.set(E_Locations.l_12_2, E_Locations.l_12_1);
state.p_Connected.set(E_Locations.l_3_3, E_Locations.l_3_4);
state.p_Connected.set(E_Locations.l_11_9, E_Locations.l_11_10);
state.p_Connected.set(E_Locations.l_7_3, E_Locations.l_7_2);
state.p_Connected.set(E_Locations.l_13_7, E_Locations.l_13_8);
state.p_Connected.set(E_Locations.l_4_21, E_Locations.l_3_21);
state.p_Connected.set(E_Locations.l_18_6, E_Locations.l_17_6);
state.p_Connected.set(E_Locations.l_2_18, E_Locations.l_3_18);
state.p_Connected.set(E_Locations.l_25_12, E_Locations.l_25_11);
state.p_Connected.set(E_Locations.l_24_20, E_Locations.l_24_19);
state.p_Connected.set(E_Locations.l_25_23, E_Locations.l_25_22);
state.p_Connected.set(E_Locations.l_23_19, E_Locations.l_24_19);
state.p_Connected.set(E_Locations.l_11_12, E_Locations.l_12_12);
state.p_Connected.set(E_Locations.l_11_22, E_Locations.l_10_22);
state.p_Connected.set(E_Locations.l_2_18, E_Locations.l_2_17);
state.p_Connected.set(E_Locations.l_13_23, E_Locations.l_12_23);
state.p_Connected.set(E_Locations.l_14_15, E_Locations.l_14_16);
state.p_Connected.set(E_Locations.l_11_19, E_Locations.l_10_19);
state.p_Connected.set(E_Locations.l_23_8, E_Locations.l_22_8);
state.p_Connected.set(E_Locations.l_3_11, E_Locations.l_3_10);
state.p_Connected.set(E_Locations.l_15_18, E_Locations.l_15_19);
state.p_Connected.set(E_Locations.l_23_16, E_Locations.l_23_17);
state.p_Connected.set(E_Locations.l_25_1, E_Locations.l_25_2);
state.p_Connected.set(E_Locations.l_20_21, E_Locations.l_20_22);
state.p_Connected.set(E_Locations.l_25_24, E_Locations.l_25_25);
state.p_Connected.set(E_Locations.l_13_5, E_Locations.l_14_5);
state.p_Connected.set(E_Locations.l_14_11, E_Locations.l_13_11);
state.p_Connected.set(E_Locations.l_25_17, E_Locations.l_25_16);
state.p_Connected.set(E_Locations.l_10_10, E_Locations.l_10_11);
state.p_Connected.set(E_Locations.l_18_20, E_Locations.l_19_20);
state.p_Connected.set(E_Locations.l_1_9, E_Locations.l_1_10);
state.p_Connected.set(E_Locations.l_21_1, E_Locations.l_20_1);
state.p_Connected.set(E_Locations.l_21_10, E_Locations.l_21_11);
state.p_Connected.set(E_Locations.l_7_9, E_Locations.l_7_10);
state.p_Connected.set(E_Locations.l_18_8, E_Locations.l_17_8);
state.p_Connected.set(E_Locations.l_23_1, E_Locations.l_23_2);
state.p_Connected.set(E_Locations.l_9_20, E_Locations.l_10_20);
state.p_Connected.set(E_Locations.l_20_16, E_Locations.l_20_15);
state.p_Connected.set(E_Locations.l_20_24, E_Locations.l_20_23);
state.p_Connected.set(E_Locations.l_12_17, E_Locations.l_12_16);
state.p_Connected.set(E_Locations.l_16_16, E_Locations.l_17_16);
state.p_Connected.set(E_Locations.l_22_2, E_Locations.l_22_3);
state.p_Connected.set(E_Locations.l_10_13, E_Locations.l_11_13);
state.p_Connected.set(E_Locations.l_17_24, E_Locations.l_18_24);
state.p_Connected.set(E_Locations.l_11_15, E_Locations.l_11_14);
state.p_Connected.set(E_Locations.l_17_4, E_Locations.l_18_4);
state.p_Connected.set(E_Locations.l_6_16, E_Locations.l_5_16);
state.p_Connected.set(E_Locations.l_10_12, E_Locations.l_10_11);
state.p_Connected.set(E_Locations.l_21_9, E_Locations.l_20_9);
state.p_Connected.set(E_Locations.l_6_9, E_Locations.l_5_9);
state.p_Connected.set(E_Locations.l_14_6, E_Locations.l_15_6);
state.p_Connected.set(E_Locations.l_18_2, E_Locations.l_17_2);
state.p_Connected.set(E_Locations.l_2_3, E_Locations.l_2_2);
state.p_Connected.set(E_Locations.l_10_24, E_Locations.l_10_23);
state.p_Connected.set(E_Locations.l_16_1, E_Locations.l_15_1);
state.p_Connected.set(E_Locations.l_7_5, E_Locations.l_8_5);
state.p_Connected.set(E_Locations.l_5_2, E_Locations.l_5_3);
state.p_Connected.set(E_Locations.l_9_2, E_Locations.l_9_3);
state.p_Connected.set(E_Locations.l_8_3, E_Locations.l_8_4);
state.p_Connected.set(E_Locations.l_11_3, E_Locations.l_12_3);
state.p_Connected.set(E_Locations.l_14_20, E_Locations.l_15_20);
state.p_Connected.set(E_Locations.l_19_20, E_Locations.l_20_20);
state.p_Connected.set(E_Locations.l_11_5, E_Locations.l_11_4);
state.p_Connected.set(E_Locations.l_13_3, E_Locations.l_12_3);
state.p_Connected.set(E_Locations.l_2_23, E_Locations.l_2_22);
state.p_Connected.set(E_Locations.l_20_5, E_Locations.l_21_5);
state.p_Connected.set(E_Locations.l_8_5, E_Locations.l_7_5);
state.p_Connected.set(E_Locations.l_17_6, E_Locations.l_16_6);
state.p_Connected.set(E_Locations.l_11_11, E_Locations.l_11_10);
state.p_Connected.set(E_Locations.l_17_11, E_Locations.l_17_12);
state.p_Connected.set(E_Locations.l_17_7, E_Locations.l_16_7);
state.p_Connected.set(E_Locations.l_15_19, E_Locations.l_15_18);
state.p_Connected.set(E_Locations.l_9_14, E_Locations.l_9_13);
state.p_Connected.set(E_Locations.l_7_21, E_Locations.l_7_22);
state.p_Connected.set(E_Locations.l_6_2, E_Locations.l_6_3);
state.p_Connected.set(E_Locations.l_14_9, E_Locations.l_14_10);
state.p_Connected.set(E_Locations.l_14_5, E_Locations.l_14_6);
state.p_Connected.set(E_Locations.l_24_4, E_Locations.l_25_4);
state.p_Connected.set(E_Locations.l_2_3, E_Locations.l_2_4);
state.p_Connected.set(E_Locations.l_5_4, E_Locations.l_5_3);
state.p_Connected.set(E_Locations.l_17_5, E_Locations.l_16_5);
state.p_Connected.set(E_Locations.l_5_7, E_Locations.l_5_6);
state.p_Connected.set(E_Locations.l_14_23, E_Locations.l_13_23);
state.p_Connected.set(E_Locations.l_8_9, E_Locations.l_8_10);
state.p_Connected.set(E_Locations.l_9_12, E_Locations.l_10_12);
state.p_Connected.set(E_Locations.l_18_19, E_Locations.l_18_18);
state.p_Connected.set(E_Locations.l_22_13, E_Locations.l_21_13);
state.p_Connected.set(E_Locations.l_5_23, E_Locations.l_6_23);
state.p_Connected.set(E_Locations.l_3_16, E_Locations.l_3_15);
state.p_Connected.set(E_Locations.l_14_10, E_Locations.l_14_9);
state.p_Connected.set(E_Locations.l_23_11, E_Locations.l_23_12);
state.p_Connected.set(E_Locations.l_16_3, E_Locations.l_16_2);
state.p_Connected.set(E_Locations.l_1_20, E_Locations.l_1_21);
state.p_Connected.set(E_Locations.l_6_8, E_Locations.l_6_7);
state.p_Connected.set(E_Locations.l_18_14, E_Locations.l_18_15);
state.p_Connected.set(E_Locations.l_2_9, E_Locations.l_2_8);
state.p_Connected.set(E_Locations.l_21_15, E_Locations.l_20_15);
state.p_Connected.set(E_Locations.l_4_3, E_Locations.l_5_3);
state.p_Connected.set(E_Locations.l_2_6, E_Locations.l_3_6);
state.p_Connected.set(E_Locations.l_12_25, E_Locations.l_13_25);
state.p_Connected.set(E_Locations.l_6_2, E_Locations.l_7_2);
state.p_Connected.set(E_Locations.l_21_8, E_Locations.l_20_8);
state.p_Connected.set(E_Locations.l_23_19, E_Locations.l_22_19);
state.p_Connected.set(E_Locations.l_5_20, E_Locations.l_5_19);
state.p_Connected.set(E_Locations.l_20_7, E_Locations.l_20_8);
state.p_Connected.set(E_Locations.l_3_24, E_Locations.l_2_24);
state.p_Connected.set(E_Locations.l_23_16, E_Locations.l_23_15);
state.p_Connected.set(E_Locations.l_4_2, E_Locations.l_3_2);
state.p_Connected.set(E_Locations.l_20_6, E_Locations.l_20_5);
state.p_Connected.set(E_Locations.l_4_22, E_Locations.l_3_22);
state.p_Connected.set(E_Locations.l_15_1, E_Locations.l_15_2);
state.p_Connected.set(E_Locations.l_6_17, E_Locations.l_5_17);
state.p_Connected.set(E_Locations.l_13_13, E_Locations.l_13_12);
state.p_Connected.set(E_Locations.l_23_4, E_Locations.l_23_5);
state.p_Connected.set(E_Locations.l_25_24, E_Locations.l_25_23);
state.p_Connected.set(E_Locations.l_22_7, E_Locations.l_23_7);
state.p_Connected.set(E_Locations.l_10_13, E_Locations.l_10_14);
state.p_Connected.set(E_Locations.l_2_16, E_Locations.l_2_15);
state.p_Connected.set(E_Locations.l_3_9, E_Locations.l_3_8);
state.p_Connected.set(E_Locations.l_4_16, E_Locations.l_4_15);
state.p_Connected.set(E_Locations.l_14_8, E_Locations.l_13_8);
state.p_Connected.set(E_Locations.l_10_8, E_Locations.l_9_8);
state.p_Connected.set(E_Locations.l_16_9, E_Locations.l_15_9);
state.p_Connected.set(E_Locations.l_25_21, E_Locations.l_25_22);
state.p_Connected.set(E_Locations.l_20_18, E_Locations.l_21_18);
state.p_Connected.set(E_Locations.l_8_10, E_Locations.l_7_10);
state.p_Connected.set(E_Locations.l_12_11, E_Locations.l_12_10);
state.p_Connected.set(E_Locations.l_24_2, E_Locations.l_24_3);
state.p_Connected.set(E_Locations.l_25_25, E_Locations.l_25_24);
state.p_Connected.set(E_Locations.l_9_23, E_Locations.l_9_22);
state.p_Connected.set(E_Locations.l_16_5, E_Locations.l_15_5);
state.p_Connected.set(E_Locations.l_7_15, E_Locations.l_6_15);
state.p_Connected.set(E_Locations.l_12_21, E_Locations.l_12_20);
state.p_Connected.set(E_Locations.l_3_18, E_Locations.l_3_17);
state.p_Connected.set(E_Locations.l_7_9, E_Locations.l_6_9);
state.p_Connected.set(E_Locations.l_8_23, E_Locations.l_7_23);
state.p_Connected.set(E_Locations.l_10_6, E_Locations.l_11_6);
state.p_Connected.set(E_Locations.l_14_19, E_Locations.l_14_20);
state.p_Connected.set(E_Locations.l_23_20, E_Locations.l_22_20);
state.p_Connected.set(E_Locations.l_20_14, E_Locations.l_20_15);
state.p_Connected.set(E_Locations.l_5_7, E_Locations.l_6_7);
state.p_Connected.set(E_Locations.l_14_10, E_Locations.l_13_10);
state.p_Connected.set(E_Locations.l_2_13, E_Locations.l_3_13);
state.p_Connected.set(E_Locations.l_16_13, E_Locations.l_16_14);
state.p_Connected.set(E_Locations.l_21_4, E_Locations.l_20_4);
state.p_Connected.set(E_Locations.l_21_7, E_Locations.l_21_6);
state.p_Connected.set(E_Locations.l_23_9, E_Locations.l_23_10);
state.p_Connected.set(E_Locations.l_3_20, E_Locations.l_3_21);
state.p_Connected.set(E_Locations.l_4_13, E_Locations.l_3_13);
state.p_Connected.set(E_Locations.l_13_11, E_Locations.l_12_11);
state.p_Connected.set(E_Locations.l_7_23, E_Locations.l_8_23);
state.p_Connected.set(E_Locations.l_9_19, E_Locations.l_8_19);
state.p_Connected.set(E_Locations.l_25_6, E_Locations.l_25_5);
state.p_Connected.set(E_Locations.l_6_1, E_Locations.l_5_1);
state.p_Connected.set(E_Locations.l_6_13, E_Locations.l_7_13);
state.p_Connected.set(E_Locations.l_17_7, E_Locations.l_17_6);
state.p_Connected.set(E_Locations.l_18_21, E_Locations.l_19_21);
state.p_Connected.set(E_Locations.l_6_13, E_Locations.l_6_14);
state.p_Connected.set(E_Locations.l_2_15, E_Locations.l_2_14);
state.p_Connected.set(E_Locations.l_7_1, E_Locations.l_8_1);
state.p_Connected.set(E_Locations.l_2_5, E_Locations.l_1_5);
state.p_Connected.set(E_Locations.l_19_19, E_Locations.l_20_19);
state.p_Connected.set(E_Locations.l_22_10, E_Locations.l_21_10);
state.p_Connected.set(E_Locations.l_11_4, E_Locations.l_10_4);
state.p_Connected.set(E_Locations.l_4_2, E_Locations.l_4_3);
state.p_Connected.set(E_Locations.l_20_18, E_Locations.l_19_18);
state.p_Connected.set(E_Locations.l_4_14, E_Locations.l_5_14);
state.p_Connected.set(E_Locations.l_12_10, E_Locations.l_12_11);
state.p_Connected.set(E_Locations.l_21_11, E_Locations.l_21_10);
state.p_Connected.set(E_Locations.l_19_22, E_Locations.l_20_22);
state.p_Connected.set(E_Locations.l_19_18, E_Locations.l_19_19);
state.p_Connected.set(E_Locations.l_2_15, E_Locations.l_1_15);
state.p_Connected.set(E_Locations.l_4_8, E_Locations.l_3_8);
state.p_Connected.set(E_Locations.l_7_7, E_Locations.l_7_6);
state.p_Connected.set(E_Locations.l_24_11, E_Locations.l_23_11);
state.p_Connected.set(E_Locations.l_18_15, E_Locations.l_19_15);
state.p_Connected.set(E_Locations.l_12_18, E_Locations.l_12_17);
state.p_Connected.set(E_Locations.l_9_21, E_Locations.l_9_22);
state.p_Connected.set(E_Locations.l_11_15, E_Locations.l_11_16);
state.p_Connected.set(E_Locations.l_3_11, E_Locations.l_3_12);
state.p_Connected.set(E_Locations.l_15_22, E_Locations.l_15_21);
state.p_Connected.set(E_Locations.l_7_16, E_Locations.l_7_17);
state.p_Connected.set(E_Locations.l_9_15, E_Locations.l_9_14);
state.p_Connected.set(E_Locations.l_14_7, E_Locations.l_14_6);
state.p_Connected.set(E_Locations.l_16_13, E_Locations.l_16_12);
state.p_Connected.set(E_Locations.l_10_9, E_Locations.l_11_9);
state.p_Connected.set(E_Locations.l_13_10, E_Locations.l_14_10);
state.p_Connected.set(E_Locations.l_13_10, E_Locations.l_13_9);
state.p_Connected.set(E_Locations.l_3_10, E_Locations.l_2_10);
state.p_Connected.set(E_Locations.l_4_7, E_Locations.l_3_7);
state.p_Connected.set(E_Locations.l_1_18, E_Locations.l_1_19);
state.p_Connected.set(E_Locations.l_25_19, E_Locations.l_25_20);
state.p_Connected.set(E_Locations.l_13_15, E_Locations.l_13_14);
state.p_Connected.set(E_Locations.l_4_20, E_Locations.l_4_19);
state.p_Connected.set(E_Locations.l_15_22, E_Locations.l_14_22);
state.p_Connected.set(E_Locations.l_15_24, E_Locations.l_16_24);
state.p_Connected.set(E_Locations.l_7_6, E_Locations.l_8_6);
state.p_Connected.set(E_Locations.l_12_21, E_Locations.l_13_21);
state.p_Connected.set(E_Locations.l_16_15, E_Locations.l_16_14);
state.p_Connected.set(E_Locations.l_17_24, E_Locations.l_17_25);
state.p_Connected.set(E_Locations.l_23_2, E_Locations.l_22_2);
state.p_Connected.set(E_Locations.l_19_5, E_Locations.l_19_6);
state.p_Connected.set(E_Locations.l_21_17, E_Locations.l_22_17);
state.p_Connected.set(E_Locations.l_9_23, E_Locations.l_8_23);
state.p_Connected.set(E_Locations.l_14_15, E_Locations.l_13_15);
state.p_Connected.set(E_Locations.l_22_16, E_Locations.l_22_15);
state.p_Connected.set(E_Locations.l_20_7, E_Locations.l_21_7);
state.p_Connected.set(E_Locations.l_7_1, E_Locations.l_6_1);
state.p_Connected.set(E_Locations.l_9_6, E_Locations.l_9_5);
state.p_Connected.set(E_Locations.l_13_4, E_Locations.l_13_3);
state.p_Connected.set(E_Locations.l_12_15, E_Locations.l_13_15);
state.p_Connected.set(E_Locations.l_4_19, E_Locations.l_4_18);
state.p_Connected.set(E_Locations.l_3_6, E_Locations.l_3_7);
state.p_Connected.set(E_Locations.l_23_10, E_Locations.l_22_10);
state.p_Connected.set(E_Locations.l_7_12, E_Locations.l_8_12);
state.p_Connected.set(E_Locations.l_24_6, E_Locations.l_24_7);
state.p_Connected.set(E_Locations.l_19_23, E_Locations.l_20_23);
state.p_Connected.set(E_Locations.l_12_19, E_Locations.l_11_19);
state.p_Connected.set(E_Locations.l_21_7, E_Locations.l_22_7);
state.p_Connected.set(E_Locations.l_1_17, E_Locations.l_1_16);
state.p_Connected.set(E_Locations.l_9_8, E_Locations.l_9_9);
state.p_Connected.set(E_Locations.l_21_7, E_Locations.l_21_8);
state.p_Connected.set(E_Locations.l_5_13, E_Locations.l_4_13);
state.p_Connected.set(E_Locations.l_5_6, E_Locations.l_4_6);
state.p_Connected.set(E_Locations.l_5_1, E_Locations.l_4_1);
state.p_Connected.set(E_Locations.l_5_9, E_Locations.l_4_9);
state.p_Connected.set(E_Locations.l_2_8, E_Locations.l_1_8);
state.p_Connected.set(E_Locations.l_4_4, E_Locations.l_4_3);
state.p_Connected.set(E_Locations.l_2_22, E_Locations.l_2_23);
state.p_Connected.set(E_Locations.l_13_20, E_Locations.l_13_19);
state.p_Connected.set(E_Locations.l_24_3, E_Locations.l_23_3);
state.p_Connected.set(E_Locations.l_18_17, E_Locations.l_17_17);
state.p_Connected.set(E_Locations.l_19_7, E_Locations.l_19_8);
state.p_Connected.set(E_Locations.l_19_5, E_Locations.l_19_4);
state.p_Connected.set(E_Locations.l_24_14, E_Locations.l_23_14);
state.p_Connected.set(E_Locations.l_13_24, E_Locations.l_13_23);
state.p_Connected.set(E_Locations.l_1_19, E_Locations.l_1_18);
state.p_Connected.set(E_Locations.l_4_4, E_Locations.l_4_5);
state.p_Connected.set(E_Locations.l_18_3, E_Locations.l_19_3);
state.p_Connected.set(E_Locations.l_4_5, E_Locations.l_4_4);
state.p_Connected.set(E_Locations.l_7_13, E_Locations.l_8_13);
state.p_Connected.set(E_Locations.l_3_20, E_Locations.l_2_20);
state.p_Connected.set(E_Locations.l_22_2, E_Locations.l_22_1);
state.p_Connected.set(E_Locations.l_14_6, E_Locations.l_14_5);
state.p_Connected.set(E_Locations.l_1_22, E_Locations.l_1_21);
state.p_Connected.set(E_Locations.l_5_23, E_Locations.l_4_23);
state.p_Connected.set(E_Locations.l_20_3, E_Locations.l_19_3);
state.p_Connected.set(E_Locations.l_4_16, E_Locations.l_4_17);
state.p_Connected.set(E_Locations.l_15_4, E_Locations.l_15_3);
state.p_Connected.set(E_Locations.l_14_7, E_Locations.l_13_7);
state.p_Connected.set(E_Locations.l_3_22, E_Locations.l_2_22);
state.p_Connected.set(E_Locations.l_7_18, E_Locations.l_7_19);
state.p_Connected.set(E_Locations.l_13_2, E_Locations.l_13_1);
state.p_Connected.set(E_Locations.l_4_4, E_Locations.l_3_4);
state.p_Connected.set(E_Locations.l_10_24, E_Locations.l_9_24);
state.p_Connected.set(E_Locations.l_2_2, E_Locations.l_3_2);
state.p_Connected.set(E_Locations.l_7_15, E_Locations.l_7_16);
state.p_Connected.set(E_Locations.l_12_15, E_Locations.l_12_16);
state.p_Connected.set(E_Locations.l_8_11, E_Locations.l_8_10);
state.p_Connected.set(E_Locations.l_21_10, E_Locations.l_20_10);
state.p_Connected.set(E_Locations.l_19_15, E_Locations.l_18_15);
state.p_Connected.set(E_Locations.l_7_2, E_Locations.l_8_2);
state.p_Connected.set(E_Locations.l_9_12, E_Locations.l_9_13);
state.p_Connected.set(E_Locations.l_3_10, E_Locations.l_3_11);
state.p_Connected.set(E_Locations.l_20_20, E_Locations.l_21_20);
state.p_Connected.set(E_Locations.l_3_13, E_Locations.l_2_13);
state.p_Connected.set(E_Locations.l_21_22, E_Locations.l_20_22);
state.p_Connected.set(E_Locations.l_9_9, E_Locations.l_9_10);
state.p_Connected.set(E_Locations.l_22_19, E_Locations.l_22_18);
state.p_Connected.set(E_Locations.l_20_17, E_Locations.l_19_17);
state.p_Connected.set(E_Locations.l_5_13, E_Locations.l_5_12);
state.p_Connected.set(E_Locations.l_15_2, E_Locations.l_14_2);
state.p_Connected.set(E_Locations.l_17_16, E_Locations.l_16_16);
state.p_Connected.set(E_Locations.l_3_21, E_Locations.l_4_21);
state.p_Connected.set(E_Locations.l_15_12, E_Locations.l_14_12);
state.p_Connected.set(E_Locations.l_13_3, E_Locations.l_13_4);
state.p_Connected.set(E_Locations.l_23_7, E_Locations.l_24_7);
state.p_Connected.set(E_Locations.l_3_13, E_Locations.l_4_13);
state.p_Connected.set(E_Locations.l_15_2, E_Locations.l_15_1);
state.p_Connected.set(E_Locations.l_5_23, E_Locations.l_5_24);
state.p_Connected.set(E_Locations.l_9_22, E_Locations.l_9_21);
state.p_Connected.set(E_Locations.l_16_4, E_Locations.l_17_4);
state.p_Connected.set(E_Locations.l_2_4, E_Locations.l_2_3);
state.p_Connected.set(E_Locations.l_18_17, E_Locations.l_19_17);
state.p_Connected.set(E_Locations.l_6_6, E_Locations.l_6_5);
state.p_Connected.set(E_Locations.l_18_4, E_Locations.l_18_5);
state.p_Connected.set(E_Locations.l_15_10, E_Locations.l_16_10);
state.p_Connected.set(E_Locations.l_15_11, E_Locations.l_14_11);
state.p_Connected.set(E_Locations.l_4_14, E_Locations.l_4_13);
state.p_Connected.set(E_Locations.l_6_2, E_Locations.l_5_2);
state.p_Connected.set(E_Locations.l_24_1, E_Locations.l_24_2);
state.p_Connected.set(E_Locations.l_1_18, E_Locations.l_1_17);
state.p_Connected.set(E_Locations.l_6_15, E_Locations.l_7_15);
state.p_Connected.set(E_Locations.l_18_25, E_Locations.l_18_24);
state.p_Connected.set(E_Locations.l_20_21, E_Locations.l_19_21);
state.p_Connected.set(E_Locations.l_23_22, E_Locations.l_24_22);
state.p_Connected.set(E_Locations.l_8_23, E_Locations.l_8_22);
state.p_Connected.set(E_Locations.l_20_2, E_Locations.l_20_3);
state.p_Connected.set(E_Locations.l_16_11, E_Locations.l_16_10);
state.p_Connected.set(E_Locations.l_24_19, E_Locations.l_25_19);
state.p_Connected.set(E_Locations.l_4_22, E_Locations.l_4_21);
state.p_Connected.set(E_Locations.l_9_4, E_Locations.l_10_4);
state.p_Connected.set(E_Locations.l_1_3, E_Locations.l_1_2);
state.p_Connected.set(E_Locations.l_18_7, E_Locations.l_18_6);
state.p_Connected.set(E_Locations.l_6_21, E_Locations.l_5_21);
state.p_Connected.set(E_Locations.l_12_10, E_Locations.l_13_10);
state.p_Connected.set(E_Locations.l_11_14, E_Locations.l_11_15);
state.p_Connected.set(E_Locations.l_10_11, E_Locations.l_11_11);
state.p_Connected.set(E_Locations.l_8_15, E_Locations.l_9_15);
state.p_Connected.set(E_Locations.l_6_4, E_Locations.l_6_3);
state.p_Connected.set(E_Locations.l_23_11, E_Locations.l_24_11);
state.p_Connected.set(E_Locations.l_17_8, E_Locations.l_18_8);
state.p_Connected.set(E_Locations.l_13_24, E_Locations.l_14_24);
state.p_Connected.set(E_Locations.l_11_14, E_Locations.l_11_13);
state.p_Connected.set(E_Locations.l_21_23, E_Locations.l_21_24);
state.p_Connected.set(E_Locations.l_25_7, E_Locations.l_25_8);
state.p_Connected.set(E_Locations.l_17_23, E_Locations.l_17_24);
state.p_Connected.set(E_Locations.l_12_2, E_Locations.l_12_3);
state.p_Connected.set(E_Locations.l_20_7, E_Locations.l_20_6);
state.p_Connected.set(E_Locations.l_16_7, E_Locations.l_16_6);
state.p_Connected.set(E_Locations.l_7_18, E_Locations.l_6_18);
state.p_Connected.set(E_Locations.l_7_2, E_Locations.l_7_3);
state.p_Connected.set(E_Locations.l_9_7, E_Locations.l_10_7);
state.p_Connected.set(E_Locations.l_22_10, E_Locations.l_23_10);
state.p_Connected.set(E_Locations.l_18_18, E_Locations.l_17_18);
state.p_Connected.set(E_Locations.l_24_9, E_Locations.l_23_9);
state.p_Connected.set(E_Locations.l_15_11, E_Locations.l_15_12);
state.p_Connected.set(E_Locations.l_25_12, E_Locations.l_24_12);
state.p_Connected.set(E_Locations.l_3_8, E_Locations.l_2_8);
state.p_Connected.set(E_Locations.l_13_6, E_Locations.l_13_7);
state.p_Connected.set(E_Locations.l_2_18, E_Locations.l_2_19);
state.p_Connected.set(E_Locations.l_11_5, E_Locations.l_12_5);
state.p_Connected.set(E_Locations.l_21_5, E_Locations.l_21_4);
state.p_Connected.set(E_Locations.l_16_21, E_Locations.l_16_20);
state.p_Connected.set(E_Locations.l_25_24, E_Locations.l_24_24);
state.p_Connected.set(E_Locations.l_9_13, E_Locations.l_9_12);
state.p_Connected.set(E_Locations.l_20_10, E_Locations.l_19_10);
state.p_Connected.set(E_Locations.l_9_22, E_Locations.l_10_22);
state.p_Connected.set(E_Locations.l_12_15, E_Locations.l_11_15);
state.p_Connected.set(E_Locations.l_16_13, E_Locations.l_17_13);
state.p_Connected.set(E_Locations.l_22_22, E_Locations.l_23_22);
state.p_Connected.set(E_Locations.l_11_1, E_Locations.l_11_2);
state.p_Connected.set(E_Locations.l_22_12, E_Locations.l_23_12);
state.p_Connected.set(E_Locations.l_7_8, E_Locations.l_6_8);
state.p_Connected.set(E_Locations.l_5_2, E_Locations.l_5_1);
state.p_Connected.set(E_Locations.l_12_12, E_Locations.l_12_13);
state.p_Connected.set(E_Locations.l_18_21, E_Locations.l_18_20);
state.p_Connected.set(E_Locations.l_7_16, E_Locations.l_6_16);
state.p_Connected.set(E_Locations.l_4_11, E_Locations.l_5_11);
state.p_Connected.set(E_Locations.l_12_9, E_Locations.l_11_9);
state.p_Connected.set(E_Locations.l_11_18, E_Locations.l_12_18);
state.p_Connected.set(E_Locations.l_15_10, E_Locations.l_15_11);
state.p_Connected.set(E_Locations.l_5_16, E_Locations.l_5_15);
state.p_Connected.set(E_Locations.l_22_21, E_Locations.l_22_20);
state.p_Connected.set(E_Locations.l_9_5, E_Locations.l_9_6);
state.p_Connected.set(E_Locations.l_7_17, E_Locations.l_8_17);
state.p_Connected.set(E_Locations.l_17_1, E_Locations.l_18_1);
state.p_Connected.set(E_Locations.l_9_16, E_Locations.l_9_15);
state.p_Connected.set(E_Locations.l_13_25, E_Locations.l_12_25);
state.p_Connected.set(E_Locations.l_23_17, E_Locations.l_24_17);
state.p_Connected.set(E_Locations.l_15_2, E_Locations.l_16_2);
state.p_Connected.set(E_Locations.l_10_11, E_Locations.l_10_12);
state.p_Connected.set(E_Locations.l_19_1, E_Locations.l_18_1);
state.p_Connected.set(E_Locations.l_13_21, E_Locations.l_14_21);
state.p_Connected.set(E_Locations.l_18_24, E_Locations.l_19_24);
state.p_Connected.set(E_Locations.l_22_8, E_Locations.l_23_8);
state.p_Connected.set(E_Locations.l_20_5, E_Locations.l_19_5);
state.p_Connected.set(E_Locations.l_11_25, E_Locations.l_11_24);
state.p_Connected.set(E_Locations.l_2_3, E_Locations.l_3_3);
state.p_Connected.set(E_Locations.l_20_23, E_Locations.l_20_24);
state.p_Connected.set(E_Locations.l_20_19, E_Locations.l_20_18);
state.p_Connected.set(E_Locations.l_23_19, E_Locations.l_23_20);
state.p_Connected.set(E_Locations.l_8_9, E_Locations.l_7_9);
state.p_Connected.set(E_Locations.l_8_20, E_Locations.l_9_20);
state.p_Connected.set(E_Locations.l_14_9, E_Locations.l_15_9);
state.p_Connected.set(E_Locations.l_9_3, E_Locations.l_9_2);
state.p_Connected.set(E_Locations.l_18_5, E_Locations.l_17_5);
state.p_Connected.set(E_Locations.l_16_12, E_Locations.l_16_13);
state.p_Connected.set(E_Locations.l_25_17, E_Locations.l_24_17);
state.p_Connected.set(E_Locations.l_8_22, E_Locations.l_8_23);
state.p_Connected.set(E_Locations.l_4_3, E_Locations.l_4_4);
state.p_Connected.set(E_Locations.l_25_11, E_Locations.l_25_12);
state.p_Connected.set(E_Locations.l_24_16, E_Locations.l_23_16);
state.p_Connected.set(E_Locations.l_8_4, E_Locations.l_9_4);
state.p_Connected.set(E_Locations.l_20_2, E_Locations.l_21_2);
state.p_Connected.set(E_Locations.l_18_10, E_Locations.l_19_10);
state.p_Connected.set(E_Locations.l_12_4, E_Locations.l_12_3);
state.p_Connected.set(E_Locations.l_10_20, E_Locations.l_10_19);
state.p_Connected.set(E_Locations.l_5_6, E_Locations.l_5_5);
state.p_Connected.set(E_Locations.l_17_11, E_Locations.l_17_10);
state.p_Connected.set(E_Locations.l_20_12, E_Locations.l_19_12);
state.p_Connected.set(E_Locations.l_24_4, E_Locations.l_23_4);
state.p_Connected.set(E_Locations.l_7_21, E_Locations.l_6_21);
state.p_Connected.set(E_Locations.l_2_25, E_Locations.l_3_25);
state.p_Connected.set(E_Locations.l_23_3, E_Locations.l_23_2);
state.p_Connected.set(E_Locations.l_18_20, E_Locations.l_18_21);
state.p_Connected.set(E_Locations.l_1_19, E_Locations.l_2_19);
state.p_Connected.set(E_Locations.l_1_12, E_Locations.l_2_12);
state.p_Connected.set(E_Locations.l_24_7, E_Locations.l_24_8);
state.p_Connected.set(E_Locations.l_18_5, E_Locations.l_18_4);
state.p_Connected.set(E_Locations.l_3_11, E_Locations.l_4_11);
state.p_Connected.set(E_Locations.l_5_15, E_Locations.l_4_15);
state.p_Connected.set(E_Locations.l_10_2, E_Locations.l_10_3);
state.p_Connected.set(E_Locations.l_10_13, E_Locations.l_10_12);
state.p_Connected.set(E_Locations.l_5_24, E_Locations.l_4_24);
state.p_Connected.set(E_Locations.l_13_19, E_Locations.l_13_20);
state.p_Connected.set(E_Locations.l_20_16, E_Locations.l_19_16);
state.p_Connected.set(E_Locations.l_16_20, E_Locations.l_16_21);
state.p_Connected.set(E_Locations.l_5_9, E_Locations.l_5_10);
state.p_Connected.set(E_Locations.l_18_16, E_Locations.l_18_17);
state.p_Connected.set(E_Locations.l_13_8, E_Locations.l_12_8);
state.p_Connected.set(E_Locations.l_18_22, E_Locations.l_18_21);
state.p_Connected.set(E_Locations.l_14_23, E_Locations.l_15_23);
state.p_Connected.set(E_Locations.l_21_17, E_Locations.l_21_16);
state.p_Connected.set(E_Locations.l_22_19, E_Locations.l_23_19);
state.p_Connected.set(E_Locations.l_24_22, E_Locations.l_24_23);
state.p_Connected.set(E_Locations.l_24_9, E_Locations.l_24_10);
state.p_Connected.set(E_Locations.l_3_20, E_Locations.l_4_20);
state.p_Connected.set(E_Locations.l_8_20, E_Locations.l_8_19);
state.p_Connected.set(E_Locations.l_16_5, E_Locations.l_16_4);
state.p_Connected.set(E_Locations.l_4_7, E_Locations.l_5_7);
state.p_Connected.set(E_Locations.l_6_18, E_Locations.l_6_17);
state.p_Connected.set(E_Locations.l_10_1, E_Locations.l_10_2);
state.p_Connected.set(E_Locations.l_12_9, E_Locations.l_12_10);
state.p_Connected.set(E_Locations.l_1_1, E_Locations.l_1_2);
state.p_Connected.set(E_Locations.l_8_2, E_Locations.l_9_2);
state.p_Connected.set(E_Locations.l_7_15, E_Locations.l_7_14);
state.p_Connected.set(E_Locations.l_17_22, E_Locations.l_16_22);
state.p_Connected.set(E_Locations.l_18_25, E_Locations.l_17_25);
state.p_Connected.set(E_Locations.l_6_23, E_Locations.l_7_23);
state.p_Connected.set(E_Locations.l_2_5, E_Locations.l_2_6);
state.p_Connected.set(E_Locations.l_8_11, E_Locations.l_7_11);
state.p_Connected.set(E_Locations.l_12_20, E_Locations.l_12_21);
state.p_Connected.set(E_Locations.l_21_2, E_Locations.l_20_2);
state.p_Connected.set(E_Locations.l_25_15, E_Locations.l_24_15);
state.p_Connected.set(E_Locations.l_16_11, E_Locations.l_16_12);
state.p_Connected.set(E_Locations.l_16_22, E_Locations.l_16_23);
state.p_Connected.set(E_Locations.l_6_9, E_Locations.l_6_10);
state.p_Connected.set(E_Locations.l_11_19, E_Locations.l_12_19);
state.p_Connected.set(E_Locations.l_23_14, E_Locations.l_23_13);
state.p_Connected.set(E_Locations.l_4_5, E_Locations.l_4_6);
state.p_Connected.set(E_Locations.l_25_2, E_Locations.l_24_2);
state.p_Connected.set(E_Locations.l_7_7, E_Locations.l_8_7);
state.p_Connected.set(E_Locations.l_24_24, E_Locations.l_25_24);
state.p_Connected.set(E_Locations.l_7_23, E_Locations.l_7_22);
state.p_Connected.set(E_Locations.l_24_8, E_Locations.l_24_7);
state.p_Connected.set(E_Locations.l_2_20, E_Locations.l_2_21);
state.p_Connected.set(E_Locations.l_12_13, E_Locations.l_12_12);
state.p_Connected.set(E_Locations.l_12_3, E_Locations.l_13_3);
state.p_Connected.set(E_Locations.l_4_13, E_Locations.l_4_12);
state.p_Connected.set(E_Locations.l_7_24, E_Locations.l_7_23);
state.p_Connected.set(E_Locations.l_12_15, E_Locations.l_12_14);
state.p_Connected.set(E_Locations.l_13_7, E_Locations.l_14_7);
state.p_Connected.set(E_Locations.l_17_14, E_Locations.l_17_13);
state.p_Connected.set(E_Locations.l_20_4, E_Locations.l_21_4);
state.p_Connected.set(E_Locations.l_18_16, E_Locations.l_19_16);
state.p_Connected.set(E_Locations.l_6_15, E_Locations.l_5_15);
state.p_Connected.set(E_Locations.l_17_18, E_Locations.l_17_19);
state.p_Connected.set(E_Locations.l_10_15, E_Locations.l_11_15);
state.p_Connected.set(E_Locations.l_9_2, E_Locations.l_9_1);
state.p_Connected.set(E_Locations.l_20_13, E_Locations.l_21_13);
state.p_Connected.set(E_Locations.l_15_21, E_Locations.l_15_20);
state.p_Connected.set(E_Locations.l_11_10, E_Locations.l_11_11);
state.p_Connected.set(E_Locations.l_13_6, E_Locations.l_14_6);
state.p_Connected.set(E_Locations.l_20_15, E_Locations.l_20_14);
state.p_Connected.set(E_Locations.l_10_18, E_Locations.l_9_18);
state.p_Connected.set(E_Locations.l_22_9, E_Locations.l_22_8);
state.p_Connected.set(E_Locations.l_2_6, E_Locations.l_2_7);
state.p_Connected.set(E_Locations.l_7_20, E_Locations.l_7_21);
state.p_Connected.set(E_Locations.l_20_17, E_Locations.l_21_17);
state.p_Connected.set(E_Locations.l_10_8, E_Locations.l_10_9);
state.p_Connected.set(E_Locations.l_8_12, E_Locations.l_7_12);
state.p_Connected.set(E_Locations.l_5_5, E_Locations.l_5_4);
state.p_Connected.set(E_Locations.l_2_2, E_Locations.l_2_1);
state.p_Connected.set(E_Locations.l_16_15, E_Locations.l_17_15);
state.p_Connected.set(E_Locations.l_23_8, E_Locations.l_24_8);
state.p_Connected.set(E_Locations.l_9_18, E_Locations.l_9_19);
state.p_Connected.set(E_Locations.l_14_14, E_Locations.l_15_14);
state.p_Connected.set(E_Locations.l_14_16, E_Locations.l_15_16);
state.p_Connected.set(E_Locations.l_7_4, E_Locations.l_6_4);
state.p_Connected.set(E_Locations.l_18_9, E_Locations.l_19_9);
state.p_Connected.set(E_Locations.l_22_24, E_Locations.l_22_25);
state.p_Connected.set(E_Locations.l_25_4, E_Locations.l_24_4);
state.p_Connected.set(E_Locations.l_5_13, E_Locations.l_5_14);
state.p_Connected.set(E_Locations.l_2_14, E_Locations.l_1_14);
state.p_Connected.set(E_Locations.l_4_25, E_Locations.l_3_25);
state.p_Connected.set(E_Locations.l_1_12, E_Locations.l_1_11);
state.p_Connected.set(E_Locations.l_4_21, E_Locations.l_4_20);
state.p_Connected.set(E_Locations.l_6_10, E_Locations.l_6_11);
state.p_Connected.set(E_Locations.l_13_8, E_Locations.l_13_7);
state.p_Connected.set(E_Locations.l_23_14, E_Locations.l_22_14);
state.p_Connected.set(E_Locations.l_10_17, E_Locations.l_10_18);
state.p_Connected.set(E_Locations.l_1_24, E_Locations.l_2_24);
state.p_Connected.set(E_Locations.l_3_19, E_Locations.l_2_19);
state.p_Connected.set(E_Locations.l_14_5, E_Locations.l_15_5);
state.p_Connected.set(E_Locations.l_14_10, E_Locations.l_15_10);
state.p_Connected.set(E_Locations.l_6_21, E_Locations.l_6_22);
state.p_Connected.set(E_Locations.l_2_14, E_Locations.l_2_13);
state.p_Connected.set(E_Locations.l_4_22, E_Locations.l_4_23);
state.p_Connected.set(E_Locations.l_14_9, E_Locations.l_14_8);
state.p_Connected.set(E_Locations.l_1_11, E_Locations.l_1_10);
state.p_Connected.set(E_Locations.l_17_23, E_Locations.l_17_22);
state.p_Connected.set(E_Locations.l_17_3, E_Locations.l_16_3);
state.p_Connected.set(E_Locations.l_19_16, E_Locations.l_20_16);
state.p_Connected.set(E_Locations.l_23_3, E_Locations.l_23_4);
state.p_Connected.set(E_Locations.l_5_16, E_Locations.l_4_16);
state.p_Connected.set(E_Locations.l_10_21, E_Locations.l_10_20);
state.p_Connected.set(E_Locations.l_24_21, E_Locations.l_23_21);
state.p_Connected.set(E_Locations.l_11_6, E_Locations.l_11_7);
state.p_Connected.set(E_Locations.l_18_17, E_Locations.l_18_18);
state.p_Connected.set(E_Locations.l_19_1, E_Locations.l_20_1);
state.p_Connected.set(E_Locations.l_20_12, E_Locations.l_21_12);
state.p_Connected.set(E_Locations.l_6_20, E_Locations.l_6_21);
state.p_Connected.set(E_Locations.l_24_17, E_Locations.l_24_16);
state.p_Connected.set(E_Locations.l_7_20, E_Locations.l_6_20);
state.p_Connected.set(E_Locations.l_8_6, E_Locations.l_8_5);
state.p_Connected.set(E_Locations.l_24_12, E_Locations.l_24_11);
state.p_Connected.set(E_Locations.l_2_12, E_Locations.l_1_12);
state.p_Connected.set(E_Locations.l_4_10, E_Locations.l_5_10);
state.p_Connected.set(E_Locations.l_9_17, E_Locations.l_9_16);
state.p_Connected.set(E_Locations.l_17_24, E_Locations.l_16_24);
state.p_Connected.set(E_Locations.l_13_11, E_Locations.l_13_12);
state.p_Connected.set(E_Locations.l_21_14, E_Locations.l_20_14);
state.p_Connected.set(E_Locations.l_4_17, E_Locations.l_3_17);
state.p_Connected.set(E_Locations.l_25_7, E_Locations.l_24_7);
state.p_Connected.set(E_Locations.l_1_15, E_Locations.l_1_16);
state.p_Connected.set(E_Locations.l_19_7, E_Locations.l_19_6);
state.p_Connected.set(E_Locations.l_8_12, E_Locations.l_8_11);
state.p_Connected.set(E_Locations.l_3_17, E_Locations.l_3_16);
state.p_Connected.set(E_Locations.l_8_10, E_Locations.l_8_11);
state.p_Connected.set(E_Locations.l_11_8, E_Locations.l_11_9);
state.p_Connected.set(E_Locations.l_8_2, E_Locations.l_7_2);
state.p_Connected.set(E_Locations.l_2_23, E_Locations.l_3_23);
state.p_Connected.set(E_Locations.l_12_18, E_Locations.l_12_19);
state.p_Connected.set(E_Locations.l_14_16, E_Locations.l_13_16);
state.p_Connected.set(E_Locations.l_11_3, E_Locations.l_11_4);
state.p_Connected.set(E_Locations.l_1_5, E_Locations.l_2_5);
state.p_Connected.set(E_Locations.l_18_12, E_Locations.l_19_12);
state.p_Connected.set(E_Locations.l_14_22, E_Locations.l_13_22);
state.p_Connected.set(E_Locations.l_24_16, E_Locations.l_24_17);
state.p_Connected.set(E_Locations.l_5_9, E_Locations.l_6_9);
state.p_Connected.set(E_Locations.l_9_14, E_Locations.l_9_15);
state.p_Connected.set(E_Locations.l_8_3, E_Locations.l_7_3);
state.p_Connected.set(E_Locations.l_6_15, E_Locations.l_6_14);
state.p_Connected.set(E_Locations.l_24_24, E_Locations.l_24_23);
state.p_Connected.set(E_Locations.l_9_5, E_Locations.l_8_5);
state.p_Connected.set(E_Locations.l_1_17, E_Locations.l_1_18);
state.p_Connected.set(E_Locations.l_4_19, E_Locations.l_4_20);
state.p_Connected.set(E_Locations.l_10_15, E_Locations.l_10_16);
state.p_Connected.set(E_Locations.l_17_2, E_Locations.l_16_2);
state.p_Connected.set(E_Locations.l_7_9, E_Locations.l_7_8);
state.p_Connected.set(E_Locations.l_3_6, E_Locations.l_4_6);
state.p_Connected.set(E_Locations.l_4_12, E_Locations.l_4_13);
state.p_Connected.set(E_Locations.l_3_12, E_Locations.l_4_12);
state.p_Connected.set(E_Locations.l_17_10, E_Locations.l_17_11);
state.p_Connected.set(E_Locations.l_2_7, E_Locations.l_2_6);
state.p_Connected.set(E_Locations.l_11_20, E_Locations.l_11_21);
state.p_Connected.set(E_Locations.l_18_13, E_Locations.l_17_13);
state.p_Connected.set(E_Locations.l_5_4, E_Locations.l_6_4);
state.p_Connected.set(E_Locations.l_1_6, E_Locations.l_1_5);
state.p_Connected.set(E_Locations.l_9_21, E_Locations.l_10_21);
state.p_Connected.set(E_Locations.l_15_8, E_Locations.l_15_7);
state.p_Connected.set(E_Locations.l_4_6, E_Locations.l_4_7);
state.p_Connected.set(E_Locations.l_12_17, E_Locations.l_12_18);
state.p_Connected.set(E_Locations.l_13_7, E_Locations.l_13_6);
state.p_Connected.set(E_Locations.l_8_19, E_Locations.l_8_20);
state.p_Connected.set(E_Locations.l_3_25, E_Locations.l_4_25);
state.p_Connected.set(E_Locations.l_3_15, E_Locations.l_2_15);
state.p_Connected.set(E_Locations.l_22_21, E_Locations.l_23_21);
state.p_Connected.set(E_Locations.l_12_14, E_Locations.l_11_14);
state.p_Connected.set(E_Locations.l_13_12, E_Locations.l_14_12);
state.p_Connected.set(E_Locations.l_17_22, E_Locations.l_18_22);
state.p_Connected.set(E_Locations.l_24_2, E_Locations.l_23_2);
state.p_Connected.set(E_Locations.l_12_12, E_Locations.l_11_12);
state.p_Connected.set(E_Locations.l_17_2, E_Locations.l_18_2);
state.p_Connected.set(E_Locations.l_9_24, E_Locations.l_9_25);
state.p_Connected.set(E_Locations.l_4_9, E_Locations.l_5_9);
state.p_Connected.set(E_Locations.l_7_24, E_Locations.l_7_25);
state.p_Connected.set(E_Locations.l_25_19, E_Locations.l_24_19);
state.p_Connected.set(E_Locations.l_22_6, E_Locations.l_22_5);
state.p_Connected.set(E_Locations.l_11_6, E_Locations.l_12_6);
state.p_Connected.set(E_Locations.l_10_19, E_Locations.l_9_19);
state.p_Connected.set(E_Locations.l_14_16, E_Locations.l_14_15);
state.p_Connected.set(E_Locations.l_8_18, E_Locations.l_8_17);
state.p_Connected.set(E_Locations.l_14_21, E_Locations.l_13_21);
state.p_Connected.set(E_Locations.l_21_9, E_Locations.l_21_8);
state.p_Connected.set(E_Locations.l_10_3, E_Locations.l_11_3);
state.p_Connected.set(E_Locations.l_18_6, E_Locations.l_19_6);
state.p_Connected.set(E_Locations.l_2_9, E_Locations.l_3_9);
state.p_Connected.set(E_Locations.l_10_17, E_Locations.l_10_16);
state.p_Connected.set(E_Locations.l_10_23, E_Locations.l_11_23);
state.p_Connected.set(E_Locations.l_19_2, E_Locations.l_19_1);
state.p_Connected.set(E_Locations.l_9_18, E_Locations.l_8_18);
state.p_Connected.set(E_Locations.l_11_7, E_Locations.l_10_7);
state.p_Connected.set(E_Locations.l_15_13, E_Locations.l_15_12);
state.p_Connected.set(E_Locations.l_16_24, E_Locations.l_16_23);
state.p_Connected.set(E_Locations.l_14_4, E_Locations.l_14_5);
state.p_Connected.set(E_Locations.l_8_24, E_Locations.l_8_25);
state.p_Connected.set(E_Locations.l_21_18, E_Locations.l_22_18);
state.p_Connected.set(E_Locations.l_12_9, E_Locations.l_12_8);
state.p_Connected.set(E_Locations.l_8_24, E_Locations.l_9_24);
state.p_Connected.set(E_Locations.l_7_10, E_Locations.l_7_9);
state.p_Connected.set(E_Locations.l_4_4, E_Locations.l_5_4);
state.p_Connected.set(E_Locations.l_10_9, E_Locations.l_10_8);
state.p_Connected.set(E_Locations.l_2_22, E_Locations.l_1_22);
state.p_Connected.set(E_Locations.l_15_16, E_Locations.l_15_15);
state.p_Connected.set(E_Locations.l_1_2, E_Locations.l_2_2);
state.p_Connected.set(E_Locations.l_9_19, E_Locations.l_9_20);
state.p_Connected.set(E_Locations.l_22_25, E_Locations.l_23_25);
state.p_Connected.set(E_Locations.l_5_11, E_Locations.l_4_11);
state.p_Connected.set(E_Locations.l_20_18, E_Locations.l_20_17);
state.p_Connected.set(E_Locations.l_12_5, E_Locations.l_12_6);
state.p_Connected.set(E_Locations.l_23_15, E_Locations.l_23_14);
state.p_Connected.set(E_Locations.l_17_6, E_Locations.l_17_5);
state.p_Connected.set(E_Locations.l_5_14, E_Locations.l_5_13);
state.p_Connected.set(E_Locations.l_19_9, E_Locations.l_20_9);
state.p_Connected.set(E_Locations.l_11_17, E_Locations.l_11_18);
state.p_Connected.set(E_Locations.l_3_7, E_Locations.l_4_7);
state.p_Connected.set(E_Locations.l_19_7, E_Locations.l_18_7);
state.p_Connected.set(E_Locations.l_2_4, E_Locations.l_3_4);
state.p_Connected.set(E_Locations.l_24_13, E_Locations.l_23_13);
state.p_Connected.set(E_Locations.l_3_11, E_Locations.l_2_11);
state.p_Connected.set(E_Locations.l_12_22, E_Locations.l_13_22);
state.p_Connected.set(E_Locations.l_15_6, E_Locations.l_14_6);
state.p_Connected.set(E_Locations.l_20_16, E_Locations.l_21_16);
state.p_Connected.set(E_Locations.l_8_17, E_Locations.l_8_18);
state.p_Connected.set(E_Locations.l_24_5, E_Locations.l_24_6);
state.p_Connected.set(E_Locations.l_11_13, E_Locations.l_11_12);
state.p_Connected.set(E_Locations.l_19_21, E_Locations.l_18_21);
state.p_Connected.set(E_Locations.l_10_8, E_Locations.l_10_7);
state.p_Connected.set(E_Locations.l_20_25, E_Locations.l_21_25);
state.p_Connected.set(E_Locations.l_5_15, E_Locations.l_5_16);
state.p_Connected.set(E_Locations.l_3_13, E_Locations.l_3_14);
state.p_Connected.set(E_Locations.l_3_4, E_Locations.l_2_4);
state.p_Connected.set(E_Locations.l_23_16, E_Locations.l_24_16);
state.p_Connected.set(E_Locations.l_10_10, E_Locations.l_10_9);
state.p_Connected.set(E_Locations.l_7_19, E_Locations.l_6_19);
state.p_Connected.set(E_Locations.l_4_8, E_Locations.l_5_8);
state.p_Connected.set(E_Locations.l_21_15, E_Locations.l_21_14);
state.p_Connected.set(E_Locations.l_15_15, E_Locations.l_14_15);
state.p_Connected.set(E_Locations.l_10_3, E_Locations.l_10_4);
state.p_Connected.set(E_Locations.l_7_21, E_Locations.l_7_20);
state.p_Connected.set(E_Locations.l_2_15, E_Locations.l_2_16);
state.p_Connected.set(E_Locations.l_8_5, E_Locations.l_8_6);
state.p_Connected.set(E_Locations.l_12_2, E_Locations.l_11_2);
state.p_Connected.set(E_Locations.l_21_13, E_Locations.l_21_14);
state.p_Connected.set(E_Locations.l_22_22, E_Locations.l_22_21);
state.p_Connected.set(E_Locations.l_22_20, E_Locations.l_23_20);
state.p_Connected.set(E_Locations.l_24_8, E_Locations.l_24_9);
state.p_Connected.set(E_Locations.l_6_4, E_Locations.l_5_4);
state.p_Connected.set(E_Locations.l_1_17, E_Locations.l_2_17);
state.p_Connected.set(E_Locations.l_13_9, E_Locations.l_12_9);
state.p_Connected.set(E_Locations.l_7_6, E_Locations.l_7_7);
state.p_Connected.set(E_Locations.l_24_11, E_Locations.l_25_11);
state.p_Connected.set(E_Locations.l_10_25, E_Locations.l_9_25);
state.p_Connected.set(E_Locations.l_20_16, E_Locations.l_20_17);
state.p_Connected.set(E_Locations.l_23_2, E_Locations.l_23_3);
state.p_Connected.set(E_Locations.l_12_5, E_Locations.l_13_5);
state.p_Connected.set(E_Locations.l_3_23, E_Locations.l_2_23);
state.p_Connected.set(E_Locations.l_12_11, E_Locations.l_12_12);
state.p_Connected.set(E_Locations.l_19_7, E_Locations.l_20_7);
state.p_Connected.set(E_Locations.l_8_1, E_Locations.l_7_1);
state.p_Connected.set(E_Locations.l_13_25, E_Locations.l_14_25);
state.p_Connected.set(E_Locations.l_22_17, E_Locations.l_21_17);
state.p_Connected.set(E_Locations.l_6_24, E_Locations.l_5_24);
state.p_Connected.set(E_Locations.l_13_18, E_Locations.l_13_17);
state.p_Connected.set(E_Locations.l_2_16, E_Locations.l_1_16);
state.p_Connected.set(E_Locations.l_7_11, E_Locations.l_8_11);
state.p_Connected.set(E_Locations.l_23_14, E_Locations.l_23_15);
state.p_Connected.set(E_Locations.l_14_18, E_Locations.l_13_18);
state.p_Connected.set(E_Locations.l_11_8, E_Locations.l_11_7);
state.p_Connected.set(E_Locations.l_17_2, E_Locations.l_17_3);
state.p_Connected.set(E_Locations.l_5_15, E_Locations.l_5_14);
state.p_Connected.set(E_Locations.l_17_13, E_Locations.l_18_13);
state.p_Connected.set(E_Locations.l_12_22, E_Locations.l_11_22);
state.p_Connected.set(E_Locations.l_6_16, E_Locations.l_7_16);
state.p_Connected.set(E_Locations.l_11_22, E_Locations.l_11_21);
state.p_Connected.set(E_Locations.l_3_16, E_Locations.l_4_16);
state.p_Connected.set(E_Locations.l_19_17, E_Locations.l_19_16);
state.p_Connected.set(E_Locations.l_1_20, E_Locations.l_1_19);
state.p_Connected.set(E_Locations.l_12_18, E_Locations.l_13_18);
state.p_Connected.set(E_Locations.l_16_23, E_Locations.l_16_24);
state.p_Connected.set(E_Locations.l_3_14, E_Locations.l_4_14);
state.p_Connected.set(E_Locations.l_20_14, E_Locations.l_19_14);
state.p_Connected.set(E_Locations.l_11_10, E_Locations.l_10_10);
state.p_Connected.set(E_Locations.l_9_9, E_Locations.l_8_9);
state.p_Connected.set(E_Locations.l_4_20, E_Locations.l_3_20);
state.p_Connected.set(E_Locations.l_18_13, E_Locations.l_18_14);
state.p_Connected.set(E_Locations.l_17_16, E_Locations.l_17_15);
state.p_Connected.set(E_Locations.l_2_11, E_Locations.l_2_10);
state.p_Connected.set(E_Locations.l_22_14, E_Locations.l_23_14);
state.p_Connected.set(E_Locations.l_14_6, E_Locations.l_14_7);
state.p_Connected.set(E_Locations.l_11_15, E_Locations.l_10_15);
state.p_Connected.set(E_Locations.l_4_23, E_Locations.l_4_22);
state.p_Connected.set(E_Locations.l_3_7, E_Locations.l_3_6);
state.p_Connected.set(E_Locations.l_22_24, E_Locations.l_23_24);
state.p_Connected.set(E_Locations.l_12_25, E_Locations.l_12_24);
state.p_Connected.set(E_Locations.l_23_1, E_Locations.l_24_1);
state.p_Connected.set(E_Locations.l_23_22, E_Locations.l_23_23);
state.p_Connected.set(E_Locations.l_22_1, E_Locations.l_22_2);
state.p_Connected.set(E_Locations.l_21_21, E_Locations.l_21_20);
state.p_Connected.set(E_Locations.l_11_17, E_Locations.l_12_17);
state.p_Connected.set(E_Locations.l_18_1, E_Locations.l_19_1);
state.p_Connected.set(E_Locations.l_10_2, E_Locations.l_10_1);
state.p_Connected.set(E_Locations.l_18_4, E_Locations.l_17_4);
state.p_Connected.set(E_Locations.l_4_18, E_Locations.l_3_18);
state.p_Connected.set(E_Locations.l_15_7, E_Locations.l_16_7);
state.p_Connected.set(E_Locations.l_21_25, E_Locations.l_20_25);
state.p_Connected.set(E_Locations.l_11_10, E_Locations.l_12_10);
state.p_Connected.set(E_Locations.l_11_13, E_Locations.l_12_13);
state.p_Connected.set(E_Locations.l_21_2, E_Locations.l_22_2);
state.p_Connected.set(E_Locations.l_18_11, E_Locations.l_17_11);
state.p_Connected.set(E_Locations.l_22_12, E_Locations.l_22_13);
state.p_Connected.set(E_Locations.l_24_5, E_Locations.l_25_5);
state.p_Connected.set(E_Locations.l_9_21, E_Locations.l_8_21);
state.p_Connected.set(E_Locations.l_22_20, E_Locations.l_21_20);
state.p_Connected.set(E_Locations.l_6_11, E_Locations.l_5_11);
state.p_Connected.set(E_Locations.l_14_18, E_Locations.l_15_18);
state.p_Connected.set(E_Locations.l_17_18, E_Locations.l_18_18);
state.p_Connected.set(E_Locations.l_23_5, E_Locations.l_24_5);
state.p_Connected.set(E_Locations.l_9_19, E_Locations.l_9_18);
state.p_Connected.set(E_Locations.l_15_24, E_Locations.l_15_23);
state.p_Connected.set(E_Locations.l_7_20, E_Locations.l_7_19);
state.p_Connected.set(E_Locations.l_13_19, E_Locations.l_14_19);
state.p_Connected.set(E_Locations.l_14_11, E_Locations.l_14_10);
state.p_Connected.set(E_Locations.l_5_10, E_Locations.l_5_9);
state.p_Connected.set(E_Locations.l_17_13, E_Locations.l_17_12);
state.p_Connected.set(E_Locations.l_11_7, E_Locations.l_11_6);
state.p_Connected.set(E_Locations.l_15_13, E_Locations.l_15_14);
state.p_Connected.set(E_Locations.l_14_12, E_Locations.l_15_12);
state.p_Connected.set(E_Locations.l_25_8, E_Locations.l_25_7);
state.p_Connected.set(E_Locations.l_7_14, E_Locations.l_7_15);
state.p_Connected.set(E_Locations.l_13_11, E_Locations.l_14_11);
state.p_Connected.set(E_Locations.l_4_16, E_Locations.l_5_16);
state.p_Connected.set(E_Locations.l_19_16, E_Locations.l_19_15);
state.p_Connected.set(E_Locations.l_10_14, E_Locations.l_9_14);
state.p_Connected.set(E_Locations.l_9_3, E_Locations.l_9_4);
state.p_Connected.set(E_Locations.l_17_15, E_Locations.l_16_15);
state.p_Connected.set(E_Locations.l_11_21, E_Locations.l_12_21);
state.p_Connected.set(E_Locations.l_1_2, E_Locations.l_1_1);
state.p_Connected.set(E_Locations.l_14_11, E_Locations.l_14_12);
state.p_Connected.set(E_Locations.l_18_3, E_Locations.l_18_4);
state.p_Connected.set(E_Locations.l_10_16, E_Locations.l_11_16);
state.p_Connected.set(E_Locations.l_16_21, E_Locations.l_16_22);
state.p_Connected.set(E_Locations.l_17_23, E_Locations.l_18_23);
state.p_Connected.set(E_Locations.l_3_10, E_Locations.l_4_10);
state.p_Connected.set(E_Locations.l_8_13, E_Locations.l_8_12);
state.p_Connected.set(E_Locations.l_5_14, E_Locations.l_5_15);
state.p_Connected.set(E_Locations.l_22_25, E_Locations.l_22_24);
state.p_Connected.set(E_Locations.l_4_24, E_Locations.l_5_24);
state.p_Connected.set(E_Locations.l_12_3, E_Locations.l_11_3);
state.p_Connected.set(E_Locations.l_3_8, E_Locations.l_3_9);
state.p_Connected.set(E_Locations.l_1_13, E_Locations.l_1_14);
state.p_Connected.set(E_Locations.l_15_11, E_Locations.l_15_10);
state.p_Connected.set(E_Locations.l_8_7, E_Locations.l_9_7);
state.p_Connected.set(E_Locations.l_12_19, E_Locations.l_12_20);
state.p_Connected.set(E_Locations.l_19_24, E_Locations.l_20_24);
state.p_Connected.set(E_Locations.l_9_2, E_Locations.l_10_2);
state.p_Connected.set(E_Locations.l_6_25, E_Locations.l_6_24);
state.p_Connected.set(E_Locations.l_19_17, E_Locations.l_20_17);
state.p_Connected.set(E_Locations.l_13_17, E_Locations.l_14_17);
state.p_Connected.set(E_Locations.l_15_25, E_Locations.l_15_24);
state.p_Connected.set(E_Locations.l_6_22, E_Locations.l_6_23);
state.p_Connected.set(E_Locations.l_2_22, E_Locations.l_3_22);
state.p_Connected.set(E_Locations.l_21_15, E_Locations.l_22_15);
state.p_Connected.set(E_Locations.l_8_21, E_Locations.l_8_22);
state.p_Connected.set(E_Locations.l_21_13, E_Locations.l_22_13);
state.p_Connected.set(E_Locations.l_5_10, E_Locations.l_5_11);
state.p_Connected.set(E_Locations.l_8_6, E_Locations.l_7_6);
state.p_Connected.set(E_Locations.l_1_25, E_Locations.l_1_24);
state.p_Connected.set(E_Locations.l_8_22, E_Locations.l_9_22);
state.p_Connected.set(E_Locations.l_11_20, E_Locations.l_12_20);
state.p_Connected.set(E_Locations.l_5_5, E_Locations.l_4_5);
state.p_Connected.set(E_Locations.l_3_21, E_Locations.l_2_21);
state.p_Connected.set(E_Locations.l_23_12, E_Locations.l_23_13);
state.p_Connected.set(E_Locations.l_2_1, E_Locations.l_1_1);
state.p_Connected.set(E_Locations.l_4_14, E_Locations.l_3_14);
state.p_Connected.set(E_Locations.l_5_18, E_Locations.l_4_18);
state.p_Connected.set(E_Locations.l_12_24, E_Locations.l_11_24);
state.p_Connected.set(E_Locations.l_24_14, E_Locations.l_24_13);
state.p_Connected.set(E_Locations.l_20_23, E_Locations.l_21_23);
state.p_Connected.set(E_Locations.l_5_17, E_Locations.l_5_16);
state.p_Connected.set(E_Locations.l_19_12, E_Locations.l_18_12);
state.p_Connected.set(E_Locations.l_11_9, E_Locations.l_12_9);
state.p_Connected.set(E_Locations.l_1_7, E_Locations.l_1_8);
state.p_Connected.set(E_Locations.l_10_20, E_Locations.l_9_20);
state.p_Connected.set(E_Locations.l_16_25, E_Locations.l_15_25);
state.p_Connected.set(E_Locations.l_20_12, E_Locations.l_20_13);
state.p_Connected.set(E_Locations.l_2_23, E_Locations.l_1_23);
state.p_Connected.set(E_Locations.l_12_8, E_Locations.l_12_9);
state.p_Connected.set(E_Locations.l_18_14, E_Locations.l_19_14);
state.p_Connected.set(E_Locations.l_9_25, E_Locations.l_10_25);
state.p_Connected.set(E_Locations.l_16_9, E_Locations.l_16_8);
state.p_Connected.set(E_Locations.l_4_20, E_Locations.l_4_21);
state.p_Connected.set(E_Locations.l_2_17, E_Locations.l_1_17);
state.p_Connected.set(E_Locations.l_22_2, E_Locations.l_23_2);
state.p_Connected.set(E_Locations.l_19_8, E_Locations.l_19_7);
state.p_Connected.set(E_Locations.l_19_12, E_Locations.l_19_13);
state.p_Connected.set(E_Locations.l_5_25, E_Locations.l_6_25);
state.p_Connected.set(E_Locations.l_5_21, E_Locations.l_6_21);
state.p_Connected.set(E_Locations.l_12_6, E_Locations.l_12_7);
state.p_Connected.set(E_Locations.l_18_10, E_Locations.l_18_9);
state.p_Connected.set(E_Locations.l_4_20, E_Locations.l_5_20);
state.p_Connected.set(E_Locations.l_22_17, E_Locations.l_22_16);
state.p_Connected.set(E_Locations.l_4_12, E_Locations.l_5_12);
state.p_Connected.set(E_Locations.l_24_19, E_Locations.l_24_20);
state.p_Connected.set(E_Locations.l_16_5, E_Locations.l_16_6);
state.p_Connected.set(E_Locations.l_19_4, E_Locations.l_19_3);
state.p_Connected.set(E_Locations.l_23_23, E_Locations.l_23_24);
state.p_Connected.set(E_Locations.l_14_20, E_Locations.l_14_21);
state.p_Connected.set(E_Locations.l_10_10, E_Locations.l_9_10);
state.p_Connected.set(E_Locations.l_11_19, E_Locations.l_11_18);
state.p_Connected.set(E_Locations.l_13_22, E_Locations.l_12_22);
state.p_Connected.set(E_Locations.l_7_19, E_Locations.l_7_18);
state.p_Connected.set(E_Locations.l_22_4, E_Locations.l_22_3);
state.p_Connected.set(E_Locations.l_24_4, E_Locations.l_24_3);
state.p_Connected.set(E_Locations.l_7_17, E_Locations.l_7_18);
state.p_Connected.set(E_Locations.l_21_11, E_Locations.l_22_11);
state.p_Connected.set(E_Locations.l_10_24, E_Locations.l_10_25);
state.p_Connected.set(E_Locations.l_8_18, E_Locations.l_8_19);
state.p_Connected.set(E_Locations.l_18_14, E_Locations.l_18_13);
state.p_Connected.set(E_Locations.l_3_1, E_Locations.l_3_2);
state.p_Connected.set(E_Locations.l_4_9, E_Locations.l_4_8);
state.p_Connected.set(E_Locations.l_22_12, E_Locations.l_22_11);
state.p_Connected.set(E_Locations.l_7_25, E_Locations.l_8_25);
state.p_Connected.set(E_Locations.l_19_4, E_Locations.l_19_5);
state.p_Connected.set(E_Locations.l_19_20, E_Locations.l_18_20);
state.p_Connected.set(E_Locations.l_5_17, E_Locations.l_5_18);
state.p_Connected.set(E_Locations.l_15_17, E_Locations.l_15_18);
state.p_Connected.set(E_Locations.l_11_24, E_Locations.l_11_25);
state.p_Connected.set(E_Locations.l_23_22, E_Locations.l_22_22);
state.p_Connected.set(E_Locations.l_19_2, E_Locations.l_20_2);
state.p_Connected.set(E_Locations.l_8_20, E_Locations.l_7_20);
state.p_Connected.set(E_Locations.l_18_3, E_Locations.l_18_2);
state.p_Connected.set(E_Locations.l_10_17, E_Locations.l_9_17);
state.p_Connected.set(E_Locations.l_11_8, E_Locations.l_10_8);
state.p_Connected.set(E_Locations.l_15_24, E_Locations.l_14_24);
state.p_Connected.set(E_Locations.l_7_11, E_Locations.l_6_11);
state.p_Connected.set(E_Locations.l_21_18, E_Locations.l_20_18);
state.p_Connected.set(E_Locations.l_22_4, E_Locations.l_22_5);
state.p_Connected.set(E_Locations.l_7_10, E_Locations.l_8_10);
state.p_Connected.set(E_Locations.l_3_18, E_Locations.l_2_18);
state.p_Connected.set(E_Locations.l_6_5, E_Locations.l_5_5);
state.p_Connected.set(E_Locations.l_5_22, E_Locations.l_5_23);
state.p_Connected.set(E_Locations.l_18_4, E_Locations.l_19_4);
state.p_Connected.set(E_Locations.l_9_12, E_Locations.l_9_11);
state.p_Connected.set(E_Locations.l_17_1, E_Locations.l_16_1);
state.p_Connected.set(E_Locations.l_9_25, E_Locations.l_8_25);
state.p_Connected.set(E_Locations.l_11_23, E_Locations.l_11_22);
state.p_Connected.set(E_Locations.l_14_3, E_Locations.l_13_3);
state.p_Connected.set(E_Locations.l_13_23, E_Locations.l_13_22);
state.p_Connected.set(E_Locations.l_15_19, E_Locations.l_16_19);
state.p_Connected.set(E_Locations.l_23_23, E_Locations.l_24_23);
state.p_Connected.set(E_Locations.l_11_25, E_Locations.l_10_25);
state.p_Connected.set(E_Locations.l_16_5, E_Locations.l_17_5);
state.p_Connected.set(E_Locations.l_15_23, E_Locations.l_15_22);
state.p_Connected.set(E_Locations.l_16_6, E_Locations.l_16_7);
state.p_Connected.set(E_Locations.l_21_7, E_Locations.l_20_7);
state.p_Connected.set(E_Locations.l_11_4, E_Locations.l_12_4);
state.p_Connected.set(E_Locations.l_18_8, E_Locations.l_19_8);
state.p_Connected.set(E_Locations.l_8_6, E_Locations.l_8_7);
state.p_Connected.set(E_Locations.l_11_13, E_Locations.l_11_14);
state.p_Connected.set(E_Locations.l_25_25, E_Locations.l_24_25);
state.p_Connected.set(E_Locations.l_16_6, E_Locations.l_15_6);
state.p_Connected.set(E_Locations.l_20_25, E_Locations.l_20_24);
state.p_Connected.set(E_Locations.l_15_1, E_Locations.l_16_1);
state.p_Connected.set(E_Locations.l_15_7, E_Locations.l_15_6);
state.p_Connected.set(E_Locations.l_20_8, E_Locations.l_19_8);
state.p_Connected.set(E_Locations.l_4_16, E_Locations.l_3_16);
state.p_Connected.set(E_Locations.l_16_4, E_Locations.l_15_4);
state.p_Connected.set(E_Locations.l_20_1, E_Locations.l_19_1);
state.p_Connected.set(E_Locations.l_20_17, E_Locations.l_20_16);
state.p_Connected.set(E_Locations.l_18_1, E_Locations.l_17_1);
state.p_Connected.set(E_Locations.l_19_4, E_Locations.l_20_4);
state.p_Connected.set(E_Locations.l_24_25, E_Locations.l_23_25);
state.p_Connected.set(E_Locations.l_9_7, E_Locations.l_8_7);
state.p_Connected.set(E_Locations.l_13_23, E_Locations.l_13_24);
state.p_Connected.set(E_Locations.l_2_16, E_Locations.l_2_17);
state.p_Connected.set(E_Locations.l_5_22, E_Locations.l_4_22);
state.p_Connected.set(E_Locations.l_22_13, E_Locations.l_23_13);
state.p_Connected.set(E_Locations.l_4_23, E_Locations.l_5_23);
state.p_Connected.set(E_Locations.l_25_13, E_Locations.l_25_12);
state.p_Connected.set(E_Locations.l_11_21, E_Locations.l_11_22);
state.p_Connected.set(E_Locations.l_6_17, E_Locations.l_7_17);
state.p_Connected.set(E_Locations.l_2_20, E_Locations.l_3_20);
state.p_Connected.set(E_Locations.l_10_14, E_Locations.l_10_15);
state.p_Connected.set(E_Locations.l_12_3, E_Locations.l_12_4);
state.p_Connected.set(E_Locations.l_9_24, E_Locations.l_8_24);
state.p_Connected.set(E_Locations.l_3_7, E_Locations.l_2_7);
state.p_Connected.set(E_Locations.l_22_9, E_Locations.l_23_9);
state.p_Connected.set(E_Locations.l_22_20, E_Locations.l_22_21);
state.p_Connected.set(E_Locations.l_9_5, E_Locations.l_10_5);
state.p_Connected.set(E_Locations.l_5_2, E_Locations.l_6_2);
state.p_Connected.set(E_Locations.l_14_25, E_Locations.l_14_24);
state.p_Connected.set(E_Locations.l_24_9, E_Locations.l_24_8);
state.p_Connected.set(E_Locations.l_17_19, E_Locations.l_17_18);
state.p_Connected.set(E_Locations.l_7_4, E_Locations.l_8_4);
state.p_Connected.set(E_Locations.l_14_10, E_Locations.l_14_11);
state.p_Connected.set(E_Locations.l_6_8, E_Locations.l_5_8);
state.p_Connected.set(E_Locations.l_23_21, E_Locations.l_23_22);
state.p_Connected.set(E_Locations.l_6_12, E_Locations.l_6_11);
state.p_Connected.set(E_Locations.l_4_17, E_Locations.l_5_17);
state.p_Connected.set(E_Locations.l_5_17, E_Locations.l_6_17);
state.p_Connected.set(E_Locations.l_8_17, E_Locations.l_9_17);
state.p_Connected.set(E_Locations.l_15_14, E_Locations.l_16_14);
state.p_Connected.set(E_Locations.l_4_10, E_Locations.l_3_10);
state.p_Connected.set(E_Locations.l_23_5, E_Locations.l_23_6);
state.p_Connected.set(E_Locations.l_23_10, E_Locations.l_23_11);
state.p_Connected.set(E_Locations.l_15_15, E_Locations.l_15_14);
state.p_Connected.set(E_Locations.l_13_14, E_Locations.l_14_14);
state.p_Connected.set(E_Locations.l_6_14, E_Locations.l_7_14);
state.p_Connected.set(E_Locations.l_22_5, E_Locations.l_22_4);
state.p_Connected.set(E_Locations.l_16_7, E_Locations.l_17_7);
state.p_Connected.set(E_Locations.l_10_18, E_Locations.l_11_18);
state.p_Connected.set(E_Locations.l_17_9, E_Locations.l_18_9);
state.p_Connected.set(E_Locations.l_21_13, E_Locations.l_21_12);
state.p_Connected.set(E_Locations.l_11_17, E_Locations.l_10_17);
state.p_Connected.set(E_Locations.l_5_25, E_Locations.l_4_25);
state.p_Connected.set(E_Locations.l_20_15, E_Locations.l_19_15);
state.p_Connected.set(E_Locations.l_4_19, E_Locations.l_3_19);
state.p_Connected.set(E_Locations.l_17_7, E_Locations.l_17_8);
state.p_Connected.set(E_Locations.l_2_4, E_Locations.l_2_5);
state.p_Connected.set(E_Locations.l_7_16, E_Locations.l_8_16);
state.p_Connected.set(E_Locations.l_18_19, E_Locations.l_17_19);
state.p_Connected.set(E_Locations.l_24_23, E_Locations.l_24_22);
state.p_Connected.set(E_Locations.l_18_15, E_Locations.l_18_14);
state.p_Connected.set(E_Locations.l_6_3, E_Locations.l_6_2);
state.p_Connected.set(E_Locations.l_2_17, E_Locations.l_2_16);
state.p_Connected.set(E_Locations.l_1_24, E_Locations.l_1_25);
state.p_Connected.set(E_Locations.l_10_5, E_Locations.l_10_4);
state.p_Connected.set(E_Locations.l_19_3, E_Locations.l_19_2);
state.p_Connected.set(E_Locations.l_17_25, E_Locations.l_16_25);
state.p_Connected.set(E_Locations.l_9_25, E_Locations.l_9_24);
state.p_Connected.set(E_Locations.l_10_12, E_Locations.l_9_12);
state.p_Connected.set(E_Locations.l_12_19, E_Locations.l_13_19);
state.p_Connected.set(E_Locations.l_1_20, E_Locations.l_2_20);
state.p_Connected.set(E_Locations.l_7_4, E_Locations.l_7_3);
state.p_Connected.set(E_Locations.l_6_24, E_Locations.l_7_24);
state.p_Connected.set(E_Locations.l_21_6, E_Locations.l_21_7);
state.p_Connected.set(E_Locations.l_5_4, E_Locations.l_5_5);
state.p_Connected.set(E_Locations.l_6_13, E_Locations.l_5_13);
state.p_Connected.set(E_Locations.l_24_23, E_Locations.l_24_24);
state.p_Connected.set(E_Locations.l_8_10, E_Locations.l_8_9);
state.p_Connected.set(E_Locations.l_23_17, E_Locations.l_23_18);
state.p_Connected.set(E_Locations.l_25_18, E_Locations.l_25_17);
state.p_Connected.set(E_Locations.l_15_9, E_Locations.l_15_8);
state.p_Connected.set(E_Locations.l_10_6, E_Locations.l_10_5);
state.p_Connected.set(E_Locations.l_3_3, E_Locations.l_4_3);
state.p_Connected.set(E_Locations.l_9_10, E_Locations.l_9_9);
state.p_Connected.set(E_Locations.l_18_19, E_Locations.l_19_19);
state.p_Connected.set(E_Locations.l_14_22, E_Locations.l_15_22);
state.p_Connected.set(E_Locations.l_21_20, E_Locations.l_20_20);
state.p_Connected.set(E_Locations.l_14_3, E_Locations.l_15_3);
state.p_Connected.set(E_Locations.l_23_1, E_Locations.l_22_1);
state.p_Connected.set(E_Locations.l_8_1, E_Locations.l_9_1);
state.p_Connected.set(E_Locations.l_23_6, E_Locations.l_24_6);
state.p_Connected.set(E_Locations.l_15_12, E_Locations.l_15_13);
state.p_Connected.set(E_Locations.l_17_17, E_Locations.l_17_16);
state.p_Connected.set(E_Locations.l_21_23, E_Locations.l_21_22);
state.p_Connected.set(E_Locations.l_11_21, E_Locations.l_11_20);
state.p_Connected.set(E_Locations.l_8_14, E_Locations.l_8_13);
state.p_Connected.set(E_Locations.l_3_1, E_Locations.l_2_1);
state.p_Connected.set(E_Locations.l_14_2, E_Locations.l_13_2);
state.p_Connected.set(E_Locations.l_22_9, E_Locations.l_21_9);
state.p_Connected.set(E_Locations.l_8_16, E_Locations.l_8_15);
state.p_Connected.set(E_Locations.l_2_24, E_Locations.l_3_24);
state.p_Connected.set(E_Locations.l_6_25, E_Locations.l_5_25);
state.p_Connected.set(E_Locations.l_11_11, E_Locations.l_12_11);
state.p_Connected.set(E_Locations.l_6_9, E_Locations.l_7_9);
state.p_Connected.set(E_Locations.l_1_10, E_Locations.l_1_11);
state.p_Connected.set(E_Locations.l_21_19, E_Locations.l_21_20);
state.p_Connected.set(E_Locations.l_11_4, E_Locations.l_11_5);
state.p_Connected.set(E_Locations.l_16_25, E_Locations.l_16_24);
state.p_Connected.set(E_Locations.l_13_13, E_Locations.l_12_13);
state.p_Connected.set(E_Locations.l_20_23, E_Locations.l_19_23);
state.p_Connected.set(E_Locations.l_15_3, E_Locations.l_14_3);
state.p_Connected.set(E_Locations.l_9_1, E_Locations.l_8_1);
state.p_Connected.set(E_Locations.l_2_1, E_Locations.l_3_1);
state.p_Connected.set(E_Locations.l_15_6, E_Locations.l_15_5);
state.p_Connected.set(E_Locations.l_17_4, E_Locations.l_17_5);
state.p_Connected.set(E_Locations.l_17_10, E_Locations.l_16_10);
state.p_Connected.set(E_Locations.l_21_2, E_Locations.l_21_1);
state.p_Connected.set(E_Locations.l_24_2, E_Locations.l_25_2);
state.p_Connected.set(E_Locations.l_16_20, E_Locations.l_17_20);
state.p_Connected.set(E_Locations.l_12_16, E_Locations.l_11_16);
state.p_Connected.set(E_Locations.l_8_7, E_Locations.l_7_7);
state.p_Connected.set(E_Locations.l_10_1, E_Locations.l_9_1);
state.p_Connected.set(E_Locations.l_16_21, E_Locations.l_15_21);
state.p_Connected.set(E_Locations.l_10_9, E_Locations.l_9_9);
state.p_Connected.set(E_Locations.l_2_8, E_Locations.l_3_8);
state.p_Connected.set(E_Locations.l_15_6, E_Locations.l_15_7);
state.p_Connected.set(E_Locations.l_17_20, E_Locations.l_17_21);
state.p_Connected.set(E_Locations.l_22_3, E_Locations.l_23_3);
state.p_Connected.set(E_Locations.l_23_13, E_Locations.l_23_14);
state.p_Connected.set(E_Locations.l_24_18, E_Locations.l_23_18);
state.p_Connected.set(E_Locations.l_17_20, E_Locations.l_18_20);
state.p_Connected.set(E_Locations.l_6_19, E_Locations.l_6_20);
state.p_Connected.set(E_Locations.l_4_11, E_Locations.l_4_10);
state.p_Connected.set(E_Locations.l_19_19, E_Locations.l_18_19);
state.p_Connected.set(E_Locations.l_19_6, E_Locations.l_19_7);
state.p_Connected.set(E_Locations.l_20_10, E_Locations.l_20_11);
state.p_Connected.set(E_Locations.l_17_6, E_Locations.l_17_7);
state.p_Connected.set(E_Locations.l_15_24, E_Locations.l_15_25);
state.p_Connected.set(E_Locations.l_16_4, E_Locations.l_16_3);
state.p_Connected.set(E_Locations.l_10_23, E_Locations.l_10_24);
state.p_Connected.set(E_Locations.l_2_10, E_Locations.l_1_10);
state.p_Connected.set(E_Locations.l_21_8, E_Locations.l_21_7);
state.p_Connected.set(E_Locations.l_9_16, E_Locations.l_9_17);
state.p_Connected.set(E_Locations.l_7_11, E_Locations.l_7_10);
state.p_Connected.set(E_Locations.l_23_10, E_Locations.l_23_9);
state.p_Connected.set(E_Locations.l_15_15, E_Locations.l_16_15);
state.p_Connected.set(E_Locations.l_21_4, E_Locations.l_21_5);
state.p_Connected.set(E_Locations.l_2_17, E_Locations.l_3_17);
state.p_Connected.set(E_Locations.l_10_16, E_Locations.l_10_17);
state.p_Connected.set(E_Locations.l_17_25, E_Locations.l_18_25);
state.p_Connected.set(E_Locations.l_18_10, E_Locations.l_18_11);
state.p_Connected.set(E_Locations.l_25_9, E_Locations.l_25_8);
state.p_Connected.set(E_Locations.l_6_7, E_Locations.l_5_7);
state.p_Connected.set(E_Locations.l_5_11, E_Locations.l_5_12);
state.p_Connected.set(E_Locations.l_19_12, E_Locations.l_19_11);
state.p_Connected.set(E_Locations.l_5_19, E_Locations.l_5_20);
state.p_Connected.set(E_Locations.l_17_8, E_Locations.l_16_8);
state.p_Connected.set(E_Locations.l_22_19, E_Locations.l_21_19);
state.p_Connected.set(E_Locations.l_23_18, E_Locations.l_24_18);
state.p_Connected.set(E_Locations.l_23_4, E_Locations.l_23_3);
state.p_Connected.set(E_Locations.l_21_17, E_Locations.l_20_17);
state.p_Connected.set(E_Locations.l_5_3, E_Locations.l_5_2);
state.p_Connected.set(E_Locations.l_16_17, E_Locations.l_17_17);
state.p_Connected.set(E_Locations.l_16_23, E_Locations.l_15_23);
state.p_Connected.set(E_Locations.l_15_5, E_Locations.l_16_5);
state.p_Connected.set(E_Locations.l_4_1, E_Locations.l_4_2);
state.p_Connected.set(E_Locations.l_23_13, E_Locations.l_22_13);
state.p_Connected.set(E_Locations.l_3_23, E_Locations.l_4_23);
state.p_Connected.set(E_Locations.l_17_9, E_Locations.l_17_8);
state.p_Connected.set(E_Locations.l_10_6, E_Locations.l_9_6);
state.p_Connected.set(E_Locations.l_2_8, E_Locations.l_2_9);
state.p_Connected.set(E_Locations.l_17_16, E_Locations.l_17_17);
state.p_Connected.set(E_Locations.l_21_14, E_Locations.l_21_15);
state.p_Connected.set(E_Locations.l_6_21, E_Locations.l_7_21);
state.p_Connected.set(E_Locations.l_20_15, E_Locations.l_20_16);
state.p_Connected.set(E_Locations.l_9_22, E_Locations.l_8_22);
state.p_Connected.set(E_Locations.l_25_22, E_Locations.l_25_21);
state.p_Connected.set(E_Locations.l_8_7, E_Locations.l_8_6);
state.p_Connected.set(E_Locations.l_24_21, E_Locations.l_25_21);
state.p_Connected.set(E_Locations.l_15_22, E_Locations.l_15_23);
state.p_Connected.set(E_Locations.l_20_13, E_Locations.l_20_14);
state.p_Connected.set(E_Locations.l_14_15, E_Locations.l_15_15);
state.p_Connected.set(E_Locations.l_22_5, E_Locations.l_21_5);
state.p_Connected.set(E_Locations.l_25_7, E_Locations.l_25_6);
state.p_Connected.set(E_Locations.l_9_22, E_Locations.l_9_23);
state.p_Connected.set(E_Locations.l_7_6, E_Locations.l_7_5);
state.p_Connected.set(E_Locations.l_8_21, E_Locations.l_7_21);
state.p_Connected.set(E_Locations.l_16_20, E_Locations.l_15_20);
state.p_Connected.set(E_Locations.l_5_12, E_Locations.l_4_12);
state.p_Connected.set(E_Locations.l_3_24, E_Locations.l_3_23);
state.p_Connected.set(E_Locations.l_15_3, E_Locations.l_15_4);
state.p_Connected.set(E_Locations.l_24_25, E_Locations.l_24_24);
state.p_Connected.set(E_Locations.l_3_18, E_Locations.l_4_18);
state.p_Connected.set(E_Locations.l_14_13, E_Locations.l_13_13);
state.p_Connected.set(E_Locations.l_1_21, E_Locations.l_1_22);
state.p_Connected.set(E_Locations.l_15_25, E_Locations.l_14_25);
state.p_Connected.set(E_Locations.l_22_11, E_Locations.l_22_12);
state.p_Connected.set(E_Locations.l_4_5, E_Locations.l_5_5);
state.p_Connected.set(E_Locations.l_16_1, E_Locations.l_17_1);
state.p_Connected.set(E_Locations.l_24_13, E_Locations.l_25_13);
state.p_Connected.set(E_Locations.l_21_23, E_Locations.l_20_23);
state.p_Connected.set(E_Locations.l_9_4, E_Locations.l_9_3);
state.p_Connected.set(E_Locations.l_1_16, E_Locations.l_1_15);
state.p_Connected.set(E_Locations.l_6_22, E_Locations.l_7_22);
state.p_Connected.set(E_Locations.l_4_14, E_Locations.l_4_15);
state.p_Connected.set(E_Locations.l_24_14, E_Locations.l_25_14);
state.p_Connected.set(E_Locations.l_21_25, E_Locations.l_21_24);
state.p_Connected.set(E_Locations.l_24_17, E_Locations.l_23_17);
state.p_Connected.set(E_Locations.l_24_24, E_Locations.l_24_25);
state.p_Connected.set(E_Locations.l_1_23, E_Locations.l_2_23);
state.p_Connected.set(E_Locations.l_16_18, E_Locations.l_15_18);
state.p_Connected.set(E_Locations.l_12_20, E_Locations.l_13_20);
state.p_Connected.set(E_Locations.l_2_24, E_Locations.l_2_23);
state.p_Connected.set(E_Locations.l_11_14, E_Locations.l_10_14);
state.p_Connected.set(E_Locations.l_17_17, E_Locations.l_17_18);
state.p_Connected.set(E_Locations.l_9_8, E_Locations.l_8_8);
state.p_Connected.set(E_Locations.l_15_5, E_Locations.l_15_6);
state.p_Connected.set(E_Locations.l_19_2, E_Locations.l_19_3);
state.p_Connected.set(E_Locations.l_12_17, E_Locations.l_11_17);
state.p_Connected.set(E_Locations.l_20_9, E_Locations.l_20_10);
state.p_Connected.set(E_Locations.l_12_24, E_Locations.l_12_23);
state.p_Connected.set(E_Locations.l_10_22, E_Locations.l_11_22);
state.p_Connected.set(E_Locations.l_23_24, E_Locations.l_22_24);
state.p_Connected.set(E_Locations.l_4_24, E_Locations.l_3_24);
state.p_Connected.set(E_Locations.l_5_21, E_Locations.l_4_21);
state.p_Connected.set(E_Locations.l_7_18, E_Locations.l_7_17);
state.p_Connected.set(E_Locations.l_14_21, E_Locations.l_14_20);
state.p_Connected.set(E_Locations.l_1_25, E_Locations.l_2_25);
state.p_Connected.set(E_Locations.l_7_22, E_Locations.l_7_23);
state.p_Connected.set(E_Locations.l_2_3, E_Locations.l_1_3);
state.p_Connected.set(E_Locations.l_11_1, E_Locations.l_12_1);
state.p_Connected.set(E_Locations.l_10_12, E_Locations.l_11_12);
state.p_Connected.set(E_Locations.l_3_2, E_Locations.l_4_2);
state.p_Connected.set(E_Locations.l_10_9, E_Locations.l_10_10);
state.p_Connected.set(E_Locations.l_16_16, E_Locations.l_15_16);
state.p_Connected.set(E_Locations.l_17_9, E_Locations.l_16_9);
state.p_Connected.set(E_Locations.l_5_21, E_Locations.l_5_20);
state.p_Connected.set(E_Locations.l_10_19, E_Locations.l_10_20);
state.p_Connected.set(E_Locations.l_10_16, E_Locations.l_10_15);
state.p_Connected.set(E_Locations.l_3_21, E_Locations.l_3_22);
state.p_Connected.set(E_Locations.l_7_16, E_Locations.l_7_15);
state.p_Connected.set(E_Locations.l_11_12, E_Locations.l_11_11);
state.p_Connected.set(E_Locations.l_13_5, E_Locations.l_13_4);
state.p_Connected.set(E_Locations.l_14_16, E_Locations.l_14_17);
state.p_Connected.set(E_Locations.l_16_2, E_Locations.l_16_1);
state.p_Connected.set(E_Locations.l_14_12, E_Locations.l_14_11);
state.p_Connected.set(E_Locations.l_15_8, E_Locations.l_15_9);
state.p_Connected.set(E_Locations.l_25_18, E_Locations.l_24_18);
state.p_Connected.set(E_Locations.l_20_8, E_Locations.l_20_7);
state.p_Connected.set(E_Locations.l_19_25, E_Locations.l_18_25);
state.p_Connected.set(E_Locations.l_4_12, E_Locations.l_4_11);
state.p_Connected.set(E_Locations.l_1_6, E_Locations.l_1_7);
state.p_Connected.set(E_Locations.l_5_1, E_Locations.l_5_2);
state.p_Connected.set(E_Locations.l_11_16, E_Locations.l_11_17);
state.p_Connected.set(E_Locations.l_12_19, E_Locations.l_12_18);
state.p_Connected.set(E_Locations.l_22_7, E_Locations.l_22_8);
state.p_Connected.set(E_Locations.l_10_2, E_Locations.l_11_2);
state.p_Connected.set(E_Locations.l_11_21, E_Locations.l_10_21);
state.p_Connected.set(E_Locations.l_13_22, E_Locations.l_13_23);
state.p_Connected.set(E_Locations.l_25_2, E_Locations.l_25_3);
state.p_Connected.set(E_Locations.l_13_17, E_Locations.l_13_18);
state.p_Connected.set(E_Locations.l_12_7, E_Locations.l_13_7);
state.p_Connected.set(E_Locations.l_14_13, E_Locations.l_14_14);
state.p_Connected.set(E_Locations.l_14_13, E_Locations.l_14_12);
state.p_Connected.set(E_Locations.l_15_9, E_Locations.l_15_10);
state.p_Connected.set(E_Locations.l_18_17, E_Locations.l_18_16);
state.p_Connected.set(E_Locations.l_20_3, E_Locations.l_20_2);
state.p_Connected.set(E_Locations.l_5_18, E_Locations.l_6_18);
state.p_Connected.set(E_Locations.l_7_6, E_Locations.l_6_6);
state.p_Connected.set(E_Locations.l_4_25, E_Locations.l_5_25);
state.p_Connected.set(E_Locations.l_8_24, E_Locations.l_8_23);
state.p_Connected.set(E_Locations.l_21_20, E_Locations.l_21_21);
state.p_Connected.set(E_Locations.l_17_5, E_Locations.l_17_6);
state.p_Connected.set(E_Locations.l_11_2, E_Locations.l_11_1);
state.p_Connected.set(E_Locations.l_13_18, E_Locations.l_14_18);
state.p_Connected.set(E_Locations.l_16_22, E_Locations.l_17_22);
state.p_Connected.set(E_Locations.l_17_10, E_Locations.l_17_9);
state.p_Connected.set(E_Locations.l_11_6, E_Locations.l_10_6);
state.p_Connected.set(E_Locations.l_8_13, E_Locations.l_8_14);
state.p_Connected.set(E_Locations.l_7_19, E_Locations.l_7_20);
state.p_Connected.set(E_Locations.l_15_21, E_Locations.l_16_21);
state.p_Connected.set(E_Locations.l_6_5, E_Locations.l_6_6);
state.p_Connected.set(E_Locations.l_14_19, E_Locations.l_14_18);
state.p_Connected.set(E_Locations.l_22_3, E_Locations.l_21_3);
state.p_Connected.set(E_Locations.l_23_13, E_Locations.l_23_12);
state.p_Connected.set(E_Locations.l_24_10, E_Locations.l_25_10);
state.p_Connected.set(E_Locations.l_21_12, E_Locations.l_22_12);
state.p_Connected.set(E_Locations.l_5_7, E_Locations.l_4_7);
state.p_Connected.set(E_Locations.l_1_7, E_Locations.l_2_7);
state.p_Connected.set(E_Locations.l_15_20, E_Locations.l_16_20);
state.p_Connected.set(E_Locations.l_3_3, E_Locations.l_2_3);
state.p_Connected.set(E_Locations.l_16_12, E_Locations.l_15_12);
state.p_Connected.set(E_Locations.l_19_17, E_Locations.l_18_17);
state.p_Connected.set(E_Locations.l_25_11, E_Locations.l_24_11);
state.p_Connected.set(E_Locations.l_17_12, E_Locations.l_16_12);
state.p_Connected.set(E_Locations.l_1_14, E_Locations.l_1_13);
state.p_Connected.set(E_Locations.l_21_25, E_Locations.l_22_25);
state.p_Connected.set(E_Locations.l_3_5, E_Locations.l_3_6);
state.p_Connected.set(E_Locations.l_14_15, E_Locations.l_14_14);
state.p_Connected.set(E_Locations.l_16_10, E_Locations.l_16_9);
state.p_Connected.set(E_Locations.l_13_2, E_Locations.l_12_2);
state.p_Connected.set(E_Locations.l_18_3, E_Locations.l_17_3);
state.p_Connected.set(E_Locations.l_25_6, E_Locations.l_24_6);
state.p_Connected.set(E_Locations.l_3_17, E_Locations.l_4_17);
state.p_Connected.set(E_Locations.l_10_25, E_Locations.l_10_24);
state.p_Connected.set(E_Locations.l_12_24, E_Locations.l_13_24);
state.p_Connected.set(E_Locations.l_2_1, E_Locations.l_2_2);
state.p_Connected.set(E_Locations.l_13_17, E_Locations.l_13_16);
state.p_Connected.set(E_Locations.l_24_24, E_Locations.l_23_24);
state.p_Connected.set(E_Locations.l_15_20, E_Locations.l_15_21);
state.p_Connected.set(E_Locations.l_12_14, E_Locations.l_12_13);
state.p_Connected.set(E_Locations.l_18_7, E_Locations.l_18_8);
state.p_Connected.set(E_Locations.l_15_16, E_Locations.l_14_16);
state.p_Connected.set(E_Locations.l_23_9, E_Locations.l_24_9);
state.p_Connected.set(E_Locations.l_6_6, E_Locations.l_7_6);
state.p_Connected.set(E_Locations.l_9_3, E_Locations.l_10_3);
state.p_Connected.set(E_Locations.l_12_11, E_Locations.l_11_11);
state.p_Connected.set(E_Locations.l_17_25, E_Locations.l_17_24);
state.p_Connected.set(E_Locations.l_3_4, E_Locations.l_3_5);
state.p_Connected.set(E_Locations.l_5_21, E_Locations.l_5_22);
state.p_Connected.set(E_Locations.l_8_8, E_Locations.l_8_7);
state.p_Connected.set(E_Locations.l_23_15, E_Locations.l_24_15);
state.p_Connected.set(E_Locations.l_23_18, E_Locations.l_23_17);
state.p_Connected.set(E_Locations.l_22_4, E_Locations.l_23_4);
state.p_Connected.set(E_Locations.l_24_12, E_Locations.l_24_13);
state.p_Connected.set(E_Locations.l_2_19, E_Locations.l_3_19);
state.p_Connected.set(E_Locations.l_21_23, E_Locations.l_22_23);
state.p_Connected.set(E_Locations.l_4_23, E_Locations.l_4_24);
state.p_Connected.set(E_Locations.l_5_9, E_Locations.l_5_8);
state.p_Connected.set(E_Locations.l_15_17, E_Locations.l_14_17);
state.p_Connected.set(E_Locations.l_3_9, E_Locations.l_3_10);
state.p_Connected.set(E_Locations.l_2_9, E_Locations.l_2_10);
state.p_Connected.set(E_Locations.l_8_12, E_Locations.l_8_13);
state.p_Connected.set(E_Locations.l_16_20, E_Locations.l_16_19);
state.p_Connected.set(E_Locations.l_5_19, E_Locations.l_5_18);
state.p_Connected.set(E_Locations.l_19_2, E_Locations.l_18_2);
state.p_Connected.set(E_Locations.l_21_22, E_Locations.l_21_23);
state.p_Connected.set(E_Locations.l_19_20, E_Locations.l_19_19);
state.p_Connected.set(E_Locations.l_16_16, E_Locations.l_16_17);
state.p_Connected.set(E_Locations.l_4_7, E_Locations.l_4_8);
state.p_Connected.set(E_Locations.l_21_24, E_Locations.l_20_24);
state.p_Connected.set(E_Locations.l_21_19, E_Locations.l_21_18);
state.p_Connected.set(E_Locations.l_17_18, E_Locations.l_16_18);
state.p_Connected.set(E_Locations.l_8_2, E_Locations.l_8_3);
state.p_Connected.set(E_Locations.l_25_23, E_Locations.l_24_23);
state.p_Connected.set(E_Locations.l_12_2, E_Locations.l_13_2);
state.p_Connected.set(E_Locations.l_15_23, E_Locations.l_14_23);
state.p_Connected.set(E_Locations.l_19_18, E_Locations.l_20_18);
state.p_Connected.set(E_Locations.l_18_9, E_Locations.l_17_9);
state.p_Connected.set(E_Locations.l_10_6, E_Locations.l_10_7);
state.p_Connected.set(E_Locations.l_14_24, E_Locations.l_14_25);
state.p_Connected.set(E_Locations.l_11_23, E_Locations.l_12_23);
state.p_Connected.set(E_Locations.l_10_24, E_Locations.l_11_24);
state.p_Connected.set(E_Locations.l_24_23, E_Locations.l_25_23);
state.p_Connected.set(E_Locations.l_13_21, E_Locations.l_12_21);
state.p_Connected.set(E_Locations.l_14_14, E_Locations.l_14_15);
state.p_Connected.set(E_Locations.l_20_21, E_Locations.l_20_20);
state.p_Connected.set(E_Locations.l_17_17, E_Locations.l_18_17);
state.p_Connected.set(E_Locations.l_3_21, E_Locations.l_3_20);
state.p_Connected.set(E_Locations.l_10_19, E_Locations.l_10_18);
state.p_Connected.set(E_Locations.l_12_10, E_Locations.l_11_10);
state.p_Connected.set(E_Locations.l_25_3, E_Locations.l_25_2);
state.p_Connected.set(E_Locations.l_8_15, E_Locations.l_7_15);
state.p_Connected.set(E_Locations.l_8_3, E_Locations.l_9_3);
state.p_Connected.set(E_Locations.l_12_7, E_Locations.l_12_8);
state.p_Connected.set(E_Locations.l_24_13, E_Locations.l_24_12);
state.p_Connected.set(E_Locations.l_6_20, E_Locations.l_7_20);
state.p_Connected.set(E_Locations.l_20_4, E_Locations.l_20_5);
state.p_Connected.set(E_Locations.l_18_13, E_Locations.l_19_13);
state.p_Connected.set(E_Locations.l_3_20, E_Locations.l_3_19);
state.p_Connected.set(E_Locations.l_17_21, E_Locations.l_16_21);
state.p_Connected.set(E_Locations.l_20_10, E_Locations.l_20_9);
state.p_Connected.set(E_Locations.l_16_2, E_Locations.l_17_2);
state.p_Connected.set(E_Locations.l_25_19, E_Locations.l_25_18);
state.p_Connected.set(E_Locations.l_4_10, E_Locations.l_4_11);
state.p_Connected.set(E_Locations.l_1_21, E_Locations.l_2_21);
state.p_Connected.set(E_Locations.l_6_8, E_Locations.l_7_8);
state.p_Connected.set(E_Locations.l_15_8, E_Locations.l_16_8);
state.p_Connected.set(E_Locations.l_14_24, E_Locations.l_14_23);
state.p_Connected.set(E_Locations.l_2_18, E_Locations.l_1_18);
state.p_Connected.set(E_Locations.l_12_13, E_Locations.l_11_13);
state.p_Connected.set(E_Locations.l_21_12, E_Locations.l_21_11);
state.p_Connected.set(E_Locations.l_19_5, E_Locations.l_20_5);
state.p_Connected.set(E_Locations.l_12_6, E_Locations.l_11_6);
state.p_Connected.set(E_Locations.l_11_3, E_Locations.l_11_2);
state.p_Connected.set(E_Locations.l_20_22, E_Locations.l_20_21);
state.p_Connected.set(E_Locations.l_13_20, E_Locations.l_12_20);
state.p_Connected.set(E_Locations.l_19_10, E_Locations.l_18_10);
state.p_Connected.set(E_Locations.l_12_17, E_Locations.l_13_17);
state.p_Connected.set(E_Locations.l_8_25, E_Locations.l_7_25);
state.p_Connected.set(E_Locations.l_8_17, E_Locations.l_8_16);
state.p_Connected.set(E_Locations.l_17_19, E_Locations.l_18_19);
state.p_Connected.set(E_Locations.l_19_22, E_Locations.l_19_21);
state.p_Connected.set(E_Locations.l_22_5, E_Locations.l_22_6);
state.p_Connected.set(E_Locations.l_22_2, E_Locations.l_21_2);
state.p_Connected.set(E_Locations.l_24_19, E_Locations.l_23_19);
state.p_Connected.set(E_Locations.l_12_12, E_Locations.l_12_11);
state.p_Connected.set(E_Locations.l_1_13, E_Locations.l_2_13);
state.p_Connected.set(E_Locations.l_16_12, E_Locations.l_16_11);
state.p_Connected.set(E_Locations.l_17_24, E_Locations.l_17_23);
state.p_Connected.set(E_Locations.l_9_23, E_Locations.l_10_23);
state.p_Connected.set(E_Locations.l_2_7, E_Locations.l_2_8);
state.p_Connected.set(E_Locations.l_19_23, E_Locations.l_19_24);
state.p_Connected.set(E_Locations.l_22_15, E_Locations.l_22_16);
state.p_Connected.set(E_Locations.l_9_18, E_Locations.l_9_17);
state.p_Connected.set(E_Locations.l_24_15, E_Locations.l_25_15);
state.p_Connected.set(E_Locations.l_1_13, E_Locations.l_1_12);
state.p_Connected.set(E_Locations.l_14_14, E_Locations.l_14_13);
state.p_Connected.set(E_Locations.l_9_17, E_Locations.l_10_17);
state.p_Connected.set(E_Locations.l_14_4, E_Locations.l_13_4);
state.p_Connected.set(E_Locations.l_9_20, E_Locations.l_9_21);
state.p_Connected.set(E_Locations.l_21_24, E_Locations.l_22_24);
state.p_Connected.set(E_Locations.l_4_17, E_Locations.l_4_16);
state.p_Connected.set(E_Locations.l_7_12, E_Locations.l_7_11);
state.p_Connected.set(E_Locations.l_20_15, E_Locations.l_21_15);
state.p_Connected.set(E_Locations.l_6_22, E_Locations.l_5_22);
state.p_Connected.set(E_Locations.l_15_20, E_Locations.l_15_19);
state.p_Connected.set(E_Locations.l_11_9, E_Locations.l_11_8);
state.p_Connected.set(E_Locations.l_20_12, E_Locations.l_20_11);
state.p_Connected.set(E_Locations.l_21_8, E_Locations.l_21_9);
state.p_Connected.set(E_Locations.l_13_4, E_Locations.l_13_5);
state.p_Connected.set(E_Locations.l_18_15, E_Locations.l_17_15);
state.p_Connected.set(E_Locations.l_2_10, E_Locations.l_3_10);
state.p_Connected.set(E_Locations.l_24_18, E_Locations.l_24_17);
state.p_Connected.set(E_Locations.l_15_9, E_Locations.l_16_9);
state.p_Connected.set(E_Locations.l_13_20, E_Locations.l_13_21);
state.p_Connected.set(E_Locations.l_7_8, E_Locations.l_7_9);
state.p_Connected.set(E_Locations.l_8_21, E_Locations.l_8_20);
state.p_Connected.set(E_Locations.l_14_20, E_Locations.l_14_19);
state.p_Connected.set(E_Locations.l_2_25, E_Locations.l_1_25);
state.p_Connected.set(E_Locations.l_5_20, E_Locations.l_6_20);
state.p_Connected.set(E_Locations.l_18_6, E_Locations.l_18_5);
state.p_Connected.set(E_Locations.l_16_10, E_Locations.l_15_10);
state.p_Connected.set(E_Locations.l_16_18, E_Locations.l_16_19);
state.p_Connected.set(E_Locations.l_9_8, E_Locations.l_9_7);
state.p_Connected.set(E_Locations.l_17_5, E_Locations.l_17_4);
state.p_Connected.set(E_Locations.l_4_6, E_Locations.l_3_6);
state.p_Connected.set(E_Locations.l_23_25, E_Locations.l_23_24);
state.p_Connected.set(E_Locations.l_25_2, E_Locations.l_25_1);
state.p_Connected.set(E_Locations.l_1_6, E_Locations.l_2_6);
state.p_Connected.set(E_Locations.l_11_7, E_Locations.l_12_7);
state.p_Connected.set(E_Locations.l_19_13, E_Locations.l_20_13);
state.p_Connected.set(E_Locations.l_16_19, E_Locations.l_15_19);
state.p_Connected.set(E_Locations.l_6_17, E_Locations.l_6_18);
state.p_Connected.set(E_Locations.l_18_7, E_Locations.l_19_7);
state.p_Connected.set(E_Locations.l_6_23, E_Locations.l_6_24);
state.p_Connected.set(E_Locations.l_24_6, E_Locations.l_24_5);
state.p_Connected.set(E_Locations.l_8_20, E_Locations.l_8_21);
state.p_Connected.set(E_Locations.l_3_12, E_Locations.l_3_11);
state.p_Connected.set(E_Locations.l_19_5, E_Locations.l_18_5);
state.p_Connected.set(E_Locations.l_23_11, E_Locations.l_22_11);
state.p_Connected.set(E_Locations.l_25_20, E_Locations.l_24_20);
state.p_Connected.set(E_Locations.l_12_6, E_Locations.l_12_5);
state.p_Connected.set(E_Locations.l_6_1, E_Locations.l_7_1);
state.p_Connected.set(E_Locations.l_6_3, E_Locations.l_7_3);
state.p_Connected.set(E_Locations.l_24_21, E_Locations.l_24_22);
state.p_Connected.set(E_Locations.l_16_3, E_Locations.l_16_4);
state.p_Connected.set(E_Locations.l_13_24, E_Locations.l_13_25);
state.p_Connected.set(E_Locations.l_20_22, E_Locations.l_20_23);
state.p_Connected.set(E_Locations.l_2_15, E_Locations.l_3_15);
state.p_Connected.set(E_Locations.l_5_16, E_Locations.l_6_16);
state.p_Connected.set(E_Locations.l_24_21, E_Locations.l_24_20);
state.p_Connected.set(E_Locations.l_6_4, E_Locations.l_6_5);
state.p_Connected.set(E_Locations.l_14_21, E_Locations.l_15_21);
state.p_Connected.set(E_Locations.l_25_10, E_Locations.l_25_9);
state.p_Connected.set(E_Locations.l_7_19, E_Locations.l_8_19);
state.p_Connected.set(E_Locations.l_16_7, E_Locations.l_16_8);
state.p_Connected.set(E_Locations.l_15_22, E_Locations.l_16_22);
state.p_Connected.set(E_Locations.l_17_16, E_Locations.l_18_16);
state.p_Connected.set(E_Locations.l_14_20, E_Locations.l_13_20);
state.p_Connected.set(E_Locations.l_10_7, E_Locations.l_9_7);
state.p_Connected.set(E_Locations.l_21_17, E_Locations.l_21_18);
state.p_Connected.set(E_Locations.l_22_11, E_Locations.l_22_10);
state.p_Connected.set(E_Locations.l_17_20, E_Locations.l_16_20);
state.p_Connected.set(E_Locations.l_10_14, E_Locations.l_10_13);
state.p_Connected.set(E_Locations.l_8_21, E_Locations.l_9_21);
state.p_Connected.set(E_Locations.l_14_1, E_Locations.l_14_2);
state.p_Connected.set(E_Locations.l_18_22, E_Locations.l_17_22);
state.p_Connected.set(E_Locations.l_21_22, E_Locations.l_22_22);
state.p_Connected.set(E_Locations.l_8_9, E_Locations.l_8_8);
state.p_Connected.set(E_Locations.l_19_16, E_Locations.l_18_16);
state.p_Connected.set(E_Locations.l_4_3, E_Locations.l_3_3);
state.p_Connected.set(E_Locations.l_7_2, E_Locations.l_6_2);
state.p_Connected.set(E_Locations.l_8_8, E_Locations.l_7_8);
state.p_Connected.set(E_Locations.l_21_5, E_Locations.l_21_6);
state.p_Connected.set(E_Locations.l_11_14, E_Locations.l_12_14);
state.p_Connected.set(E_Locations.l_8_17, E_Locations.l_7_17);
state.p_Connected.set(E_Locations.l_10_2, E_Locations.l_9_2);
state.p_Connected.set(E_Locations.l_14_19, E_Locations.l_15_19);
state.p_Connected.set(E_Locations.l_16_6, E_Locations.l_17_6);
state.p_Connected.set(E_Locations.l_4_18, E_Locations.l_5_18);
state.p_Connected.set(E_Locations.l_19_24, E_Locations.l_19_25);
state.p_Connected.set(E_Locations.l_21_16, E_Locations.l_21_15);
state.p_Connected.set(E_Locations.l_22_6, E_Locations.l_22_7);
state.p_Connected.set(E_Locations.l_22_17, E_Locations.l_22_18);
state.p_Connected.set(E_Locations.l_21_19, E_Locations.l_22_19);
state.p_Connected.set(E_Locations.l_9_6, E_Locations.l_8_6);
state.p_Connected.set(E_Locations.l_25_14, E_Locations.l_25_13);
state.p_Connected.set(E_Locations.l_4_8, E_Locations.l_4_7);
state.p_Connected.set(E_Locations.l_2_23, E_Locations.l_2_24);
state.p_Connected.set(E_Locations.l_21_11, E_Locations.l_21_12);
state.p_Connected.set(E_Locations.l_18_2, E_Locations.l_18_3);
state.p_Connected.set(E_Locations.l_17_12, E_Locations.l_18_12);
state.p_Connected.set(E_Locations.l_15_20, E_Locations.l_14_20);
state.p_Connected.set(E_Locations.l_11_23, E_Locations.l_10_23);
state.p_Connected.set(E_Locations.l_10_25, E_Locations.l_11_25);
state.p_Connected.set(E_Locations.l_6_19, E_Locations.l_6_18);
state.p_Connected.set(E_Locations.l_13_3, E_Locations.l_14_3);
state.p_Connected.set(E_Locations.l_19_16, E_Locations.l_19_17);
state.p_Connected.set(E_Locations.l_7_25, E_Locations.l_7_24);
state.p_Connected.set(E_Locations.l_20_20, E_Locations.l_19_20);
state.p_Connected.set(E_Locations.l_11_22, E_Locations.l_11_23);
state.p_Connected.set(E_Locations.l_9_13, E_Locations.l_10_13);
state.p_Connected.set(E_Locations.l_18_20, E_Locations.l_17_20);
state.p_Connected.set(E_Locations.l_16_17, E_Locations.l_16_16);
state.p_Connected.set(E_Locations.l_5_22, E_Locations.l_5_21);
state.p_Connected.set(E_Locations.l_18_11, E_Locations.l_18_10);
state.p_Connected.set(E_Locations.l_11_15, E_Locations.l_12_15);
state.p_Connected.set(E_Locations.l_12_16, E_Locations.l_12_15);
state.p_Connected.set(E_Locations.l_16_24, E_Locations.l_17_24);
state.p_Connected.set(E_Locations.l_1_5, E_Locations.l_1_4);
state.p_Connected.set(E_Locations.l_8_15, E_Locations.l_8_16);
state.p_Connected.set(E_Locations.l_21_8, E_Locations.l_22_8);
state.p_Connected.set(E_Locations.l_20_6, E_Locations.l_21_6);
state.p_Connected.set(E_Locations.l_9_13, E_Locations.l_9_14);
state.p_Connected.set(E_Locations.l_14_3, E_Locations.l_14_4);
state.p_Connected.set(E_Locations.l_6_3, E_Locations.l_6_4);
state.p_Connected.set(E_Locations.l_7_5, E_Locations.l_7_4);
state.p_Connected.set(E_Locations.l_2_14, E_Locations.l_2_15);
state.p_Connected.set(E_Locations.l_20_4, E_Locations.l_19_4);
state.p_Connected.set(E_Locations.l_24_4, E_Locations.l_24_5);
state.p_Connected.set(E_Locations.l_18_11, E_Locations.l_19_11);
state.p_Connected.set(E_Locations.l_8_11, E_Locations.l_8_12);
state.p_Connected.set(E_Locations.l_21_21, E_Locations.l_20_21);
state.p_Connected.set(E_Locations.l_17_2, E_Locations.l_17_1);
state.p_Connected.set(E_Locations.l_23_16, E_Locations.l_22_16);
state.p_Connected.set(E_Locations.l_17_21, E_Locations.l_17_22);
state.p_Connected.set(E_Locations.l_16_7, E_Locations.l_15_7);
state.p_Connected.set(E_Locations.l_8_19, E_Locations.l_8_18);
state.p_Connected.set(E_Locations.l_16_13, E_Locations.l_15_13);
state.p_Connected.set(E_Locations.l_6_20, E_Locations.l_5_20);
state.p_Connected.set(E_Locations.l_3_14, E_Locations.l_3_15);
state.p_Connected.set(E_Locations.l_1_19, E_Locations.l_1_20);
state.p_Connected.set(E_Locations.l_6_12, E_Locations.l_7_12);
state.p_Connected.set(E_Locations.l_8_14, E_Locations.l_7_14);
state.p_Connected.set(E_Locations.l_12_5, E_Locations.l_11_5);
state.p_Connected.set(E_Locations.l_25_16, E_Locations.l_25_17);
state.p_Connected.set(E_Locations.l_19_3, E_Locations.l_20_3);
state.p_Connected.set(E_Locations.l_7_5, E_Locations.l_7_6);
state.p_Connected.set(E_Locations.l_12_24, E_Locations.l_12_25);
state.p_Connected.set(E_Locations.l_23_2, E_Locations.l_23_1);
state.p_Connected.set(E_Locations.l_1_15, E_Locations.l_2_15);
state.p_Connected.set(E_Locations.l_14_1, E_Locations.l_13_1);
state.p_Connected.set(E_Locations.l_18_24, E_Locations.l_18_23);
state.p_Connected.set(E_Locations.l_15_7, E_Locations.l_14_7);
state.p_Connected.set(E_Locations.l_1_22, E_Locations.l_1_23);
state.p_Connected.set(E_Locations.l_5_5, E_Locations.l_6_5);
state.p_Connected.set(E_Locations.l_9_20, E_Locations.l_9_19);
state.p_Connected.set(E_Locations.l_20_14, E_Locations.l_21_14);
state.p_Connected.set(E_Locations.l_22_21, E_Locations.l_22_22);
state.p_Connected.set(E_Locations.l_18_23, E_Locations.l_18_24);
state.p_Connected.set(E_Locations.l_7_3, E_Locations.l_6_3);
state.p_Connected.set(E_Locations.l_22_18, E_Locations.l_22_19);
state.p_Connected.set(E_Locations.l_21_13, E_Locations.l_20_13);
state.p_Connected.set(E_Locations.l_19_11, E_Locations.l_18_11);
state.p_Connected.set(E_Locations.l_2_21, E_Locations.l_3_21);
state.p_Connected.set(E_Locations.l_18_2, E_Locations.l_18_1);
state.p_Connected.set(E_Locations.l_25_5, E_Locations.l_25_6);
state.p_Connected.set(E_Locations.l_13_14, E_Locations.l_13_15);
state.p_Connected.set(E_Locations.l_4_24, E_Locations.l_4_25);
state.p_Connected.set(E_Locations.l_3_22, E_Locations.l_3_23);
state.p_Connected.set(E_Locations.l_21_21, E_Locations.l_21_22);
state.p_Connected.set(E_Locations.l_16_25, E_Locations.l_17_25);
state.p_Connected.set(E_Locations.l_21_19, E_Locations.l_20_19);
state.p_Connected.set(E_Locations.l_6_5, E_Locations.l_7_5);
state.p_Connected.set(E_Locations.l_2_12, E_Locations.l_2_11);
state.p_Connected.set(E_Locations.l_14_12, E_Locations.l_14_13);
state.p_Connected.set(E_Locations.l_9_11, E_Locations.l_8_11);
state.p_Connected.set(E_Locations.l_17_3, E_Locations.l_17_4);
state.p_Connected.set(E_Locations.l_11_23, E_Locations.l_11_24);
state.p_Connected.set(E_Locations.l_16_8, E_Locations.l_16_9);
state.p_Connected.set(E_Locations.l_8_23, E_Locations.l_9_23);
state.p_Connected.set(E_Locations.l_9_10, E_Locations.l_9_11);
state.p_Connected.set(E_Locations.l_2_5, E_Locations.l_2_4);
state.p_Connected.set(E_Locations.l_3_22, E_Locations.l_3_21);
state.p_Connected.set(E_Locations.l_7_7, E_Locations.l_6_7);
state.p_Connected.set(E_Locations.l_9_10, E_Locations.l_10_10);
state.p_Connected.set(E_Locations.l_18_8, E_Locations.l_18_7);
state.p_Connected.set(E_Locations.l_21_1, E_Locations.l_21_2);
state.p_Connected.set(E_Locations.l_19_20, E_Locations.l_19_21);
state.p_Connected.set(E_Locations.l_9_11, E_Locations.l_9_10);
state.p_Connected.set(E_Locations.l_12_4, E_Locations.l_12_5);
state.p_Connected.set(E_Locations.l_17_5, E_Locations.l_18_5);
state.p_Connected.set(E_Locations.l_18_7, E_Locations.l_17_7);
state.p_Connected.set(E_Locations.l_19_11, E_Locations.l_19_12);
state.p_Connected.set(E_Locations.l_15_19, E_Locations.l_15_20);
state.p_Connected.set(E_Locations.l_7_10, E_Locations.l_7_11);
state.p_Connected.set(E_Locations.l_11_18, E_Locations.l_10_18);
state.p_Connected.set(E_Locations.l_6_7, E_Locations.l_7_7);
state.p_Connected.set(E_Locations.l_7_25, E_Locations.l_6_25);
state.p_Connected.set(E_Locations.l_22_11, E_Locations.l_21_11);
state.p_Connected.set(E_Locations.l_23_18, E_Locations.l_23_19);
state.p_Connected.set(E_Locations.l_18_23, E_Locations.l_18_22);
state.p_Connected.set(E_Locations.l_19_15, E_Locations.l_19_16);
state.p_Connected.set(E_Locations.l_22_18, E_Locations.l_22_17);
state.p_Connected.set(E_Locations.l_18_5, E_Locations.l_19_5);
state.p_Connected.set(E_Locations.l_7_22, E_Locations.l_6_22);
state.p_Connected.set(E_Locations.l_9_17, E_Locations.l_8_17);
state.p_Connected.set(E_Locations.l_24_18, E_Locations.l_25_18);
state.p_Connected.set(E_Locations.l_15_23, E_Locations.l_16_23);
state.p_Connected.set(E_Locations.l_14_17, E_Locations.l_14_16);
state.p_Connected.set(E_Locations.l_18_18, E_Locations.l_19_18);
state.p_Connected.set(E_Locations.l_25_13, E_Locations.l_24_13);
state.p_Connected.set(E_Locations.l_1_9, E_Locations.l_2_9);
state.p_Connected.set(E_Locations.l_4_2, E_Locations.l_5_2);
state.p_Connected.set(E_Locations.l_8_7, E_Locations.l_8_8);
state.p_Connected.set(E_Locations.l_15_11, E_Locations.l_16_11);
state.p_Connected.set(E_Locations.l_9_21, E_Locations.l_9_20);
state.p_Connected.set(E_Locations.l_22_6, E_Locations.l_21_6);
state.p_Connected.set(E_Locations.l_15_12, E_Locations.l_15_11);
state.p_Connected.set(E_Locations.l_6_9, E_Locations.l_6_8);
state.p_Connected.set(E_Locations.l_17_3, E_Locations.l_18_3);
state.p_Connected.set(E_Locations.l_25_5, E_Locations.l_24_5);
state.p_Connected.set(E_Locations.l_7_10, E_Locations.l_6_10);
state.p_Connected.set(E_Locations.l_7_3, E_Locations.l_7_4);
state.p_Connected.set(E_Locations.l_3_7, E_Locations.l_3_8);
state.p_Connected.set(E_Locations.l_16_15, E_Locations.l_16_16);
state.p_Connected.set(E_Locations.l_18_10, E_Locations.l_17_10);
state.p_Connected.set(E_Locations.l_6_18, E_Locations.l_7_18);
state.p_Connected.set(E_Locations.l_7_21, E_Locations.l_8_21);
state.p_Connected.set(E_Locations.l_18_16, E_Locations.l_17_16);
state.p_Connected.set(E_Locations.l_4_22, E_Locations.l_5_22);
state.p_Connected.set(E_Locations.l_13_10, E_Locations.l_12_10);
state.p_Connected.set(E_Locations.l_22_10, E_Locations.l_22_11);
state.p_Connected.set(E_Locations.l_10_22, E_Locations.l_10_21);
state.p_Connected.set(E_Locations.l_12_23, E_Locations.l_12_22);
state.p_Connected.set(E_Locations.l_14_17, E_Locations.l_14_18);
state.p_Connected.set(E_Locations.l_22_4, E_Locations.l_21_4);
state.p_Connected.set(E_Locations.l_23_12, E_Locations.l_22_12);
state.p_Connected.set(E_Locations.l_4_24, E_Locations.l_4_23);
state.p_Connected.set(E_Locations.l_2_14, E_Locations.l_3_14);
state.p_Connected.set(E_Locations.l_10_21, E_Locations.l_9_21);
state.p_Connected.set(E_Locations.l_24_8, E_Locations.l_23_8);
state.p_Connected.set(E_Locations.l_19_22, E_Locations.l_18_22);
state.p_Connected.set(E_Locations.l_19_23, E_Locations.l_19_22);
state.p_Connected.set(E_Locations.l_9_13, E_Locations.l_8_13);
state.p_Connected.set(E_Locations.l_5_11, E_Locations.l_6_11);
state.p_Connected.set(E_Locations.l_20_18, E_Locations.l_20_19);
state.p_Connected.set(E_Locations.l_24_16, E_Locations.l_24_15);
state.p_Connected.set(E_Locations.l_2_19, E_Locations.l_2_18);
state.p_Connected.set(E_Locations.l_9_20, E_Locations.l_8_20);
state.p_Connected.set(E_Locations.l_24_17, E_Locations.l_25_17);
state.p_Connected.set(E_Locations.l_1_2, E_Locations.l_1_3);
state.p_Connected.set(E_Locations.l_5_12, E_Locations.l_5_13);
state.p_Connected.set(E_Locations.l_13_9, E_Locations.l_14_9);
state.p_Connected.set(E_Locations.l_14_8, E_Locations.l_14_9);
state.p_Connected.set(E_Locations.l_5_15, E_Locations.l_6_15);
state.p_Connected.set(E_Locations.l_19_14, E_Locations.l_18_14);
state.p_Connected.set(E_Locations.l_3_9, E_Locations.l_2_9);
state.p_Connected.set(E_Locations.l_9_11, E_Locations.l_10_11);
state.p_Connected.set(E_Locations.l_19_9, E_Locations.l_18_9);
state.p_Connected.set(E_Locations.l_23_9, E_Locations.l_22_9);
state.p_Connected.set(E_Locations.l_22_14, E_Locations.l_21_14);
state.p_Connected.set(E_Locations.l_3_23, E_Locations.l_3_24);
state.p_Connected.set(E_Locations.l_10_5, E_Locations.l_11_5);
state.p_Connected.set(E_Locations.l_13_13, E_Locations.l_14_13);
state.p_Connected.set(E_Locations.l_23_13, E_Locations.l_24_13);
state.p_Connected.set(E_Locations.l_3_8, E_Locations.l_4_8);
state.p_Connected.set(E_Locations.l_9_14, E_Locations.l_8_14);
state.p_Connected.set(E_Locations.l_11_18, E_Locations.l_11_17);
state.p_Connected.set(E_Locations.l_3_6, E_Locations.l_2_6);
state.p_Connected.set(E_Locations.l_9_17, E_Locations.l_9_18);
state.p_Connected.set(E_Locations.l_16_23, E_Locations.l_17_23);
state.p_Connected.set(E_Locations.l_19_1, E_Locations.l_19_2);
state.p_Connected.set(E_Locations.l_12_14, E_Locations.l_12_15);
state.p_Connected.set(E_Locations.l_2_2, E_Locations.l_1_2);
state.p_Connected.set(E_Locations.l_13_22, E_Locations.l_14_22);
state.p_Connected.set(E_Locations.l_13_18, E_Locations.l_12_18);
state.p_Connected.set(E_Locations.l_3_13, E_Locations.l_3_12);
state.p_Connected.set(E_Locations.l_10_23, E_Locations.l_9_23);
state.p_Connected.set(E_Locations.l_7_14, E_Locations.l_8_14);
state.p_Connected.set(E_Locations.l_1_9, E_Locations.l_1_8);
state.p_Connected.set(E_Locations.l_3_5, E_Locations.l_3_4);
state.p_Connected.set(E_Locations.l_14_1, E_Locations.l_15_1);
state.p_Connected.set(E_Locations.l_11_9, E_Locations.l_10_9);
state.p_Connected.set(E_Locations.l_21_11, E_Locations.l_20_11);
state.p_Connected.set(E_Locations.l_4_7, E_Locations.l_4_6);
state.p_Connected.set(E_Locations.l_15_16, E_Locations.l_16_16);
state.p_Connected.set(E_Locations.l_3_23, E_Locations.l_3_22);
state.p_Connected.set(E_Locations.l_5_8, E_Locations.l_6_8);
state.p_Connected.set(E_Locations.l_16_3, E_Locations.l_17_3);
state.p_Connected.set(E_Locations.l_6_14, E_Locations.l_6_13);
state.p_Connected.set(E_Locations.l_23_12, E_Locations.l_23_11);
state.p_Connected.set(E_Locations.l_7_14, E_Locations.l_6_14);
state.p_Connected.set(E_Locations.l_14_18, E_Locations.l_14_17);
state.p_Connected.set(E_Locations.l_20_24, E_Locations.l_21_24);
state.p_Connected.set(E_Locations.l_6_1, E_Locations.l_6_2);
state.p_Connected.set(E_Locations.l_3_5, E_Locations.l_4_5);
state.p_Connected.set(E_Locations.l_19_14, E_Locations.l_20_14);
state.p_Connected.set(E_Locations.l_8_18, E_Locations.l_9_18);
state.p_Connected.set(E_Locations.l_12_18, E_Locations.l_11_18);
state.p_Connected.set(E_Locations.l_4_21, E_Locations.l_5_21);
state.p_Connected.set(E_Locations.l_18_9, E_Locations.l_18_10);
state.p_Connected.set(E_Locations.l_8_9, E_Locations.l_9_9);
state.p_Connected.set(E_Locations.l_5_14, E_Locations.l_6_14);
state.p_Connected.set(E_Locations.l_1_7, E_Locations.l_1_6);
state.p_Connected.set(E_Locations.l_13_15, E_Locations.l_12_15);
state.p_Connected.set(E_Locations.l_16_14, E_Locations.l_16_13);
state.p_Connected.set(E_Locations.l_6_11, E_Locations.l_6_12);
state.p_Connected.set(E_Locations.l_6_7, E_Locations.l_6_6);
state.p_Connected.set(E_Locations.l_19_8, E_Locations.l_18_8);
state.p_Connected.set(E_Locations.l_24_23, E_Locations.l_23_23);
state.p_Connected.set(E_Locations.l_3_2, E_Locations.l_3_3);
state.p_Connected.set(E_Locations.l_6_16, E_Locations.l_6_17);
state.p_Connected.set(E_Locations.l_24_17, E_Locations.l_24_18);
state.p_Connected.set(E_Locations.l_8_6, E_Locations.l_9_6);
state.p_Connected.set(E_Locations.l_16_22, E_Locations.l_15_22);
state.p_Connected.set(E_Locations.l_3_18, E_Locations.l_3_19);
state.p_Connected.set(E_Locations.l_4_10, E_Locations.l_4_9);
state.p_Connected.set(E_Locations.l_14_6, E_Locations.l_13_6);
state.p_Connected.set(E_Locations.l_3_9, E_Locations.l_4_9);
state.p_Connected.set(E_Locations.l_16_17, E_Locations.l_16_18);
state.p_Connected.set(E_Locations.l_20_4, E_Locations.l_20_3);
state.p_Connected.set(E_Locations.l_11_16, E_Locations.l_12_16);
state.p_Connected.set(E_Locations.l_2_8, E_Locations.l_2_7);
state.p_Connected.set(E_Locations.l_20_7, E_Locations.l_19_7);
state.p_Connected.set(E_Locations.l_23_25, E_Locations.l_22_25);
state.p_Connected.set(E_Locations.l_23_20, E_Locations.l_23_19);
state.p_Connected.set(E_Locations.l_21_15, E_Locations.l_21_16);
state.p_Connected.set(E_Locations.l_24_5, E_Locations.l_24_4);
state.p_Connected.set(E_Locations.l_17_8, E_Locations.l_17_9);
state.p_Connected.set(E_Locations.l_5_18, E_Locations.l_5_19);
state.p_Connected.set(E_Locations.l_15_12, E_Locations.l_16_12);
state.p_Connected.set(E_Locations.l_4_11, E_Locations.l_3_11);
state.p_Connected.set(E_Locations.l_7_3, E_Locations.l_8_3);
state.p_Connected.set(E_Locations.l_10_4, E_Locations.l_9_4);
state.p_Connected.set(E_Locations.l_23_24, E_Locations.l_24_24);
state.p_Connected.set(E_Locations.l_4_25, E_Locations.l_4_24);
state.p_Connected.set(E_Locations.l_5_20, E_Locations.l_4_20);
state.p_Connected.set(E_Locations.l_10_5, E_Locations.l_10_6);
state.p_Connected.set(E_Locations.l_11_11, E_Locations.l_11_12);
state.p_Connected.set(E_Locations.l_18_12, E_Locations.l_17_12);
state.p_Connected.set(E_Locations.l_10_23, E_Locations.l_10_22);
state.p_Connected.set(E_Locations.l_2_21, E_Locations.l_2_20);
state.p_Connected.set(E_Locations.l_21_3, E_Locations.l_21_2);
state.p_Connected.set(E_Locations.l_11_25, E_Locations.l_12_25);
state.p_Connected.set(E_Locations.l_17_4, E_Locations.l_16_4);
state.p_Connected.set(E_Locations.l_16_1, E_Locations.l_16_2);
state.p_Connected.set(E_Locations.l_17_23, E_Locations.l_16_23);
state.p_Connected.set(E_Locations.l_13_4, E_Locations.l_12_4);
state.p_Connected.set(E_Locations.l_9_24, E_Locations.l_10_24);
state.p_Connected.set(E_Locations.l_14_17, E_Locations.l_15_17);
state.p_Connected.set(E_Locations.l_21_4, E_Locations.l_22_4);
state.p_Connected.set(E_Locations.l_23_7, E_Locations.l_23_8);
state.p_Connected.set(E_Locations.l_9_23, E_Locations.l_9_24);
state.p_Connected.set(E_Locations.l_8_5, E_Locations.l_9_5);
state.p_Connected.set(E_Locations.l_24_1, E_Locations.l_23_1);
state.p_Connected.set(E_Locations.l_23_23, E_Locations.l_22_23);
state.p_Connected.set(E_Locations.l_12_7, E_Locations.l_11_7);
state.p_Connected.set(E_Locations.l_12_14, E_Locations.l_13_14);
state.p_Connected.set(E_Locations.l_19_25, E_Locations.l_19_24);
state.p_Connected.set(E_Locations.l_13_14, E_Locations.l_12_14);
state.p_Connected.set(E_Locations.l_24_7, E_Locations.l_25_7);
state.p_Connected.set(E_Locations.l_23_2, E_Locations.l_24_2);
state.p_Connected.set(E_Locations.l_11_8, E_Locations.l_12_8);
state.p_Connected.set(E_Locations.l_21_20, E_Locations.l_21_19);
state.p_Connected.set(E_Locations.l_17_12, E_Locations.l_17_11);
state.p_Connected.set(E_Locations.l_23_3, E_Locations.l_24_3);
state.p_Connected.set(E_Locations.l_6_19, E_Locations.l_7_19);
state.p_Connected.set(E_Locations.l_11_20, E_Locations.l_10_20);
state.p_Connected.set(E_Locations.l_12_3, E_Locations.l_12_2);
state.p_Connected.set(E_Locations.l_11_19, E_Locations.l_11_20);
state.p_Connected.set(E_Locations.l_9_16, E_Locations.l_10_16);
state.p_Connected.set(E_Locations.l_17_13, E_Locations.l_16_13);
state.p_Connected.set(E_Locations.l_3_4, E_Locations.l_3_3);
state.p_Connected.set(E_Locations.l_9_6, E_Locations.l_10_6);
state.p_Connected.set(E_Locations.l_18_24, E_Locations.l_17_24);
state.p_Connected.set(E_Locations.l_1_23, E_Locations.l_1_22);
state.p_Connected.set(E_Locations.l_22_18, E_Locations.l_23_18);
state.p_Connected.set(E_Locations.l_2_5, E_Locations.l_3_5);
state.p_Connected.set(E_Locations.l_6_4, E_Locations.l_7_4);
state.p_Connected.set(E_Locations.l_11_6, E_Locations.l_11_5);
state.p_Connected.set(E_Locations.l_20_24, E_Locations.l_19_24);
state.p_Connected.set(E_Locations.l_22_20, E_Locations.l_22_19);
state.p_Connected.set(E_Locations.l_7_4, E_Locations.l_7_5);
state.p_Connected.set(E_Locations.l_21_10, E_Locations.l_22_10);
state.p_Connected.set(E_Locations.l_18_20, E_Locations.l_18_19);
state.p_Connected.set(E_Locations.l_22_3, E_Locations.l_22_4);
state.p_Connected.set(E_Locations.l_19_11, E_Locations.l_19_10);
state.p_Connected.set(E_Locations.l_16_10, E_Locations.l_17_10);
state.p_Connected.set(E_Locations.l_2_11, E_Locations.l_3_11);
state.p_Connected.set(E_Locations.l_13_11, E_Locations.l_13_10);
state.p_Connected.set(E_Locations.l_14_2, E_Locations.l_14_1);
state.p_Connected.set(E_Locations.l_17_9, E_Locations.l_17_10);
state.p_Connected.set(E_Locations.l_16_14, E_Locations.l_15_14);
state.p_Connected.set(E_Locations.l_3_19, E_Locations.l_3_20);
state.p_Connected.set(E_Locations.l_15_16, E_Locations.l_15_17);
state.p_Connected.set(E_Locations.l_6_21, E_Locations.l_6_20);
state.p_Connected.set(E_Locations.l_23_21, E_Locations.l_24_21);
state.p_Connected.set(E_Locations.l_18_1, E_Locations.l_18_2);
state.p_Connected.set(E_Locations.l_18_6, E_Locations.l_18_7);
state.p_Connected.set(E_Locations.l_10_11, E_Locations.l_9_11);
state.p_Connected.set(E_Locations.l_7_20, E_Locations.l_8_20);
state.p_Connected.set(E_Locations.l_22_8, E_Locations.l_22_7);
state.p_Connected.set(E_Locations.l_25_3, E_Locations.l_24_3);
state.p_Connected.set(E_Locations.l_18_25, E_Locations.l_19_25);
state.p_Connected.set(E_Locations.l_9_7, E_Locations.l_9_8);
state.p_Connected.set(E_Locations.l_5_8, E_Locations.l_5_9);
state.p_Connected.set(E_Locations.l_13_15, E_Locations.l_14_15);
state.p_Connected.set(E_Locations.l_2_10, E_Locations.l_2_9);
state.p_Connected.set(E_Locations.l_25_21, E_Locations.l_25_20);
state.p_Connected.set(E_Locations.l_16_22, E_Locations.l_16_21);
state.p_Connected.set(E_Locations.l_19_12, E_Locations.l_20_12);
state.p_Connected.set(E_Locations.l_7_13, E_Locations.l_7_12);
state.p_Connected.set(E_Locations.l_6_18, E_Locations.l_6_19);
state.p_Connected.set(E_Locations.l_21_5, E_Locations.l_20_5);
state.p_Connected.set(E_Locations.l_15_23, E_Locations.l_15_24);
state.p_Connected.set(E_Locations.l_2_4, E_Locations.l_1_4);
state.p_Connected.set(E_Locations.l_2_20, E_Locations.l_2_19);
state.p_Connected.set(E_Locations.l_17_18, E_Locations.l_17_17);
state.p_Connected.set(E_Locations.l_25_10, E_Locations.l_24_10);
state.p_Connected.set(E_Locations.l_16_24, E_Locations.l_15_24);
state.p_Connected.set(E_Locations.l_6_17, E_Locations.l_6_16);
state.p_Connected.set(E_Locations.l_2_9, E_Locations.l_1_9);
state.p_Connected.set(E_Locations.l_19_23, E_Locations.l_18_23);
state.p_Connected.set(E_Locations.l_2_13, E_Locations.l_1_13);
state.p_Connected.set(E_Locations.l_22_3, E_Locations.l_22_2);
state.p_Connected.set(E_Locations.l_18_22, E_Locations.l_18_23);
state.p_Connected.set(E_Locations.l_2_2, E_Locations.l_2_3);
state.p_Connected.set(E_Locations.l_8_15, E_Locations.l_8_14);
state.p_Connected.set(E_Locations.l_25_15, E_Locations.l_25_16);
state.p_Connected.set(E_Locations.l_22_16, E_Locations.l_22_17);
state.p_Connected.set(E_Locations.l_19_18, E_Locations.l_18_18);
state.p_Connected.set(E_Locations.l_25_11, E_Locations.l_25_10);
state.p_Connected.set(E_Locations.l_3_15, E_Locations.l_3_14);
state.p_Connected.set(E_Locations.l_3_17, E_Locations.l_2_17);
state.p_Connected.set(E_Locations.l_16_8, E_Locations.l_16_7);
state.p_Connected.set(E_Locations.l_17_20, E_Locations.l_17_19);
state.p_Connected.set(E_Locations.l_20_8, E_Locations.l_20_9);
state.p_Connected.set(E_Locations.l_8_11, E_Locations.l_9_11);
state.p_Connected.set(E_Locations.l_10_8, E_Locations.l_11_8);
state.p_Connected.set(E_Locations.l_3_16, E_Locations.l_3_17);
state.p_Connected.set(E_Locations.l_22_19, E_Locations.l_22_20);
state.p_Connected.set(E_Locations.l_13_19, E_Locations.l_13_18);
state.p_Connected.set(E_Locations.l_14_4, E_Locations.l_14_3);
state.p_Connected.set(E_Locations.l_25_18, E_Locations.l_25_19);
state.p_Connected.set(E_Locations.l_3_14, E_Locations.l_2_14);
state.p_Connected.set(E_Locations.l_18_15, E_Locations.l_18_16);
state.p_Connected.set(E_Locations.l_19_3, E_Locations.l_18_3);
state.p_Connected.set(E_Locations.l_16_11, E_Locations.l_17_11);
state.p_Connected.set(E_Locations.l_1_8, E_Locations.l_1_9);
state.p_Connected.set(E_Locations.l_24_11, E_Locations.l_24_12);
state.p_Connected.set(E_Locations.l_4_3, E_Locations.l_4_2);
state.p_Connected.set(E_Locations.l_20_23, E_Locations.l_20_22);
state.p_Connected.set(E_Locations.l_15_14, E_Locations.l_15_13);
state.p_Connected.set(E_Locations.l_15_4, E_Locations.l_16_4);
state.p_Connected.set(E_Locations.l_19_4, E_Locations.l_18_4);
state.p_Connected.set(E_Locations.l_19_8, E_Locations.l_19_9);
state.p_Connected.set(E_Locations.l_7_23, E_Locations.l_7_24);
state.p_Connected.set(E_Locations.l_9_2, E_Locations.l_8_2);
state.p_Connected.set(E_Locations.l_3_12, E_Locations.l_2_12);
state.p_Connected.set(E_Locations.l_12_8, E_Locations.l_11_8);
state.p_Connected.set(E_Locations.l_24_9, E_Locations.l_25_9);
state.p_Connected.set(E_Locations.l_25_8, E_Locations.l_25_9);
state.p_Connected.set(E_Locations.l_7_2, E_Locations.l_7_1);
state.p_Connected.set(E_Locations.l_21_6, E_Locations.l_22_6);
state.p_Connected.set(E_Locations.l_17_1, E_Locations.l_17_2);
state.p_Connected.set(E_Locations.l_25_22, E_Locations.l_25_23);
state.p_Connected.set(E_Locations.l_24_3, E_Locations.l_24_4);
state.p_Connected.set(E_Locations.l_14_23, E_Locations.l_14_22);
state.p_Connected.set(E_Locations.l_9_4, E_Locations.l_8_4);
state.p_Connected.set(E_Locations.l_13_5, E_Locations.l_12_5);
state.p_Connected.set(E_Locations.l_6_11, E_Locations.l_6_10);
state.p_Connected.set(E_Locations.l_20_9, E_Locations.l_21_9);
state.p_Connected.set(E_Locations.l_22_16, E_Locations.l_21_16);
state.p_Connected.set(E_Locations.l_2_7, E_Locations.l_3_7);
state.p_Connected.set(E_Locations.l_23_17, E_Locations.l_23_16);
state.p_Connected.set(E_Locations.l_2_13, E_Locations.l_2_12);
state.p_Connected.set(E_Locations.l_10_4, E_Locations.l_11_4);
state.p_Connected.set(E_Locations.l_12_5, E_Locations.l_12_4);
state.p_Connected.set(E_Locations.l_16_19, E_Locations.l_16_18);
state.p_Connected.set(E_Locations.l_1_3, E_Locations.l_1_4);
state.p_Connected.set(E_Locations.l_11_18, E_Locations.l_11_19);
state.p_Connected.set(E_Locations.l_17_22, E_Locations.l_17_23);
state.p_Connected.set(E_Locations.l_15_25, E_Locations.l_16_25);
state.p_Connected.set(E_Locations.l_10_10, E_Locations.l_11_10);
state.p_Connected.set(E_Locations.l_8_16, E_Locations.l_7_16);
state.p_Connected.set(E_Locations.l_9_7, E_Locations.l_9_6);
state.p_Connected.set(E_Locations.l_13_4, E_Locations.l_14_4);
state.p_Connected.set(E_Locations.l_19_19, E_Locations.l_19_18);
state.p_Connected.set(E_Locations.l_4_1, E_Locations.l_3_1);
state.p_Connected.set(E_Locations.l_16_8, E_Locations.l_15_8);
state.p_Connected.set(E_Locations.l_11_17, E_Locations.l_11_16);
state.p_Connected.set(E_Locations.l_24_15, E_Locations.l_24_14);
state.p_Connected.set(E_Locations.l_8_16, E_Locations.l_9_16);
state.p_Connected.set(E_Locations.l_19_13, E_Locations.l_19_14);
state.p_Connected.set(E_Locations.l_25_15, E_Locations.l_25_14);
state.p_Connected.set(E_Locations.l_17_14, E_Locations.l_16_14);
state.p_Connected.set(E_Locations.l_16_24, E_Locations.l_16_25);
state.p_Connected.set(E_Locations.l_13_12, E_Locations.l_13_11);
state.p_Connected.set(E_Locations.l_13_17, E_Locations.l_12_17);
state.p_Connected.set(E_Locations.l_5_18, E_Locations.l_5_17);
state.p_Connected.set(E_Locations.l_6_25, E_Locations.l_7_25);
state.p_Connected.set(E_Locations.l_17_10, E_Locations.l_18_10);
state.p_Connected.set(E_Locations.l_3_5, E_Locations.l_2_5);
state.p_Connected.set(E_Locations.l_25_14, E_Locations.l_25_15);
state.p_Connected.set(E_Locations.l_19_21, E_Locations.l_19_22);
state.p_Connected.set(E_Locations.l_20_13, E_Locations.l_20_12);
state.p_Connected.set(E_Locations.l_9_12, E_Locations.l_8_12);
state.p_Connected.set(E_Locations.l_19_19, E_Locations.l_19_20);
state.p_Connected.set(E_Locations.l_22_22, E_Locations.l_21_22);
state.p_Connected.set(E_Locations.l_23_5, E_Locations.l_23_4);
state.p_Connected.set(E_Locations.l_22_24, E_Locations.l_21_24);
state.p_Connected.set(E_Locations.l_18_18, E_Locations.l_18_19);
state.p_Connected.set(E_Locations.l_15_7, E_Locations.l_15_8);
state.p_Connected.set(E_Locations.l_17_14, E_Locations.l_17_15);
state.p_Connected.set(E_Locations.l_1_16, E_Locations.l_2_16);
state.p_Connected.set(E_Locations.l_8_5, E_Locations.l_8_4);
state.p_Connected.set(E_Locations.l_5_3, E_Locations.l_5_4);
state.p_Connected.set(E_Locations.l_4_11, E_Locations.l_4_12);
state.p_Connected.set(E_Locations.l_16_21, E_Locations.l_17_21);
state.p_Connected.set(E_Locations.l_24_1, E_Locations.l_25_1);
state.p_Connected.set(E_Locations.l_1_15, E_Locations.l_1_14);
state.p_Connected.set(E_Locations.l_7_12, E_Locations.l_6_12);
state.p_Connected.set(E_Locations.l_19_6, E_Locations.l_19_5);
state.p_Connected.set(E_Locations.l_16_18, E_Locations.l_17_18);
state.p_Connected.set(E_Locations.l_19_8, E_Locations.l_20_8);
state.p_Connected.set(E_Locations.l_20_11, E_Locations.l_19_11);
state.p_Connected.set(E_Locations.l_3_16, E_Locations.l_2_16);
state.p_Connected.set(E_Locations.l_5_8, E_Locations.l_5_7);
state.p_Connected.set(E_Locations.l_13_9, E_Locations.l_13_8);
state.p_Connected.set(E_Locations.l_18_9, E_Locations.l_18_8);
state.p_Connected.set(E_Locations.l_19_24, E_Locations.l_19_23);
state.p_Connected.set(E_Locations.l_1_24, E_Locations.l_1_23);
state.p_Connected.set(E_Locations.l_25_8, E_Locations.l_24_8);
state.p_Connected.set(E_Locations.l_24_20, E_Locations.l_24_21);
state.p_Connected.set(E_Locations.l_10_22, E_Locations.l_10_23);
state.p_Connected.set(E_Locations.l_19_9, E_Locations.l_19_10);
state.p_Connected.set(E_Locations.l_4_9, E_Locations.l_4_10);
state.p_Connected.set(E_Locations.l_1_22, E_Locations.l_2_22);
state.p_Connected.set(E_Locations.l_9_18, E_Locations.l_10_18);
state.p_Connected.set(E_Locations.l_19_3, E_Locations.l_19_4);
state.p_Connected.set(E_Locations.l_20_3, E_Locations.l_20_4);
state.p_Connected.set(E_Locations.l_14_4, E_Locations.l_15_4);
state.p_Connected.set(E_Locations.l_22_8, E_Locations.l_21_8);
state.p_Connected.set(E_Locations.l_15_13, E_Locations.l_14_13);
state.p_Connected.set(E_Locations.l_20_19, E_Locations.l_19_19);
state.p_Connected.set(E_Locations.l_21_22, E_Locations.l_21_21);
state.p_Connected.set(E_Locations.l_23_21, E_Locations.l_22_21);
state.p_Connected.set(E_Locations.l_15_18, E_Locations.l_15_17);
state.p_Connected.set(E_Locations.l_22_24, E_Locations.l_22_23);
state.p_Connected.set(E_Locations.l_20_24, E_Locations.l_20_25);
state.p_Connected.set(E_Locations.l_14_7, E_Locations.l_14_8);
state.p_Connected.set(E_Locations.l_5_19, E_Locations.l_6_19);
state.p_Connected.set(E_Locations.l_17_6, E_Locations.l_18_6);
state.p_Connected.set(E_Locations.l_23_24, E_Locations.l_23_23);
state.p_Connected.set(E_Locations.l_10_15, E_Locations.l_9_15);
state.p_Connected.set(E_Locations.l_14_7, E_Locations.l_15_7);
state.p_Connected.set(E_Locations.l_19_21, E_Locations.l_19_20);
state.p_Connected.set(E_Locations.l_22_13, E_Locations.l_22_14);
state.p_Connected.set(E_Locations.l_7_7, E_Locations.l_7_8);
state.p_Connected.set(E_Locations.l_18_16, E_Locations.l_18_15);
state.p_Connected.set(E_Locations.l_23_21, E_Locations.l_23_20);
state.p_Connected.set(E_Locations.l_24_3, E_Locations.l_25_3);
state.p_Connected.set(E_Locations.l_15_1, E_Locations.l_14_1);
state.p_Connected.set(E_Locations.l_10_22, E_Locations.l_9_22);
state.p_Connected.set(E_Locations.l_12_25, E_Locations.l_11_25);
state.p_Connected.set(E_Locations.l_13_12, E_Locations.l_12_12);
state.p_Connected.set(E_Locations.l_7_18, E_Locations.l_8_18);
state.p_Connected.set(E_Locations.l_13_10, E_Locations.l_13_11);
state.p_Connected.set(E_Locations.l_7_12, E_Locations.l_7_13);
state.p_Connected.set(E_Locations.l_21_18, E_Locations.l_21_19);
state.p_Connected.set(E_Locations.l_25_20, E_Locations.l_25_21);
state.p_Connected.set(E_Locations.l_8_13, E_Locations.l_7_13);
state.p_Connected.set(E_Locations.l_10_18, E_Locations.l_10_19);
state.p_Connected.set(E_Locations.l_2_6, E_Locations.l_1_6);
state.p_Connected.set(E_Locations.l_12_22, E_Locations.l_12_21);
state.p_Connected.set(E_Locations.l_14_8, E_Locations.l_14_7);
state.p_Connected.set(E_Locations.l_8_18, E_Locations.l_7_18);
state.p_Connected.set(E_Locations.l_22_17, E_Locations.l_23_17);
state.p_Connected.set(E_Locations.l_6_15, E_Locations.l_6_16);
state.p_Connected.set(E_Locations.l_15_3, E_Locations.l_15_2);
state.p_Connected.set(E_Locations.l_18_5, E_Locations.l_18_6);
state.p_Connected.set(E_Locations.l_18_13, E_Locations.l_18_12);
state.p_Connected.set(E_Locations.l_15_10, E_Locations.l_15_9);
state.p_Connected.set(E_Locations.l_3_15, E_Locations.l_4_15);
state.p_Connected.set(E_Locations.l_5_12, E_Locations.l_5_11);
state.p_Connected.set(E_Locations.l_13_3, E_Locations.l_13_2);
state.p_Connected.set(E_Locations.l_5_7, E_Locations.l_5_8);
state.p_Connected.set(E_Locations.l_22_11, E_Locations.l_23_11);
state.p_Connected.set(E_Locations.l_4_15, E_Locations.l_5_15);
state.p_Connected.set(E_Locations.l_10_13, E_Locations.l_9_13);
state.p_Connected.set(E_Locations.l_14_5, E_Locations.l_13_5);
state.p_Connected.set(E_Locations.l_23_24, E_Locations.l_23_25);
state.p_Connected.set(E_Locations.l_20_9, E_Locations.l_20_8);
state.p_Connected.set(E_Locations.l_8_24, E_Locations.l_7_24);
state.p_Connected.set(E_Locations.l_14_23, E_Locations.l_14_24);
state.p_Connected.set(E_Locations.l_11_16, E_Locations.l_11_15);
state.p_Connected.set(E_Locations.l_24_19, E_Locations.l_24_18);
state.p_Connected.set(E_Locations.l_15_18, E_Locations.l_16_18);
state.p_Connected.set(E_Locations.l_19_10, E_Locations.l_19_9);
state.p_Connected.set(E_Locations.l_12_6, E_Locations.l_13_6);
state.p_Connected.set(E_Locations.l_12_4, E_Locations.l_13_4);
state.p_Connected.set(E_Locations.l_4_15, E_Locations.l_4_14);
state.p_Connected.set(E_Locations.l_13_16, E_Locations.l_13_15);
state.p_Connected.set(E_Locations.l_20_25, E_Locations.l_19_25);
state.p_Connected.set(E_Locations.l_17_12, E_Locations.l_17_13);
state.p_Connected.set(E_Locations.l_17_15, E_Locations.l_17_16);
state.p_Connected.set(E_Locations.l_17_19, E_Locations.l_16_19);
state.p_Connected.set(E_Locations.l_5_19, E_Locations.l_4_19);
state.p_Connected.set(E_Locations.l_11_3, E_Locations.l_10_3);
state.p_Connected.set(E_Locations.l_18_12, E_Locations.l_18_13);
state.p_Connected.set(E_Locations.l_8_8, E_Locations.l_9_8);
state.p_Connected.set(E_Locations.l_3_25, E_Locations.l_3_24);
state.p_Connected.set(E_Locations.l_8_4, E_Locations.l_8_5);
state.p_Connected.set(E_Locations.l_24_13, E_Locations.l_24_14);
state.p_Connected.set(E_Locations.l_14_22, E_Locations.l_14_21);
state.p_Connected.set(E_Locations.l_12_8, E_Locations.l_13_8);
state.p_Connected.set(E_Locations.l_16_14, E_Locations.l_17_14);
state.p_Connected.set(E_Locations.l_17_14, E_Locations.l_18_14);
state.p_Connected.set(E_Locations.l_13_24, E_Locations.l_12_24);
state.p_Connected.set(E_Locations.l_17_4, E_Locations.l_17_3);
state.p_Connected.set(E_Locations.l_25_23, E_Locations.l_25_24);
state.p_Connected.set(E_Locations.l_24_14, E_Locations.l_24_15);
state.p_Connected.set(E_Locations.l_23_19, E_Locations.l_23_18);
state.p_Connected.set(E_Locations.l_24_25, E_Locations.l_25_25);
state.p_Connected.set(E_Locations.l_18_22, E_Locations.l_19_22);
state.p_Connected.set(E_Locations.l_16_8, E_Locations.l_17_8);
state.p_Connected.set(E_Locations.l_21_16, E_Locations.l_22_16);
state.p_Connected.set(E_Locations.l_9_4, E_Locations.l_9_5);
state.p_Connected.set(E_Locations.l_12_23, E_Locations.l_11_23);
state.p_Connected.set(E_Locations.l_6_10, E_Locations.l_6_9);
state.p_Connected.set(E_Locations.l_7_23, E_Locations.l_6_23);
state.p_Connected.set(E_Locations.l_9_19, E_Locations.l_10_19);
state.p_Connected.set(E_Locations.l_6_20, E_Locations.l_6_19);
state.p_Connected.set(E_Locations.l_21_18, E_Locations.l_21_17);
state.p_Connected.set(E_Locations.l_9_9, E_Locations.l_9_8);
state.p_Connected.set(E_Locations.l_23_6, E_Locations.l_22_6);
state.p_Connected.set(E_Locations.l_1_23, E_Locations.l_1_24);
state.p_Connected.set(E_Locations.l_13_16, E_Locations.l_14_16);
state.p_Connected.set(E_Locations.l_9_10, E_Locations.l_8_10);
state.p_Connected.set(E_Locations.l_5_14, E_Locations.l_4_14);
state.p_Connected.set(E_Locations.l_17_13, E_Locations.l_17_14);
state.p_Connected.set(E_Locations.l_17_7, E_Locations.l_18_7);
state.p_Connected.set(E_Locations.l_15_8, E_Locations.l_14_8);
state.p_Connected.set(E_Locations.l_13_13, E_Locations.l_13_14);
state.p_Connected.set(E_Locations.l_23_3, E_Locations.l_22_3);
state.p_Connected.set(E_Locations.l_24_15, E_Locations.l_23_15);
state.p_Connected.set(E_Locations.l_4_6, E_Locations.l_4_5);
state.p_Connected.set(E_Locations.l_22_7, E_Locations.l_21_7);
state.p_Connected.set(E_Locations.l_13_6, E_Locations.l_12_6);
state.p_Connected.set(E_Locations.l_21_14, E_Locations.l_21_13);
state.p_Connected.set(E_Locations.l_20_22, E_Locations.l_21_22);
state.p_Connected.set(E_Locations.l_19_17, E_Locations.l_19_18);
state.p_Connected.set(E_Locations.l_18_14, E_Locations.l_17_14);
state.p_Connected.set(E_Locations.l_19_21, E_Locations.l_20_21);
state.p_Connected.set(E_Locations.l_13_18, E_Locations.l_13_19);
state.p_Connected.set(E_Locations.l_16_16, E_Locations.l_16_15);
state.p_Connected.set(E_Locations.l_25_5, E_Locations.l_25_4);
state.p_Connected.set(E_Locations.l_5_22, E_Locations.l_6_22);
state.p_Connected.set(E_Locations.l_16_11, E_Locations.l_15_11);
state.p_Connected.set(E_Locations.l_2_16, E_Locations.l_3_16);
state.p_Connected.set(E_Locations.l_2_11, E_Locations.l_1_11);
state.p_Connected.set(E_Locations.l_20_14, E_Locations.l_20_13);
state.p_Connected.set(E_Locations.l_6_8, E_Locations.l_6_9);
state.p_Connected.set(E_Locations.l_4_13, E_Locations.l_5_13);
state.p_Connected.set(E_Locations.l_3_2, E_Locations.l_2_2);
state.p_Connected.set(E_Locations.l_19_22, E_Locations.l_19_23);
state.p_Connected.set(E_Locations.l_8_1, E_Locations.l_8_2);
state.p_Connected.set(E_Locations.l_20_3, E_Locations.l_21_3);
state.p_Connected.set(E_Locations.l_4_2, E_Locations.l_4_1);
state.p_Connected.set(E_Locations.l_23_22, E_Locations.l_23_21);
state.p_Connected.set(E_Locations.l_21_20, E_Locations.l_22_20);
state.p_Connected.set(E_Locations.l_6_22, E_Locations.l_6_21);
state.p_Connected.set(E_Locations.l_10_14, E_Locations.l_11_14);
state.p_Connected.set(E_Locations.l_20_11, E_Locations.l_21_11);
state.p_Connected.set(E_Locations.l_15_21, E_Locations.l_15_22);
state.p_Connected.set(E_Locations.l_15_18, E_Locations.l_14_18);
state.p_Connected.set(E_Locations.l_3_19, E_Locations.l_4_19);
state.p_Connected.set(E_Locations.l_20_6, E_Locations.l_20_7);
state.p_Connected.set(E_Locations.l_21_12, E_Locations.l_20_12);
state.p_Connected.set(E_Locations.l_24_10, E_Locations.l_24_9);
state.p_Connected.set(E_Locations.l_1_11, E_Locations.l_2_11);
state.p_Connected.set(E_Locations.l_4_23, E_Locations.l_3_23);
state.p_Connected.set(E_Locations.l_3_25, E_Locations.l_2_25);
state.p_Connected.set(E_Locations.l_1_5, E_Locations.l_1_6);
state.p_Connected.set(E_Locations.l_16_18, E_Locations.l_16_17);
state.p_Connected.set(E_Locations.l_23_8, E_Locations.l_23_9);
state.p_Connected.set(E_Locations.l_19_24, E_Locations.l_18_24);
state.p_Connected.set(E_Locations.l_5_1, E_Locations.l_6_1);
state.p_Connected.set(E_Locations.l_10_21, E_Locations.l_10_22);
state.p_Connected.set(E_Locations.l_13_2, E_Locations.l_14_2);
state.p_Connected.set(E_Locations.l_3_6, E_Locations.l_3_5);
state.p_Connected.set(E_Locations.l_20_11, E_Locations.l_20_10);
state.p_Connected.set(E_Locations.l_11_11, E_Locations.l_10_11);
state.p_Connected.set(E_Locations.l_22_15, E_Locations.l_23_15);
state.p_Connected.set(E_Locations.l_4_6, E_Locations.l_5_6);
state.p_Connected.set(E_Locations.l_19_6, E_Locations.l_20_6);
state.p_Connected.set(E_Locations.l_22_18, E_Locations.l_21_18);
state.p_Connected.set(E_Locations.l_22_21, E_Locations.l_21_21);
state.p_Connected.set(E_Locations.l_2_7, E_Locations.l_1_7);
state.p_Connected.set(E_Locations.l_6_3, E_Locations.l_5_3);
state.p_Connected.set(E_Locations.l_11_20, E_Locations.l_11_19);
state.p_Connected.set(E_Locations.l_16_2, E_Locations.l_15_2);
state.p_Connected.set(E_Locations.l_7_24, E_Locations.l_8_24);
state.p_Connected.set(E_Locations.l_16_4, E_Locations.l_16_5);
state.p_Connected.set(E_Locations.l_12_23, E_Locations.l_12_24);
state.p_Connected.set(E_Locations.l_18_4, E_Locations.l_18_3);
state.p_Connected.set(E_Locations.l_21_14, E_Locations.l_22_14);
state.p_Connected.set(E_Locations.l_11_5, E_Locations.l_10_5);
state.p_Connected.set(E_Locations.l_14_5, E_Locations.l_14_4);
state.p_Connected.set(E_Locations.l_7_13, E_Locations.l_7_14);
state.p_Connected.set(E_Locations.l_16_9, E_Locations.l_16_10);
state.p_Connected.set(E_Locations.l_22_7, E_Locations.l_22_6);
state.p_Connected.set(E_Locations.l_12_1, E_Locations.l_13_1);
state.p_Connected.set(E_Locations.l_23_11, E_Locations.l_23_10);
state.p_Connected.set(E_Locations.l_11_13, E_Locations.l_10_13);
state.p_Connected.set(E_Locations.l_12_21, E_Locations.l_11_21);
state.p_Connected.set(E_Locations.l_5_16, E_Locations.l_5_17);
state.p_Connected.set(E_Locations.l_11_10, E_Locations.l_11_9);
state.p_Connected.set(E_Locations.l_12_16, E_Locations.l_12_17);
state.p_Connected.set(E_Locations.l_24_20, E_Locations.l_25_20);
state.p_Connected.set(E_Locations.l_24_15, E_Locations.l_24_16);
state.p_Connected.set(E_Locations.l_3_24, E_Locations.l_4_24);
state.p_Connected.set(E_Locations.l_22_1, E_Locations.l_23_1);
state.p_Connected.set(E_Locations.l_23_5, E_Locations.l_22_5);
state.p_Connected.set(E_Locations.l_5_13, E_Locations.l_6_13);
state.p_Connected.set(E_Locations.l_23_6, E_Locations.l_23_5);
state.p_Connected.set(E_Locations.l_5_24, E_Locations.l_5_23);
state.p_Connected.set(E_Locations.l_5_2, E_Locations.l_4_2);
state.p_Connected.set(E_Locations.l_6_14, E_Locations.l_6_15);
state.p_Connected.set(E_Locations.l_11_2, E_Locations.l_10_2);
state.p_Connected.set(E_Locations.l_15_4, E_Locations.l_15_5);
state.p_Connected.set(E_Locations.l_16_10, E_Locations.l_16_11);
state.p_Connected.set(E_Locations.l_10_7, E_Locations.l_10_6);
state.p_Connected.set(E_Locations.l_20_19, E_Locations.l_20_20);
state.p_Connected.set(E_Locations.l_10_7, E_Locations.l_10_8);
state.p_Connected.set(E_Locations.l_13_21, E_Locations.l_13_22);
state.p_Connected.set(E_Locations.l_6_6, E_Locations.l_5_6);
state.p_Connected.set(E_Locations.l_12_8, E_Locations.l_12_7);
state.p_Connected.set(E_Locations.l_16_15, E_Locations.l_15_15);
state.p_Connected.set(E_Locations.l_8_22, E_Locations.l_8_21);
state.p_Connected.set(E_Locations.l_25_9, E_Locations.l_25_10);
state.p_Connected.set(E_Locations.l_14_11, E_Locations.l_15_11);
state.p_Connected.set(E_Locations.l_11_12, E_Locations.l_10_12);
state.p_Connected.set(E_Locations.l_13_25, E_Locations.l_13_24);
state.p_Connected.set(E_Locations.l_2_11, E_Locations.l_2_12);
state.p_Connected.set(E_Locations.l_19_15, E_Locations.l_19_14);
state.p_Connected.set(E_Locations.l_1_4, E_Locations.l_2_4);
state.p_Connected.set(E_Locations.l_23_18, E_Locations.l_22_18);
state.p_Connected.set(E_Locations.l_23_15, E_Locations.l_23_16);
state.p_Connected.set(E_Locations.l_17_8, E_Locations.l_17_7);
state.p_Connected.set(E_Locations.l_7_14, E_Locations.l_7_13);
state.p_Connected.set(E_Locations.l_3_2, E_Locations.l_3_1);
state.p_Connected.set(E_Locations.l_21_3, E_Locations.l_20_3);
state.p_Connected.set(E_Locations.l_2_13, E_Locations.l_2_14);
state.p_Connected.set(E_Locations.l_16_2, E_Locations.l_16_3);
state.p_Connected.set(E_Locations.l_8_25, E_Locations.l_8_24);
state.p_Connected.set(E_Locations.l_24_6, E_Locations.l_23_6);
state.p_Connected.set(E_Locations.l_14_3, E_Locations.l_14_2);
state.p_Connected.set(E_Locations.l_2_21, E_Locations.l_1_21);
state.p_Connected.set(E_Locations.l_6_5, E_Locations.l_6_4);
state.p_Connected.set(E_Locations.l_25_21, E_Locations.l_24_21);
state.p_Connected.set(E_Locations.l_12_1, E_Locations.l_12_2);
state.p_Connected.set(E_Locations.l_15_17, E_Locations.l_15_16);
state.p_Connected.set(E_Locations.l_24_16, E_Locations.l_25_16);
state.p_Connected.set(E_Locations.l_6_2, E_Locations.l_6_1);
state.p_Connected.set(E_Locations.l_12_20, E_Locations.l_11_20);
state.p_Connected.set(E_Locations.l_14_13, E_Locations.l_15_13);
state.p_Connected.set(E_Locations.l_9_15, E_Locations.l_9_16);
state.p_Connected.set(E_Locations.l_14_9, E_Locations.l_13_9);
state.p_Connected.set(E_Locations.l_6_14, E_Locations.l_5_14);
state.p_Connected.set(E_Locations.l_25_9, E_Locations.l_24_9);
state.p_Connected.set(E_Locations.l_6_12, E_Locations.l_5_12);
state.p_Connected.set(E_Locations.l_22_5, E_Locations.l_23_5);
state.p_Connected.set(E_Locations.l_17_11, E_Locations.l_16_11);
state.p_Connected.set(E_Locations.l_10_19, E_Locations.l_11_19);
state.p_Connected.set(E_Locations.l_18_21, E_Locations.l_17_21);
state.p_Connected.set(E_Locations.l_22_14, E_Locations.l_22_15);
state.p_Connected.set(E_Locations.l_18_11, E_Locations.l_18_12);
state.p_Connected.set(E_Locations.l_2_25, E_Locations.l_2_24);
state.p_Connected.set(E_Locations.l_10_3, E_Locations.l_9_3);
state.p_Connected.set(E_Locations.l_23_4, E_Locations.l_24_4);
state.p_Connected.set(E_Locations.l_21_4, E_Locations.l_21_3);
state.p_Connected.set(E_Locations.l_20_9, E_Locations.l_19_9);
state.p_Connected.set(E_Locations.l_18_12, E_Locations.l_18_11);
state.p_Connected.set(E_Locations.l_5_24, E_Locations.l_5_25);
state.p_Connected.set(E_Locations.l_25_14, E_Locations.l_24_14);
state.p_Connected.set(E_Locations.l_5_10, E_Locations.l_4_10);
state.p_Connected.set(E_Locations.l_21_9, E_Locations.l_22_9);
state.p_Connected.set(E_Locations.l_23_15, E_Locations.l_22_15);
state.p_Connected.set(E_Locations.l_24_8, E_Locations.l_25_8);
state.p_Connected.set(E_Locations.l_7_24, E_Locations.l_6_24);
state.p_Connected.set(E_Locations.l_8_19, E_Locations.l_9_19);
state.p_Connected.set(E_Locations.l_5_3, E_Locations.l_6_3);
state.p_Connected.set(E_Locations.l_4_5, E_Locations.l_3_5);
state.p_Connected.set(E_Locations.l_14_18, E_Locations.l_14_19);
state.p_Connected.set(E_Locations.l_24_5, E_Locations.l_23_5);
state.p_Connected.set(E_Locations.l_5_12, E_Locations.l_6_12);
state.p_Connected.set(E_Locations.l_24_7, E_Locations.l_23_7);
state.p_Connected.set(E_Locations.l_24_10, E_Locations.l_23_10);
state.p_Connected.set(E_Locations.l_12_23, E_Locations.l_13_23);
state.p_Connected.set(E_Locations.l_2_21, E_Locations.l_2_22);
state.p_Connected.set(E_Locations.l_18_24, E_Locations.l_18_25);
state.p_Connected.set(E_Locations.l_7_1, E_Locations.l_7_2);
state.p_Connected.set(E_Locations.l_22_23, E_Locations.l_22_24);
state.p_Connected.set(E_Locations.l_8_4, E_Locations.l_8_3);
state.p_Connected.set(E_Locations.l_25_4, E_Locations.l_25_3);
state.p_Connected.set(E_Locations.l_1_14, E_Locations.l_1_15);
state.p_Connected.set(E_Locations.l_1_12, E_Locations.l_1_13);
state.p_Connected.set(E_Locations.l_3_19, E_Locations.l_3_18);
state.p_Connected.set(E_Locations.l_24_12, E_Locations.l_25_12);
state.p_Connected.set(E_Locations.l_23_25, E_Locations.l_24_25);
state.p_Connected.set(E_Locations.l_18_23, E_Locations.l_17_23);
state.p_Connected.set(E_Locations.l_21_3, E_Locations.l_22_3);
state.p_Connected.set(E_Locations.l_6_23, E_Locations.l_6_22);
state.p_Connected.set(E_Locations.l_3_17, E_Locations.l_3_18);
state.p_Connected.set(E_Locations.l_19_13, E_Locations.l_18_13);
state.p_Connected.set(E_Locations.l_3_1, E_Locations.l_4_1);
state.p_Connected.set(E_Locations.l_10_4, E_Locations.l_10_3);
state.p_Connected.set(E_Locations.l_3_3, E_Locations.l_3_2);
state.p_Connected.set(E_Locations.l_22_22, E_Locations.l_22_23);
state.p_Connected.set(E_Locations.l_20_5, E_Locations.l_20_6);
state.p_Connected.set(E_Locations.l_22_15, E_Locations.l_21_15);
state.p_Connected.set(E_Locations.l_19_10, E_Locations.l_20_10);
state.p_Connected.set(E_Locations.l_22_8, E_Locations.l_22_9);
state.p_Connected.set(E_Locations.l_4_17, E_Locations.l_4_18);
state.p_Connected.set(E_Locations.l_6_23, E_Locations.l_5_23);
state.p_Connected.set(E_Locations.l_11_12, E_Locations.l_11_13);
state.p_Connected.set(E_Locations.l_8_19, E_Locations.l_7_19);
state.p_Connected.set(E_Locations.l_20_6, E_Locations.l_19_6);
state.p_Connected.set(E_Locations.l_21_3, E_Locations.l_21_4);
state.p_Connected.set(E_Locations.l_5_6, E_Locations.l_6_6);
state.p_Connected.set(E_Locations.l_8_10, E_Locations.l_9_10);
state.p_Connected.set(E_Locations.l_22_23, E_Locations.l_21_23);
state.p_Connected.set(E_Locations.l_9_14, E_Locations.l_10_14);
state.p_Connected.set(E_Locations.l_5_25, E_Locations.l_5_24);
state.p_Connected.set(E_Locations.l_25_12, E_Locations.l_25_13);
state.p_Connected.set(E_Locations.l_10_12, E_Locations.l_10_13);
state.p_Connected.set(E_Locations.l_22_6, E_Locations.l_23_6);
state.p_Connected.set(E_Locations.l_23_7, E_Locations.l_22_7);
state.p_Connected.set(E_Locations.l_20_19, E_Locations.l_21_19);
state.p_Connected.set(E_Locations.l_9_1, E_Locations.l_10_1);
state.p_Connected.set(E_Locations.l_6_19, E_Locations.l_5_19);
state.p_Connected.set(E_Locations.l_4_18, E_Locations.l_4_17);
state.p_Connected.set(E_Locations.l_7_8, E_Locations.l_8_8);
state.p_Connected.set(E_Locations.l_21_6, E_Locations.l_20_6);
state.p_Connected.set(E_Locations.l_21_24, E_Locations.l_21_25);
state.p_Connected.set(E_Locations.l_21_5, E_Locations.l_22_5);
state.p_Connected.set(E_Locations.l_1_16, E_Locations.l_1_17);
state.p_Connected.set(E_Locations.l_25_6, E_Locations.l_25_7);
state.p_Connected.set(E_Locations.l_16_6, E_Locations.l_16_5);
state.p_Connected.set(E_Locations.l_12_12, E_Locations.l_13_12);
state.p_Connected.set(E_Locations.l_13_1, E_Locations.l_13_2);
state.p_Connected.set(E_Locations.l_1_10, E_Locations.l_1_9);
state.p_Connected.set(E_Locations.l_15_14, E_Locations.l_14_14);
state.p_Connected.set(E_Locations.l_8_12, E_Locations.l_9_12);
state.p_Connected.set(E_Locations.l_9_3, E_Locations.l_8_3);
state.p_Connected.set(E_Locations.l_10_15, E_Locations.l_10_14);
state.p_Connected.set(E_Locations.l_7_22, E_Locations.l_7_21);
state.p_Connected.set(E_Locations.l_12_20, E_Locations.l_12_19);
state.p_Connected.set(E_Locations.l_2_24, E_Locations.l_1_24);
state.p_Connected.set(E_Locations.l_14_24, E_Locations.l_13_24);
state.p_Connected.set(E_Locations.l_8_4, E_Locations.l_7_4);
state.p_Connected.set(E_Locations.l_19_18, E_Locations.l_19_17);
state.p_Connected.set(E_Locations.l_20_2, E_Locations.l_20_1);
state.p_Connected.set(E_Locations.l_1_8, E_Locations.l_2_8);
state.p_Connected.set(E_Locations.l_11_22, E_Locations.l_12_22);
state.p_Connected.set(E_Locations.l_21_2, E_Locations.l_21_3);
state.p_Connected.set(E_Locations.l_15_15, E_Locations.l_15_16);
state.p_Connected.set(E_Locations.l_14_25, E_Locations.l_13_25);
state.p_Connected.set(E_Locations.l_2_6, E_Locations.l_2_5);
state.p_Connected.set(E_Locations.l_16_23, E_Locations.l_16_22);
state.p_Connected.set(E_Locations.l_24_11, E_Locations.l_24_10);
state.p_Connected.set(E_Locations.l_23_20, E_Locations.l_23_21);
state.p_Connected.set(E_Locations.l_2_17, E_Locations.l_2_18);
state.p_Connected.set(E_Locations.l_11_24, E_Locations.l_10_24);
state.p_Connected.set(E_Locations.l_4_18, E_Locations.l_4_19);
state.p_Connected.set(E_Locations.l_23_8, E_Locations.l_23_7);
state.p_Connected.set(E_Locations.l_5_23, E_Locations.l_5_22);
state.p_Connected.set(E_Locations.l_11_5, E_Locations.l_11_6);
state.p_Connected.set(E_Locations.l_5_3, E_Locations.l_4_3);
state.p_Connected.set(E_Locations.l_16_9, E_Locations.l_17_9);
state.p_Connected.set(E_Locations.l_20_5, E_Locations.l_20_4);
state.p_Connected.set(E_Locations.l_25_1, E_Locations.l_24_1);
state.p_Connected.set(E_Locations.l_25_20, E_Locations.l_25_19);
state.p_Connected.set(E_Locations.l_19_11, E_Locations.l_20_11);
state.p_Connected.set(E_Locations.l_7_17, E_Locations.l_7_16);
state.p_Connected.set(E_Locations.l_10_3, E_Locations.l_10_2);
state.p_Connected.set(E_Locations.l_9_11, E_Locations.l_9_12);
state.p_Connected.set(E_Locations.l_3_14, E_Locations.l_3_13);
state.p_Connected.set(E_Locations.l_16_12, E_Locations.l_17_12);
state.p_Connected.set(E_Locations.l_14_21, E_Locations.l_14_22);
state.p_Connected.set(E_Locations.l_11_1, E_Locations.l_10_1);
state.p_Connected.set(E_Locations.l_3_15, E_Locations.l_3_16);
state.p_Connected.set(E_Locations.l_6_16, E_Locations.l_6_15);
state.p_Connected.set(E_Locations.l_12_4, E_Locations.l_11_4);
state.p_Connected.set(E_Locations.l_20_1, E_Locations.l_20_2);
state.p_Connected.set(E_Locations.l_19_6, E_Locations.l_18_6);
state.p_Connected.set(E_Locations.l_8_16, E_Locations.l_8_17);
state.p_Connected.set(E_Locations.l_8_2, E_Locations.l_8_1);
state.p_Connected.set(E_Locations.l_2_12, E_Locations.l_2_13);
state.p_Connected.set(E_Locations.l_10_20, E_Locations.l_10_21);
state.p_Connected.set(E_Locations.l_14_2, E_Locations.l_14_3);
state.p_Connected.set(E_Locations.l_14_22, E_Locations.l_14_23);
state.p_Connected.set(E_Locations.l_13_1, E_Locations.l_14_1);
state.p_Connected.set(E_Locations.l_17_17, E_Locations.l_16_17);
state.p_Connected.set(E_Locations.l_24_3, E_Locations.l_24_2);
state.p_Connected.set(E_Locations.l_6_10, E_Locations.l_5_10);
state.p_Connected.set(E_Locations.l_5_4, E_Locations.l_4_4);
state.p_Connected.set(E_Locations.l_8_14, E_Locations.l_8_15);
state.p_Connected.set(E_Locations.l_7_5, E_Locations.l_6_5);
state.p_Connected.set(E_Locations.l_4_19, E_Locations.l_5_19);
state.p_Connected.set(E_Locations.l_17_21, E_Locations.l_17_20);
state.p_Connected.set(E_Locations.l_4_9, E_Locations.l_3_9);
state.p_Connected.set(E_Locations.l_17_19, E_Locations.l_17_20);
state.p_Connected.set(E_Locations.l_14_12, E_Locations.l_13_12);
state.p_Connected.set(E_Locations.l_15_4, E_Locations.l_14_4);
state.p_Connected.set(E_Locations.l_15_19, E_Locations.l_14_19);
state.p_Connected.set(E_Locations.l_23_6, E_Locations.l_23_7);
state.p_Connected.set(E_Locations.l_1_14, E_Locations.l_2_14);
state.p_Connected.set(E_Locations.l_18_8, E_Locations.l_18_9);
state.p_Connected.set(E_Locations.l_25_13, E_Locations.l_25_14);
state.p_Connected.set(E_Locations.l_13_9, E_Locations.l_13_10);
state.p_Connected.set(E_Locations.l_14_2, E_Locations.l_15_2);
state.p_Connected.set(E_Locations.l_3_22, E_Locations.l_4_22);
state.p_Connected.set(E_Locations.l_10_4, E_Locations.l_10_5);
state.p_Connected.set(E_Locations.l_3_12, E_Locations.l_3_13);
state.p_Connected.set(E_Locations.l_19_14, E_Locations.l_19_15);
state.p_Connected.set(E_Locations.l_20_11, E_Locations.l_20_12);
state.p_Connected.set(E_Locations.l_3_4, E_Locations.l_4_4);
state.p_Connected.set(E_Locations.l_13_16, E_Locations.l_13_17);
state.p_Connected.set(E_Locations.l_4_13, E_Locations.l_4_14);
state.p_Connected.set(E_Locations.l_11_24, E_Locations.l_12_24);
state.p_Connected.set(E_Locations.l_10_16, E_Locations.l_9_16);
state.p_Connected.set(E_Locations.l_5_17, E_Locations.l_4_17);
state.p_Connected.set(E_Locations.l_2_10, E_Locations.l_2_11);
state.p_Connected.set(E_Locations.l_12_9, E_Locations.l_13_9);
state.p_Connected.set(E_Locations.l_6_12, E_Locations.l_6_13);
state.p_Connected.set(E_Locations.l_23_7, E_Locations.l_23_6);
state.p_Connected.set(E_Locations.l_24_22, E_Locations.l_25_22);
state.p_Connected.set(E_Locations.l_4_1, E_Locations.l_5_1);
state.p_Connected.set(E_Locations.l_8_22, E_Locations.l_7_22);
state.p_Connected.set(E_Locations.l_9_24, E_Locations.l_9_23);
state.p_Connected.set(E_Locations.l_25_10, E_Locations.l_25_11);
state.p_Connected.set(E_Locations.l_20_21, E_Locations.l_21_21);
state.p_Connected.set(E_Locations.l_16_17, E_Locations.l_15_17);
state.p_Connected.set(E_Locations.l_10_18, E_Locations.l_10_17);
state.p_Connected.set(E_Locations.l_21_6, E_Locations.l_21_5);
state.p_Connected.set(E_Locations.l_13_23, E_Locations.l_14_23);
state.p_Connected.set(E_Locations.l_2_20, E_Locations.l_1_20);
state.p_Connected.set(E_Locations.l_1_4, E_Locations.l_1_3);
state.p_Connected.set(E_Locations.l_6_13, E_Locations.l_6_12);
state.p_Connected.set(E_Locations.l_21_9, E_Locations.l_21_10);
state.p_Connected.set(E_Locations.l_22_16, E_Locations.l_23_16);
state.p_Connected.set(E_Locations.l_12_16, E_Locations.l_13_16);
state.p_Connected.set(E_Locations.l_22_23, E_Locations.l_23_23);
state.p_Connected.set(E_Locations.l_9_15, E_Locations.l_8_15);
state.p_Connected.set(E_Locations.l_6_24, E_Locations.l_6_23);
state.p_Connected.set(E_Locations.l_14_8, E_Locations.l_15_8);
state.p_Connected.set(E_Locations.l_10_1, E_Locations.l_11_1);
state.p_Connected.set(E_Locations.l_18_21, E_Locations.l_18_22);
state.p_Connected.set(E_Locations.l_24_6, E_Locations.l_25_6);
state.p_Connected.set(E_Locations.l_13_12, E_Locations.l_13_13);
state.p_Connected.set(E_Locations.l_20_2, E_Locations.l_19_2);
state.p_Connected.set(E_Locations.l_22_12, E_Locations.l_21_12);
state.p_Connected.set(E_Locations.l_4_15, E_Locations.l_4_16);
state.p_Connected.set(E_Locations.l_25_17, E_Locations.l_25_18);
state.p_Connected.set(E_Locations.l_23_12, E_Locations.l_24_12);
state.p_Connected.set(E_Locations.l_22_9, E_Locations.l_22_10);
state.p_Connected.set(E_Locations.l_23_10, E_Locations.l_24_10);
state.p_Connected.set(E_Locations.l_5_24, E_Locations.l_6_24);
state.p_Connected.set(E_Locations.l_6_10, E_Locations.l_7_10);
state.p_Connected.set(E_Locations.l_10_17, E_Locations.l_11_17);
state.p_Connected.set(E_Locations.l_17_21, E_Locations.l_18_21);
state.p_Connected.set(E_Locations.l_19_15, E_Locations.l_20_15);
state.p_Connected.set(E_Locations.l_21_21, E_Locations.l_22_21);
state.p_Connected.set(E_Locations.l_20_10, E_Locations.l_21_10);
state.p_Connected.set(E_Locations.l_19_14, E_Locations.l_19_13);
state.p_Connected.set(E_Locations.l_8_14, E_Locations.l_9_14);
state.p_Connected.set(E_Locations.l_23_4, E_Locations.l_22_4);
state.p_Connected.set(E_Locations.l_23_20, E_Locations.l_24_20);
state.p_Connected.set(E_Locations.l_9_8, E_Locations.l_10_8);
state.p_Connected.set(E_Locations.l_1_10, E_Locations.l_2_10);
state.p_Connected.set(E_Locations.l_16_19, E_Locations.l_17_19);
state.p_Connected.set(E_Locations.l_20_13, E_Locations.l_19_13);
state.p_Connected.set(E_Locations.l_13_7, E_Locations.l_12_7);
state.p_Connected.set(E_Locations.l_20_20, E_Locations.l_20_19);
state.p_Connected.set(E_Locations.l_23_17, E_Locations.l_22_17);
state.p_Connected.set(E_Locations.l_19_13, E_Locations.l_19_12);
state.p_Connected.set(E_Locations.l_22_25, E_Locations.l_21_25);
state.p_Connected.set(E_Locations.l_10_5, E_Locations.l_9_5);
state.p_Connected.set(E_Locations.l_15_14, E_Locations.l_15_15);
state.p_Connected.set(E_Locations.l_9_15, E_Locations.l_10_15);
state.p_Connected.set(E_Locations.l_13_21, E_Locations.l_13_20);
state.p_Connected.set(E_Locations.l_19_10, E_Locations.l_19_11);
state.p_Connected.set(E_Locations.l_21_24, E_Locations.l_21_23);
state.p_Connected.set(E_Locations.l_11_2, E_Locations.l_12_2);
state.p_Connected.set(E_Locations.l_18_19, E_Locations.l_18_20);
state.p_Connected.set(E_Locations.l_15_10, E_Locations.l_14_10);
state.p_Connected.set(E_Locations.l_16_19, E_Locations.l_16_20);
state.p_Connected.set(E_Locations.l_15_3, E_Locations.l_16_3);
state.p_Connected.set(E_Locations.l_24_10, E_Locations.l_24_11);
state.p_Connected.set(E_Locations.l_13_14, E_Locations.l_13_13);
state.p_Connected.set(E_Locations.l_4_15, E_Locations.l_3_15);
state.p_Connected.set(E_Locations.l_10_21, E_Locations.l_11_21);
state.p_Connected.set(E_Locations.l_17_15, E_Locations.l_18_15);
state.p_Connected.set(E_Locations.l_12_7, E_Locations.l_12_6);
state.p_Connected.set(E_Locations.l_13_20, E_Locations.l_14_20);
state.p_Connected.set(E_Locations.l_13_19, E_Locations.l_12_19);
state.p_Connected.set(E_Locations.l_25_16, E_Locations.l_24_16);
state.p_Connected.set(E_Locations.l_5_10, E_Locations.l_6_10);
state.p_Connected.set(E_Locations.l_15_5, E_Locations.l_15_4);
state.p_Connected.set(E_Locations.l_2_12, E_Locations.l_3_12);
state.p_Connected.set(E_Locations.l_18_23, E_Locations.l_19_23);
state.p_Connected.set(E_Locations.l_17_11, E_Locations.l_18_11);
state.p_Connected.set(E_Locations.l_1_11, E_Locations.l_1_12);
state.p_Connected.set(E_Locations.l_21_1, E_Locations.l_22_1);
state.p_Connected.set(E_Locations.l_19_9, E_Locations.l_19_8);
state.p_Connected.set(E_Locations.l_6_7, E_Locations.l_6_8);
state.p_Connected.set(E_Locations.l_7_9, E_Locations.l_8_9);
state.p_Connected.set(E_Locations.l_4_8, E_Locations.l_4_9);
state.p_Connected.set(E_Locations.l_2_19, E_Locations.l_1_19);
state.p_Connected.set(E_Locations.l_5_11, E_Locations.l_5_10);
state.p_Connected.set(E_Locations.l_1_21, E_Locations.l_1_20);
state.p_Connected.set(E_Locations.l_6_11, E_Locations.l_7_11);
state.p_Connected.set(E_Locations.l_18_2, E_Locations.l_19_2);
state.p_Connected.set(E_Locations.l_13_5, E_Locations.l_13_6);
state.p_Connected.set(E_Locations.l_12_11, E_Locations.l_13_11);
state.p_Connected.set(E_Locations.l_12_13, E_Locations.l_12_14);
state.p_Connected.set(E_Locations.l_15_21, E_Locations.l_14_21);
state.p_Connected.set(E_Locations.l_24_7, E_Locations.l_24_6);
state.p_Connected.set(E_Locations.l_22_23, E_Locations.l_22_22);
state.p_Connected.set(E_Locations.l_15_17, E_Locations.l_16_17);
state.p_Connected.set(E_Locations.l_22_15, E_Locations.l_22_14);
state.p_Connected.set(E_Locations.l_20_8, E_Locations.l_21_8);
state.p_Connected.set(E_Locations.l_1_18, E_Locations.l_2_18);
state.p_Connected.set(E_Locations.l_3_24, E_Locations.l_3_25);
state.p_Connected.set(E_Locations.l_4_12, E_Locations.l_3_12);
state.p_Connected.set(E_Locations.l_20_1, E_Locations.l_21_1);
state.p_Connected.set(E_Locations.l_14_25, E_Locations.l_15_25);
state.p_Connected.set(E_Locations.l_25_16, E_Locations.l_25_15);
state.p_Connected.set(E_Locations.l_13_16, E_Locations.l_12_16);
state.p_Connected.set(E_Locations.l_5_20, E_Locations.l_5_21);
state.p_Connected.set(E_Locations.l_9_5, E_Locations.l_9_4);
state.p_Connected.set(E_Locations.l_20_17, E_Locations.l_20_18);
state.p_Connected.set(E_Locations.l_20_20, E_Locations.l_20_21);
state.p_Connected.set(E_Locations.l_7_22, E_Locations.l_8_22);
state.p_Connected.set(E_Locations.l_3_8, E_Locations.l_3_7);
state.p_Connected.set(E_Locations.l_12_1, E_Locations.l_11_1);
state.p_Connected.set(E_Locations.l_3_10, E_Locations.l_3_9);
state.p_Connected.set(E_Locations.l_8_13, E_Locations.l_9_13);
state.p_Connected.set(E_Locations.l_16_3, E_Locations.l_15_3);
state.p_Connected.set(E_Locations.l_13_2, E_Locations.l_13_3);
state.p_Connected.set(E_Locations.l_4_21, E_Locations.l_4_22);
state.p_Connected.set(E_Locations.l_10_11, E_Locations.l_10_10);
state.p_Connected.set(E_Locations.l_8_23, E_Locations.l_8_24);
state.p_Connected.set(E_Locations.l_9_16, E_Locations.l_8_16);
state.p_Connected.set(E_Locations.l_12_21, E_Locations.l_12_22);
state.p_Connected.set(E_Locations.l_5_8, E_Locations.l_4_8);
state.p_Connected.set(E_Locations.l_12_10, E_Locations.l_12_9);
state.p_Connected.set(E_Locations.l_1_8, E_Locations.l_1_7);
state.p_Connected.set(E_Locations.l_12_13, E_Locations.l_13_13);
state.p_Connected.set(E_Locations.l_15_6, E_Locations.l_16_6);
state.p_Connected.set(E_Locations.l_7_15, E_Locations.l_8_15);
state.p_Connected.set(E_Locations.l_15_5, E_Locations.l_14_5);
state.p_Connected.set(E_Locations.l_22_10, E_Locations.l_22_9);
state.p_Connected.set(E_Locations.l_1_4, E_Locations.l_1_5);
state.p_Connected.set(E_Locations.l_10_7, E_Locations.l_11_7);
state.p_Connected.set(E_Locations.l_14_14, E_Locations.l_13_14);
state.p_Connected.set(E_Locations.l_2_24, E_Locations.l_2_25);
state.p_Connected.set(E_Locations.l_7_8, E_Locations.l_7_7);
state.p_Connected.set(E_Locations.l_17_3, E_Locations.l_17_2);
state.p_Connected.set(E_Locations.l_24_18, E_Locations.l_24_19);
state.p_Connected.set(E_Locations.l_15_9, E_Locations.l_14_9);
state.p_Connected.set(E_Locations.l_13_1, E_Locations.l_12_1);
state.p_Connected.set(E_Locations.l_6_6, E_Locations.l_6_7);
state.p_Connected.set(E_Locations.l_14_17, E_Locations.l_13_17);
state.p_Connected.set(E_Locations.l_21_10, E_Locations.l_21_9);
state.p_Connected.set(E_Locations.l_24_12, E_Locations.l_23_12);
state.p_Connected.set(E_Locations.l_8_25, E_Locations.l_9_25);
state.p_Connected.set(E_Locations.l_11_16, E_Locations.l_10_16);
state.p_Connected.set(E_Locations.l_22_13, E_Locations.l_22_12);
state.p_Connected.set(E_Locations.l_17_22, E_Locations.l_17_21);
state.p_Accessible.set(E_Locations.l_5_18);
state.p_Accessible.set(E_Locations.l_7_21);
state.p_Accessible.set(E_Locations.l_13_2);
state.p_Accessible.set(E_Locations.l_2_13);
state.p_Accessible.set(E_Locations.l_7_10);
state.p_Accessible.set(E_Locations.l_9_3);
state.p_Accessible.set(E_Locations.l_18_22);
state.p_Accessible.set(E_Locations.l_23_15);
state.p_Accessible.set(E_Locations.l_13_14);
state.p_Accessible.set(E_Locations.l_6_1);
state.p_Accessible.set(E_Locations.l_19_18);
state.p_Accessible.set(E_Locations.l_3_23);
state.p_Accessible.set(E_Locations.l_5_6);
state.p_Accessible.set(E_Locations.l_10_6);
state.p_Accessible.set(E_Locations.l_22_5);
state.p_Accessible.set(E_Locations.l_20_8);
state.p_Accessible.set(E_Locations.l_7_8);
state.p_Accessible.set(E_Locations.l_25_20);
state.p_Accessible.set(E_Locations.l_6_13);
state.p_Accessible.set(E_Locations.l_11_7);
state.p_Accessible.set(E_Locations.l_6_7);
state.p_Accessible.set(E_Locations.l_18_8);
state.p_Accessible.set(E_Locations.l_22_11);
state.p_Accessible.set(E_Locations.l_15_6);
state.p_Accessible.set(E_Locations.l_16_7);
state.p_Accessible.set(E_Locations.l_5_16);
state.p_Accessible.set(E_Locations.l_21_17);
state.p_Accessible.set(E_Locations.l_10_4);
state.p_Accessible.set(E_Locations.l_5_19);
state.p_Accessible.set(E_Locations.l_15_17);
state.p_Accessible.set(E_Locations.l_19_5);
state.p_Accessible.set(E_Locations.l_19_15);
state.p_Accessible.set(E_Locations.l_24_20);
state.p_Accessible.set(E_Locations.l_13_19);
state.p_Accessible.set(E_Locations.l_19_13);
state.p_Accessible.set(E_Locations.l_19_17);
state.p_Accessible.set(E_Locations.l_16_5);
state.p_Accessible.set(E_Locations.l_9_9);
state.p_Accessible.set(E_Locations.l_3_22);
state.p_Accessible.set(E_Locations.l_8_1);
state.p_Accessible.set(E_Locations.l_25_15);
state.p_Accessible.set(E_Locations.l_25_24);
state.p_Accessible.set(E_Locations.l_13_17);
state.p_Accessible.set(E_Locations.l_7_7);
state.p_Accessible.set(E_Locations.l_8_23);
state.p_Accessible.set(E_Locations.l_7_5);
state.p_Accessible.set(E_Locations.l_12_6);
state.p_Accessible.set(E_Locations.l_19_21);
state.p_Accessible.set(E_Locations.l_5_4);
state.p_Accessible.set(E_Locations.l_12_3);
state.p_Accessible.set(E_Locations.l_16_22);
state.p_Accessible.set(E_Locations.l_22_14);
state.p_Accessible.set(E_Locations.l_10_5);
state.p_Accessible.set(E_Locations.l_19_9);
state.p_Accessible.set(E_Locations.l_13_13);
state.p_Accessible.set(E_Locations.l_18_24);
state.p_Accessible.set(E_Locations.l_11_25);
state.p_Accessible.set(E_Locations.l_9_8);
state.p_Accessible.set(E_Locations.l_22_13);
state.p_Accessible.set(E_Locations.l_5_22);
state.p_Accessible.set(E_Locations.l_25_23);
state.p_Accessible.set(E_Locations.l_4_3);
state.p_Accessible.set(E_Locations.l_24_21);
state.p_Accessible.set(E_Locations.l_20_16);
state.p_Accessible.set(E_Locations.l_10_25);
state.p_Accessible.set(E_Locations.l_23_14);
state.p_Accessible.set(E_Locations.l_12_16);
state.p_Accessible.set(E_Locations.l_2_19);
state.p_Accessible.set(E_Locations.l_16_24);
state.p_Accessible.set(E_Locations.l_8_5);
state.p_Accessible.set(E_Locations.l_22_15);
state.p_Accessible.set(E_Locations.l_24_15);
state.p_Accessible.set(E_Locations.l_24_18);
state.p_Accessible.set(E_Locations.l_21_12);
state.p_Accessible.set(E_Locations.l_7_18);
state.p_Accessible.set(E_Locations.l_20_19);
state.p_Accessible.set(E_Locations.l_21_6);
state.p_Accessible.set(E_Locations.l_12_10);
state.p_Accessible.set(E_Locations.l_10_15);
state.p_Accessible.set(E_Locations.l_25_18);
state.p_Accessible.set(E_Locations.l_10_20);
state.p_Accessible.set(E_Locations.l_4_1);
state.p_Accessible.set(E_Locations.l_6_21);
state.p_Accessible.set(E_Locations.l_5_17);
state.p_Accessible.set(E_Locations.l_21_14);
state.p_Accessible.set(E_Locations.l_1_15);
state.p_Accessible.set(E_Locations.l_7_25);
state.p_Accessible.set(E_Locations.l_7_9);
state.p_Accessible.set(E_Locations.l_18_17);
state.p_Accessible.set(E_Locations.l_2_9);
state.p_Accessible.set(E_Locations.l_13_20);
state.p_Accessible.set(E_Locations.l_23_13);
state.p_Accessible.set(E_Locations.l_14_5);
state.p_Accessible.set(E_Locations.l_11_23);
state.p_Accessible.set(E_Locations.l_3_18);
state.p_Accessible.set(E_Locations.l_20_7);
state.p_Accessible.set(E_Locations.l_2_10);
state.p_Accessible.set(E_Locations.l_23_10);
state.p_Accessible.set(E_Locations.l_9_14);
state.p_Accessible.set(E_Locations.l_17_23);
state.p_Accessible.set(E_Locations.l_11_6);
state.p_Accessible.set(E_Locations.l_14_4);
state.p_Accessible.set(E_Locations.l_4_17);
state.p_Accessible.set(E_Locations.l_23_11);
state.p_Accessible.set(E_Locations.l_13_18);
state.p_Accessible.set(E_Locations.l_25_11);
state.p_Accessible.set(E_Locations.l_16_20);
state.p_Accessible.set(E_Locations.l_25_1);
state.p_Accessible.set(E_Locations.l_3_2);
state.p_Accessible.set(E_Locations.l_6_3);
state.p_Accessible.set(E_Locations.l_21_19);
state.p_Accessible.set(E_Locations.l_18_1);
state.p_Accessible.set(E_Locations.l_4_10);
state.p_Accessible.set(E_Locations.l_7_6);
state.p_Accessible.set(E_Locations.l_8_15);
state.p_Accessible.set(E_Locations.l_15_23);
state.p_Accessible.set(E_Locations.l_22_20);
state.p_Accessible.set(E_Locations.l_25_7);
state.p_Accessible.set(E_Locations.l_3_12);
state.p_Accessible.set(E_Locations.l_14_25);
state.p_Accessible.set(E_Locations.l_14_11);
state.p_Accessible.set(E_Locations.l_1_11);
state.p_Accessible.set(E_Locations.l_25_12);
state.p_Accessible.set(E_Locations.l_4_15);
state.p_Accessible.set(E_Locations.l_14_22);
state.p_Accessible.set(E_Locations.l_21_5);
state.p_Accessible.set(E_Locations.l_1_24);
state.p_Accessible.set(E_Locations.l_24_22);
state.p_Accessible.set(E_Locations.l_13_9);
state.p_Accessible.set(E_Locations.l_11_17);
state.p_Accessible.set(E_Locations.l_8_9);
state.p_Accessible.set(E_Locations.l_3_8);
state.p_Accessible.set(E_Locations.l_12_7);
state.p_Accessible.set(E_Locations.l_21_20);
state.p_Accessible.set(E_Locations.l_1_2);
state.p_Accessible.set(E_Locations.l_14_18);
state.p_Accessible.set(E_Locations.l_22_2);
state.p_Accessible.set(E_Locations.l_22_19);
state.p_Accessible.set(E_Locations.l_2_11);
state.p_Accessible.set(E_Locations.l_2_14);
state.p_Accessible.set(E_Locations.l_5_5);
state.p_Accessible.set(E_Locations.l_7_14);
state.p_Accessible.set(E_Locations.l_15_8);
state.p_Accessible.set(E_Locations.l_15_3);
state.p_Accessible.set(E_Locations.l_15_1);
state.p_Accessible.set(E_Locations.l_14_6);
state.p_Accessible.set(E_Locations.l_19_19);
state.p_Accessible.set(E_Locations.l_25_9);
state.p_Accessible.set(E_Locations.l_10_10);
state.p_Accessible.set(E_Locations.l_17_9);
state.p_Accessible.set(E_Locations.l_9_16);
state.p_Accessible.set(E_Locations.l_7_15);
state.p_Accessible.set(E_Locations.l_3_10);
state.p_Accessible.set(E_Locations.l_14_24);
state.p_Accessible.set(E_Locations.l_6_19);
state.p_Accessible.set(E_Locations.l_10_17);
state.p_Accessible.set(E_Locations.l_20_11);
state.p_Accessible.set(E_Locations.l_10_19);
state.p_Accessible.set(E_Locations.l_22_21);
state.p_Accessible.set(E_Locations.l_11_11);
state.p_Accessible.set(E_Locations.l_25_2);
state.p_Accessible.set(E_Locations.l_8_14);
state.p_Accessible.set(E_Locations.l_23_6);
state.p_Accessible.set(E_Locations.l_2_5);
state.p_Accessible.set(E_Locations.l_25_4);
state.p_Accessible.set(E_Locations.l_20_21);
state.p_Accessible.set(E_Locations.l_20_23);
state.p_Accessible.set(E_Locations.l_18_10);
state.p_Accessible.set(E_Locations.l_2_21);
state.p_Accessible.set(E_Locations.l_10_23);
state.p_Accessible.set(E_Locations.l_14_23);
state.p_Accessible.set(E_Locations.l_6_6);
state.p_Accessible.set(E_Locations.l_4_8);
state.p_Accessible.set(E_Locations.l_9_18);
state.p_Accessible.set(E_Locations.l_25_3);
state.p_Accessible.set(E_Locations.l_12_1);
state.p_Accessible.set(E_Locations.l_11_3);
state.p_Accessible.set(E_Locations.l_20_17);
state.p_Accessible.set(E_Locations.l_24_17);
state.p_Accessible.set(E_Locations.l_9_5);
state.p_Accessible.set(E_Locations.l_7_11);
state.p_Accessible.set(E_Locations.l_13_15);
state.p_Accessible.set(E_Locations.l_21_8);
state.p_Accessible.set(E_Locations.l_17_18);
state.p_Accessible.set(E_Locations.l_16_10);
state.p_Accessible.set(E_Locations.l_19_3);
state.p_Accessible.set(E_Locations.l_21_23);
state.p_Accessible.set(E_Locations.l_23_9);
state.p_Accessible.set(E_Locations.l_15_19);
state.p_Accessible.set(E_Locations.l_2_22);
state.p_Accessible.set(E_Locations.l_24_24);
state.p_Accessible.set(E_Locations.l_13_25);
state.p_Accessible.set(E_Locations.l_23_5);
state.p_Accessible.set(E_Locations.l_23_3);
state.p_Accessible.set(E_Locations.l_21_4);
state.p_Accessible.set(E_Locations.l_4_25);
state.p_Accessible.set(E_Locations.l_12_18);
state.p_Accessible.set(E_Locations.l_6_14);
state.p_Accessible.set(E_Locations.l_23_7);
state.p_Accessible.set(E_Locations.l_20_13);
state.p_Accessible.set(E_Locations.l_4_20);
state.p_Accessible.set(E_Locations.l_7_20);
state.p_Accessible.set(E_Locations.l_5_12);
state.p_Accessible.set(E_Locations.l_13_22);
state.p_Accessible.set(E_Locations.l_6_15);
state.p_Accessible.set(E_Locations.l_16_25);
state.p_Accessible.set(E_Locations.l_13_23);
state.p_Accessible.set(E_Locations.l_24_23);
state.p_Accessible.set(E_Locations.l_18_15);
state.p_Accessible.set(E_Locations.l_3_13);
state.p_Accessible.set(E_Locations.l_8_18);
state.p_Accessible.set(E_Locations.l_4_5);
state.p_Accessible.set(E_Locations.l_18_21);
state.p_Accessible.set(E_Locations.l_19_24);
state.p_Accessible.set(E_Locations.l_10_2);
state.p_Accessible.set(E_Locations.l_13_7);
state.p_Accessible.set(E_Locations.l_1_12);
state.p_Accessible.set(E_Locations.l_4_21);
state.p_Accessible.set(E_Locations.l_8_7);
state.p_Accessible.set(E_Locations.l_8_6);
state.p_Accessible.set(E_Locations.l_20_15);
state.p_Accessible.set(E_Locations.l_7_1);
state.p_Accessible.set(E_Locations.l_24_4);
state.p_Accessible.set(E_Locations.l_6_25);
state.p_Accessible.set(E_Locations.l_9_4);
state.p_Accessible.set(E_Locations.l_25_8);
state.p_Accessible.set(E_Locations.l_15_13);
state.p_Accessible.set(E_Locations.l_16_13);
state.p_Accessible.set(E_Locations.l_14_8);
state.p_Accessible.set(E_Locations.l_10_24);
state.p_Accessible.set(E_Locations.l_17_10);
state.p_Accessible.set(E_Locations.l_5_2);
state.p_Accessible.set(E_Locations.l_5_11);
state.p_Accessible.set(E_Locations.l_6_8);
state.p_Accessible.set(E_Locations.l_11_21);
state.p_Accessible.set(E_Locations.l_9_13);
state.p_Accessible.set(E_Locations.l_12_22);
state.p_Accessible.set(E_Locations.l_8_4);
state.p_Accessible.set(E_Locations.l_16_21);
state.p_Accessible.set(E_Locations.l_6_2);
state.p_Accessible.set(E_Locations.l_1_10);
state.p_Accessible.set(E_Locations.l_3_1);
state.p_Accessible.set(E_Locations.l_18_20);
state.p_Accessible.set(E_Locations.l_3_14);
state.p_Accessible.set(E_Locations.l_5_10);
state.p_Accessible.set(E_Locations.l_22_9);
state.p_Accessible.set(E_Locations.l_12_13);
state.p_Accessible.set(E_Locations.l_12_17);
state.p_Accessible.set(E_Locations.l_11_5);
state.p_Accessible.set(E_Locations.l_5_14);
state.p_Accessible.set(E_Locations.l_17_8);
state.p_Accessible.set(E_Locations.l_11_8);
state.p_Accessible.set(E_Locations.l_8_3);
state.p_Accessible.set(E_Locations.l_9_7);
state.p_Accessible.set(E_Locations.l_2_15);
state.p_Accessible.set(E_Locations.l_19_12);
state.p_Accessible.set(E_Locations.l_13_16);
state.p_Accessible.set(E_Locations.l_9_25);
state.p_Accessible.set(E_Locations.l_24_9);
state.p_Accessible.set(E_Locations.l_16_2);
state.p_Accessible.set(E_Locations.l_19_7);
state.p_Accessible.set(E_Locations.l_16_12);
state.p_Accessible.set(E_Locations.l_14_7);
state.p_Accessible.set(E_Locations.l_24_13);
state.p_Accessible.set(E_Locations.l_25_10);
state.p_Accessible.set(E_Locations.l_2_24);
state.p_Accessible.set(E_Locations.l_2_8);
state.p_Accessible.set(E_Locations.l_16_16);
state.p_Accessible.set(E_Locations.l_21_25);
state.p_Accessible.set(E_Locations.l_18_25);
state.p_Accessible.set(E_Locations.l_11_12);
state.p_Accessible.set(E_Locations.l_12_23);
state.p_Accessible.set(E_Locations.l_11_16);
state.p_Accessible.set(E_Locations.l_9_11);
state.p_Accessible.set(E_Locations.l_23_20);
state.p_Accessible.set(E_Locations.l_12_5);
state.p_Accessible.set(E_Locations.l_17_15);
state.p_Accessible.set(E_Locations.l_23_8);
state.p_Accessible.set(E_Locations.l_23_16);
state.p_Accessible.set(E_Locations.l_10_12);
state.p_Accessible.set(E_Locations.l_8_8);
state.p_Accessible.set(E_Locations.l_15_25);
state.p_Accessible.set(E_Locations.l_14_10);
state.p_Accessible.set(E_Locations.l_12_4);
state.p_Accessible.set(E_Locations.l_2_3);
state.p_Accessible.set(E_Locations.l_8_11);
state.p_Accessible.set(E_Locations.l_10_8);
state.p_Accessible.set(E_Locations.l_24_19);
state.p_Accessible.set(E_Locations.l_21_7);
state.p_Accessible.set(E_Locations.l_9_21);
state.p_Accessible.set(E_Locations.l_21_2);
state.p_Accessible.set(E_Locations.l_15_14);
state.p_Accessible.set(E_Locations.l_6_11);
state.p_Accessible.set(E_Locations.l_18_11);
state.p_Accessible.set(E_Locations.l_23_23);
state.p_Accessible.set(E_Locations.l_4_7);
state.p_Accessible.set(E_Locations.l_6_23);
state.p_Accessible.set(E_Locations.l_6_24);
state.p_Accessible.set(E_Locations.l_2_12);
state.p_Accessible.set(E_Locations.l_24_3);
state.p_Accessible.set(E_Locations.l_8_25);
state.p_Accessible.set(E_Locations.l_15_11);
state.p_Accessible.set(E_Locations.l_17_14);
state.p_Accessible.set(E_Locations.l_2_23);
state.p_Accessible.set(E_Locations.l_18_19);
state.p_Accessible.set(E_Locations.l_20_12);
state.p_Accessible.set(E_Locations.l_25_16);
state.p_Accessible.set(E_Locations.l_3_19);
state.p_Accessible.set(E_Locations.l_5_8);
state.p_Accessible.set(E_Locations.l_10_11);
state.p_Accessible.set(E_Locations.l_13_1);
state.p_Accessible.set(E_Locations.l_20_4);
state.p_Accessible.set(E_Locations.l_7_4);
state.p_Accessible.set(E_Locations.l_17_4);
state.p_Accessible.set(E_Locations.l_25_21);
state.p_Accessible.set(E_Locations.l_9_20);
state.p_Accessible.set(E_Locations.l_7_13);
state.p_Accessible.set(E_Locations.l_11_15);
state.p_Accessible.set(E_Locations.l_1_7);
state.p_Accessible.set(E_Locations.l_11_1);
state.p_Accessible.set(E_Locations.l_12_24);
state.p_Accessible.set(E_Locations.l_16_8);
state.p_Accessible.set(E_Locations.l_10_22);
state.p_Accessible.set(E_Locations.l_17_17);
state.p_Accessible.set(E_Locations.l_20_18);
state.p_Accessible.set(E_Locations.l_12_19);
state.p_Accessible.set(E_Locations.l_3_25);
state.p_Accessible.set(E_Locations.l_18_4);
state.p_Accessible.set(E_Locations.l_19_25);
state.p_Accessible.set(E_Locations.l_11_19);
state.p_Accessible.set(E_Locations.l_4_12);
state.p_Accessible.set(E_Locations.l_19_4);
state.p_Accessible.set(E_Locations.l_11_10);
state.p_Accessible.set(E_Locations.l_13_6);
state.p_Accessible.set(E_Locations.l_1_1);
state.p_Accessible.set(E_Locations.l_2_1);
state.p_Accessible.set(E_Locations.l_17_22);
state.p_Accessible.set(E_Locations.l_13_5);
state.p_Accessible.set(E_Locations.l_21_10);
state.p_Accessible.set(E_Locations.l_12_20);
state.p_Accessible.set(E_Locations.l_1_21);
state.p_Accessible.set(E_Locations.l_20_9);
state.p_Accessible.set(E_Locations.l_9_12);
state.p_Accessible.set(E_Locations.l_17_25);
state.p_Accessible.set(E_Locations.l_18_5);
state.p_Accessible.set(E_Locations.l_19_22);
state.p_Accessible.set(E_Locations.l_15_5);
state.p_Accessible.set(E_Locations.l_8_24);
state.p_Accessible.set(E_Locations.l_10_13);
state.p_Accessible.set(E_Locations.l_21_11);
state.p_Accessible.set(E_Locations.l_8_16);
state.p_Accessible.set(E_Locations.l_21_24);
state.p_Accessible.set(E_Locations.l_9_10);
state.p_Accessible.set(E_Locations.l_9_2);
state.p_Accessible.set(E_Locations.l_11_14);
state.p_Accessible.set(E_Locations.l_13_4);
state.p_Accessible.set(E_Locations.l_8_2);
state.p_Accessible.set(E_Locations.l_14_9);
state.p_Accessible.set(E_Locations.l_15_2);
state.p_Accessible.set(E_Locations.l_25_19);
state.p_Accessible.set(E_Locations.l_15_10);
state.p_Accessible.set(E_Locations.l_19_8);
state.p_Accessible.set(E_Locations.l_8_17);
state.p_Accessible.set(E_Locations.l_16_11);
state.p_Accessible.set(E_Locations.l_7_22);
state.p_Accessible.set(E_Locations.l_25_22);
state.p_Accessible.set(E_Locations.l_14_16);
state.p_Accessible.set(E_Locations.l_1_16);
state.p_Accessible.set(E_Locations.l_25_13);
state.p_Accessible.set(E_Locations.l_25_14);
state.p_Accessible.set(E_Locations.l_24_12);
state.p_Accessible.set(E_Locations.l_1_4);
state.p_Accessible.set(E_Locations.l_5_21);
state.p_Accessible.set(E_Locations.l_13_24);
state.p_Accessible.set(E_Locations.l_14_21);
state.p_Accessible.set(E_Locations.l_17_20);
state.p_Accessible.set(E_Locations.l_1_17);
state.p_Accessible.set(E_Locations.l_22_16);
state.p_Accessible.set(E_Locations.l_17_16);
state.p_Accessible.set(E_Locations.l_14_12);
state.p_Accessible.set(E_Locations.l_12_12);
state.p_Accessible.set(E_Locations.l_15_18);
state.p_Accessible.set(E_Locations.l_22_1);
state.p_Accessible.set(E_Locations.l_16_14);
state.p_Accessible.set(E_Locations.l_14_13);
state.p_Accessible.set(E_Locations.l_17_11);
state.p_Accessible.set(E_Locations.l_25_25);
state.p_Accessible.set(E_Locations.l_17_2);
state.p_Accessible.set(E_Locations.l_25_6);
state.p_Accessible.set(E_Locations.l_14_17);
state.p_Accessible.set(E_Locations.l_18_14);
state.p_Accessible.set(E_Locations.l_18_3);
state.p_Accessible.set(E_Locations.l_22_3);
state.p_Accessible.set(E_Locations.l_17_7);
state.p_Accessible.set(E_Locations.l_19_14);
state.p_Accessible.set(E_Locations.l_10_7);
state.p_Accessible.set(E_Locations.l_18_18);
state.p_Accessible.set(E_Locations.l_2_18);
state.p_Accessible.set(E_Locations.l_13_11);
state.p_Accessible.set(E_Locations.l_19_1);
state.p_Accessible.set(E_Locations.l_9_17);
state.p_Accessible.set(E_Locations.l_9_15);
state.p_Accessible.set(E_Locations.l_22_24);
state.p_Accessible.set(E_Locations.l_3_21);
state.p_Accessible.set(E_Locations.l_17_19);
state.p_Accessible.set(E_Locations.l_22_7);
state.p_Accessible.set(E_Locations.l_7_19);
state.p_Accessible.set(E_Locations.l_4_23);
state.p_Accessible.set(E_Locations.l_3_16);
state.p_Accessible.set(E_Locations.l_5_24);
state.p_Accessible.set(E_Locations.l_4_16);
state.p_Accessible.set(E_Locations.l_20_22);
state.p_Accessible.set(E_Locations.l_20_14);
state.p_Accessible.set(E_Locations.l_14_20);
state.p_Accessible.set(E_Locations.l_7_17);
state.p_Accessible.set(E_Locations.l_3_6);
state.p_Accessible.set(E_Locations.l_4_4);
state.p_Accessible.set(E_Locations.l_17_1);
state.p_Accessible.set(E_Locations.l_22_22);
state.p_Accessible.set(E_Locations.l_3_5);
state.p_Accessible.set(E_Locations.l_7_2);
state.p_Accessible.set(E_Locations.l_12_2);
state.p_Accessible.set(E_Locations.l_4_24);
state.p_Accessible.set(E_Locations.l_13_3);
state.p_Accessible.set(E_Locations.l_18_23);
state.p_Accessible.set(E_Locations.l_23_19);
state.p_Accessible.set(E_Locations.l_22_8);
state.p_Accessible.set(E_Locations.l_16_6);
state.p_Accessible.set(E_Locations.l_3_24);
state.p_Accessible.set(E_Locations.l_19_11);
state.p_Accessible.set(E_Locations.l_16_17);
state.p_Accessible.set(E_Locations.l_17_24);
state.p_Accessible.set(E_Locations.l_6_9);
state.p_Accessible.set(E_Locations.l_6_4);
state.p_Accessible.set(E_Locations.l_1_22);
state.p_Accessible.set(E_Locations.l_23_18);
state.p_Accessible.set(E_Locations.l_2_25);
state.p_Accessible.set(E_Locations.l_3_17);
state.p_Accessible.set(E_Locations.l_18_12);
state.p_Accessible.set(E_Locations.l_22_10);
state.p_Accessible.set(E_Locations.l_23_21);
state.p_Accessible.set(E_Locations.l_6_16);
state.p_Accessible.set(E_Locations.l_24_25);
state.p_Accessible.set(E_Locations.l_17_3);
state.p_Accessible.set(E_Locations.l_5_25);
state.p_Accessible.set(E_Locations.l_3_3);
state.p_Accessible.set(E_Locations.l_23_25);
state.p_Accessible.set(E_Locations.l_6_5);
state.p_Accessible.set(E_Locations.l_19_10);
state.p_Accessible.set(E_Locations.l_7_23);
state.p_Accessible.set(E_Locations.l_1_6);
state.p_Accessible.set(E_Locations.l_20_1);
state.p_Accessible.set(E_Locations.l_16_9);
state.p_Accessible.set(E_Locations.l_21_1);
state.p_Accessible.set(E_Locations.l_19_23);
state.p_Accessible.set(E_Locations.l_19_20);
state.p_Accessible.set(E_Locations.l_21_3);
state.p_Accessible.set(E_Locations.l_4_9);
state.p_Accessible.set(E_Locations.l_1_14);
state.p_Accessible.set(E_Locations.l_18_13);
state.p_Accessible.set(E_Locations.l_22_18);
state.p_Accessible.set(E_Locations.l_5_7);
state.p_Accessible.set(E_Locations.l_5_23);
state.p_Accessible.set(E_Locations.l_2_4);
state.p_Accessible.set(E_Locations.l_9_19);
state.p_Accessible.set(E_Locations.l_6_12);
state.p_Accessible.set(E_Locations.l_5_3);
state.p_Accessible.set(E_Locations.l_9_23);
state.p_Accessible.set(E_Locations.l_23_12);
state.p_Accessible.set(E_Locations.l_1_25);
state.p_Accessible.set(E_Locations.l_20_6);
state.p_Accessible.set(E_Locations.l_17_6);
state.p_Accessible.set(E_Locations.l_10_3);
state.p_Accessible.set(E_Locations.l_25_5);
state.p_Accessible.set(E_Locations.l_3_9);
state.p_Accessible.set(E_Locations.l_22_12);
state.p_Accessible.set(E_Locations.l_16_23);
state.p_Accessible.set(E_Locations.l_4_18);
state.p_Accessible.set(E_Locations.l_23_17);
state.p_Accessible.set(E_Locations.l_22_6);
state.p_Accessible.set(E_Locations.l_7_24);
state.p_Accessible.set(E_Locations.l_18_16);
state.p_Accessible.set(E_Locations.l_15_24);
state.p_Accessible.set(E_Locations.l_18_7);
state.p_Accessible.set(E_Locations.l_20_2);
state.p_Accessible.set(E_Locations.l_2_17);
state.p_Accessible.set(E_Locations.l_24_6);
state.p_Accessible.set(E_Locations.l_24_2);
state.p_Accessible.set(E_Locations.l_14_1);
state.p_Accessible.set(E_Locations.l_8_12);
state.p_Accessible.set(E_Locations.l_4_22);
state.p_Accessible.set(E_Locations.l_6_22);
state.p_Accessible.set(E_Locations.l_24_7);
state.p_Accessible.set(E_Locations.l_16_1);
state.p_Accessible.set(E_Locations.l_11_13);
state.p_Accessible.set(E_Locations.l_12_14);
state.p_Accessible.set(E_Locations.l_4_6);
state.p_Accessible.set(E_Locations.l_8_20);
state.p_Accessible.set(E_Locations.l_19_16);
state.p_Accessible.set(E_Locations.l_6_20);
state.p_Accessible.set(E_Locations.l_11_22);
state.p_Accessible.set(E_Locations.l_1_3);
state.p_Accessible.set(E_Locations.l_22_17);
state.p_Accessible.set(E_Locations.l_8_19);
state.p_Accessible.set(E_Locations.l_15_12);
state.p_Accessible.set(E_Locations.l_11_4);
state.p_Accessible.set(E_Locations.l_24_1);
state.p_Accessible.set(E_Locations.l_3_15);
state.p_Accessible.set(E_Locations.l_6_18);
state.p_Accessible.set(E_Locations.l_12_15);
state.p_Accessible.set(E_Locations.l_22_25);
state.p_Accessible.set(E_Locations.l_13_12);
state.p_Accessible.set(E_Locations.l_17_12);
state.p_Accessible.set(E_Locations.l_5_13);
state.p_Accessible.set(E_Locations.l_21_9);
state.p_Accessible.set(E_Locations.l_7_3);
state.p_Accessible.set(E_Locations.l_7_12);
state.p_Accessible.set(E_Locations.l_12_25);
state.p_Accessible.set(E_Locations.l_16_18);
state.p_Accessible.set(E_Locations.l_12_11);
state.p_Accessible.set(E_Locations.l_20_5);
state.p_Accessible.set(E_Locations.l_21_13);
state.p_Accessible.set(E_Locations.l_22_23);
state.p_Accessible.set(E_Locations.l_11_20);
state.p_Accessible.set(E_Locations.l_23_1);
state.p_Accessible.set(E_Locations.l_16_3);
state.p_Accessible.set(E_Locations.l_24_14);
state.p_Accessible.set(E_Locations.l_4_11);
state.p_Accessible.set(E_Locations.l_11_2);
state.p_Accessible.set(E_Locations.l_15_15);
state.p_Accessible.set(E_Locations.l_13_10);
state.p_Accessible.set(E_Locations.l_24_8);
state.p_Accessible.set(E_Locations.l_19_6);
state.p_Accessible.set(E_Locations.l_23_4);
state.p_Accessible.set(E_Locations.l_21_18);
state.p_Accessible.set(E_Locations.l_24_5);
state.p_Accessible.set(E_Locations.l_16_19);
state.p_Accessible.set(E_Locations.l_12_21);
state.p_Accessible.set(E_Locations.l_22_4);
state.p_Accessible.set(E_Locations.l_10_1);
state.p_Accessible.set(E_Locations.l_15_22);
state.p_Accessible.set(E_Locations.l_13_21);
state.p_Accessible.set(E_Locations.l_1_20);
state.p_Accessible.set(E_Locations.l_10_21);
state.p_Accessible.set(E_Locations.l_1_19);
state.p_Accessible.set(E_Locations.l_8_21);
state.p_Accessible.set(E_Locations.l_1_13);
state.p_Accessible.set(E_Locations.l_21_21);
state.p_Accessible.set(E_Locations.l_3_7);
state.p_Accessible.set(E_Locations.l_2_2);
state.p_Accessible.set(E_Locations.l_21_15);
state.p_Accessible.set(E_Locations.l_21_16);
state.p_Accessible.set(E_Locations.l_1_9);
state.p_Accessible.set(E_Locations.l_14_19);
state.p_Accessible.set(E_Locations.l_4_2);
state.p_Accessible.set(E_Locations.l_3_20);
state.p_Accessible.set(E_Locations.l_2_7);
state.p_Accessible.set(E_Locations.l_18_9);
state.p_Accessible.set(E_Locations.l_17_5);
state.p_Accessible.set(E_Locations.l_24_16);
state.p_Accessible.set(E_Locations.l_2_20);
state.p_Accessible.set(E_Locations.l_14_15);
state.p_Accessible.set(E_Locations.l_15_21);
state.p_Accessible.set(E_Locations.l_6_17);
state.p_Accessible.set(E_Locations.l_15_4);
state.p_Accessible.set(E_Locations.l_8_22);
state.p_Accessible.set(E_Locations.l_5_15);
state.p_Accessible.set(E_Locations.l_11_24);
state.p_Accessible.set(E_Locations.l_15_16);
state.p_Accessible.set(E_Locations.l_6_10);
state.p_Accessible.set(E_Locations.l_20_20);
state.p_Accessible.set(E_Locations.l_16_4);
state.p_Accessible.set(E_Locations.l_24_11);
state.p_Accessible.set(E_Locations.l_17_21);
state.p_Accessible.set(E_Locations.l_20_25);
state.p_Accessible.set(E_Locations.l_18_6);
state.p_Accessible.set(E_Locations.l_4_14);
state.p_Accessible.set(E_Locations.l_15_20);
state.p_Accessible.set(E_Locations.l_11_9);
state.p_Accessible.set(E_Locations.l_15_7);
state.p_Accessible.set(E_Locations.l_9_6);
state.p_Accessible.set(E_Locations.l_25_17);
state.p_Accessible.set(E_Locations.l_1_23);
state.p_Accessible.set(E_Locations.l_10_14);
state.p_Accessible.set(E_Locations.l_1_8);
state.p_Accessible.set(E_Locations.l_14_3);
state.p_Accessible.set(E_Locations.l_21_22);
state.p_Accessible.set(E_Locations.l_8_13);
state.p_Accessible.set(E_Locations.l_14_14);
state.p_Accessible.set(E_Locations.l_9_1);
state.p_Accessible.set(E_Locations.l_10_18);
state.p_Accessible.set(E_Locations.l_23_24);
state.p_Accessible.set(E_Locations.l_11_18);
state.p_Accessible.set(E_Locations.l_5_9);
state.p_Accessible.set(E_Locations.l_17_13);
state.p_Accessible.set(E_Locations.l_12_9);
state.p_Accessible.set(E_Locations.l_9_22);
state.p_Accessible.set(E_Locations.l_16_15);
state.p_Accessible.set(E_Locations.l_7_16);
state.p_Accessible.set(E_Locations.l_20_3);
state.p_Accessible.set(E_Locations.l_9_24);
state.p_Accessible.set(E_Locations.l_13_8);
state.p_Accessible.set(E_Locations.l_2_16);
state.p_Accessible.set(E_Locations.l_24_10);
state.p_Accessible.set(E_Locations.l_10_9);
state.p_Accessible.set(E_Locations.l_4_13);
state.p_Accessible.set(E_Locations.l_1_5);
state.p_Accessible.set(E_Locations.l_23_2);
state.p_Accessible.set(E_Locations.l_10_16);
state.p_Accessible.set(E_Locations.l_23_22);
state.p_Accessible.set(E_Locations.l_2_6);
state.p_Accessible.set(E_Locations.l_15_9);
state.p_Accessible.set(E_Locations.l_3_4);
state.p_Accessible.set(E_Locations.l_20_24);
state.p_Accessible.set(E_Locations.l_5_20);
state.p_Accessible.set(E_Locations.l_20_10);
state.p_Accessible.set(E_Locations.l_18_2);
state.p_Accessible.set(E_Locations.l_19_2);
state.p_Accessible.set(E_Locations.l_4_19);
state.p_Accessible.set(E_Locations.l_5_1);
state.p_Accessible.set(E_Locations.l_12_8);
state.p_Accessible.set(E_Locations.l_1_18);
state.p_Accessible.set(E_Locations.l_8_10);
state.p_Accessible.set(E_Locations.l_3_11);
state.p_Accessible.set(E_Locations.l_14_2);
state.p_Solid.set(E_Locations.l_15_20);
state.p_Solid.set(E_Locations.l_13_2);
state.p_Solid.set(E_Locations.l_23_2);
state.p_Solid.set(E_Locations.l_6_14);
state.p_Solid.set(E_Locations.l_14_3);
state.p_Solid.set(E_Locations.l_6_5);
state.p_Solid.set(E_Locations.l_16_6);
state.p_Solid.set(E_Locations.l_8_18);
state.p_Solid.set(E_Locations.l_9_5);
state.p_Solid.set(E_Locations.l_1_4);
state.p_Solid.set(E_Locations.l_22_21);
state.p_Solid.set(E_Locations.l_21_1);
state.p_Solid.set(E_Locations.l_6_18);
state.p_Solid.set(E_Locations.l_19_18);
state.p_Solid.set(E_Locations.l_19_20);
state.p_Solid.set(E_Locations.l_17_16);
state.p_Solid.set(E_Locations.l_10_24);
state.p_Solid.set(E_Locations.l_16_9);
state.p_Solid.set(E_Locations.l_15_14);
state.p_Solid.set(E_Locations.l_24_11);
state.p_Solid.set(E_Locations.l_22_5);
state.p_Solid.set(E_Locations.l_3_7);
state.p_Solid.set(E_Locations.l_12_22);
state.p_Solid.set(E_Locations.l_24_25);
state.p_Solid.set(E_Locations.l_12_2);
state.p_Solid.set(E_Locations.l_1_23);
state.p_Solid.set(E_Locations.l_11_21);
state.p_Solid.set(E_Locations.l_21_13);
state.p_Solid.set(E_Locations.l_17_9);
state.p_Solid.set(E_Locations.l_21_18);
state.p_Solid.set(E_Locations.l_6_20);
state.p_Solid.set(E_Locations.l_16_19);
state.p_Solid.set(E_Locations.l_18_2);
state.p_Solid.set(E_Locations.l_1_15);
state.p_Solid.set(E_Locations.l_1_20);
state.p_Solid.set(E_Locations.l_2_14);
state.p_Solid.set(E_Locations.l_3_22);
state.p_Solid.set(E_Locations.l_19_5);
state.p_Solid.set(E_Locations.l_3_20);
state.p_Solid.set(E_Locations.l_2_19);
state.p_Solid.set(E_Locations.l_10_25);
state.p_Solid.set(E_Locations.l_22_22);
state.p_Solid.set(E_Locations.l_18_1);
state.p_Solid.set(E_Locations.l_25_9);
state.p_Solid.set(E_Locations.l_10_11);
state.p_Solid.set(E_Locations.l_16_21);
state.p_Solid.set(E_Locations.l_1_8);
state.p_Solid.set(E_Locations.l_8_5);
state.p_Solid.set(E_Locations.l_19_2);
state.p_Solid.set(E_Locations.l_19_24);
state.p_Solid.set(E_Locations.l_23_12);
state.p_Solid.set(E_Locations.l_25_13);
state.p_Solid.set(E_Locations.l_9_14);
state.p_Solid.set(E_Locations.l_4_17);
state.p_Solid.set(E_Locations.l_21_11);
state.p_Solid.set(E_Locations.l_17_19);
state.p_Solid.set(E_Locations.l_2_13);
state.p_Solid.set(E_Locations.l_12_21);
state.p_Solid.set(E_Locations.l_7_3);
state.p_Solid.set(E_Locations.l_15_11);
state.p_Solid.set(E_Locations.l_13_4);
state.p_Solid.set(E_Locations.l_8_12);
state.p_Solid.set(E_Locations.l_5_12);
state.p_Solid.set(E_Locations.l_4_14);
state.p_Solid.set(E_Locations.l_6_7);
state.p_Solid.set(E_Locations.l_12_11);
state.p_Solid.set(E_Locations.l_17_4);
state.p_Solid.set(E_Locations.l_7_23);
state.p_Solid.set(E_Locations.l_23_10);
state.p_Solid.set(E_Locations.l_18_22);
state.p_Solid.set(E_Locations.l_14_14);
state.p_Solid.set(E_Locations.l_4_21);
state.p_Solid.set(E_Locations.l_2_1);
state.p_Solid.set(E_Locations.l_17_20);
state.p_Solid.set(E_Locations.l_12_9);
state.p_Solid.set(E_Locations.l_19_7);
state.p_Solid.set(E_Locations.l_17_10);
state.p_Solid.set(E_Locations.l_11_25);
state.p_Solid.set(E_Locations.l_5_17);
state.p_Solid.set(E_Locations.l_7_12);
state.p_Solid.set(E_Locations.l_12_12);
state.p_Solid.set(E_Locations.l_24_10);
state.p_Solid.set(E_Locations.l_20_8);
state.p_Solid.set(E_Locations.l_19_4);
state.p_Solid.set(E_Locations.l_7_25);
state.p_Solid.set(E_Locations.l_13_15);
state.p_Solid.set(E_Locations.l_15_25);
state.p_Solid.set(E_Locations.l_25_25);
state.p_Solid.set(E_Locations.l_4_24);
state.p_Solid.set(E_Locations.l_10_5);
state.p_Solid.set(E_Locations.l_12_20);
state.p_Solid.set(E_Locations.l_7_14);
state.p_Solid.set(E_Locations.l_22_10);
state.p_Solid.set(E_Locations.l_17_14);
state.p_Solid.set(E_Locations.l_17_15);
state.p_Solid.set(E_Locations.l_23_8);
state.p_Solid.set(E_Locations.l_8_8);
state.p_Solid.set(E_Locations.l_17_5);
state.p_Solid.set(E_Locations.l_8_15);
state.p_Solid.set(E_Locations.l_16_16);
state.p_Solid.set(E_Locations.l_25_22);
state.p_Solid.set(E_Locations.l_14_25);
state.p_Solid.set(E_Locations.l_8_19);
state.p_Solid.set(E_Locations.l_4_2);
state.p_Solid.set(E_Locations.l_16_1);
state.p_Solid.set(E_Locations.l_2_7);
state.p_Solid.set(E_Locations.l_18_3);
state.p_Solid.set(E_Locations.l_17_24);
state.p_Solid.set(E_Locations.l_21_22);
state.p_Solid.set(E_Locations.l_2_3);
state.p_Solid.set(E_Locations.l_16_7);
state.p_Solid.set(E_Locations.l_6_1);
state.p_Solid.set(E_Locations.l_23_11);
state.p_Solid.set(E_Locations.l_14_15);
state.p_Solid.set(E_Locations.l_16_8);
state.p_Solid.set(E_Locations.l_16_2);
state.p_Solid.set(E_Locations.l_2_17);
state.p_Solid.set(E_Locations.l_15_22);
state.p_Solid.set(E_Locations.l_14_18);
state.p_Solid.set(E_Locations.l_20_25);
state.p_Solid.set(E_Locations.l_4_10);
state.p_Solid.set(E_Locations.l_13_1);
state.p_Solid.set(E_Locations.l_3_19);
state.p_Solid.set(E_Locations.l_25_19);
state.p_Solid.set(E_Locations.l_17_11);
state.p_Solid.set(E_Locations.l_18_19);
state.p_Solid.set(E_Locations.l_12_4);
state.p_Solid.set(E_Locations.l_5_14);
state.p_Solid.set(E_Locations.l_2_22);
state.p_Solid.set(E_Locations.l_8_9);
state.p_Solid.set(E_Locations.l_1_17);
state.p_Solid.set(E_Locations.l_1_6);
state.p_Solid.set(E_Locations.l_21_20);
state.p_Solid.set(E_Locations.l_12_7);
state.p_Solid.set(E_Locations.l_15_17);
state.p_Solid.set(E_Locations.l_8_13);
state.p_Solid.set(E_Locations.l_25_2);
state.p_Solid.set(E_Locations.l_11_14);
state.p_Solid.set(E_Locations.l_10_1);
state.p_Solid.set(E_Locations.l_6_12);
state.p_Solid.set(E_Locations.l_6_13);
state.p_Solid.set(E_Locations.l_4_6);
state.p_Solid.set(E_Locations.l_10_8);
state.p_Solid.set(E_Locations.l_23_25);
state.p_Solid.set(E_Locations.l_18_23);
state.p_Solid.set(E_Locations.l_11_10);
state.p_Solid.set(E_Locations.l_18_14);
state.p_Solid.set(E_Locations.l_15_4);
state.p_Solid.set(E_Locations.l_1_7);
state.p_Solid.set(E_Locations.l_24_2);
state.p_Solid.set(E_Locations.l_22_19);
state.p_Solid.set(E_Locations.l_7_10);
state.p_Solid.set(E_Locations.l_16_13);
state.p_Solid.set(E_Locations.l_18_7);
state.p_Solid.set(E_Locations.l_7_16);
state.p_Solid.set(E_Locations.l_4_8);
state.p_Solid.set(E_Locations.l_13_22);
state.p_Solid.set(E_Locations.l_3_5);
state.p_Solid.set(E_Locations.l_8_14);
state.p_Solid.set(E_Locations.l_3_23);
state.p_Solid.set(E_Locations.l_5_1);
state.p_Solid.set(E_Locations.l_18_13);
state.p_Solid.set(E_Locations.l_9_25);
state.p_Solid.set(E_Locations.l_13_24);
state.p_Solid.set(E_Locations.l_4_16);
state.p_Solid.set(E_Locations.l_20_22);
state.p_Solid.set(E_Locations.l_2_12);
state.p_Solid.set(E_Locations.l_12_10);
state.p_Solid.set(E_Locations.l_24_4);
state.p_Solid.set(E_Locations.l_14_8);
state.p_Solid.set(E_Locations.l_3_10);
state.p_Solid.set(E_Locations.l_21_16);
state.p_Solid.set(E_Locations.l_14_17);
state.p_Solid.set(E_Locations.l_7_8);
state.p_Solid.set(E_Locations.l_7_21);
state.p_Solid.set(E_Locations.l_13_9);
state.p_Solid.set(E_Locations.l_22_11);
state.p_Solid.set(E_Locations.l_9_13);
state.p_Solid.set(E_Locations.l_16_10);
state.p_Solid.set(E_Locations.l_6_15);
state.p_Solid.set(E_Locations.l_1_16);
state.p_Solid.set(E_Locations.l_18_24);
state.p_Solid.set(E_Locations.l_15_5);
state.p_Solid.set(E_Locations.l_22_4);
state.p_Solid.set(E_Locations.l_1_18);
state.p_Solid.set(E_Locations.l_23_24);
state.p_Solid.set(E_Locations.l_13_14);
state.p_Solid.set(E_Locations.l_12_19);
state.p_Solid.set(E_Locations.l_4_19);
state.p_Solid.set(E_Locations.l_2_8);
state.p_Solid.set(E_Locations.l_15_24);
state.p_Solid.set(E_Locations.l_12_8);
state.p_Solid.set(E_Locations.l_22_18);
state.p_Solid.set(E_Locations.l_1_9);
state.p_Solid.set(E_Locations.l_20_17);
state.p_Solid.set(E_Locations.l_8_25);
state.p_Solid.set(E_Locations.l_14_2);
state.p_Solid.set(E_Locations.l_7_17);
state.p_Solid.set(E_Locations.l_17_6);
state.p_Solid.set(E_Locations.l_3_25);
state.p_Solid.set(E_Locations.l_19_25);
state.p_Solid.set(E_Locations.l_23_22);
state.p_Solid.set(E_Locations.l_3_18);
state.p_Solid.set(E_Locations.l_25_21);
state.p_Solid.set(E_Locations.l_20_13);
state.p_Solid.set(E_Locations.l_17_18);
state.p_Solid.set(E_Locations.l_19_14);
state.p_Solid.set(E_Locations.l_22_8);
state.p_Solid.set(E_Locations.l_10_4);
state.p_Solid.set(E_Locations.l_24_9);
state.p_Solid.set(E_Locations.l_4_7);
state.p_Solid.set(E_Locations.l_4_23);
state.p_Solid.set(E_Locations.l_10_21);
state.p_Solid.set(E_Locations.l_18_12);
state.p_Solid.set(E_Locations.l_20_5);
state.p_Solid.set(E_Locations.l_17_17);
state.p_Solid.set(E_Locations.l_10_9);
state.p_Solid.set(E_Locations.l_4_3);
state.p_Solid.set(E_Locations.l_20_6);
state.p_Solid.set(E_Locations.l_14_10);
state.p_Solid.set(E_Locations.l_12_15);
state.p_Solid.set(E_Locations.l_23_19);
state.p_Solid.set(E_Locations.l_15_12);
state.p_Solid.set(E_Locations.l_7_15);
state.p_Solid.set(E_Locations.l_22_24);
state.p_Solid.set(E_Locations.l_1_3);
state.p_Solid.set(E_Locations.l_13_11);
state.p_Solid.set(E_Locations.l_13_16);
state.p_Solid.set(E_Locations.l_6_25);
state.p_Solid.set(E_Locations.l_11_4);
state.p_Solid.set(E_Locations.l_10_15);
state.p_Solid.set(E_Locations.l_7_18);
state.p_Solid.set(E_Locations.l_24_20);
state.p_Solid.set(E_Locations.l_20_9);
state.p_Solid.set(E_Locations.l_9_21);
state.p_Solid.set(E_Locations.l_5_23);
state.p_Solid.set(E_Locations.l_5_22);
state.p_Solid.set(E_Locations.l_3_6);
state.p_Solid.set(E_Locations.l_21_4);
state.p_Solid.set(E_Locations.l_13_12);
state.p_Solid.set(E_Locations.l_12_18);
state.p_Solid.set(E_Locations.l_16_15);
state.p_Solid.set(E_Locations.l_18_17);
state.p_Solid.set(E_Locations.l_7_2);
state.p_Solid.set(E_Locations.l_4_15);
state.p_Solid.set(E_Locations.l_23_14);
state.p_Solid.set(E_Locations.l_18_9);
state.p_Solid.set(E_Locations.l_20_4);
state.p_Solid.set(E_Locations.l_12_3);
state.p_Solid.set(E_Locations.l_16_11);
state.p_Solid.set(E_Locations.l_23_4);
state.p_Solid.set(E_Locations.l_9_11);
state.p_Solid.set(E_Locations.l_23_20);
state.p_Solid.set(E_Locations.l_3_1);
state.p_Solid.set(E_Locations.l_2_10);
state.p_Solid.set(E_Locations.l_7_4);
state.p_Solid.set(E_Locations.l_7_7);
state.p_Solid.set(E_Locations.l_3_14);
state.p_Solid.set(E_Locations.l_23_17);
state.p_Solid.set(E_Locations.l_24_19);
state.p_Solid.set(E_Locations.l_6_9);
state.p_Solid.set(E_Locations.l_5_16);
state.p_Solid.set(E_Locations.l_5_21);
state.p_Solid.set(E_Locations.l_11_17);
state.p_Solid.set(E_Locations.l_13_7);
state.p_Solid.set(E_Locations.l_1_19);
state.p_Solid.set(E_Locations.l_8_16);
state.p_Solid.set(E_Locations.l_19_9);
state.p_Solid.set(E_Locations.l_7_19);
state.p_Solid.set(E_Locations.l_6_11);
state.p_Solid.set(E_Locations.l_15_13);
state.p_Solid.set(E_Locations.l_3_16);
state.p_Solid.set(E_Locations.l_20_16);
state.p_Solid.set(E_Locations.l_2_21);
state.p_Solid.set(E_Locations.l_24_21);
state.p_Solid.set(E_Locations.l_8_11);
state.p_Solid.set(E_Locations.l_13_20);
state.p_Solid.set(E_Locations.l_23_13);
state.p_Solid.set(E_Locations.l_13_6);
state.p_Solid.set(E_Locations.l_24_15);
state.p_Solid.set(E_Locations.l_10_17);
state.p_Solid.set(E_Locations.l_24_5);
state.p_Solid.set(E_Locations.l_16_23);
state.p_Solid.set(E_Locations.l_7_24);
state.p_Solid.set(E_Locations.l_17_12);
state.p_Solid.set(E_Locations.l_5_6);
state.p_Solid.set(E_Locations.l_8_22);
state.p_Solid.set(E_Locations.l_16_20);
state.p_Solid.set(E_Locations.l_14_21);
state.p_Solid.set(E_Locations.l_15_16);
state.p_Solid.set(E_Locations.l_2_23);
state.p_Solid.set(E_Locations.l_5_11);
state.p_Solid.set(E_Locations.l_21_24);
state.p_Solid.set(E_Locations.l_23_3);
state.p_Solid.set(E_Locations.l_4_1);
state.p_Solid.set(E_Locations.l_21_25);
state.p_Solid.set(E_Locations.l_9_16);
state.p_Solid.set(E_Locations.l_5_2);
state.p_Solid.set(E_Locations.l_12_16);
state.p_Solid.set(E_Locations.l_8_20);
state.p_Solid.set(E_Locations.l_19_16);
state.p_Solid.set(E_Locations.l_11_2);
state.p_Solid.set(E_Locations.l_5_10);
state.p_Solid.set(E_Locations.l_21_17);
state.p_Solid.set(E_Locations.l_14_5);
state.p_Solid.set(E_Locations.l_16_3);
state.p_Solid.set(E_Locations.l_5_19);
state.p_Solid.set(E_Locations.l_5_20);
state.p_Solid.set(E_Locations.l_13_3);
state.p_Solid.set(E_Locations.l_21_12);
state.p_Solid.set(E_Locations.l_19_11);
state.p_Solid.set(E_Locations.l_21_3);
state.p_Solid.set(E_Locations.l_18_21);
state.p_Solid.set(E_Locations.l_24_24);
state.p_Solid.set(E_Locations.l_19_23);
state.p_Solid.set(E_Locations.l_14_4);
state.p_Solid.set(E_Locations.l_20_15);
state.p_Solid.set(E_Locations.l_19_17);
state.p_Solid.set(E_Locations.l_22_6);
state.p_Solid.set(E_Locations.l_25_1);
state.p_Solid.set(E_Locations.l_20_2);
state.p_Solid.set(E_Locations.l_23_7);
state.p_Solid.set(E_Locations.l_3_2);
state.p_Solid.set(E_Locations.l_11_13);
state.p_Solid.set(E_Locations.l_8_1);
state.p_Solid.set(E_Locations.l_9_9);
state.p_Solid.set(E_Locations.l_4_12);
state.p_Solid.set(E_Locations.l_15_21);
state.p_Solid.set(E_Locations.l_22_17);
state.p_Solid.set(E_Locations.l_18_16);
state.p_Solid.set(E_Locations.l_15_15);
state.p_Solid.set(E_Locations.l_12_17);
state.p_Solid.set(E_Locations.l_21_7);
state.p_Solid.set(E_Locations.l_23_9);
state.p_Solid.set(E_Locations.l_18_18);
state.p_Solid.set(E_Locations.l_3_8);
state.p_Solid.set(E_Locations.l_16_4);
state.p_Solid.set(E_Locations.l_5_13);
state.p_Solid.set(E_Locations.l_4_9);
state.p_Solid.set(E_Locations.l_5_15);
state.p_Solid.set(E_Locations.l_13_25);
state.p_Solid.set(E_Locations.l_22_2);
state.p_Solid.set(E_Locations.l_21_14);
state.p_Solid.set(E_Locations.l_23_23);
state.p_Solid.set(E_Locations.l_20_18);
state.p_Solid.set(E_Locations.l_22_1);
state.p_Solid.set(E_Locations.l_14_11);
state.p_Solid.set(E_Locations.l_11_7);
state.p_Solid.set(E_Locations.l_8_23);
state.p_Solid.set(E_Locations.l_1_5);
state.p_Solid.set(E_Locations.l_5_18);
state.p_Solid.set(E_Locations.l_19_19);
state.p_Solid.set(E_Locations.l_5_8);
state.p_Solid.set(E_Locations.l_24_14);
state.p_Solid.set(E_Locations.l_15_9);
state.p_Solid.set(E_Locations.l_22_23);
state.p_Solid.set(E_Locations.l_11_11);
state.p_Solid.set(E_Locations.l_6_19);
state.p_Solid.set(E_Locations.l_20_24);
state.p_Solid.set(E_Locations.l_11_18);
state.p_Solid.set(E_Locations.l_21_6);
state.p_Solid.set(E_Locations.l_1_21);
state.p_Solid.set(E_Locations.l_25_8);
state.p_Solid.set(E_Locations.l_12_13);
state.p_Solid.set(E_Locations.l_1_2);
state.p_Solid.set(E_Locations.l_2_18);
state.p_Solid.set(E_Locations.l_17_1);
state.p_Solid.set(E_Locations.l_25_23);
state.p_Solid.set(E_Locations.l_21_15);
state.p_Solid.set(E_Locations.l_10_6);
state.p_Solid.set(E_Locations.l_15_1);
state.p_Solid.set(E_Locations.l_23_21);
state.p_Solid.set(E_Locations.l_6_8);
state.p_Solid.set(E_Locations.l_9_24);
state.p_Solid.set(E_Locations.l_9_18);
state.p_Solid.set(E_Locations.l_25_3);
state.p_Solid.set(E_Locations.l_2_15);
state.p_Solid.set(E_Locations.l_17_22);
state.p_Solid.set(E_Locations.l_4_18);
state.p_Solid.set(E_Locations.l_22_3);
state.p_Solid.set(E_Locations.l_16_12);
state.p_Solid.set(E_Locations.l_5_9);
state.p_Solid.set(E_Locations.l_13_13);
state.p_Solid.set(E_Locations.l_25_18);
state.p_Solid.set(E_Locations.l_8_10);
state.p_Solid.set(E_Locations.l_11_16);
state.p_Solid.set(E_Locations.l_15_7);
state.p_Solid.set(E_Locations.l_15_10);
state.p_Solid.set(E_Locations.l_5_25);
state.p_Solid.set(E_Locations.l_25_6);
state.p_Solid.set(E_Locations.l_21_5);
state.p_Solid.set(E_Locations.l_24_18);
state.p_Solid.set(E_Locations.l_14_16);
state.p_Solid.set(E_Locations.l_7_22);
state.p_Solid.set(E_Locations.l_9_17);
state.p_Solid.set(E_Locations.l_21_2);
state.p_Solid.set(E_Locations.l_2_25);
state.p_Solid.set(E_Locations.l_20_19);
state.p_Solid.set(E_Locations.l_25_4);
state.p_Solid.set(E_Locations.l_21_19);
state.p_Solid.set(E_Locations.l_6_24);
state.p_Solid.set(E_Locations.l_15_3);
state.p_Solid.set(E_Locations.l_14_13);
state.p_Solid.set(E_Locations.l_18_4);
state.p_Solid.set(E_Locations.l_20_11);
state.p_Solid.set(E_Locations.l_2_6);
state.p_Solid.set(E_Locations.l_8_17);
state.p_Solid.set(E_Locations.l_9_20);
state.p_Solid.set(E_Locations.l_2_16);
state.p_Solid.set(E_Locations.l_24_8);
state.p_Solid.set(E_Locations.l_13_5);
state.p_Solid.set(E_Locations.l_18_20);
state.p_Solid.set(E_Locations.l_18_15);
state.p_Solid.set(E_Locations.l_1_12);
state.p_Solid.set(E_Locations.l_25_11);
state.p_Solid.set(E_Locations.l_13_21);
state.p_Solid.set(E_Locations.l_11_15);
state.p_Solid.set(E_Locations.l_11_1);
state.p_Solid.set(E_Locations.l_19_13);
state.p_Solid.set(E_Locations.l_2_11);
state.p_Solid.set(E_Locations.l_5_24);
state.p_Solid.set(E_Locations.l_18_25);
state.p_Solid.set(E_Locations.l_14_12);
state.p_Solid.set(E_Locations.l_4_4);
state.p_Solid.set(E_Locations.l_25_24);
state.p_Solid.set(E_Locations.l_20_12);
state.p_Solid.set(E_Locations.l_5_4);
state.p_Solid.set(E_Locations.l_1_1);
state.p_Solid.set(E_Locations.l_2_9);
state.p_Solid.set(E_Locations.l_3_3);
state.p_Solid.set(E_Locations.l_12_14);
state.p_Solid.set(E_Locations.l_21_8);
state.p_Solid.set(E_Locations.l_25_17);
state.p_Solid.set(E_Locations.l_17_2);
state.p_Solid.set(E_Locations.l_24_17);
state.p_Solid.set(E_Locations.l_7_13);
state.p_Solid.set(E_Locations.l_18_8);
state.p_Solid.set(E_Locations.l_11_5);
state.p_Solid.set(E_Locations.l_24_12);
state.p_Solid.set(E_Locations.l_3_15);
state.p_Solid.set(E_Locations.l_20_1);
state.p_Solid.set(E_Locations.l_24_16);
state.p_Solid.set(E_Locations.l_2_5);
state.p_Solid.set(E_Locations.l_15_19);
state.p_Solid.set(E_Locations.l_1_22);
state.p_Solid.set(E_Locations.l_18_6);
state.p_Solid.set(E_Locations.l_21_9);
state.p_Solid.set(E_Locations.l_24_13);
state.p_Solid.set(E_Locations.l_22_13);
state.p_Solid.set(E_Locations.l_23_5);
state.p_Solid.set(E_Locations.l_9_10);
state.p_Solid.set(E_Locations.l_24_7);
state.p_Solid.set(E_Locations.l_1_24);
state.p_Solid.set(E_Locations.l_1_13);
state.p_Solid.set(E_Locations.l_7_20);
state.p_Solid.set(E_Locations.l_12_5);
state.p_Solid.set(E_Locations.l_11_12);
state.p_Solid.set(E_Locations.l_11_23);
state.p_Solid.set(E_Locations.l_19_21);
state.p_Solid.set(E_Locations.l_7_5);
state.p_Solid.set(E_Locations.l_10_2);
state.p_Solid.set(E_Locations.l_15_6);
state.p_Solid.set(E_Locations.l_8_7);
state.p_Solid.set(E_Locations.l_16_25);
state.p_Solid.set(E_Locations.l_22_12);
state.p_Solid.set(E_Locations.l_25_5);
state.p_Solid.set(E_Locations.l_3_13);
state.p_Solid.set(E_Locations.l_24_23);
state.p_Solid.set(E_Locations.l_19_12);
state.p_Solid.set(E_Locations.l_6_17);
state.p_Solid.set(E_Locations.l_10_19);
state.p_Solid.set(E_Locations.l_14_23);
state.p_Solid.set(E_Locations.l_23_18);
state.p_Solid.set(E_Locations.l_10_22);
state.p_Solid.set(E_Locations.l_14_9);
state.p_Solid.set(E_Locations.l_4_22);
state.p_Solid.set(E_Locations.l_1_10);
state.p_Solid.set(E_Locations.l_14_6);
state.p_Solid.set(E_Locations.l_15_2);
state.p_Solid.set(E_Locations.l_13_17);
state.p_Solid.set(E_Locations.l_11_19);
state.p_Solid.set(E_Locations.l_6_16);
state.p_Solid.set(E_Locations.l_10_14);
state.p_Solid.set(E_Locations.l_24_22);
state.p_Solid.set(E_Locations.l_10_12);
state.p_Solid.set(E_Locations.l_21_21);
state.p_Solid.set(E_Locations.l_16_24);
state.p_Solid.set(E_Locations.l_10_3);
state.p_Solid.set(E_Locations.l_23_1);
state.p_Solid.set(E_Locations.l_11_20);
state.p_Solid.set(E_Locations.l_19_1);
state.p_Solid.set(E_Locations.l_10_16);
state.p_Solid.set(E_Locations.l_17_25);
state.p_Solid.set(E_Locations.l_17_7);
state.p_Solid.set(E_Locations.l_16_22);
state.p_Solid.set(E_Locations.l_8_6);
state.p_Solid.set(E_Locations.l_6_10);
state.p_Solid.set(E_Locations.l_19_3);
state.p_Solid.set(E_Locations.l_14_7);
state.p_Solid.set(E_Locations.l_2_24);
state.p_Solid.set(E_Locations.l_4_25);
state.p_Solid.set(E_Locations.l_6_23);
state.p_Solid.set(E_Locations.l_25_15);
state.p_Solid.set(E_Locations.l_6_21);
state.p_Solid.set(E_Locations.l_8_2);
state.p_Solid.set(E_Locations.l_1_14);
state.p_Solid.set(E_Locations.l_12_1);
state.p_Solid.set(E_Locations.l_1_11);
state.p_Solid.set(E_Locations.l_3_17);
state.p_Medium.set(E_Locations.l_17_13);
state.p_Medium.set(E_Locations.l_22_20);
state.p_Medium.set(E_Locations.l_7_11);
state.p_Medium.set(E_Locations.l_11_24);
state.p_Medium.set(E_Locations.l_23_6);
state.p_Medium.set(E_Locations.l_9_19);
state.p_Medium.set(E_Locations.l_13_10);
state.p_Medium.set(E_Locations.l_5_5);
state.p_Medium.set(E_Locations.l_10_7);
state.p_Medium.set(E_Locations.l_7_9);
state.p_Medium.set(E_Locations.l_10_20);
state.p_Medium.set(E_Locations.l_19_8);
state.p_Medium.set(E_Locations.l_19_10);
state.p_Medium.set(E_Locations.l_20_10);
state.p_Medium.set(E_Locations.l_12_24);
state.p_Medium.set(E_Locations.l_23_15);
state.p_Medium.set(E_Locations.l_23_16);
state.p_Medium.set(E_Locations.l_9_2);
state.p_Medium.set(E_Locations.l_18_5);
state.p_Medium.set(E_Locations.l_22_25);
state.p_Medium.set(E_Locations.l_11_22);
state.p_Medium.set(E_Locations.l_2_4);
state.p_Medium.set(E_Locations.l_8_3);
state.p_Medium.set(E_Locations.l_9_7);
state.p_Medium.set(E_Locations.l_14_24);
state.p_Medium.set(E_Locations.l_4_20);
state.p_Medium.set(E_Locations.l_16_17);
state.p_Medium.set(E_Locations.l_1_25);
state.p_Medium.set(E_Locations.l_5_7);
state.p_Medium.set(E_Locations.l_22_16);
state.p_Medium.set(E_Locations.l_20_23);
state.p_Medium.set(E_Locations.l_21_10);
state.p_Medium.set(E_Locations.l_9_15);
state.p_Medium.set(E_Locations.l_17_23);
state.p_Medium.set(E_Locations.l_25_16);
state.p_Medium.set(E_Locations.l_25_20);
state.p_Medium.set(E_Locations.l_16_14);
state.p_Medium.set(E_Locations.l_3_11);
state.p_Medium.set(E_Locations.l_3_4);
state.p_Medium.set(E_Locations.l_9_22);
state.p_Medium.set(E_Locations.l_24_3);
state.p_Medium.set(E_Locations.l_20_20);
state.p_Medium.set(E_Locations.l_7_1);
state.p_Small.set(E_Locations.l_10_23);
state.p_Small.set(E_Locations.l_4_11);
state.p_Small.set(E_Locations.l_3_9);
state.p_Small.set(E_Locations.l_10_10);
state.p_Small.set(E_Locations.l_9_23);
state.p_Small.set(E_Locations.l_6_22);
state.p_Small.set(E_Locations.l_6_4);
state.p_Small.set(E_Locations.l_12_25);
state.p_Small.set(E_Locations.l_3_12);
state.p_Small.set(E_Locations.l_20_14);
state.p_Small.set(E_Locations.l_9_8);
state.p_Small.set(E_Locations.l_14_20);
state.p_Small.set(E_Locations.l_13_19);
state.p_Small.set(E_Locations.l_4_13);
state.p_Small.set(E_Locations.l_8_21);
state.p_Small.set(E_Locations.l_2_20);
state.p_Small.set(E_Locations.l_2_2);
state.p_Small.set(E_Locations.l_17_21);
state.p_Small.set(E_Locations.l_4_5);
state.p_Small.set(E_Locations.l_20_21);
state.p_Small.set(E_Locations.l_6_6);
state.p_Small.set(E_Locations.l_16_18);
state.p_Small.set(E_Locations.l_14_22);
state.p_Small.set(E_Locations.l_7_6);
state.p_Small.set(E_Locations.l_6_3);
state.p_Small.set(E_Locations.l_3_21);
state.p_Small.set(E_Locations.l_22_7);
state.p_Small.set(E_Locations.l_9_12);
state.p_Small.set(E_Locations.l_25_14);
state.p_Small.set(E_Locations.l_22_14);
state.p_Small.set(E_Locations.l_9_4);
state.p_Small.set(E_Locations.l_11_9);
state.p_Small.set(E_Locations.l_9_1);
state.p_Big.set(E_Locations.l_19_22);
state.p_Big.set(E_Locations.l_24_1);
state.p_Big.set(E_Locations.l_14_1);
state.p_Big.set(E_Locations.l_14_19);
state.p_Big.set(E_Locations.l_12_23);
state.p_Big.set(E_Locations.l_22_15);
state.p_Big.set(E_Locations.l_3_24);
state.p_Big.set(E_Locations.l_13_23);
state.p_Big.set(E_Locations.l_15_23);
state.p_Big.set(E_Locations.l_11_8);
state.p_Big.set(E_Locations.l_25_12);
state.p_Big.set(E_Locations.l_12_6);
state.p_Big.set(E_Locations.l_15_18);
state.p_Big.set(E_Locations.l_8_4);
state.p_Big.set(E_Locations.l_18_10);
state.p_Big.set(E_Locations.l_20_3);
state.p_Big.set(E_Locations.l_9_6);
state.p_Big.set(E_Locations.l_15_8);
state.p_Big.set(E_Locations.l_10_13);
state.p_Big.set(E_Locations.l_21_23);
state.p_Big.set(E_Locations.l_25_7);
state.p_Big.set(E_Locations.l_22_9);
state.p_Big.set(E_Locations.l_20_7);
state.p_Big.set(E_Locations.l_24_6);
state.p_Big.set(E_Locations.l_6_2);
state.p_Big.set(E_Locations.l_11_3);
state.p_Big.set(E_Locations.l_19_15);
state.p_Big.set(E_Locations.l_16_5);
state.p_Big.set(E_Locations.l_9_3);
state.p_Big.set(E_Locations.l_19_6);
state.p_Big.set(E_Locations.l_25_10);
state.p_Big.set(E_Locations.l_11_6);
state.p_Big.set(E_Locations.l_10_18);
state.p_Big.set(E_Locations.l_18_11);
state.p_Big.set(E_Locations.l_8_24);
state.p_Big.set(E_Locations.l_13_18);
state.p_Big.set(E_Locations.l_17_8);
state.p_Big.set(E_Locations.l_5_3);
state.p_Big.set(E_Locations.l_13_8);
state.p_Big.set(E_Locations.l_17_3);
}
@Override
public String getName() {
return "Perestroika-Problem";
}
@Override
public Domain getDomain() {
return domain;
}
@Override
public State getState() {
return state;
}
@Override
public Goal getGoal() {
return goal;
}
@Override
public PDDLDeadEnd getDeadEnd() {
return deadEnd;
}
}
|
/*
Copyright (C) 2013-2015 The Open University
SPDX-FileCopyrightText: 2013-2015 The Open University
SPDX-License-Identifier: Apache-2.0
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.
*/
/**
* Classes that describe and implement rules for identifier naming.
*
* <p>
* The classes may be divided into two groups. There are infrastructure classes
* that provide a means of aggregating rules into rule sets, and groups of
* rule sets. There are also classes that are components of the rule sets and
* represent an individual rule.
* </p>
*
*
* <p>
* {@link RulesetGroupFactory} is used to create instances of {@link RulesetGroup}
* constructed from text files of rules either stored in a jar file, on the
* filesystem. {@code RulesetGroup}s are then used to
* test instances of {@code IdentifierName}, which need to be instantiated by
* the caller.
* </p>
*
* <p>
* Rule sets are created for a particular sub-species or type of identifier name,
* e.g. a method that takes no arguments and returns a boolean. Each {@link Ruleset}
* contains {@link Rule}s for typography and phrase structure.
* </p>
*
* <p>
* The grammar for .nom files defining rules is available from the
* package {@code uk.ac.open.crc.nominal.rules.parser}.
* </p>
*
*
*
*/
package uk.ac.open.crc.nominal.rules;
|
package com.ethan.cache.config;
import com.ethan.context.utils.InstanceUtils;
import org.springframework.cache.CacheManager;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.cache.interceptor.SimpleKeyGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.cache.RedisCacheWriter;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializationContext;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
//@Configuration
@Deprecated
public class RedisConfig {
@Bean
public CacheManager cacheManager(RedisConnectionFactory connectionFactory) {
return new RedisCacheManager(
RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory),
getRedisCacheConfigurationWithTtl(5),
getRedisCacheConfigurationMap()
);
}
private RedisCacheConfiguration getRedisCacheConfigurationWithTtl(long seconds) {
RedisSerializationContext.SerializationPair<String> keySerializer = RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer());
RedisSerializationContext.SerializationPair<Object> valueSerializer =
RedisSerializationContext.SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer(InstanceUtils.getMapperInstance()));
return RedisCacheConfiguration.defaultCacheConfig()
.entryTtl(Duration.ofSeconds(seconds))
.serializeKeysWith(keySerializer)
.serializeValuesWith(valueSerializer);
}
private Map<String, RedisCacheConfiguration> getRedisCacheConfigurationMap() {
Map<String, RedisCacheConfiguration> redisCacheConfigurationMap = new HashMap<>();
redisCacheConfigurationMap.put("SsoCache", this.getRedisCacheConfigurationWithTtl(24*60*60));
redisCacheConfigurationMap.put("BasicDataCache", this.getRedisCacheConfigurationWithTtl(30));
return redisCacheConfigurationMap;
}
@Bean("redisJackson")
public RedisTemplate<String, String> redisTemplate(RedisConnectionFactory connectionFactory) {
StringRedisTemplate template = new StringRedisTemplate(connectionFactory);
template.setKeySerializer(new StringRedisSerializer());
template.setValueSerializer(new GenericJackson2JsonRedisSerializer(InstanceUtils.getMapperInstance()));
template.afterPropertiesSet();
return template;
}
/**
* define the cache key generator
* @return SimpleKeyGenerator
*/
@Bean
public KeyGenerator keyGenerator() {
return new SimpleKeyGenerator();
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.