auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean isStandAlonePrimitive() { if (jjtGetNumChildren() != 1) { return false; } ASTPrimaryExpression primaryExpression = getFirstChildOfType(ASTPrimaryExpression.class); if (primaryExpression == null || primaryExpression.jjtGetNumChildren() != 1) { return false; } ASTPrimaryPrefix primaryPrefix = primaryExpression.getFirstChildOfType(ASTPrimaryPrefix.class); if (primaryPrefix == null || primaryPrefix.jjtGetNumChildren() != 1) { return false; } ASTLiteral literal = primaryPrefix.getFirstChildOfType(ASTLiteral.class); if (literal == null || literal.jjtGetNumChildren() != 0) { return false; } return true; }

Target:
public boolean isStandAlonePrimitive() { if (jjtGetNumChildren() != 1) { return false; } ASTPrimaryExpression primaryExpression = getFirstChildOfType(ASTPrimaryExpression.class); if (primaryExpression == null || primaryExpression.jjtGetNumChildren() != 1) { return false; } ASTPrimaryPrefix primaryPrefix = primaryExpression.getFirstChildOfType(ASTPrimaryPrefix.class); if (primaryPrefix == null || primaryPrefix.jjtGetNumChildren() != 1) { return false; } ASTLiteral literal = primaryPrefix.getFirstChildOfType(ASTLiteral.class); if (literal == null || literal.isStringLiteral() || (literal.jjtGetNumChildren() != 0 && literal.jjtGetChild(0) instanceof ASTNullLiteral)) { return false; } return true; }
Source:
boolean allocate(PooledByteBuf<T> buf, int reqCapacity, int normCapacity) { final long handle; if ((normCapacity & subpageOverflowMask) != 0) { handle = allocateRun(normCapacity); } else { handle = allocateSubpage(normCapacity); } if (handle > 0) { ByteBuffer nioBuffer = cachedNioBuffers != null ? cachedNioBuffers.pollLast() : null; initBuf(buf, nioBuffer, handle, reqCapacity); return true; } return false; }

Target:
boolean allocate(PooledByteBuf<T> buf, int reqCapacity, int normCapacity) { final long handle; if ((normCapacity & subpageOverflowMask) != 0) { handle = allocateRun(normCapacity); } else { handle = allocateSubpage(normCapacity); } if (handle < 0) { return false; } ByteBuffer nioBuffer = cachedNioBuffers != null ? cachedNioBuffers.pollLast() : null; initBuf(buf, nioBuffer, handle, reqCapacity); return true; }
Source:
public boolean isRepresentationsResource() { boolean isRepresentationsResource = false; try { isRepresentationsResource = resource.getURI() != null; isRepresentationsResource = isRepresentationsResource && new FileQuery(resource.getURI().fileExtension()).isSessionResourceFile(); } catch (IllegalStateException e) { } isRepresentationsResource = isRepresentationsResource || resource instanceof AirdResource; if (!isRepresentationsResource && !resource.getContents().isEmpty()) { for (EObject contentEObject : resource.getContents()) { if (contentEObject instanceof DAnalysis) { isRepresentationsResource = true; break; } } } return isRepresentationsResource; }

Target:
public boolean isRepresentationsResource() { boolean isRepresentationsResource = false; try { isRepresentationsResource = resource.getURI() != null; isRepresentationsResource = isRepresentationsResource && new FileQuery(resource.getURI().fileExtension()).isSessionResourceFile(); } catch (IllegalStateException e) { } isRepresentationsResource = isRepresentationsResource || resource instanceof AirdResource; if (!isRepresentationsResource && !resource.getContents().isEmpty()) { EObject contentEObject = resource.getContents().get(0); if (contentEObject instanceof DAnalysis) { isRepresentationsResource = true; } } return isRepresentationsResource; }
Source:
public static void bootstrap() { parserPool = new BasicParserPool(); parserPool.setMaxPoolSize(100); parserPool.setCoalescing(true); parserPool.setIgnoreComments(true); parserPool.setNamespaceAware(true); Map<String, Object> builderAttributes = new HashMap<String, Object>(); SecurityManager secMgmr = new SecurityManager(); builderAttributes.put("<LINK_2>", secMgmr); parserPool.setBuilderAttributes(builderAttributes); Map<String, Boolean> features = new HashMap<String, Boolean>(); features.put("<LINK_1>", Boolean.TRUE); features.put("<LINK_0>", Boolean.FALSE); features.put("<LINK_3>", Boolean.TRUE); parserPool.setBuilderFeatures(features); try { parserPool.initialize(); } catch (ComponentInitializationException e) { throw new RuntimeException("Exception initializing parserPool", e); } try { InitializationService.initialize(); } catch (InitializationException e) { throw new RuntimeException("Exception initializing OpenSAML", e); } XMLObjectProviderRegistry registry; synchronized(ConfigurationService.class) { registry = ConfigurationService.get(XMLObjectProviderRegistry.class); if (registry == null) { registry = new XMLObjectProviderRegistry(); ConfigurationService.register(XMLObjectProviderRegistry.class, registry); } } registry.setParserPool(parserPool); }

Target:
private static void bootstrap() { parserPool = new BasicParserPool(); parserPool.setMaxPoolSize(100); parserPool.setCoalescing(true); parserPool.setIgnoreComments(true); parserPool.setNamespaceAware(true); final Map<String, Object> builderAttributes = new HashMap<String, Object>(); parserPool.setBuilderAttributes(builderAttributes); final Map<String, Boolean> features = new HashMap<String, Boolean>(); features.put("<LINK_1>", Boolean.TRUE); features.put("<LINK_0>", Boolean.FALSE); features.put("<LINK_3>", Boolean.TRUE); parserPool.setBuilderFeatures(features); try { parserPool.initialize(); } catch (final ComponentInitializationException e) { throw new RuntimeException("Exception initializing parserPool", e); } try { InitializationService.initialize(); } catch (final InitializationException e) { throw new RuntimeException("Exception initializing OpenSAML", e); } XMLObjectProviderRegistry registry; synchronized(ConfigurationService.class) { registry = ConfigurationService.get(XMLObjectProviderRegistry.class); if (registry == null) { registry = new XMLObjectProviderRegistry(); ConfigurationService.register(XMLObjectProviderRegistry.class, registry); } } registry.setParserPool(parserPool); }
Source:
public synchronized int getFirst() { if (data.isEmpty()) { return -1; } return data.get(0); }

