auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void deactivate(Object id) { RequestBody emptyBody = RequestBody.create(null, new byte[0]);; Request request = new Request.Builder().url(host + "/r/operators/" + id + "/deactivate").post(emptyBody).build(); client.newCall(request); }

Target:
public void deactivate(Object id) { RequestBody emptyBody = RequestBody.create(null, new byte[0]); Request request = new Request.Builder().url(host + "/r/operators/" + id + "/deactivate").post(emptyBody).build(); client.newCall(request); }
Source:
public void uncaughtException(@NonNull Thread t, @NonNull Throwable e) { boolean strictModeThrowable = strictModeHandler.isStrictModeThrowable(e); for (Client client : clientMap.keySet()) { if (strictModeThrowable) { String violationDesc = strictModeHandler.getViolationDescription(e.getMessage()); MetaData metaData = new MetaData( Collections.<String, Object>singletonMap(KEY_STRICT_MODE_VIOLATION, violationDesc)); client.cacheAndNotify(e, Severity.ERROR, metaData); } client.cacheAndNotify(e, Severity.ERROR, null); } if (originalHandler != null) { originalHandler.uncaughtException(t, e); } else { System.err.printf("Exception in thread \"%s\" ", t.getName()); e.printStackTrace(System.err); } }

Target:
public void uncaughtException(@NonNull Thread t, @NonNull Throwable e) { boolean strictModeThrowable = strictModeHandler.isStrictModeThrowable(e); for (Client client : clientMap.keySet()) { MetaData metaData = null; if (strictModeThrowable) { String violationDesc = strictModeHandler.getViolationDescription(e.getMessage()); metaData = new MetaData(); metaData.addToTab(STRICT_MODE_TAB, STRICT_MODE_KEY, violationDesc); } client.cacheAndNotify(e, Severity.ERROR, metaData); } if (originalHandler != null) { originalHandler.uncaughtException(t, e); } else { System.err.printf("Exception in thread \"%s\" ", t.getName()); e.printStackTrace(System.err); } }
Source:
public IProject[] getTrackedProjects() { IProject[] projects = new IProject[trackedProjects.keySet().size()]; return trackedProjects.keySet().toArray(projects); }

Target:
public IProject[] getTrackedProjects() { return trackedProjects.keySet().toArray(new IProject[0]); }
Source:
public synchronized void stop(StopContext context) { final ContentRepositoryCleaner contentCleaner = this.deploymentContentCleaner; this.deploymentContentCleaner = null; contentCleaner.stopScan(); scheduledExecutorValue.getValue().shutdown(); }

Target:
public synchronized void stop(StopContext context) { final ContentRepositoryCleaner contentCleaner = this.deploymentContentCleaner; this.deploymentContentCleaner = null; contentCleaner.stopScan(); }
Source:
public List<ConfigItem> generateConfig(final NetworkElementCommand cmd) { final SetMonitorServiceCommand command = (SetMonitorServiceCommand) cmd; final MonitorService monitorService = new MonitorService( command.getConfiguration(), cmd.getAccessDetail(SetMonitorServiceCommand.ROUTER_MONITORING_ENABLED), cmd.getAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_ENABLED)); try { monitorService.setHealthChecksBasicRunInterval(Integer.parseInt(cmd.getAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_BASIC_INTERVAL))); } catch (NumberFormatException exception) { s_logger.error("Unexpected health check basic interval set" + cmd.getAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_BASIC_INTERVAL) + ". Exception: " + exception + "Will use default value"); } try { monitorService.setHealthChecksAdvanceRunInterval(Integer.parseInt(cmd.getAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_ADVANCED_INTERVAL))); } catch (NumberFormatException exception) { s_logger.error("Unexpected health check advance interval set" + cmd.getAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_ADVANCED_INTERVAL) + ". Exception: " + exception + "Will use default value"); } monitorService.setExcludedHealthChecks(cmd.getAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_EXCLUDED)); monitorService.setAdditionalData(command.getAdditionalData()); monitorService.setDeleteFromProcessedCache(command.shouldDeleteFromProcessedCache()); List<ConfigItem> configItems = generateConfigItems(monitorService); if (configItems != null && command.shouldReconfigureAfterUpdate()) { configItems.add(new ScriptConfigItem(VRScripts.CONFIGURE, "monitor_service.json")); } return configItems; }

Target:
public List<ConfigItem> generateConfig(final NetworkElementCommand cmd) { final SetMonitorServiceCommand command = (SetMonitorServiceCommand) cmd; final MonitorService monitorService = new MonitorService( command.getConfiguration(), cmd.getAccessDetail(SetMonitorServiceCommand.ROUTER_MONITORING_ENABLED), cmd.getAccessDetail(SetMonitorServiceCommand.ROUTER_HEALTH_CHECKS_ENABLED)); setupHealthChecksRelatedInfo(monitorService, command); monitorService.setDeleteFromProcessedCache(command.shouldDeleteFromProcessedCache()); List<ConfigItem> configItems = generateConfigItems(monitorService); if (configItems != null && command.shouldReconfigureAfterUpdate()) { configItems.add(new ScriptConfigItem(VRScripts.CONFIGURE, "monitor_service.json")); } return configItems; }
Source:
public void testRenameNullFile() { Path path = new Path("/directory1/"); assertThrows("src must not be null", NullPointerException.class, () -> ghfs.rename(null, null)); assertThrows("src must not be null", NullPointerException.class, () -> ghfs.rename(null, path)); assertThrows("dst must not be null", NullPointerException.class, () -> ghfs.rename(null, null)); assertThrows("dst must not be null", NullPointerException.class, () -> ghfs.rename(null, path)); }

Target:
public void testRenameNullFile() { Path path = new Path("/directory1/"); assertThrows( "src and dst must not be null", NullPointerException.class, () -> ghfs.rename(null, null)); assertThrows("src must not be null", NullPointerException.class, () -> ghfs.rename(null, path)); assertThrows("dst must not be null", NullPointerException.class, () -> ghfs.rename(path, null)); }
Source:
protected void onInit() { super.onInit(); if (principalMapping != null && !principalMapping.isEmpty() || groupPrincipalMapping != null && !groupPrincipalMapping.isEmpty()) { try { mapper.loadMappingTable(principalMapping, groupPrincipalMapping); } catch (PrincipalMappingException e) { LOGGER.error("PrincipalMappingException in onInit", e); } } try { hadoopConfig = new Configuration(false); hadoopGroups = new Groups(hadoopConfig); } catch (final Exception e) { LOGGER.error("Exception in onInit", e); } }