Target:
public synchronized int getFirst() { return data.isEmpty() ? -1 : data.get(0); }
Source:
public ContainerInfo inspectContainer(String containerId) throws IOException { Pod pod = getChePodByContainerId(containerId); if (pod == null ) { LOG.warn("No Pod found by container ID {}", containerId); return null; } String podPullSpec = pod.getSpec().getContainers().get(0).getImage(); String tagName = KubernetesStringUtils.getTagNameFromPullSpec(podPullSpec); ImageStreamTag tag = getImageStreamTagFromRepo(tagName); ImageInfo imageInfo = getImageInfoFromTag(tag); String deploymentName = pod.getMetadata().getLabels().get(OPENSHIFT_DEPLOYMENT_LABEL); if (deploymentName == null ) { LOG.warn("No label found for Pod {}", OPENSHIFT_DEPLOYMENT_LABEL, pod.getMetadata().getName()); return null; } Service svc = getCheServiceBySelector(OPENSHIFT_DEPLOYMENT_LABEL, deploymentName); if (svc == null) { LOG.warn("No Service found by selector {}={}", OPENSHIFT_DEPLOYMENT_LABEL, deploymentName); return null; } return createContainerInfo(svc, imageInfo, pod, containerId); }

Target:
public ContainerInfo inspectContainer(String containerId) throws IOException { Pod pod = getChePodByContainerId(containerId); if (pod == null ) { LOG.warn("No Pod found by container ID {}", containerId); return null; } List<Container> podContainers = pod.getSpec().getContainers(); if (podContainers.size() > 1) { throw new OpenShiftException("Multiple Containers found in Pod."); } else if (podContainers.size() < 1 || isNullOrEmpty(podContainers.get(0).getImage())) { throw new OpenShiftException(String.format("Container %s not found", containerId)); } String podPullSpec = podContainers.get(0).getImage(); String tagName = KubernetesStringUtils.getTagNameFromPullSpec(podPullSpec); ImageStreamTag tag = getImageStreamTagFromRepo(tagName); ImageInfo imageInfo = getImageInfoFromTag(tag); String deploymentName = pod.getMetadata().getLabels().get(OPENSHIFT_DEPLOYMENT_LABEL); if (deploymentName == null ) { LOG.warn("No label found for Pod {}", OPENSHIFT_DEPLOYMENT_LABEL, pod.getMetadata().getName()); return null; } Service svc = getCheServiceBySelector(OPENSHIFT_DEPLOYMENT_LABEL, deploymentName); if (svc == null) { LOG.warn("No Service found by selector {}={}", OPENSHIFT_DEPLOYMENT_LABEL, deploymentName); return null; } return createContainerInfo(svc, imageInfo, pod, containerId); }
Source:
public static Calendar getCalendarParameter(String param) { if (param != null) { Calendar cal = Calendar.getInstance(); try { Date date = DateParser.parseW3CDateTime(param); if (date != null) { cal.setTime(DateParser.parseW3CDateTime(param)); return cal; } } catch (IllegalArgumentException e) { log.warn("Date should have 'YYYY-MM-DDThh:mm:ss.sTZD' format, trying to parse 'yyyy-MM-dd' format"); DateTime date = ISODateTimeFormat.date().parseDateTime(param); if (date != null) { cal.setTime(date.toDate()); return cal; } } } return null; }

Target:
public static Calendar getCalendarParameter(String param) { if (param != null) { Calendar cal = Calendar.getInstance(); try { Date date = DateParser.parseW3CDateTime(param); if (date != null) { cal.setTime(date); return cal; } } catch (IllegalArgumentException e) { log.warn("Date should have 'YYYY-MM-DDThh:mm:ss.sTZD' format, trying to parse 'yyyy-MM-dd' format"); DateTime date = ISODateTimeFormat.date().parseDateTime(param); if (date != null) { cal.setTime(date.toDate()); return cal; } } } return null; }
Source:
public CopyArtifact(String projectName, String parameters, BuildSelector selector, String filter, String excludes, String target, boolean flatten, boolean optional, boolean fingerprintArtifacts) { StaplerRequest req = Stapler.getCurrentRequest(); if (req!=null) { AbstractProject<?,?> p = req.findAncestorObject(AbstractProject.class); if (p != null) { ItemGroup<?> context = p.getParent(); if (projectName.indexOf('$') < 0 && Jenkins.getInstance().getItem(projectName, context, Job.class) == null) projectName = ""; } } this.project = projectName; this.parameters = Util.fixEmptyAndTrim(parameters); if (selector == null) { this.selector = new StatusBuildSelector(true); } else { this.selector = selector; } this.filter = Util.fixNull(filter).trim(); this.excludes = Util.fixNull(excludes).trim(); this.target = Util.fixNull(target).trim(); this.flatten = flatten ? Boolean.TRUE : null; this.optional = optional ? Boolean.TRUE : null; this.doNotFingerprintArtifacts = !fingerprintArtifacts; }

Target:
public CopyArtifact(String projectName, String parameters, BuildSelector selector, String filter, String excludes, String target, boolean flatten, boolean optional, boolean fingerprintArtifacts) { this(projectName); setParameters(parameters); setFilter(filter); setTarget(target); setExcludes(excludes); if (selector == null) { selector = DEFAULT_BUILD_SELECTOR; } setSelector(selector); setFlatten(flatten); setOptional(optional); setFingerprintArtifacts(fingerprintArtifacts); }
Source:
public void shouldFailRequestingARefund_whenChargeRefundIsFull() { Long refundAmount = defaultTestCharge.getAmount(); String externalChargeId = defaultTestCharge.getExternalChargeId(); Long chargeId = defaultTestCharge.getChargeId(); postRefundFor(externalChargeId, refundAmount, defaultTestCharge.getAmount()) .statusCode(ACCEPTED.getStatusCode()); List<Map<String, Object>> refundsFoundByChargeId = databaseTestHelper.getRefundsByChargeId(chargeId); assertThat(refundsFoundByChargeId.size(), is(1)); assertRefundsHistoryInDBForSuccessfulOrPartialRefund(defaultTestCharge); postRefundFor(externalChargeId, 1L, defaultTestCharge.getAmount() - refundAmount) .statusCode(BAD_REQUEST.getStatusCode()) .body("reason", is("full")) .body("message", is(format("Charge with id [%s] not available for refund.", externalChargeId))); }