Target:
protected void onInit() { super.onInit(); if (principalMapping != null && !principalMapping.isEmpty() || groupPrincipalMapping != null && !groupPrincipalMapping.isEmpty()) { try { mapper.loadMappingTable(principalMapping, groupPrincipalMapping); } catch (PrincipalMappingException e) { LOGGER.error("PrincipalMappingException in onInit", e); } } try { hadoopConfig = new Configuration(); hadoopGroups = new Groups(hadoopConfig); } catch (final Exception e) { LOGGER.error("Exception in onInit", e); } }
Source:
public boolean eligible() { return false; }

Target:
public boolean eligible() { if (this.getProperty("why").equals("DEAD")) { this.setProperty("reason", "DEAD | " + this.getProperty("obsDate")); return true; } else if (this.getProperty("why").equals("TO | (Ampath) ")) { this.setProperty("reason", "TO | (Ampath) " + this.getProperty("obsDate")); return true; } else if (this.getProperty("why").equals("TO | (Non-Ampath) ")) { this.setProperty("reason", "TO | (Non-Ampath) " + this.getProperty("obsDate")); return true; } else if (this.getProperty("why").equals("LTFU")) { this.setProperty("reason", "LTFU | " + this.getProperty("obsDate")); return true; } return false; }
Source:
public ListBoxModel doFillPriorityIdItems(@AncestorInPath final Item item) { ListBoxModel items = new ListBoxModel().add(""); ItemGroup parent = item == null ? null : item.getParent(); List<JiraSite> sites = parent instanceof Folder ? JiraFolderProperty.getSitesFromFolders( parent ) : JiraGlobalConfiguration.get().getSites(); for (JiraSite site : sites) { JiraSession session = parent instanceof Folder ? site.getSession(item) : site.getSession(); if (session != null) { for (Priority priority : session.getPriorities()) { items.add("[" + site.getName() + "] " + priority.getName(), String.valueOf(priority.getId())); } } } return items; }

Target:
public ListBoxModel doFillPriorityIdItems(@AncestorInPath final Item item) { ListBoxModel items = new ListBoxModel().add(""); List<JiraSite> sites = JiraSite.getJiraSites(item); for (JiraSite site : sites) { JiraSession session = site.getSession(item); if (session != null) { for (Priority priority : session.getPriorities()) { items.add("[" + site.getName() + "] " + priority.getName(), String.valueOf(priority.getId())); } } } return items; }
Source:
public Mono<Void> send(Iterable<EventData> events, SendOptions options) { if (events == null) { return Mono.error(logger.logExceptionAsError(new NullPointerException("'events' cannot be null."))); } else if (options == null) { return Mono.error(logger.logExceptionAsError(new NullPointerException("'options' cannot be null."))); } return send(Flux.fromIterable(events), options); }

Target:
public Mono<Void> send(Iterable<EventData> events, SendOptions options) { if (events == null) { return monoError(logger, new NullPointerException("'events' cannot be null.")); } else if (options == null) { return monoError(logger, new NullPointerException("'options' cannot be null.")); } return send(Flux.fromIterable(events), options); }
Source:
public void testRouteStartSuccess() throws Exception { getMockEndpoint("mock:fcrepo:{{fcrepo.baseUri}}").expectedMessageCount(1); createContext(); String body = createBody(); template.sendBodyAndHeaders("direct-vm:createThumbnail", body, createEvent(fileID, eventTypes)); assertMockEndpointsSatisfied(); }

Target:
public void testRouteStartSuccess() throws Exception { getMockEndpoint("mock:direct:images").expectedMessageCount(1); createContext(enhancementRoute); template.sendBodyAndHeaders("", createEvent(fileID, eventTypes)); assertMockEndpointsSatisfied(); }
Source:
public Result adaptResponse(Row response) { if (response == null) { return new Result(); } SortedSet<Cell> hbaseCells = new TreeSet<>(KeyValue.COMPARATOR); byte[] rowKey = ByteStringer.extract(response.getKey()); for (com.google.cloud.bigtable.data.v2.models.RowCell rowCell : response.getCells()) { if (rowCell.getLabels().size() > 0) { continue; } byte[] familyNameBytes = Bytes.toBytes(rowCell.getFamily()); byte[] columnQualifier = ByteStringer.extract(rowCell.getQualifier()); long hbaseTimestamp = TimestampConverter.bigtable2hbase(rowCell.getTimestamp()); RowCell keyValue = new RowCell( rowKey, familyNameBytes, columnQualifier, hbaseTimestamp, ByteStringer.extract(rowCell.getValue())); hbaseCells.add(keyValue); } return Result.create(hbaseCells.toArray(new Cell[hbaseCells.size()])); }

Target:
public Result adaptResponse(Row response) { if (response == null) { return new Result(); } ImmutableList.Builder<Cell> hbaseCellBuilder = ImmutableList.builder(); byte[] rowKey = ByteStringer.extract(response.getKey()); for (com.google.cloud.bigtable.data.v2.models.RowCell rowCell : response.getCells()) { if (rowCell.getLabels().size() > 0) { continue; } byte[] familyNameBytes = Bytes.toBytes(rowCell.getFamily()); byte[] columnQualifier = ByteStringer.extract(rowCell.getQualifier()); long hbaseTimestamp = TimestampConverter.bigtable2hbase(rowCell.getTimestamp()); RowCell keyValue = new RowCell( rowKey, familyNameBytes, columnQualifier, hbaseTimestamp, ByteStringer.extract(rowCell.getValue())); hbaseCellBuilder.add(keyValue); } ImmutableList<Cell> hbaseCells = hbaseCellBuilder.build(); return Result.create(hbaseCells.toArray(new Cell[hbaseCells.size()])); }
Source:
public void setException(Exception e) { if (e == null) { this.e = null; } else { this.e = new RuntimeException(e); } }

Target:
public void setException(Exception e) { this.e = e == null ? null : new RuntimeException(e); }
Source:
public LayerNormBp(SameDiff sameDiff, SDVariable input, SDVariable gain, SDVariable bias, SDVariable gradient, int... dimensions) { super(null, sameDiff, new SDVariable[] {input, gain, bias, gradient}, false); this.dimensions = dimensions; addIArgument(dimensions); }

Target:
public LayerNormBp(SameDiff sameDiff, SDVariable input, SDVariable gain, SDVariable bias, SDVariable gradient, int... dimensions) { super(null, sameDiff, new SDVariable[] {input, gain, bias, gradient}, false); Preconditions.checkArgument(bias != null, "LayerNormBp: Use constructor without bias argument if bias is null / not available."); setDimensions(dimensions); }
Source:
public Object sampleVal() { checkHasParams(); double[][] mat = new double[d][1]; for (int i = 0; i < d; i++) { mat[i][0] = UnivarGaussian.STANDARD.sampleValue(); } MatrixLib temp = MatrixFactory.fromArray(mat); return mean.transpose().plus(sqrtCovariance.timesMat(temp)); }

Target:
public Object sampleVal() { return sample_value(); }
Source:
public List<SshPair> getPairs(String owner, String service) throws ServerException { return sshDao.get(owner, service).stream().collect(Collectors.toList()); }

Target:
public List<SshPairImpl> getPairs(String owner, String service) throws ServerException { return sshDao.get(owner, service); }
Source:
public JsonNode getDefault(FieldDescriptor f) { if (f.isRequired() || f.isRepeated()) return null; if (f.hasDefaultValue()) { Object value = f.getDefaultValue(); switch (f.getType()) { case ENUM: value = ((EnumValueDescriptor) value).getName(); break; } String json = toString(value); try { return MAPPER.readTree(FACTORY.createParser(json)); } catch (IOException e) { throw new RuntimeException(e); } } switch (f.getType()) { case BOOL: return NODES.booleanNode(false); case FLOAT: case DOUBLE: case INT32: case UINT32: case SINT32: case FIXED32: case SFIXED32: case INT64: case UINT64: case SINT64: case FIXED64: case SFIXED64: return NODES.numberNode(0); case STRING: case BYTES: return NODES.textNode(""); case ENUM: return NODES.textNode(f.getEnumType().getValues().get(0).getName()); case MESSAGE: return NODES.nullNode(); case GROUP: default: throw new RuntimeException("Unexpected type: " + f.getType()); } }

Target:
private JsonNode getDefault(FieldDescriptor f) { if (f.isRequired() || f.isRepeated()) return null; if (f.hasDefaultValue()) { Object value = f.getDefaultValue(); switch (f.getType()) { case ENUM: value = ((EnumValueDescriptor) value).getName(); break; } String json = toString(value); try { return MAPPER.readTree(FACTORY.createParser(json)); } catch (IOException e) { throw new RuntimeException(e); } } switch (f.getType()) { case BOOL: return NODES.booleanNode(false); case FLOAT: case DOUBLE: case INT32: case UINT32: case SINT32: case FIXED32: case SFIXED32: case INT64: case UINT64: case SINT64: case FIXED64: case SFIXED64: return NODES.numberNode(0); case STRING: case BYTES: return NODES.textNode(""); case ENUM: return NODES.textNode(f.getEnumType().getValues().get(0).getName()); case MESSAGE: return NODES.nullNode(); case GROUP: default: throw new RuntimeException("Unexpected type: " + f.getType()); } }
Source:
public void testValidSelectionKey() throws Exception { final ZooKeeper zk = createClient(); try { Iterable<ServerCnxn> connections = serverFactory.getConnections(); for (ServerCnxn serverCnxn : connections) { MockNIOServerCnxn mock = new MockNIOServerCnxn((NIOServerCnxn) serverCnxn); ((NIOServerCnxn) serverCnxn).sock.keyFor(((NIOServerCnxnFactory) serverFactory).selector).cancel();; mock.mockSendBuffer( ByteBuffer.allocate(8) ); } } catch (CancelledKeyException e) { e.printStackTrace(); Assert.fail(e.toString()); } finally { zk.close(); } }

Target:
public void testValidSelectionKey() throws Exception { final ZooKeeper zk = createZKClient(hostPort, 3000); try { Iterable<ServerCnxn> connections = serverFactory.getConnections(); for (ServerCnxn serverCnxn : connections) { MockNIOServerCnxn mock = new MockNIOServerCnxn((NIOServerCnxn) serverCnxn); ((NIOServerCnxn) serverCnxn).sock.keyFor(((NIOServerCnxnFactory) serverFactory).selector).cancel();; mock.mockSendBuffer(ByteBuffer.allocate(8)); } } catch (CancelledKeyException e) { LOG.error("Exception while sending bytes!", e); Assert.fail(e.toString()); } finally { zk.close(); } }
Source:
boolean firstToken(UUID playerId) { return playerIds.get(playerId) == TokenState.FirstToken; }

Target:
boolean firstToken(UUID playerId) { return playerIds.getOrDefault(playerId, TokenState.NoToken) == TokenState.FirstToken; }
Source:
InitializeCheckingWrapper(TransactionManager manager, Supplier<Boolean> initializationPrerequisite, Callback<TransactionManager> callBack, ScheduledExecutorService initializer) { this.txManager = manager; this.initializationPrerequisite = initializationPrerequisite; this.callback = callBack; this.executorService = initializer; if (isInitializedInternal()) { runCallback(); } else { scheduleInitializationCheckAndCallback(); } }

Target:
InitializeCheckingWrapper(TransactionManager manager, Supplier<Boolean> initializationPrerequisite, Callback<TransactionManager> callBack, ScheduledExecutorService initializer) { this.txManager = manager; this.initializationPrerequisite = initializationPrerequisite; this.callback = callBack; this.executorService = initializer; runCallbackIfInitializedOrScheduleForLater(this::attemptCallbackSynchronously); }
Source:
public void write(DataOutput output) throws IOException { Map<String, byte[][]> snapShots = ImmutableMap.copyOf(regionGuidePosts); WritableUtils.writeVInt(output, snapShots.size()); for (String key: snapShots.keySet()) { Gson gson = new Gson(); WritableUtils.writeString(output, key); WritableUtils.writeString(output, gson.toJson(snapShots.get(key))); } }

Target:
public void write(DataOutput output) throws IOException { if (regionGuidePosts == null) { WritableUtils.writeVInt(output, 0); return; } WritableUtils.writeVInt(output, regionGuidePosts.size()); for (Entry<String, byte[][]> entry : regionGuidePosts.entrySet()) { WritableUtils.writeString(output, entry.getKey()); byte[][] value = entry.getValue(); WritableUtils.writeVInt(output, value.length); for (int i=0; i<value.length; i++) { Bytes.writeByteArray(output, value[i]); } } }
Source:
public HdfsSplitInfo build() { assert (inputPath != null && inputSplit != null && inputFormatClassName != null); return new HdfsSplitInfo(inputPath, inputSplit, inputFormatClassName); }

Target:
public HdfsSplitInfo build() { BuilderUtils.notNull(inputPath); BuilderUtils.notNull(inputSplit); BuilderUtils.notNull(inputFormatClassName); return new HdfsSplitInfo(inputPath, inputSplit, inputFormatClassName); }
Source:
public void handlerAdded(ChannelHandlerContext ctx) { ChannelPipeline cp = ctx.pipeline(); if (cp.get(WebSocketServerProtocolHandshakeHandler.class) == null) { ctx.pipeline().addBefore(ctx.name(), WebSocketServerProtocolHandshakeHandler.class.getName(), new WebSocketServerProtocolHandshakeHandler(websocketPath, subprotocols, allowExtensions, maxFramePayloadLength, allowMaskMismatch, checkStartsWith) .handshakeTimeoutMillis(handshakeTimeoutMillis)); } if (cp.get(Utf8FrameValidator.class) == null) { ctx.pipeline().addBefore(ctx.name(), Utf8FrameValidator.class.getName(), new Utf8FrameValidator()); } }