Target:
public void shouldFailRequestingARefund_whenChargeRefundIsFull() { Long refundAmount = defaultTestCharge.getAmount(); String externalChargeId = defaultTestCharge.getExternalChargeId(); Long chargeId = defaultTestCharge.getChargeId(); postRefundFor(externalChargeId, refundAmount, defaultTestCharge.getAmount()) .statusCode(ACCEPTED.getStatusCode()); List<Map<String, Object>> refundsFoundByChargeId = databaseTestHelper.getRefundsByChargeId(chargeId); assertThat(refundsFoundByChargeId.size(), is(1)); postRefundFor(externalChargeId, 1L, defaultTestCharge.getAmount() - refundAmount) .statusCode(BAD_REQUEST.getStatusCode()) .body("reason", is("full")) .body("message", is(format("Charge with id [%s] not available for refund.", externalChargeId))); }
Source:
@Override public Token load(ClientSecret key) throws Exception { return api.authorizeClientSecret(key.clientId(), key.clientSecret(), key.resource()); }

Target:
@Override public Token load(ClientSecret key) throws Exception { return api.authorizeClientSecret(key.clientId(), key.clientSecret(), key.resource(), key.scope()); }
Source:
public BinaryContent transform( Metacard metacard, String transformerShortname, Map<String, Serializable> arguments) throws CatalogTransformerException { return transformOperations.transform(metacard, transformerShortname, arguments).get(0); }

Target:
public BinaryContent transform( Metacard metacard, String transformerShortname, Map<String, Serializable> arguments) throws CatalogTransformerException { List<BinaryContent> binaryContents = transformOperations.transform(metacard, transformerShortname, arguments); if (CollectionUtils.isNotEmpty(binaryContents)) { return binaryContents.get(0); } throw new CatalogTransformerException("Unable to transform metacard."); }
Source:
public String getLocalAuthor(IProgressMonitor monitor) { final ICVSFile cvsFile= getCVSFile(); if (cvsFile == null) return null; final ResourceSyncInfo info= getSyncInfoForLocal(cvsFile); if (info == null) return null; final String localRevision= info.getRevision(); if (localRevision == null) return null; final ILogEntry entries[]= getLogEntries(cvsFile, monitor); if (entries == null || entries.length == 0) return null; for (ILogEntry entrie : entries) { try { if (localRevision.equals(entrie.getRemoteFile().getRevision())) { return entrie.getAuthor(); } }catch (TeamException e) { CVSProviderPlugin.log(e); } } return null; }

Target:
public String getLocalAuthor(IProgressMonitor monitor) { final ICVSFile cvsFile= getCVSFile(); if (cvsFile == null) return null; final ResourceSyncInfo info= getSyncInfoForLocal(cvsFile); if (info == null) return null; final String localRevision= info.getRevision(); if (localRevision == null) return null; final ILogEntry entries[]= getLogEntries(cvsFile, monitor); if (entries == null || entries.length == 0) return null; for (ILogEntry entry : entries) { try { if (localRevision.equals(entry.getRemoteFile().getRevision())) { return entry.getAuthor(); } } catch (TeamException e) { CVSProviderPlugin.log(e); } } return null; }
Source:
public String toString() { return "Request metadata: " + (restRequestMetadata != null ? restRequestMetadata.toString() : "null") + " Request content: " + (restRequestContent != null ? restRequestContent.toString() : "null") + " Response handler: " + (restResponseHandler != null ? restResponseHandler.toString() : "null"); }

Target:
public String toString() { return "Request metadata: " + restRequestMetadata + " Request content: " + restRequestContent + " Response handler: " + restResponseHandler; }
Source:
private ArrayList<Double> findMarketPrice(ArrayList<Order> buyList, ArrayList<Order> sellList) { ArrayList<Double> values = new ArrayList<Double>(); int buyVolume = 0; int sellVolume = 0; int finalBuyVolume = 10000000; int finalSellVolume = 0; int totalSellVolume = -1; int buyNumber = -1, sellNumber = -1; double price = -1.0; for (int i = 0; i < buyList.size(); i++){ buyVolume += buyList.get(i).getSize(); sellVolume = 0; for (int j = 0; j < sellList.size(); j++) { sellVolume += sellList.get(j).getSize(); if (buyVolume >= sellVolume) { if ((buyVolume - sellVolume) <= (finalBuyVolume - finalSellVolume) && totalSellVolume < sellVolume && buyList.get(i).getPrice() >= sellList.get(j).getPrice()) { buyNumber = i; sellNumber = j; finalBuyVolume = buyVolume; finalSellVolume = sellVolume; price = sellList.get(sellNumber).getPrice(); totalSellVolume = sellVolume; } } } } values.add((double) buyNumber); values.add((double) sellNumber); values.add(price); values.add((double) totalSellVolume); return values; }

Target:
private ArrayList<Double> findMarketPrice(ArrayList<Order> buyList, ArrayList<Order> sellList) { ArrayList<Double> marketTradeInformation = new ArrayList<Double>(); int buyVolume = 0; int sellVolume = 0; int finalBuyVolume = 10000000; int finalSellVolume = 0; int totalSellVolume = -1; int buyNumber = -1, sellNumber = -1; double price = -1.0; for (int i = 0; i < buyList.size(); i++){ buyVolume += buyList.get(i).getSize(); sellVolume = 0; for (int j = 0; j < sellList.size(); j++) { sellVolume += sellList.get(j).getSize(); if (buyVolume >= sellVolume) { if ((buyVolume - sellVolume) <= (finalBuyVolume - finalSellVolume) && totalSellVolume < sellVolume && buyList.get(i).getPrice() >= sellList.get(j).getPrice()) { buyNumber = i; sellNumber = j; finalBuyVolume = buyVolume; finalSellVolume = sellVolume; price = sellList.get(sellNumber).getPrice(); totalSellVolume = sellVolume; } } } } marketTradeInformation.add((double) buyNumber); marketTradeInformation.add((double) sellNumber); marketTradeInformation.add(price); marketTradeInformation.add((double) totalSellVolume); return values; }
Source:
public final <T> void setTag(Class<T> clazz, T value) { if (clazz != value.getClass()) { throw new IllegalArgumentException("Tag value must be of type " + clazz.getName()); } if (tags == null) { tags = new HashMap<>(); } tags.put(clazz, value); }

Target:
public final <T> void setTag(Class<T> clazz, T value) { if (!clazz.isAssignableFrom(value.getClass())) { throw new IllegalArgumentException("Tag value must be of type " + clazz.getName()); } if (tags == null) { tags = new LinkedHashMap<>(); } tags.put(clazz, value); }
Source:
UnixDESCryptPasswordImpl(final ClearPasswordSpec spec) throws InvalidKeySpecException { this.salt = (short) (ThreadLocalRandom.current().nextInt() & 0xff); this.hash = generateHash(this.salt, spec.getEncodedPassword().clone()); }

Target:
UnixDESCryptPasswordImpl(final ClearPasswordSpec spec) throws InvalidKeySpecException { this.salt = (short) (ThreadLocalRandom.current().nextInt() & 0xfff); this.hash = generateHash(this.salt, spec.getEncodedPassword().clone()); }
Source:
public Date getDate(Date date, boolean floorDate) { Utils.checkState(validated, Utils.formatL("PathTemplateEL for '{}' must be validated", pathTemplate)); DateContext dc = new DateContext(date, timeZone); elVars.addContextVariable(DATE_CONTEXT, dc); try { freqEdgeElEval.eval(elVars, pathTemplate, String.class); } catch (ELEvalException ex) { throw new RuntimeException("Unknown OnError value " + ex.toString(), ex); } elVars.addContextVariable(DATE_CONTEXT, null); if (!dc.noDate) { int rangeEdgeCorrection = (floorDate) ? 0 : 1; for (int i = 0; i < UNITS_ORDERED.length; i++) { if (UNITS_ORDERED[i] > incrementUnit) { dc.adjusted.set(UNITS_ORDERED[i], dc.adjusted.getMinimum(UNITS_ORDERED[i])); } } dc.adjusted.set(Calendar.MILLISECOND, 0); if (dc.frequency > 1) { if (dc.frequencyUnit == 0) { throw new IllegalStateException(Utils.format( "Unknown error every() function in path template seems to have an invalid unit: {}", pathTemplate)); } int frequencyRangeEdge = (dc.adjusted.get(dc.frequencyUnit) / dc.frequency + rangeEdgeCorrection) * dc.frequency; dc.adjusted.set(dc.frequencyUnit, dc.adjusted.getMinimum(dc.frequencyUnit)); dc.adjusted.add(dc.frequencyUnit, frequencyRangeEdge); } else { dc.adjusted.add(incrementUnit, rangeEdgeCorrection); } if (!floorDate) { dc.adjusted.add(Calendar.MILLISECOND, -1); } date = dc.adjusted.getTime(); } else { date = null; } return date; }

Target:
public Date getDate(Date date, boolean floorDate) { Utils.checkState(validated, Utils.formatL("PathTemplateEL for '{}' must be validated", pathTemplate)); DateContext dc = new DateContext(date, timeZone); elVars.addContextVariable(DATE_CONTEXT, dc); try { freqEdgeElEval.eval(elVars, pathTemplate, String.class); } catch (ELEvalException ex) { throw new RuntimeException(Utils.format("Unexpected exception: {}", ex.toString()), ex); } elVars.addContextVariable(DATE_CONTEXT, null); if (!dc.noDate) { int rangeEdgeCorrection = (floorDate) ? 0 : 1; for (int i = 0; i < UNITS_ORDERED.length; i++) { if (UNITS_ORDERED[i] > incrementUnit) { dc.adjusted.set(UNITS_ORDERED[i], dc.adjusted.getMinimum(UNITS_ORDERED[i])); } } dc.adjusted.set(Calendar.MILLISECOND, 0); if (dc.frequency > 1) { if (dc.frequencyUnit == 0) { throw new IllegalStateException(Utils.format( "Unknown error every() function in path template seems to have an invalid unit: {}", pathTemplate)); } int frequencyRangeEdge = (dc.adjusted.get(dc.frequencyUnit) / dc.frequency + rangeEdgeCorrection) * dc.frequency; dc.adjusted.set(dc.frequencyUnit, dc.adjusted.getMinimum(dc.frequencyUnit)); dc.adjusted.add(dc.frequencyUnit, frequencyRangeEdge); } else { dc.adjusted.add(incrementUnit, rangeEdgeCorrection); } if (!floorDate) { dc.adjusted.add(Calendar.MILLISECOND, -1); } date = dc.adjusted.getTime(); } else { date = null; } return date; }
Source:
public boolean equals(Object o) { if (o == this) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BinaryPredicate that = (BinaryPredicate) o; return getType().equals(that.getType()); }

Target:
public boolean equals(Object o) { if (o == this) { return true; } if (o == null || getClass() != o.getClass()) { return false; } BinaryPredicate that = (BinaryPredicate) o; if (!getType().equals(that.getType())) { return false; } if (!left.equals(that.left)) { return false; } return right.equals(that.right); }
Source:
private ChangeInfo toChangeInfo(ChangeData cd) throws OrmException { ChangeInfo out = new ChangeInfo(); Change in = cd.change(db); out.project = in.getProject().get(); out.branch = in.getDest().getShortName(); out.topic = in.getTopic(); out.id = in.getKey().get(); out.subject = in.getSubject(); out.status = in.getStatus(); out.owner = asAccountAttribute(in.getOwner()); out.updated = in.getLastUpdatedOn(); out._number = in.getId().get(); out._sortkey = in.getSortKey(); out.starred = user.getStarredChanges().contains(in.getId()) ? true : null; out.labels = true ? labelsFor(cd) : null; return out; }