Target:
public void handlerAdded(ChannelHandlerContext ctx) { ChannelPipeline cp = ctx.pipeline(); if (cp.get(WebSocketServerProtocolHandshakeHandler.class) == null) { ctx.pipeline().addBefore(ctx.name(), WebSocketServerProtocolHandshakeHandler.class.getName(), new WebSocketServerProtocolHandshakeHandler(websocketPath, subprotocols, allowExtensions, maxFramePayloadLength, allowMaskMismatch, checkStartsWith, handshakeTimeoutMillis)); } if (cp.get(Utf8FrameValidator.class) == null) { ctx.pipeline().addBefore(ctx.name(), Utf8FrameValidator.class.getName(), new Utf8FrameValidator()); } }
Source:
public void offerStatement(SQLStmt stmt, int offset, ByteBuffer psetBuffer) { int stmtHash = SQLStmtAdHocHelper.getHash(stmt); m_inputCRC.update(stmtHash); if (m_stmtCount < MAX_STATEMENTS_WITH_DETAIL) { m_stmtParamCRC.reset(); m_stmtParamCRC.updateFromPosition(offset, psetBuffer); int perStmtCRC = (int) m_stmtParamCRC.getValue(); m_hashes[m_stmtCount * 2] = stmtHash; m_hashes[m_stmtCount * 2 + 1] = perStmtCRC; m_inputCRC.update(perStmtCRC); } else { m_inputCRC.updateFromPosition(offset, psetBuffer); } m_stmtCount++; }

Target:
public void offerStatement(SQLStmt stmt, int offset, ByteBuffer psetBuffer) { int stmtHash = SQLStmtAdHocHelper.getHash(stmt); m_inputCRC.update(stmtHash); if (m_hashCount < MAX_HASHES_COUNT) { m_stmtParamCRC.reset(); m_stmtParamCRC.updateFromPosition(offset, psetBuffer); int perStmtCRC = (int) m_stmtParamCRC.getValue(); m_hashes[m_hashCount] = stmtHash; m_hashes[m_hashCount + 1] = perStmtCRC; m_inputCRC.update(perStmtCRC); } else { m_inputCRC.updateFromPosition(offset, psetBuffer); } m_hashCount += 2; }
Source:
public synchronized void notify(RecordsDeliveryAck recordsDeliveryAck) { final RecordsRetrieved recordsToCheck = peekNextResult(); if (recordsToCheck != null && recordsToCheck.batchUniqueIdentifier() .equals(recordsDeliveryAck.batchUniqueIdentifier())) { evictPublishedEvent(); drainQueueForRequests(); } else { final BatchUniqueIdentifier peekedBatchUniqueIdentifier = recordsToCheck == null ? null : recordsToCheck.batchUniqueIdentifier(); log.info("{} : Received a stale notification with id instead of expected id at {}. Will ignore.", shardId, recordsDeliveryAck.batchUniqueIdentifier(), peekedBatchUniqueIdentifier, Instant.now()); } takeDelayedDeliveryActionIfRequired(shardId, lastEventDeliveryTime, log); }

Target:
public synchronized void notify(RecordsDeliveryAck recordsDeliveryAck) { publisherSession.handleRecordsDeliveryAck(recordsDeliveryAck, shardId, () -> drainQueueForRequests()); takeDelayedDeliveryActionIfRequired(shardId, lastEventDeliveryTime, log); }
Source:
public byte[] getCacheKey() { return new byte[]{0x1}; }

Target:
public byte[] getCacheKey() { return ALL_CACHE_PREFIX; }
Source:
public void testAospFileContexts() throws Exception { checkFc = copyResourceToTempFile("/checkfc"); checkFc.setExecutable(true); deviceFcFile = File.createTempFile("file_contexts", ".bin"); deviceFcFile.deleteOnExit(); mDevice.pullFile("/file_contexts.bin", deviceFcFile); aospFcFile = copyResourceToTempFile("/general_file_contexts.bin"); ProcessBuilder pb = new ProcessBuilder(checkFc.getAbsolutePath(), "-c", aospFcFile.getAbsolutePath(), deviceFcFile.getAbsolutePath()); pb.redirectOutput(ProcessBuilder.Redirect.PIPE); pb.redirectErrorStream(true); Process p = pb.start(); p.waitFor(); BufferedReader result = new BufferedReader(new InputStreamReader(p.getInputStream())); String line = result.readLine(); if(line.equals("equal") || line.equals("subset")) { CLog.d("The file_contexts.bin file includes the latest AOSP entries.\n"); } else { CLog.d("The file_contexts.bin file did not include the latest AOSP entries:\n" + line + "\n"); aospFcFile = copyResourceToTempFile("/ab3857191_file_contexts.bin"); ProcessBuilder pb1 = new ProcessBuilder(checkFc.getAbsolutePath(), "-c", aospFcFile.getAbsolutePath(), deviceFcFile.getAbsolutePath()); pb1.redirectOutput(ProcessBuilder.Redirect.PIPE); pb1.redirectErrorStream(true); Process p1 = pb1.start(); p1.waitFor(); BufferedReader result1 = new BufferedReader(new InputStreamReader(p1.getInputStream())); String line1 = result1.readLine(); assertTrue("The file_contexts.bin file did not include the AOSP entries:\n" + line1 + "\n", line1.equals("equal") || line1.equals("subset")); } }

Target:
public void testAospFileContexts() throws Exception { checkFc = copyResourceToTempFile("/checkfc"); checkFc.setExecutable(true); deviceFcFile = File.createTempFile("file_contexts", ".bin"); deviceFcFile.deleteOnExit(); mDevice.pullFile("/file_contexts.bin", deviceFcFile); String line = checkFileContexts("/general_file_contexts.bin"); if(line.equals("equal") || line.equals("subset")) { CLog.d("The file_contexts.bin file includes the latest AOSP entries.\n"); } else { CLog.d("The file_contexts.bin file did not include the latest AOSP entries:\n" + line + "\n"); line = checkFileContexts("/ab3857191_file_contexts.bin"); assertTrue("The file_contexts.bin file did not include the AOSP entries:\n" + line + "\n", line.equals("equal") || line.equals("subset")); } }
Source:
public void createMOTOPayment() { int minimumAmount = 1; publicAuthMockClient.mapBearerTokenToAccountId(API_KEY, GATEWAY_ACCOUNT_ID); connectorMockClient.respondOk_whenCreateCharge(CHARGE_TOKEN_ID, GATEWAY_ACCOUNT_ID, aCreateOrGetChargeResponseFromConnector() .withAmount(minimumAmount) .withChargeId(CHARGE_ID) .withState(CREATED) .withReturnUrl(RETURN_URL) .withDescription(DESCRIPTION) .withReference(REFERENCE) .withPaymentProvider(PAYMENT_PROVIDER) .withGatewayTransactionId(GATEWAY_TRANSACTION_ID) .withCreatedDate(CREATED_DATE) .withLanguage(SupportedLanguage.ENGLISH) .withDelayedCapture(false) .withMoto(true) .withRefundSummary(REFUND_SUMMARY) .withCardDetails(CARD_DETAILS) .build()); CreateChargeRequestParams params = aCreateChargeRequestParams() .withAmount(minimumAmount) .withDescription(DESCRIPTION) .withReference(REFERENCE) .withReturnUrl(RETURN_URL) .withMoto(true) .build(); postPaymentResponse(paymentPayload(params)) .statusCode(201) .contentType(JSON) .body("payment_id", is(CHARGE_ID)) .body("amount", is(minimumAmount)) .body("reference", is(REFERENCE)) .body("description", is(DESCRIPTION)) .body("return_url", is(RETURN_URL)) .body("moto", is(true)) .body("payment_provider", is(PAYMENT_PROVIDER)) .body("created_date", is(CREATED_DATE)); connectorMockClient.verifyCreateChargeConnectorRequest(GATEWAY_ACCOUNT_ID, params); }

Target:
public void createMOTOPayment() { int amount = 1; publicAuthMockClient.mapBearerTokenToAccountId(API_KEY, GATEWAY_ACCOUNT_ID); connectorMockClient.respondOk_whenCreateCharge(CHARGE_TOKEN_ID, GATEWAY_ACCOUNT_ID, aCreateOrGetChargeResponseFromConnector() .withAmount(amount) .withChargeId(CHARGE_ID) .withState(CREATED) .withReturnUrl(RETURN_URL) .withDescription(DESCRIPTION) .withReference(REFERENCE) .withPaymentProvider(PAYMENT_PROVIDER) .withGatewayTransactionId(GATEWAY_TRANSACTION_ID) .withCreatedDate(CREATED_DATE) .withLanguage(SupportedLanguage.ENGLISH) .withDelayedCapture(false) .withMoto(true) .withRefundSummary(REFUND_SUMMARY) .withCardDetails(CARD_DETAILS) .build()); CreateChargeRequestParams params = aCreateChargeRequestParams() .withAmount(amount) .withDescription(DESCRIPTION) .withReference(REFERENCE) .withReturnUrl(RETURN_URL) .withMoto(true) .build(); postPaymentResponse(paymentPayload(params)) .statusCode(201) .contentType(JSON) .body("payment_id", is(CHARGE_ID)) .body("amount", is(amount)) .body("reference", is(REFERENCE)) .body("description", is(DESCRIPTION)) .body("return_url", is(RETURN_URL)) .body("moto", is(true)) .body("payment_provider", is(PAYMENT_PROVIDER)) .body("created_date", is(CREATED_DATE)); connectorMockClient.verifyCreateChargeConnectorRequest(GATEWAY_ACCOUNT_ID, params); }
Source:
public void afterPropertiesSet() { eventBus.register(this); fafService.addOnMessageListener(JoinGameMessage.class, message -> iceAdapterProxy.joinGame(message.getUsername(), message.getPeerUid())); fafService.addOnMessageListener(HostGameMessage.class, message -> iceAdapterProxy.hostGame(message.getMap())); fafService.addOnMessageListener(ConnectToPeerMessage.class, message -> iceAdapterProxy.connectToPeer(message.getUsername(), message.getPeerUid(), message.isOffer())); fafService.addOnMessageListener(GameLaunchMessage.class, this::updateLobbyModeFromGameInfo); fafService.addOnMessageListener(DisconnectFromPeerMessage.class, message -> iceAdapterProxy.disconnectFromPeer(message.getUid())); fafService.addOnMessageListener(IceServerMessage.class, message -> iceAdapterProxy.iceMsg(message.getSender(), message.getRecord())); iceAdapterProxy = newIceAdapterProxy(); }

Target:
public void afterPropertiesSet() { eventBus.register(this); fafService.addOnMessageListener(JoinGameMessage.class, message -> iceAdapterProxy.joinGame(message.getUsername(), message.getPeerUid())); fafService.addOnMessageListener(HostGameMessage.class, message -> iceAdapterProxy.hostGame(message.getMap())); fafService.addOnMessageListener(ConnectToPeerMessage.class, message -> iceAdapterProxy.connectToPeer(message.getUsername(), message.getPeerUid(), message.isOffer())); fafService.addOnMessageListener(GameLaunchMessage.class, this::updateLobbyModeFromGameInfo); fafService.addOnMessageListener(DisconnectFromPeerMessage.class, message -> iceAdapterProxy.disconnectFromPeer(message.getUid())); fafService.addOnMessageListener(IceServerMessage.class, message -> iceAdapterProxy.iceMsg(message.getSender(), message.getRecord())); }
Source:
public void invalidateToken(Integer connectionHash){ tokens.put(connectionHash, null); }

Target:
public void invalidateToken(Integer connectionHash) { tokens.remove(connectionHash); }
Source:
public boolean isExactSort() { return true; }

Target:
public final boolean isExactSort() { return true; }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + this.a; result = prime * result + this.b; result = prime * result + this.c; result = prime * result + this.d; result = prime * result + this.e; result = prime * result + this.f; return result; }

Target:
public int hashCode() { return Objects.hash(this.a, this.b, this.c, this.d, this.e, this.f); }
Source:
public JobStatus schedule(@PathParam("task") String task) { String className = "org.candlepin.pinsetter.tasks." + task; try { boolean isCron = false; for (String cronJob : ConfigProperties.DEFAULT_TASK_LIST) { if (className.equalsIgnoreCase(cronJob)) { isCron = true; className = cronJob; } } if (isCron) { Class<? extends KingpinJob> taskClass = (Class<? extends KingpinJob>) Class .forName(className); return pk.scheduleSingleJob(taskClass, Util.generateUUID()); } else { throw new BadRequestException("Not a cron job:" + task); } } catch (ClassNotFoundException e) { throw new IseException(i18n.tr("Error trying to schedule {}: {}", className, e.getMessage())); } catch (PinsetterException e) { throw new IseException(i18n.tr("Error trying to schedule {}: {}", className, e.getMessage())); } }