Target:
private ChangeInfo toChangeInfo(ChangeData cd) throws OrmException { ChangeInfo out = new ChangeInfo(); Change in = cd.change(db); out.project = in.getProject().get(); out.branch = in.getDest().getShortName(); out.topic = in.getTopic(); out.id = in.getKey().get(); out.subject = in.getSubject(); out.status = in.getStatus(); out.owner = asAccountAttribute(in.getOwner()); out.updated = in.getLastUpdatedOn(); out._number = in.getId().get(); out._sortkey = in.getSortKey(); out.starred = user.getStarredChanges().contains(in.getId()) ? true : null; out.labels = labelsFor(cd); return out; }
Source:
private PartitionStatistics getExistingPartitionStatistics(Partition partition, String partitionName) { try { PartitionStatistics statistics = delegate.getPartitionStatistics(partition.getDatabaseName(), partition.getTableName(), ImmutableSet.of(partitionName)) .get(partitionName); if (statistics == null) { throw new PrestoException( TRANSACTION_CONFLICT, format("The partition that this transaction modified was deleted in another transaction. %s %s", partition.getTableName(), partition.getValues())); } return statistics; } catch (PrestoException e) { if (e.getErrorCode().equals(HIVE_CORRUPTED_COLUMN_STATISTICS.toErrorCode())) { log.error(e); return PartitionStatistics.empty(); } throw e; } }

Target:
private PartitionStatistics getExistingPartitionStatistics(Partition partition, String partitionName) { try { PartitionStatistics statistics = delegate.getPartitionStatistics(partition.getDatabaseName(), partition.getTableName(), ImmutableSet.of(partitionName)) .get(partitionName); if (statistics == null) { throw new PrestoException( TRANSACTION_CONFLICT, format("The partition that this transaction modified was deleted in another transaction. %s %s", partition.getTableName(), partition.getValues())); } return statistics; } catch (PrestoException e) { if (e.getErrorCode().equals(HIVE_CORRUPTED_COLUMN_STATISTICS.toErrorCode())) { log.warn( e, "Corrupted statistics found when altering partition. Table: %s.%s. Partition: %s", partition.getDatabaseName(), partition.getTableName(), partition.getValues()); return PartitionStatistics.empty(); } throw e; } }
Source:
public void onPartitionsLost(final Collection<TopicPartition> partitions) { log.info("at state {}: partitions lost due to missed rebalance.\n" + "\tlost active tasks: {}\n" + "\tlost assigned standby tasks: {}\n", streamThread.state(), partitions, taskManager.activeTaskIds(), taskManager.standbyTaskIds()); final long start = time.milliseconds(); try { taskManager.handleLostAll(); } catch (final Exception e) { throw new TaskMigratedException("Error caught during partitions lost", e); } finally { log.info("partitions lost took ms.", time.milliseconds() - start); } }

Target:
public void onPartitionsLost(final Collection<TopicPartition> partitions) { log.info("at state {}: partitions lost due to missed rebalance.\n" + "\tlost active tasks: {}\n" + "\tlost assigned standby tasks: {}\n", streamThread.state(), partitions, taskManager.activeTaskIds(), taskManager.standbyTaskIds()); final long start = time.milliseconds(); try { taskManager.handleLostAll(); } finally { log.info("partitions lost took ms.", time.milliseconds() - start); } }
Source:
public HttpRequest filter(final HttpRequest request) throws HttpException { return request.toBuilder() .replaceHeader(HttpHeaders.ACCEPT, String.format("application/json; version=%s", apiVersion)) .build(); }