Target:
public JobStatus schedule(@PathParam("task") String task) { String className = "org.candlepin.pinsetter.tasks." + task; try { boolean allowed = false; for (String permissibleJob : ConfigProperties.DEFAULT_TASK_LIST) { if (className.equalsIgnoreCase(permissibleJob)) { allowed = true; className = permissibleJob; } } if (allowed) { Class taskClass = Class.forName(className); return pk.scheduleSingleJob((Class<? extends KingpinJob>) taskClass, Util.generateUUID()); } else { throw new BadRequestException(i18n.tr("Not a permissible job: {0}", task)); } } catch (ClassNotFoundException e) { throw new IseException(i18n.tr("Error trying to schedule {0}: {1}", className, e.getMessage())); } catch (PinsetterException e) { throw new IseException(i18n.tr("Error trying to schedule {0}: {1}", className, e.getMessage())); } }
Source:
public Response processPostLogout( @FormParam(SAML_REQ) final String samlRequest, @FormParam(SAML_RESPONSE) final String samlResponse, @FormParam(RELAY_STATE) final String relayState, @Context final HttpServletRequest request) throws WSSecurityException, IdpException { LogoutState logoutState = getLogoutState(request); Cookie cookie = getCookie(request); try { if (samlRequest != null) { LogoutRequest logoutRequest = logoutMessage.extractSamlLogoutRequest( new String(Base64.getMimeDecoder().decode(samlRequest), StandardCharsets.UTF_8)); validatePost(request, logoutRequest); return handleLogoutRequest( cookie, logoutState, logoutRequest, SamlProtocol.Binding.HTTP_POST, relayState); } else if (samlResponse != null) { LogoutResponse logoutResponse = logoutMessage.extractSamlLogoutResponse(RestSecurity.inflateBase64(samlResponse)); String requestId = logoutState != null ? logoutState.getCurrentRequestId() : null; validatePost(request, logoutResponse, requestId); return handleLogoutResponse( cookie, logoutState, logoutResponse, SamlProtocol.Binding.HTTP_POST); } } catch (IOException | XMLStreamException e) { throw new IdpException("Unable to inflate Saml Object", e); } catch (ValidationException e) { throw new IdpException("Unable to validate Saml Object", e); } throw new IdpException("Unable to process logout"); }

Target:
public Response processPostLogout( @FormParam(SAML_REQ) final String samlRequest, @FormParam(SAML_RESPONSE) final String samlResponse, @FormParam(RELAY_STATE) final String relayState, @Context final HttpServletRequest request) throws WSSecurityException, IdpException { LogoutState logoutState = getLogoutState(request); Cookie cookie = getCookie(request); try { if (samlRequest != null) { LogoutRequest logoutRequest = logoutMessage.extractSamlLogoutRequest( new String(RestSecurity.base64Decode(samlRequest), StandardCharsets.UTF_8)); validatePost(request, logoutRequest); return handleLogoutRequest( cookie, logoutState, logoutRequest, SamlProtocol.Binding.HTTP_POST, relayState); } else if (samlResponse != null) { LogoutResponse logoutResponse = logoutMessage.extractSamlLogoutResponse(RestSecurity.inflateBase64(samlResponse)); String requestId = logoutState != null ? logoutState.getCurrentRequestId() : null; validatePost(request, logoutResponse, requestId); return handleLogoutResponse( cookie, logoutState, logoutResponse, SamlProtocol.Binding.HTTP_POST); } } catch (IOException | XMLStreamException e) { throw new IdpException("Unable to inflate Saml Object", e); } catch (ValidationException e) { throw new IdpException("Unable to validate Saml Object", e); } throw new IdpException("Unable to process logout"); }
Source:
public KualiDecimal getOtherNewTotalBilledForAwardPeriod(ContractsGrantsInvoiceDocument contractsGrantsInvoiceDocument) { KualiDecimal newTotalBilled = KualiDecimal.ZERO; Map<String, String> fieldValuesForInvoice = new HashMap<String, String>(); fieldValuesForInvoice.put(ArPropertyConstants.ContractsGrantsInvoiceDocumentFields.PROPOSAL_NUMBER, contractsGrantsInvoiceDocument.getInvoiceGeneralDetail().getProposalNumber().toString()); fieldValuesForInvoice.put(ArPropertyConstants.INVOICE_GENERAL_DETAIL+"."+ArPropertyConstants.BILLING_PERIOD, contractsGrantsInvoiceDocument.getInvoiceGeneralDetail().getBillingPeriod()); fieldValuesForInvoice.put(KFSPropertyConstants.DOCUMENT_NUMBER, SearchOperator.NOT + contractsGrantsInvoiceDocument.getDocumentNumber()); if (ObjectUtils.isNotNull(contractsGrantsInvoiceDocument.getFinancialSystemDocumentHeader()) && StringUtils.isNotBlank(contractsGrantsInvoiceDocument.getFinancialSystemDocumentHeader().getFinancialDocumentInErrorNumber())) { fieldValuesForInvoice.put(KFSPropertyConstants.DOCUMENT_NUMBER, SearchOperator.NOT + contractsGrantsInvoiceDocument.getFinancialSystemDocumentHeader().getFinancialDocumentInErrorNumber()); } Collection<ContractsGrantsInvoiceDocument> cgInvoiceDocuments = retrieveAllCGInvoicesByCriteria(fieldValuesForInvoice); for (ContractsGrantsInvoiceDocument cgInvoiceDocument: cgInvoiceDocuments) { for (InvoiceAccountDetail invAcctD : cgInvoiceDocument.getAccountDetails()) { newTotalBilled = newTotalBilled.add(invAcctD.getExpenditureAmount()); } } return newTotalBilled; }

Target:
public KualiDecimal getOtherNewTotalBilledForAwardPeriod(ContractsGrantsInvoiceDocument contractsGrantsInvoiceDocument) { KualiDecimal newTotalBilled = KualiDecimal.ZERO; Map<String, String> fieldValuesForInvoice = new HashMap<>(); fieldValuesForInvoice.put(ArPropertyConstants.ContractsGrantsInvoiceDocumentFields.PROPOSAL_NUMBER, contractsGrantsInvoiceDocument.getInvoiceGeneralDetail().getProposalNumber().toString()); fieldValuesForInvoice.put(ArPropertyConstants.INVOICE_GENERAL_DETAIL+"."+ArPropertyConstants.BILLING_PERIOD, contractsGrantsInvoiceDocument.getInvoiceGeneralDetail().getBillingPeriod()); fieldValuesForInvoice.put(KFSPropertyConstants.DOCUMENT_NUMBER, SearchOperator.NOT + contractsGrantsInvoiceDocument.getDocumentNumber()); if (ObjectUtils.isNotNull(contractsGrantsInvoiceDocument.getFinancialSystemDocumentHeader()) && StringUtils.isNotBlank(contractsGrantsInvoiceDocument.getFinancialSystemDocumentHeader().getFinancialDocumentInErrorNumber())) { fieldValuesForInvoice.put(KFSPropertyConstants.DOCUMENT_NUMBER, SearchOperator.NOT + contractsGrantsInvoiceDocument.getFinancialSystemDocumentHeader().getFinancialDocumentInErrorNumber()); } Collection<ContractsGrantsInvoiceDocument> cgInvoiceDocuments = retrieveAllCGInvoicesByCriteria(fieldValuesForInvoice); for (ContractsGrantsInvoiceDocument cgInvoiceDocument: cgInvoiceDocuments) { for (InvoiceAccountDetail invAcctD : cgInvoiceDocument.getAccountDetails()) { newTotalBilled = newTotalBilled.add(invAcctD.getExpenditureAmount()); } } return newTotalBilled; }
Source:
public Builder() { this.eventName = null; this.condition = null; this.continuity = null; this.classType = null; this.optional = false; this.times = false; this.minTimes = -1; this.maxTimes = -1; this.stopCondition = null; }

Target:
public Builder() { this.eventName = null; this.condition = null; this.contiguity = null; this.classType = null; this.optional = false; this.times = false; this.minTimes = -1; this.maxTimes = -1; this.innerContiguity = DEFAULT_INNER_CONTIGUITY; this.stopCondition = DEFAULT_STOPCONDITION; }
Source:
private GraphiteReporter startGraphiteReporter() { metrics.registerAll( new GarbageCollectorMetricSet(ManagementFactory.getGarbageCollectorMXBeans()) ); metrics.registerAll(new MemoryUsageGaugeSet()); metrics.registerAll(new ThreadStatesGaugeSet()); metrics.registerAll(new JvmAttributeGaugeSet()); try { GraphiteReporter reporter = GraphiteReporter.forRegistry(metrics) .prefixedWith("atlas-owl-api.".concat(InetAddress.getLocalHost().getHostName())) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .filter(MetricFilter.ALL) .build(new Graphite(new InetSocketAddress( graphiteHost, graphitePort ))); if (!IS_PROCESSING && graphiteReportingEnabled) { reporter.start(30, TimeUnit.SECONDS); System.out.println("Started Graphite reporter"); } return reporter; } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
private GraphiteReporter startGraphiteReporter() { metrics.registerAll( new GarbageCollectorMetricSet(ManagementFactory.getGarbageCollectorMXBeans()) ); metrics.registerAll(new MemoryUsageGaugeSet()); metrics.registerAll(new ThreadStatesGaugeSet()); metrics.registerAll(new JvmAttributeGaugeSet()); try { GraphiteReporter reporter = GraphiteReporter.forRegistry(metrics) .prefixedWith("atlas-owl-api.".concat(InetAddress.getLocalHost().getHostName())) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .filter(MetricFilter.ALL) .build(new Graphite(GRAPHITE_ADDRESS)); if (!IS_PROCESSING && GRAPHITE_REPORTING_ENABLED) { reporter.start(30, TimeUnit.SECONDS); System.out.println("Started Graphite reporter"); } return reporter; } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
public void delay() { final AtomicBoolean bookedForRunning = this.bookedForRunning; if (bookedForRunning == null || bookedForRunning.compareAndSet(false, true)) { try { scheduledExecutorService.schedule(() -> delayedRunForScheduler(bookedForRunning), nsPeriod, TimeUnit.NANOSECONDS); } catch (RejectedExecutionException e) { if (bookedForRunning == null) { bookedForRunning.set(false); } throw e; } } }

Target:
public boolean delay() { final AtomicBoolean booked = this.bookedForRunning; if (!booked.compareAndSet(false, true)) { return false; } try { scheduledExecutorService.schedule(() -> bookedRunForScheduler(booked), period, timeUnit); return true; } catch (RejectedExecutionException e) { booked.set(false); throw e; } }
Source:
private OrganizationDto getOrganization(DbSession dbSession, @Nullable String organizationParam) { String organizationKey = Optional.ofNullable(organizationParam) .orElseGet(organizationProvider.get()::getKey); return checkFoundWithOptional( dbClient.organizationDao().selectByKey(dbSession, organizationKey), "No organizationDto with key '%s'", organizationKey); }

Target:
private OrganizationDto getOrganization(DbSession dbSession, @Nullable String organizationParam) { String organizationKey = Optional.ofNullable(organizationParam) .orElseGet(organizationProvider.get()::getKey); return checkFoundWithOptional( dbClient.organizationDao().selectByKey(dbSession, organizationKey), "No organization with key '%s'", organizationKey); }
Source:
private boolean isAuthorized(HttpServletRequest request) { String cognitoIdToken = request.getHeader(CuCamsConstants.CapAssetApi.COGNITO_ID_TOKEN); PublicKey cognitoUserPoolPublicKey = getPublicKeyFromFile(); if (ObjectUtils.isNull(cognitoUserPoolPublicKey)) { return false; } Algorithm algorithm = Algorithm.RSA256((RSAPublicKey) cognitoUserPoolPublicKey, null); JWTVerifier verifier = JWT.require(algorithm) .withIssuer(CuCamsConstants.CapAssetApi.COGNITO_USER_POOL_ISSUER_URL) .withClaim(CuCamsConstants.CapAssetApi.TOKEN_USE, CuCamsConstants.CapAssetApi.ID) .build(); DecodedJWT jwt = verifier.verify(cognitoIdToken); String email = jwt.getClaim(CuCamsConstants.CapAssetApi.EMAIL).asString(); LOG.info("CapAssetInventory Authorized {}", email); return true; }

Target:
private boolean isAuthorized(HttpServletRequest request) { String cognitoIdToken = request.getHeader(CuCamsConstants.CapAssetApi.COGNITO_ID_TOKEN); PublicKey cognitoUserPoolPublicKey = getCognitoUserPoolPublicKey(); if (ObjectUtils.isNull(cognitoUserPoolPublicKey)) { return false; } String cognitoUserPoolIssuerUrl = getConfigurationService().getPropertyValueAsString(CuCamsConstants.CapAssetApi.ConfigurationProperties.COGNITO_USER_POOL_ISSUER_URL); Algorithm algorithm = Algorithm.RSA256((RSAPublicKey) cognitoUserPoolPublicKey, null); JWTVerifier verifier = JWT.require(algorithm) .withIssuer(cognitoUserPoolIssuerUrl) .withClaim(CuCamsConstants.CapAssetApi.TOKEN_USE, CuCamsConstants.CapAssetApi.ID) .build(); DecodedJWT jwt = verifier.verify(cognitoIdToken); String email = jwt.getClaim(CuCamsConstants.CapAssetApi.EMAIL).asString(); LOG.info("CapAssetInventory Authorized {}", email); return true; }
Source:
private ReconcilerWithAutoSave getAutoSave(){ Reconciler reconciler = getConfiguration().getReconciler(); if(reconciler == null){ return null; } if(reconciler instanceof ReconcilerWithAutoSave) { return ((ReconcilerWithAutoSave)reconciler); } return null; }

Target:
private ReconcilerWithAutoSave getAutoSave() { Reconciler reconciler = getConfiguration().getReconciler(); if (reconciler != null && reconciler instanceof ReconcilerWithAutoSave) { return ((ReconcilerWithAutoSave)reconciler); } return null; }
Source:
public void refreshDetails(GlusterVolumeEntity volumeEntity) { AsyncDataProvider.getGlusterRebalanceStatus(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { VdcQueryReturnValue vdcValue = (VdcQueryReturnValue) returnValue; GlusterVolumeTaskStatusEntity rebalanceStatusEntity =vdcValue.getReturnValue(); showStatus(rebalanceStatusEntity); } }), volumeEntity.getClusterId(), volumeEntity.getId()); }