Target:
public HttpRequest filter(final HttpRequest request) throws HttpException { Collection<String> accept = checkNotNull(request.getHeaders().get(ACCEPT), "accept header must not be null"); String versionHeader = Joiner.on("; ").join(ImmutableList.builder() .addAll(accept) .add(format("version=%s", apiVersion)) .build()); return request.toBuilder() .replaceHeader(ACCEPT, versionHeader) .build(); }
Source:
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { if (logger.isDebugEnabled()) { logger.debug("Storing delivery for " + BlockingQueueConsumer.this); } try { if (BlockingQueueConsumer.this.abortStarted > 0) { if (!BlockingQueueConsumer.this.queue.offer(new Delivery(consumerTag, envelope, properties, body), BlockingQueueConsumer.this.shutdownTimeout, TimeUnit.MILLISECONDS)) { try { BlockingQueueConsumer.this.queue.clear(); getChannel().basicNack(envelope.getDeliveryTag(), true, true); getChannel().basicCancel(consumerTag); RabbitUtils.setPhysicalCloseRequired(true); getChannel().close(); } catch (Exception e) { if (logger.isDebugEnabled()) { logger.debug("Error performing 'basicCancel'", e); } } } } else { BlockingQueueConsumer.this.queue.put(new Delivery(consumerTag, envelope, properties, body)); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }

Target:
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { if (logger.isDebugEnabled()) { logger.debug("Storing delivery for " + BlockingQueueConsumer.this); } try { if (BlockingQueueConsumer.this.abortStarted > 0) { if (!BlockingQueueConsumer.this.queue.offer(new Delivery(consumerTag, envelope, properties, body), BlockingQueueConsumer.this.shutdownTimeout, TimeUnit.MILLISECONDS)) { RabbitUtils.setPhysicalCloseRequired(true); BlockingQueueConsumer.this.queue.clear(); getChannel().basicNack(envelope.getDeliveryTag(), true, true); getChannel().basicCancel(consumerTag); try { getChannel().close(); } catch (TimeoutException e) { } } } else { BlockingQueueConsumer.this.queue.put(new Delivery(consumerTag, envelope, properties, body)); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }
Source:
private File getTempMediaFile(int type) { try { String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); File outputDir; File outputFile; if (type == MEDIA_TYPE_IMAGE) { outputDir = _reactContext.getCacheDir(); outputFile = File.createTempFile("IMG_" + timeStamp, ".jpg", outputDir); } else if (type == MEDIA_TYPE_VIDEO) { outputDir = _reactContext.getFilesDir(); outputFile = File.createTempFile("VID_" + timeStamp, ".mp4", outputDir); } else { Log.e(TAG, "Unsupported media type:" + type); return null; } return outputFile; } catch (Exception e) { Log.e(TAG, e.getMessage()); return null; } }

Target:
private File getTempMediaFile(int type) { try { String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); File outputDir = _reactContext.getCacheDir(); File outputFile; if (type == MEDIA_TYPE_IMAGE) { outputFile = File.createTempFile("IMG_" + timeStamp, ".jpg", outputDir); } else if (type == MEDIA_TYPE_VIDEO) { outputFile = File.createTempFile("VID_" + timeStamp, ".mp4", outputDir); } else { Log.e(TAG, "Unsupported media type:" + type); return null; } return outputFile; } catch (Exception e) { Log.e(TAG, e.getMessage()); return null; } }
Source:
public void testLoginFailureWrongPassword() throws IdPClientException, AuthenticationException { Map<String, String> userProperties = new HashMap<>(); Role defaultRole = new Role("1", "admin"); User defaultUser = new User("admin", "YWRtaW4=", userProperties, Collections.singletonList(defaultRole)); LocalIdPClient localIdPClient = new LocalIdPClient(1, Collections.singletonList(defaultUser), Collections.singletonList(defaultRole)); Map<String, String> loginProperties = new HashMap<>(); loginProperties.put(IdPClientConstants.GRANT_TYPE, IdPClientConstants.PASSWORD_GRANT_TYPE); loginProperties.put(IdPClientConstants.USERNAME, "admin"); loginProperties.put(IdPClientConstants.PASSWORD, "admin2" + ""); Map<String, String> login = localIdPClient.login(loginProperties); Assert.assertEquals(IdPClientConstants.LoginStatus.LOGIN_FAILURE, login.get(IdPClientConstants.LOGIN_STATUS)); }

Target:
public void testLoginFailureWrongPassword() throws IdPClientException, AuthenticationException { Map<String, String> userProperties = new HashMap<>(); Role defaultRole = new Role("1", "admin"); User defaultUser = new User("admin", "YWRtaW4=", userProperties, Collections.singletonList(defaultRole)); LocalIdPClient localIdPClient = new LocalIdPClient(1, Collections.singletonList(defaultUser), Collections.singletonList(defaultRole)); Map<String, String> loginProperties = new HashMap<>(); loginProperties.put(IdPClientConstants.GRANT_TYPE, IdPClientConstants.PASSWORD_GRANT_TYPE); loginProperties.put(IdPClientConstants.USERNAME, "admin"); loginProperties.put(IdPClientConstants.PASSWORD, "admin2"); Map<String, String> login = localIdPClient.login(loginProperties); Assert.assertEquals(IdPClientConstants.LoginStatus.LOGIN_FAILURE, login.get(IdPClientConstants.LOGIN_STATUS)); }
Source:
public String toString() { String str = ""; str += super.toString(); str += "\n - Sub type = " + subType; str += "\n - Id = " + sensorId; str += "\n - Wind direction = " + windDirection; str += "\n - Wind speed = " + windSpeed; str += "\n - Average Wind speed = " + windAvSpeed; if (subType == SubType.TFA) { str += "\n - Temperature = " + temperature; str += "\n - Chill Factor = " + chillFactor; } str += "\n - Signal level = " + signalLevel; str += "\n - Battery level = " + batteryLevel; return str; }

Target:
public String toString() { StringBuilder sb = new StringBuilder(super.toString()); sb.append("\n - Sub type = ").append(subType); sb.append("\n - Id = ").append(sensorId); sb.append("\n - Wind direction = ").append(windDirection); sb.append("\n - Wind speed = ").append(windSpeed); sb.append("\n - Average Wind speed = ").append(windAvSpeed); if (subType == SubType.TFA) { sb.append("\n - Temperature = ").append(temperature); sb.append("\n - Chill Factor = ").append(chillFactor); } sb.append("\n - Signal level = ").append(signalLevel); sb.append("\n - Battery level = ").append(batteryLevel); return sb.toString(); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Job)) { return false; } Job other = (Job) obj; if (actionType != other.actionType) { return false; } if (correlationId == null) { if (other.correlationId != null) { return false; } } else if (!correlationId.equals(other.correlationId)) { return false; } if (endTime == null) { if (other.endTime != null) { return false; } } else if (!endTime.equals(other.endTime)) { return false; } if (id == null) { if (other.id != null) { return false; } } else if (!id.equals(other.id)) { return false; } if (isVisible != other.isVisible) { return false; } if (jobSubjectEntities == null) { if (other.jobSubjectEntities != null) { return false; } } else if (!jobSubjectEntities.equals(other.jobSubjectEntities)) { return false; } if (lastUpdateTime == null) { if (other.lastUpdateTime != null) { return false; } } else if (!lastUpdateTime.equals(other.lastUpdateTime)) { return false; } if (ownerId == null) { if (other.ownerId != null) { return false; } } else if (!ownerId.equals(other.ownerId)) { return false; } if (startTime == null) { if (other.startTime != null) { return false; } } else if (!startTime.equals(other.startTime)) { return false; } if (status != other.status) { return false; } if (steps == null) { if (other.steps != null) { return false; } } else if (!steps.equals(other.steps)) { return false; } if (external != other.external) { return false; } return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Job)) { return false; } Job other = (Job) obj; if (actionType != other.actionType) { return false; } if (correlationId == null) { if (other.correlationId != null) { return false; } } else if (!correlationId.equals(other.correlationId)) { return false; } if (endTime == null) { if (other.endTime != null) { return false; } } else if (!endTime.equals(other.endTime)) { return false; } if (id == null) { if (other.id != null) { return false; } } else if (!id.equals(other.id)) { return false; } if (isVisible != other.isVisible) { return false; } if (jobSubjectEntities == null) { if (other.jobSubjectEntities != null) { return false; } } else if (!jobSubjectEntities.equals(other.jobSubjectEntities)) { return false; } if (lastUpdateTime == null) { if (other.lastUpdateTime != null) { return false; } } else if (!lastUpdateTime.equals(other.lastUpdateTime)) { return false; } if (ownerId == null) { if (other.ownerId != null) { return false; } } else if (!ownerId.equals(other.ownerId)) { return false; } if (startTime == null) { if (other.startTime != null) { return false; } } else if (!startTime.equals(other.startTime)) { return false; } if (status != other.status) { return false; } if (steps == null) { if (other.steps != null) { return false; } } else if (!steps.equals(other.steps)) { return false; } if (external != other.external) { return false; } if (autoCleared != other.autoCleared) { return false; } return true; }
Source:
public final Object get(PageContext pc, Key key, Object defaultValue) { synchronized (_req) { Object value = _req.getAttribute(key.getLowerString()); if (value != null) return value; Iterator<String> it = ListUtil.toIterator(_req.getAttributeNames()); Collection.Key k; while (it.hasNext()) { k = KeyImpl.init(it.next()); if (key.equals(k)) return _req.getAttribute(k.getString()); } return defaultValue; } }