Target:
public void refreshDetails(GlusterVolumeEntity volumeEntity) { AsyncDataProvider.getGlusterRebalanceStatus(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { VdcQueryReturnValue vdcValue = (VdcQueryReturnValue) returnValue; GlusterVolumeTaskStatusEntity rebalanceStatusEntity =vdcValue.getReturnValue(); if (rebalanceStatusEntity != null) { showStatus(rebalanceStatusEntity); } } }), volumeEntity.getClusterId(), volumeEntity.getId()); }
Source:
public RawPacket reverseTransform(RawPacket pkt) { if (extensionId != -1) { RawPacket.HeaderExtension he = pkt.getHeaderExtension((byte) extensionId); if (he != null && he.getExtLength() == 2) { int seq = RTPUtils.readUint16AsInt( he.getBuffer(), he.getOffset() + 1); packetReceived( seq, pkt.getPayloadType(), pkt.isPacketMarked()); } } return pkt; }

Target:
public RawPacket reverseTransform(RawPacket pkt) { if (extensionId != -1) { RawPacket.HeaderExtension he = pkt.getHeaderExtension((byte) extensionId); if (he != null && he.getExtLength() == 2) { int seq = RTPUtils.readUint16AsInt( he.getBuffer(), he.getOffset() + 1); packetReceived( seq, RawPacket.getPayloadType(pkt), pkt.isPacketMarked()); } } return pkt; }
Source:
public static Block stPoints(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { Geometry geometry = deserialize(input); validateType("ST_Points", geometry, VALID_TYPES_FOR_ST_POINTS); if (geometry.isEmpty()) { return null; } int pointCount = geometry.getNumPoints(); BlockBuilder blockBuilder = GEOMETRY.createBlockBuilder(null, pointCount); buildPointsBlock(geometry, blockBuilder); return blockBuilder.build(); }

Target:
public static Block stPoints(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { Geometry geometry = deserialize(input); if (geometry.isEmpty()) { return null; } BlockBuilder blockBuilder = GEOMETRY.createBlockBuilder(null, geometry.getNumPoints()); buildPointsBlock(geometry, blockBuilder); return blockBuilder.build(); }
Source:
public Object getValue(String paramName) throws IllegalArgumentException { if (values.containsKey(paramName)) { return values.get(paramName); } Expression expression = null; if (parameterExpressions.containsKey(paramName)) { if (input instanceof Collection<?>) { expression = parameterExpressions.get(paramName)[1]; } else { expression = parameterExpressions.get(paramName)[0]; } } else { String expr = input instanceof Collection<?> ? "#root.![" + paramName + "]" : paramName; expression = PARSER.parseExpression(expr); } Object value = evaluateExpression(expression, input); values.put(paramName, value); if (logger.isDebugEnabled()) { logger.debug("Resolved expression " + expression + " to " + value); } return value; }

Target:
public Object getValue(String paramName) throws IllegalArgumentException { if (values.containsKey(paramName)) { return values.get(paramName); } if (!parameterExpressions.containsKey(paramName)) { Expression[] expressions = new Expression[] { PARSER.parseExpression(paramName), PARSER.parseExpression("#root.![" + paramName + "]") }; ExpressionEvaluatingSqlParameterSourceFactory.this.parameterExpressions.put(paramName, expressions); this.parameterExpressions.put(paramName, expressions); } Expression expression = null; if (input instanceof Collection<?>) { expression = parameterExpressions.get(paramName)[1]; } else { expression = parameterExpressions.get(paramName)[0]; } Object value = evaluateExpression(expression, input); values.put(paramName, value); if (logger.isDebugEnabled()) { logger.debug("Resolved expression " + expression + " to " + value); } return value; }
Source:
public void setSingleBlockMode(boolean singleBlockMode) { logger.log(Level.INFO, "Setting singleBlockMode to ".concat((singleBlockMode)?"true":"false")); this.singleBlockMode = singleBlockMode; changed(); }

Target:
public void setSingleBlockMode(boolean singleBlockMode) { logger.log(Level.INFO, "Setting singleBlockMode to ".concat( ((Boolean)singleBlockMode).toString() )); this.singleBlockMode = singleBlockMode; changed(); }
Source:
private static void addRangeToNeighbors(List<CommonRange> neighborRangeList, Range<Token> range, EndpointsForRange neighbors) { Set<InetAddressAndPort> endpoints = neighbors.endpoints(); Set<InetAddressAndPort> transEndpoints = neighbors.filter(Replica::isTransient).endpoints(); for (CommonRange cr : neighborRangeList) { if (Sets.difference(cr.endpoints, endpoints).isEmpty() && Sets.difference(cr.transEndpoints, transEndpoints).isEmpty()) { cr.ranges.add(range); return; } } List<Range<Token>> ranges = new ArrayList<>(); ranges.add(range); neighborRangeList.add(new CommonRange(endpoints, transEndpoints, ranges)); }

Target:
private static void addRangeToNeighbors(List<CommonRange> neighborRangeList, Range<Token> range, EndpointsForRange neighbors) { Set<InetAddressAndPort> endpoints = neighbors.endpoints(); Set<InetAddressAndPort> transEndpoints = neighbors.filter(Replica::isTransient).endpoints(); for (CommonRange commonRange : neighborRangeList) { if (commonRange.matchesEndpoints(endpoints, transEndpoints)) { commonRange.ranges.add(range); return; } } List<Range<Token>> ranges = new ArrayList<>(); ranges.add(range); neighborRangeList.add(new CommonRange(endpoints, transEndpoints, ranges)); }