Target:
public final Object get(PageContext pc, Key key, Object defaultValue) { synchronized (_req) { Object value = _req.getAttribute(key.getLowerString()); if (value != null) return value; Enumeration<String> names = _req.getAttributeNames(); Collection.Key k; while (names.hasMoreElements()) { k = KeyImpl.init(names.nextElement()); if (key.equals(k)) return _req.getAttribute(k.getString()); } return defaultValue; } }
Source:
public final int delete(final String table, final String key) { try { final MongoCollection collection = database.getCollection(table); final Document q = BuilderFactory.start().add("_id", key).build(); final long res = collection.delete(q, writeConcern); if (res == 0) { System.err.println("Nothing deleted for key " + key); return StatusCode.ERROR; } return StatusCode.OK; } catch (final Exception e) { System.err.println(e.toString()); return StatusCode.ERROR; } }

Target:
public final Status delete(final String table, final String key) { try { final MongoCollection collection = database.getCollection(table); final Document q = BuilderFactory.start().add("_id", key).build(); final long res = collection.delete(q, writeConcern); if (res == 0) { System.err.println("Nothing deleted for key " + key); return Status.NOT_FOUND; } return Status.OK; } catch (final Exception e) { System.err.println(e.toString()); return Status.ERROR; } }
Source:
public void configure(Map stormConf, JsonNode jsonNode) { List<URLFilter> filterLists = new ArrayList<URLFilter>(); String name = getClass().getCanonicalName(); jsonNode = jsonNode.get(name); if (jsonNode == null) { LOG.info("No field in JSON config. Skipping", name); filters = new URLFilter[0]; return; } Iterator<JsonNode> filterIter = jsonNode.elements(); while (filterIter.hasNext()) { JsonNode afilterNode = filterIter.next(); String filterName = "<unnamed>"; JsonNode nameNode = afilterNode.get("name"); if (nameNode != null) { filterName = nameNode.textValue(); } JsonNode classNode = afilterNode.get("class"); if (classNode == null) { LOG.error("Filter doesn't specified a 'class' attribute", filterName); continue; } String className = classNode.textValue().trim(); filterName += '[' + className + ']'; try { Class<?> filterClass = Class.forName(className); boolean interfaceOK = URLFilter.class .isAssignableFrom(filterClass); if (!interfaceOK) { LOG.error("Filter does not implement URLFilter", filterName); continue; } URLFilter filterInstance = (URLFilter) filterClass .newInstance(); JsonNode paramNode = afilterNode.get("params"); if (paramNode != null) { filterInstance.configure(stormConf, paramNode); } else { filterInstance.configure(stormConf, NullNode.getInstance()); } filterLists.add(filterInstance); LOG.info("Loaded instance of class {}", className); } catch (Exception e) { LOG.error("Can't setup {}: {}", filterName, e); continue; } } filters = filterLists.toArray(new URLFilter[filterLists.size()]); }

Target:
public void configure(Map stormConf, JsonNode jsonNode) { List<URLFilter> filterLists = new ArrayList<URLFilter>(); String name = getClass().getCanonicalName(); jsonNode = jsonNode.get(name); if (jsonNode == null) { LOG.info("No field in JSON config. Skipping", name); filters = new URLFilter[0]; return; } Iterator<JsonNode> filterIter = jsonNode.elements(); while (filterIter.hasNext()) { JsonNode afilterNode = filterIter.next(); String filterName = "<unnamed>"; JsonNode nameNode = afilterNode.get("name"); if (nameNode != null) { filterName = nameNode.textValue(); } JsonNode classNode = afilterNode.get("class"); if (classNode == null) { LOG.error("Filter doesn't specified a 'class' attribute", filterName); continue; } String className = classNode.textValue().trim(); filterName += '[' + className + ']'; try { Class<?> filterClass = Class.forName(className); boolean interfaceOK = URLFilter.class .isAssignableFrom(filterClass); if (!interfaceOK) { LOG.error("Class does not implement URLFilter", className); continue; } URLFilter filterInstance = (URLFilter) filterClass .newInstance(); JsonNode paramNode = afilterNode.get("params"); if (paramNode != null) { filterInstance.configure(stormConf, paramNode); } else { filterInstance.configure(stormConf, NullNode.getInstance()); } filterLists.add(filterInstance); LOG.info("Loaded instance of class {}", className); } catch (Exception e) { LOG.error("Can't setup {}: {}", filterName, e); continue; } } filters = filterLists.toArray(new URLFilter[filterLists.size()]); }
Source:
public void setUp() throws Exception { organization1.addAdmin(adminTestUser.getId()); organization2.addAdmin(adminTestUser.getId()); organization2.addMember(testUser.getId()); suborg1.addAdmin(adminTestUser.getId()); suborg2.addMember(testUser.getId()); suborgNameAdmin = organization1.getName() + "/" + suborg1.getName(); suborgNameMember = organization2.getName() + "/" + suborg2.getName(); dashboard.open(adminTestUser.getName(), adminTestUser.getPassword()); }

Target:
public void setUp() throws Exception { org1.addAdmin(adminTestUser.getId()); org2.addAdmin(adminTestUser.getId()); org2.addMember(testUser.getId()); suborg1.addAdmin(adminTestUser.getId()); suborg2.addMember(testUser.getId()); suborgForAdminName = org1.getName() + "/" + suborg1.getName(); suborgForMemberName = org2.getName() + "/" + suborg2.getName(); dashboard.open(adminTestUser.getName(), adminTestUser.getPassword()); }
Source:
private DBCollection getCollection(final Object obj) { if (obj == null) { return null; } return getCollection(obj instanceof Class ? (Class) obj : obj.getClass()); }

Target:
public DBCollection getCollection(final Object obj) { if (obj == null) { return null; } return getCollection(obj instanceof Class ? (Class) obj : obj.getClass()); }
Source:
public Set<PluginRoleConfig> pluginRoles() { return roleToUsersMappings.keySet(); }

Target:
protected Set<PluginRoleConfig> pluginRoles() { return new HashSet<>(roleToUsersMappings.keySet()); }
Source:
public PinotQueryGeneratorContext withFilter(String filter) { checkSupported(!hasFilter(), "There already exists a filter. Pinot doesn't support filters at multiple levels"); checkSupported(!hasAggregation(), "Pinot doesn't support filtering the results of aggregation"); checkSupported(!hasLimit(), "Pinot doesn't support filtering on top of the limit"); return new PinotQueryGeneratorContext(selections, from, filter, numAggregations, groupByColumns, topNColumnOrderingMap, limit, hiddenColumnSet); }

Target:
public PinotQueryGeneratorContext withFilter(String filter) { checkSupported(!hasFilter(), "There already exists a filter. Pinot doesn't support filters at multiple levels"); checkSupported(!hasAggregation(), "Pinot doesn't support filtering the results of aggregation"); checkSupported(!hasLimit(), "Pinot doesn't support filtering on top of the limit"); return new PinotQueryGeneratorContext( selections, from, Optional.of(filter), aggregations, groupByColumns, topNColumnOrderingMap, limit, variablesInAggregation, hiddenColumnSet); }
Source:
public JwtIssuerValidator(String issuer) { Assert.notNull(issuer, "issuer cannot be null"); Predicate<Object> testClaimValueURL = ( claimValue) -> ((claimValue instanceof URL) && issuer.equals(claimValue.toString())); this.validator = new JwtClaimValidator<>(JwtClaimNames.ISS, testClaimValueURL.or(issuer::equals)); }

Target:
public JwtIssuerValidator(String issuer) { Assert.notNull(issuer, "issuer cannot be null"); Predicate<Object> testClaimValue = (claimValue) -> (claimValue != null) && issuer.equals(claimValue.toString()); this.validator = new JwtClaimValidator<>(JwtClaimNames.ISS, testClaimValue); }
Source:
public static void validate(TableConfig tableConfig, @Nullable Schema schema) { if (tableConfig.getTableType() == TableType.REALTIME) { Preconditions.checkState(schema != null, "Schema should not be null for REALTIME table"); } validateValidationConfig(tableConfig, schema); validateIngestionConfig(tableConfig.getIngestionConfig(), schema); validateTierConfigList(tableConfig.getTierConfigsList()); validateIndexingConfig(tableConfig.getIndexingConfig(), schema); }

Target:
public static void validate(TableConfig tableConfig, @Nullable Schema schema) { if (tableConfig.getTableType() == TableType.REALTIME) { Preconditions.checkState(schema != null, "Schema should not be null for REALTIME table"); } validateValidationConfig(tableConfig, schema); validateIngestionConfig(tableConfig.getIngestionConfig(), schema); validateTierConfigList(tableConfig.getTierConfigsList()); validateIndexingConfig(tableConfig.getIndexingConfig(), schema); validateFieldConfigList(tableConfig.getFieldConfigList(), schema); }
Source:
protected void clickXY(int x, int y) { log.debug(MessageFormat.format("Clicking on {0}", this)); notifyTable(SWT.MouseEnter); notifyTable(SWT.MouseMove); notifyTable(SWT.Activate); notifyTable(SWT.FocusIn); notifyTable(SWT.MouseDown, createMouseEvent(x, y, 1, SWT.NONE, 1)); syncExec(new VoidResult() { public void run() { if (table.getSelectionCount() != 1 || table.getSelection()[0].equals(widget)) { table.setSelection(widget); } } }); notifyTable(SWT.Selection, createEvent()); notifyTable(SWT.MouseUp, createMouseEvent(x, y, 1, SWT.BUTTON1, 1)); notifyTable(SWT.MouseHover); notifyTable(SWT.MouseMove); notifyTable(SWT.MouseExit); notifyTable(SWT.Deactivate); notifyTable(SWT.FocusOut); log.debug(MessageFormat.format("Clicked on {0}", this)); }

Target:
protected void clickXY(int x, int y) { log.debug(MessageFormat.format("Clicking on {0}", this)); notifyTable(SWT.MouseEnter); notifyTable(SWT.MouseMove); notifyTable(SWT.Activate); notifyTable(SWT.FocusIn); notifyTable(SWT.MouseDown, createMouseEvent(x, y, 1, SWT.NONE, 1)); syncExec(new VoidResult() { public void run() { if (table.getSelectionCount() != 1 || !table.getSelection()[0].equals(widget)) { table.setSelection(widget); } } }); notifyTable(SWT.Selection, createEvent()); notifyTable(SWT.MouseUp, createMouseEvent(x, y, 1, SWT.BUTTON1, 1)); notifyTable(SWT.MouseHover); notifyTable(SWT.MouseMove); notifyTable(SWT.MouseExit); notifyTable(SWT.Deactivate); notifyTable(SWT.FocusOut); log.debug(MessageFormat.format("Clicked on {0}", this)); }
Source:
public final boolean IsConnected() { if (sdkLevel >= SdkLevel.LEVEL_ICE_CREAM_SANDWICH) { return (connectedBluetoothSocket != null && BluetoothReflection.isBluetoothSocketConnected(connectedBluetoothSocket)); } else return (connectedBluetoothSocket != null); }

Target:
public final boolean IsConnected() { if (sdkLevel >= SdkLevel.LEVEL_ICE_CREAM_SANDWICH) { return (connectedBluetoothSocket != null && BluetoothReflection.isBluetoothSocketConnected(connectedBluetoothSocket)); } else { return (connectedBluetoothSocket != null); } }
Source:
protected AuthenticationToken createToken( final ServletRequest request, final ServletResponse response ) { if ( null != keys ) { final HttpServletRequest http = WebUtils.toHttp( request ); final Map<String, char[]> credentials = new HashMap<String, char[]>(); for ( final String k : keys ) { final String guid = http.getHeader( k ); if ( null != guid ) { credentials.put( k, guid.toCharArray() ); } } if ( !credentials.isEmpty() ) { return new NexusApiKeyAuthenticationToken( credentials, RemoteIPFinder.findIP( http ) ); } } return super.createToken( request, response ); }

Target:
protected AuthenticationToken createToken( final ServletRequest request, final ServletResponse response ) { if ( null != apiKeys ) { final HttpServletRequest http = WebUtils.toHttp( request ); for ( final String key : apiKeys ) { final String token = http.getHeader( key ); if ( null != token ) { return new NexusApiKeyAuthenticationToken( key, token.toCharArray(), request.getRemoteHost() ); } } } return super.createToken( request, response ); }