auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ProgressorJsonRpcHandler( RequestHandlerConfigurator configurator, AppContext appContext, EventBus eventBus, RequestTransmitter requestTransmitter) { this.configurator = configurator; this.requestTransmitter = requestTransmitter; handleMavenServerMessages(); eventBus.addHandler(WorkspaceRunningEvent.TYPE, e -> subscribe()); if (appContext.getWorkspace().getStatus() == RUNNING) { subscribe(); } }

Target:
public ProgressorJsonRpcHandler( RequestHandlerConfigurator configurator, AppContext appContext, EventBus eventBus, RequestTransmitter requestTransmitter) { this.configurator = configurator; this.requestTransmitter = requestTransmitter; handleProgressesReports(); eventBus.addHandler(WorkspaceRunningEvent.TYPE, e -> subscribe()); if (appContext.getWorkspace().getStatus() == RUNNING) { subscribe(); } }
Source:
public Callable<String> getCachePopulator( final String id, final StaticMapExtractionNamespace extractionNamespace, final String lastVersion, final Map<String, String> swap ) { return new Callable<String>() { @Override public String call() throws Exception { if (lastVersion != null) { throw new AssertionError( "StaticMapExtractionNamespaceCacheFactory could only be configured for a namespace which is scheduled " + "to be updated once, not periodically. Last version: `" + lastVersion + "`"); } else { swap.putAll(extractionNamespace.getMap()); return version; } } }; }

Target:
public Callable<String> getCachePopulator( final String id, final StaticMapExtractionNamespace extractionNamespace, final String lastVersion, final Map<String, String> swap ) { if (lastVersion != null) { throw new AssertionError( "StaticMapExtractionNamespaceCacheFactory could only be configured for a namespace which is scheduled " + "to be updated once, not periodically. Last version: `" + lastVersion + "`"); } return new Callable<String>() { @Override public String call() throws Exception { swap.putAll(extractionNamespace.getMap()); return version; } }; }
Source:
private StageExecutionDescriptor(StageExecutionStrategy stageExecutionStrategy, Set<PlanNodeId> groupedExecutionScanNodes) { this.stageExecutionStrategy = requireNonNull(stageExecutionStrategy, "stageExecutionStrategy is null"); this.groupedExecutionScanNodes = requireNonNull(groupedExecutionScanNodes, "groupedExecutionScanNodes is null"); switch (stageExecutionStrategy) { case UNGROUPED_EXECUTION: checkArgument(groupedExecutionScanNodes.isEmpty()); break; case FIXED_LIFESPAN_SCHEDULE_GROUPED_EXECUTION: case DYNAMIC_LIFESPAN_SCHEDULE_GROUPED_EXECUTION: checkArgument(!groupedExecutionScanNodes.isEmpty()); break; default: throw new IllegalArgumentException("Unsupport stage execution strategy: " + stageExecutionStrategy); } }

Target:
private StageExecutionDescriptor(StageExecutionStrategy stageExecutionStrategy, Set<PlanNodeId> groupedExecutionScanNodes) { switch (stageExecutionStrategy) { case UNGROUPED_EXECUTION: checkArgument(groupedExecutionScanNodes.isEmpty(), "groupedExecutionScanNodes must be empty if stage execution strategy is ungrouped execution"); break; case FIXED_LIFESPAN_SCHEDULE_GROUPED_EXECUTION: case DYNAMIC_LIFESPAN_SCHEDULE_GROUPED_EXECUTION: checkArgument(!groupedExecutionScanNodes.isEmpty(), "groupedExecutionScanNodes cannot be empty if stage execution strategy is grouped execution"); break; default: throw new IllegalArgumentException("Unsupported stage execution strategy: " + stageExecutionStrategy); } this.stageExecutionStrategy = requireNonNull(stageExecutionStrategy, "stageExecutionStrategy is null"); this.groupedExecutionScanNodes = requireNonNull(groupedExecutionScanNodes, "groupedExecutionScanNodes is null"); }
Source:
private PartitionPublishingState getClientPartitionPublishingState(String partitionId) { if (!this.isIdempotentPartitionPublishing) { throw logger.logExceptionAsWarning( new IllegalStateException("getPartitionPublishingState() shouldn't be called if the producer" + " is not an idempotent producer.")); } if (this.partitionPublishingStates.containsKey(partitionId)) { return this.partitionPublishingStates.get(partitionId); } else { synchronized (this) { if (this.partitionPublishingStates.containsKey(partitionId)) { return this.partitionPublishingStates.get(partitionId); } PartitionPublishingState state = new PartitionPublishingState(); this.partitionPublishingStates.put(partitionId, state); return state; } } }

Target:
private PartitionPublishingState getClientPartitionPublishingState(String partitionId) { if (!isIdempotentPartitionPublishing) { throw logger.logExceptionAsWarning( new IllegalStateException("getPartitionPublishingState() shouldn't be called if the producer" + " is not an idempotent producer.")); } if (partitionPublishingStates.containsKey(partitionId)) { return partitionPublishingStates.get(partitionId); } else { synchronized (partitionPublishingStates) { if (partitionPublishingStates.containsKey(partitionId)) { return partitionPublishingStates.get(partitionId); } PartitionPublishingState state = new PartitionPublishingState(); partitionPublishingStates.put(partitionId, state); return state; } } }
Source:
public PageSizeTemplate(Integer value, Integer minPageSize, Integer maxPageSize) { super(value); setDescription("Represents maximum number of items on the page"); setAllowedValues("Any integer greater or equals to " + minPageSize + " and less or equals to " + maxPageSize); }

Target:
public PageSizeTemplate(Integer value, Integer minPageSize, Integer maxPageSize) { super(value); setDescription("Represents maximum number of items on the page"); setAllowedValues("Any integer greater or equal to " + minPageSize + " and less or equal to " + maxPageSize); }
Source:
public final ZkSubscription<List<String>> subscribeForSessionListChanges(final Runnable listener) { getLog().info("subscribeForSessionListChanges: " + listener.hashCode()); return new ZkSubscriptionImpl.ZkSubscriptionChildrenImpl( getCurator(), listener, getSubscriptionPath("/sessions")); }

Target:
public final ZkSubscription<List<String>> subscribeForSessionListChanges(final Runnable listener) throws NakadiRuntimeException { getLog().info("subscribeForSessionListChanges: " + listener.hashCode()); return new ZkSubscriptionImpl.ZkSubscriptionChildrenImpl( getCurator(), listener, getSubscriptionPath("/sessions")); }
Source:
private void onCallResponse(CallResponse<CallInfo> message, ActorRef self, ActorRef sender) throws ServletParseException { String senderPath = sender.path().name(); CallInfo callInfo = message.get(); callDetailsMap.put(senderPath, callInfo); if (callInfo != null && callInfo.invite() != null) { if (logger.isDebugEnabled()) { logger.debug("onCallResponse Before: callLocationMap: "+ callLocationMap.toString()); } callLocationMap.put(callInfo.invite().getAddressHeader(ContactHeader.NAME).getURI().toString(), sender); if (logger.isDebugEnabled()) { logger.debug("onCallResponse After: callLocationMap: "+ callLocationMap.toString()); } } if (callInfo.direction().equalsIgnoreCase("inbound")) { if (logger.isDebugEnabled()) { logger.debug("New inbound call from: "+callInfo.from()+" to: "+callInfo.to()); } incomingCallDetailsMap.put(senderPath, callInfo); incomingCallsUpToNow.incrementAndGet(); } else { if (logger.isDebugEnabled()) { logger.debug("New outbound call from: "+callInfo.from()+" to: "+callInfo.to()); } outgoingCallDetailsMap.put(senderPath, callInfo); outgoingCallsUpToNow.incrementAndGet(); } if (maxConcurrentCalls.get() < callDetailsMap.size()) { maxConcurrentCalls.set(callDetailsMap.size()); } if (maxConcurrentIncomingCalls.get() < incomingCallDetailsMap.size()) { maxConcurrentIncomingCalls.set(incomingCallDetailsMap.size()); } if (maxConcurrentOutgoingCalls.get() < outgoingCallDetailsMap.size()) { maxConcurrentOutgoingCalls.set(outgoingCallDetailsMap.size()); } }

Target:
private void onCallResponse(CallResponse<CallInfo> message, ActorRef self, ActorRef sender) throws ServletParseException { String senderPath = sender.path().name(); CallInfo callInfo = message.get(); callDetailsMap.put(senderPath, callInfo); if (callInfo != null && callInfo.invite() != null) { callLocationMap.put(callInfo.invite().getAddressHeader(ContactHeader.NAME).getURI().toString(), sender); } if (callInfo.direction().equalsIgnoreCase("inbound")) { if (logger.isDebugEnabled()) { logger.debug("New inbound call from: "+callInfo.from()+" to: "+callInfo.to()); } incomingCallDetailsMap.put(senderPath, callInfo); incomingCallsUpToNow.incrementAndGet(); } else { if (logger.isDebugEnabled()) { logger.debug("New outbound call from: "+callInfo.from()+" to: "+callInfo.to()); } outgoingCallDetailsMap.put(senderPath, callInfo); outgoingCallsUpToNow.incrementAndGet(); } if (maxConcurrentCalls.get() < callDetailsMap.size()) { maxConcurrentCalls.set(callDetailsMap.size()); } if (maxConcurrentIncomingCalls.get() < incomingCallDetailsMap.size()) { maxConcurrentIncomingCalls.set(incomingCallDetailsMap.size()); } if (maxConcurrentOutgoingCalls.get() < outgoingCallDetailsMap.size()) { maxConcurrentOutgoingCalls.set(outgoingCallDetailsMap.size()); } }
Source:
public void refreshChangedItems() { TreeViewer viewer = this.filteredTree.getViewer(); for (OperationItem item : this.activeItems.keySet()) { viewer.update(item, null); if (shouldBeVisible(item)) { viewer.expandToLevel(item, 0); } } viewer.refresh(false); Iterator<OperationItem> items = this.activeItems.keySet().iterator(); while (items.hasNext()) { OperationItem item = items.next(); if (this.activeItems.get(item)) { items.remove(); } } }

Target:
public void refreshChangedItems() { TreeViewer viewer = this.filteredTree.getViewer(); for (OperationItem item : Sets.union(this.activeItems, this.removedItems)) { viewer.update(item, null); if (shouldBeVisible(item)) { viewer.expandToLevel(item, 0); } } viewer.refresh(false); this.activeItems.removeAll(this.removedItems); this.removedItems.clear(); }
Source:
public void onCheatGrowth(ActivateEvent event, EntityRef item, CheatGrowthComponent cheatGrowthComponent, ItemComponent itemComponent) { if (!event.getTarget().hasComponent(VineDefinitionComponent.class) || !event.getTarget().hasComponent(VineNodeComponent.class)) { return; } VineDefinitionComponent vineDefinitionComponent = event.getTarget().getComponent(VineDefinitionComponent.class); VineNodeComponent vineNodeComponent = event.getTarget().getComponent(VineNodeComponent.class); if (!cheatGrowthComponent.causesUnGrowth) { doGrowVine(event.getTarget(), vineNodeComponent, vineDefinitionComponent); } }

Target:
public void onCheatGrowth(ActivateEvent event, EntityRef item, CheatGrowthComponent cheatGrowthComponent, ItemComponent itemComponent) { EntityRef target = event.getTarget(); if (!target.hasComponent(VineDefinitionComponent.class) || !target.hasComponent(VineNodeComponent.class)) { return; } VineDefinitionComponent vineDefinitionComponent = target.getComponent(VineDefinitionComponent.class); VineNodeComponent vineNodeComponent = target.getComponent(VineNodeComponent.class); if (!cheatGrowthComponent.causesUnGrowth) { doGrowVine(target, vineNodeComponent, vineDefinitionComponent); } }
Source:
protected File createPapyrusUserOomphModel(Path setupFilePath, File... project) throws IOException { OomphUserModelBuilder userModelBuilder = new OomphUserModelBuilder(); Path oomphFolderPath = getTestTmpFolder().resolve("oomphFolder"); File userSetupFile = userModelBuilder.setInstallationLocation(oomphFolderPath.toString()) .setWorkspaceLocation(getWorkspaceLocation().getAbsolutePath()) .setProjectPaths(Arrays.stream(project).map(p -> p.getAbsolutePath()).toArray(String[]::new)) .setRepositories("<LINK_0>", "<LINK_1>") .setRequirements("org.eclipse.uml2.feature.group", "org.eclipse.papyrus.sdk.feature.feature.group", "org.eclipse.emf.compare.rcp.ui.feature.group", "org.eclipse.emf.compare.uml2.feature.group", "org.eclipse.emf.compare.diagram.gmf.feature.group", "org.eclipse.emf.compare.diagram.papyrus.feature.group") .saveTo(setupFilePath.toString()); return userSetupFile; }

Target:
protected File createPapyrusUserOomphModel(Path setupFilePath, File... project) throws IOException { OomphUserModelBuilder userModelBuilder = new OomphUserModelBuilder(); Path oomphFolderPath = getTestTmpFolder().resolve("oomphFolder"); File userSetupFile = userModelBuilder.setInstallationLocation(oomphFolderPath.toString()) .setWorkspaceLocation(getWorkspaceLocation().getAbsolutePath()) .setProjectPaths(Arrays.stream(project).map(p -> p.getAbsolutePath()).toArray(String[]::new)) .setRepositories("<LINK_0>", "<LINK_1>", "<LINK_2>") .setRequirements("org.eclipse.uml2.feature.group", "org.eclipse.papyrus.sdk.feature.feature.group", "org.eclipse.emf.compare.rcp.ui.feature.group", "org.eclipse.emf.compare.uml2.feature.group", "org.eclipse.emf.compare.diagram.gmf.feature.group", "org.eclipse.emf.compare.diagram.papyrus.feature.group") .saveTo(setupFilePath.toString()); return userSetupFile; }
Source:
public void registerForVoiceRouterMessages(long id) { VoiceRouter.VoiceMessageListener listener = new VoiceRouter.VoiceMessageListener() { @Override public void onVoiceMessage() { if (aidlCallbackListener != null) { for (OsmandAidlService.AidlCallbackParams cb : aidlCallbackListener.getAidlCallbacks().values()) { if (!aidlCallbackListener.getAidlCallbacks().isEmpty() && (cb.getKey() & KEY_ON_VOICE_MESSAGE) > 0) { try { cb.getCallback().onVoiceRouterNotify(); } catch (Exception e) { LOG.debug(e.getMessage(), e); } } } } } }; voiceRouterMessageCallbacks.put(id, listener); app.getRoutingHelper().getVoiceRouter().addVoiceMessageListener(listener); }

Target:
public void registerForVoiceRouterMessages(long id) { VoiceRouter.VoiceMessageListener listener = new VoiceRouter.VoiceMessageListener() { @Override public void onVoiceMessage() { if (aidlCallbackListener != null) { for (OsmandAidlService.AidlCallbackParams cb : aidlCallbackListener.getAidlCallbacks().values()) { if (!aidlCallbackListener.getAidlCallbacks().isEmpty() && (cb.getKey() & KEY_ON_VOICE_MESSAGE) > 0) { try { cb.getCallback().onVoiceRouterNotify(); } catch (Exception e) { LOG.error(e.getMessage(), e); } } } } } }; voiceRouterMessageCallbacks.put(id, listener); app.getRoutingHelper().getVoiceRouter().addVoiceMessageListener(listener); }
Source:
public void createRequiredExternalIdWithRolesOK() { mockHealthCodeAndAccountRetrieval(); STUDY.setExternalIdRequiredOnSignup(true); StudyParticipant participant = new StudyParticipant.Builder().copyOf(PARTICIPANT).withExternalId(null).build(); participantService.createParticipant(STUDY, participant, false); }

Target:
public void createRequiredExternalIdWithRolesOK() { mockHealthCodeAndAccountRetrieval(); STUDY.setExternalIdRequiredOnSignup(true); StudyParticipant participant = new StudyParticipant.Builder().copyOf(PARTICIPANT).withExternalId(null).build(); participantService.createParticipant(STUDY, participant, false); verify(externalIdService).commitAssignExternalId(null); }
Source:
private boolean acquire(String callerId,String resourceId, Long ttl, Date now, Date expiration) { BasicDBObject update=new BasicDBObject(). append(CALLERID,callerId). append(RESOURCEID,resourceId). append(TIMESTAMP,now). append(TTL, ttl). append(EXPIRATION,expiration). append(COUNT,1). append(VERSION,1); LOGGER.debug("insert: {}", update); coll.insert(update, WriteConcern.ACKNOWLEDGED); return true; }

Target:
private boolean acquire(String callerId,String resourceId, Long ttl, Date now, Date expiration) { BasicDBObject update=new BasicDBObject(). append(CALLERID,callerId). append(RESOURCEID,resourceId). append(TIMESTAMP,now). append(TTL, ttl). append(EXPIRATION,expiration). append(COUNT,1). append(VERSION,1); try { LOGGER.debug("insert: {}", update); coll.insert(update, WriteConcern.ACKNOWLEDGED); } catch (DuplicateKeyException dke) { return false; } return true; }
Source:
public List<Block> execute(TocMacroParameters parameters, String content, MacroTransformationContext context) throws MacroExecutionException { Block rootBlock = null; WikiModel wikiModel = this.wikiModelProvider.get(); if (parameters.getReference() != null) { if (wikiModel != null) { parameters.setScope(TocMacroParameters.Scope.PAGE); rootBlock = getXDOM(new DocumentResourceReference(parameters.getReference()), wikiModel); } else { throw new MacroExecutionException( "The \"reference\" parameter can only be used when a WikiModel implementation is available"); } } TreeParametersBuilder builder = new TreeParametersBuilder(); TreeParameters treeParameters = builder.build(rootBlock, parameters, context); List<Block> parametersList = this.tocTreeBuilder.build(treeParameters); if (parameters.getBox()) { MacroBlock mb = new MacroBlock("toc", parametersList.get(0).getRoot().getParameters(), false); } return parametersList; }

Target:
public List<Block> execute(TocMacroParameters parameters, String content, MacroTransformationContext context) throws MacroExecutionException { Block rootBlock = null; WikiModel wikiModel = this.wikiModelProvider.get(); if (parameters.getReference() != null) { if (wikiModel != null) { parameters.setScope(TocMacroParameters.Scope.PAGE); rootBlock = getXDOM(new DocumentResourceReference(parameters.getReference()), wikiModel); } else { throw new MacroExecutionException( "The \"reference\" parameter can only be used when a WikiModel implementation is available"); } } TreeParametersBuilder builder = new TreeParametersBuilder(); TreeParameters treeParameters = builder.build(rootBlock, parameters, context); List<Block> parametersList = this.tocTreeBuilder.build(treeParameters); if (parameters.getBox()) { BoxMacroParameters boxParameters = new BoxMacroParameters(); boxParameters.setCssClass(context.getId() + "message"); parametersList = boxMacro.execute(boxParameters, content, context); } return parametersList; }
Source:
private void writeMappingTable(Map<String,String> mappings) { createMappingTable(); PreparedStatement pStatement = session.prepare("INSERT INTO openshift_metrics.metrics_mappings (project_id, project_name) VALUES(?,?);"); for (Map.Entry<String,String> entry: mappings.entrySet()) { int max_retries = 3; int tries = 0; boolean succeeded = false; while (!succeeded && tries < max_retries) { try { log.infof("trying to write value to metrics_mapping table: %s %s", entry.getKey(), entry.getValue()); session.execute(pStatement.bind(entry.getKey(), entry.getValue())); log.infof("wrote value to metrics_mapping table"); succeeded = true; } catch (Exception e) { log.errorf(e, "Error trying to insert entry into the openshift_metrics.metrics_mappings table (%s:%s). Will retry.", entry.getKey(), entry.getValue()); try { Thread.sleep(1000); } catch (InterruptedException e1) { e1.printStackTrace(); } } tries++; } if (!succeeded) { throw new RuntimeException("Could not write all values to the openshift_metrics.metrics_mapping table. Aborting"); } } session.execute(pStatement.bind("%succeeded", "true")); }

Target:
private void writeMappingTable(Map<String,String> mappings) { createMappingTable(); PreparedStatement pStatement = session.prepare("INSERT INTO openshift_metrics.metrics_mappings (project_id, project_name) VALUES(?,?);"); for (Map.Entry<String,String> entry: mappings.entrySet()) { int maxRetries = 3; int tries = 0; boolean succeeded = false; while (!succeeded && tries < maxRetries) { try { log.debugf("trying to write value to metrics_mapping table: %s %s", entry.getKey(), entry.getValue()); session.execute(pStatement.bind(entry.getKey(), entry.getValue())); log.debugf("wrote value to metrics_mapping table"); succeeded = true; } catch (Exception e) { log.errorf(e, "Error trying to insert entry into the openshift_metrics.metrics_mappings table (%s:%s). Will retry.", entry.getKey(), entry.getValue()); try { Thread.sleep(1000); } catch (InterruptedException ie) { break; } } tries++; } if (!succeeded) { throw new RuntimeException("Could not write all values to the openshift_metrics.metrics_mapping table. Aborting"); } } session.execute(pStatement.bind("%succeeded", "true")); }
Source:
public void testRelativeIncludesWithLoadingViaUri() throws Exception { tearDown(); File configFile = new File("./tmp/test-config.xml"); File configFile2 = new File("./tmp/test-config2.xml"); new File(configFile.getParent()).mkdirs(); out = new BufferedWriter(new FileWriter(configFile2)); startConfig(); appendProperty("a", "b"); endConfig(); out = new BufferedWriter(new FileWriter(configFile)); startConfig(); startInclude(configFile2.getName()); endInclude(); appendProperty("c", "d"); endConfig(); Path fileResource = new Path(configFile.toURI()); conf.addResource(fileResource); assertEquals(conf.get("a"), "b"); assertEquals(conf.get("c"), "d"); configFile.delete(); configFile2.delete(); new File(configFile.getParent()).delete(); }

Target:
public void testRelativeIncludesWithLoadingViaUri() throws Exception { tearDown(); File configFile = new File("./tmp/test-config.xml"); File configFile2 = new File("./tmp/test-config2.xml"); new File(configFile.getParent()).mkdirs(); out = new BufferedWriter(new FileWriter(configFile2)); startConfig(); appendProperty("a", "b"); endConfig(); out = new BufferedWriter(new FileWriter(configFile)); startConfig(); startInclude(configFile2.getName()); endInclude(); appendProperty("c", "d"); endConfig(); Path fileResource = new Path(configFile.toURI()); conf.addResource(fileResource); assertEquals("b", conf.get("a")); assertEquals("d", conf.get("c")); configFile.delete(); configFile2.delete(); new File(configFile.getParent()).delete(); }
Source:
public static long getLength(ArtifactInputStream is) throws IOException { InputStream target = is.getTarget(); if (!(target instanceof SbByteRangeInputStream)) { return -1L; } SbByteRangeInputStream bris = (SbByteRangeInputStream) target; return bris.getLength(); }

Target:
public static long getLength(ArtifactInputStream is) throws IOException { InputStream target = is.getTarget(); if (!(target instanceof ByteRangeInputStream)) { return -1L; } ByteRangeInputStream bris = (ByteRangeInputStream) target; return bris.getLength(); }
Source:
public void persistAsyncTaskPlaceHolder(VdcActionType parentCommand, String taskKey) { if (!taskKeyToTaskIdMap.containsKey(taskKey)) { taskKeyToTaskIdMap.put(taskKey, persistAsyncTaskPlaceHolder(parentCommand)); } }

Target:
public void persistAsyncTaskPlaceHolder(VdcActionType parentCommand, String taskKey) { if (taskKeyToTaskIdMap.containsKey(taskKey)) { return; } try { AsyncTasks task = createAsyncTask(new AsyncTaskCreationInfo(), parentCommand); Guid taskId = task.getTaskId(); AsyncTaskUtils.addOrUpdateTaskInDB(task, null, EMPTY_GUID_ARRAY); taskKeyToTaskIdMap.put(taskKey, taskId); } catch (RuntimeException ex) { log.errorFormat("Error during persistAsyncTaskPlaceHolder for command: {0}. Exception {1}", this.getClass().getName(), ex); } }
Source:
public Integer int32(String name) { Int32Field field = fieldSearcher.nextField(name, Int32Field.class, null, readBuffer); if (field == null) { return null; } return (Integer) field.decode(readBuffer); }

Target:
public Integer int32(String name) { return fieldDecoder.decodeValue(name, Int32Field.class); }
Source:
private static String formatTime( final long startTime ) { return OffsetDateTime .ofInstant( Instant.ofEpochMilli( startTime ), ZoneId.of("GMT") ) .format( ISO_OFFSET_DATE_TIME ); }

Target:
private static String formatTime( final long startTime ) { return OffsetDateTime .ofInstant( Instant.ofEpochMilli( startTime ), UTC_ZONE_ID) .format( ISO_OFFSET_DATE_TIME ); }
Source:
private boolean isCallToSystemIdentityHashCodeWithValueBasedClass(int seen) { boolean callToSystemIdentityHashCode = seen == INVOKESTATIC && "java/lang/System".equals(getClassConstantOperand()) && "identityHashCode".equals(getNameConstantOperand()); if (!callToSystemIdentityHashCode) { return false; } Item callArgumentStackItem = getStack().getStackItem(0); String callArgumentSignature = callArgumentStackItem.getSignature(); String callArgumentClassName = ClassName.extractClassName(callArgumentSignature); return ValueBasedClassIdentifier.isValueBasedClass(callArgumentClassName); }

Target:
private boolean isCallToSystemIdentityHashCodeWithValueBasedClass(int seen) { boolean callToSystemIdentityHashCode = seen == INVOKESTATIC && getMethodDescriptorOperand().equals(IDENTITY_HASH_CODE); if (!callToSystemIdentityHashCode) { return false; } Item callArgumentStackItem = getStack().getStackItem(0); String callArgumentSignature = callArgumentStackItem.getSignature(); String callArgumentClassName = ClassName.fromFieldSignature(callArgumentSignature); return ValueBasedClassIdentifier.isValueBasedClass(callArgumentClassName); }
Source:
public boolean isValidExprForIndexesAndMVs(StringBuffer msg, boolean isMV) { final int invalidFunctionId = containsFunctionByIds(INVALID_FUNCTIONS_FOR_IDXS_AND_MVS); if (invalidFunctionId != -1) { if (invalidFunctionId == FunctionSQL.voltGetCurrentTimestampId()) { msg.append("cannot include the function NOW or CURRENT_TIMESTAMP."); return false; } else if (invalidFunctionId == FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_STR) { msg.append("cannot include the function STR."); return false; } else { msg.append("cannot include invalid function."); return false; } } else if (hasAnySubexpressionOfClass(AggregateExpression.class)) { msg.append("cannot contain aggregate expressions."); return false; } else if (hasAnySubexpressionOfClass(AbstractSubqueryExpression.class)) { if (isMV) { msg.append("cannot contain subquery sources."); } else { msg.append("cannot contain subqueries."); } return false; } else if (hasUserDefinedFunctionExpression()) { msg.append("cannot contain calls to user defined functions."); return false; } else { return true; } }

Target:
public boolean isValidExprForIndexesAndMVs(StringBuffer msg, boolean isMV) { final int invalidFunctionId = containsFunctionByIds(INVALID_FUNCTIONS_FOR_IDXS_AND_MVS); if (invalidFunctionId != -1) { if (invalidFunctionId == FunctionSQL.voltGetCurrentTimestampId()) { msg.append("cannot include the function NOW or CURRENT_TIMESTAMP."); return false; } else if (invalidFunctionId == FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_STR) { msg.append("cannot include the function STR."); return false; } else { assert false; return false; } } else if (hasAnySubexpressionOfClass(AggregateExpression.class)) { msg.append("cannot contain aggregate expressions."); return false; } else if (hasAnySubexpressionOfClass(AbstractSubqueryExpression.class)) { if (isMV) { msg.append("cannot contain subquery sources."); } else { msg.append("cannot contain subqueries."); } return false; } else if (hasUserDefinedFunctionExpression()) { msg.append("cannot contain calls to user defined functions."); return false; } else { return true; } }
Source:
public void testGetCompletionTimesTwoFragmentInteractionP2PSync() { Trace trace1 = new Trace(); trace1.setId("1_2ip2psync"); trace1.setStartTime(System.currentTimeMillis() - 60000); Consumer c1 = new Consumer(); c1.setUri("testuri"); c1.setDuration(TimeUnit.NANOSECONDS.convert(5000, TimeUnit.MILLISECONDS)); trace1.getNodes().add(c1); Producer p1 = new Producer(); p1.setUri("testuri2"); p1.setBaseTime(TimeUnit.NANOSECONDS.convert(500, TimeUnit.MILLISECONDS)); p1.setDuration(TimeUnit.NANOSECONDS.convert(4000, TimeUnit.MILLISECONDS)); p1.addInteractionCorrelationId("cid1_2ip2psync"); c1.getNodes().add(p1); Trace trace2 = new Trace(); trace2.setId("2_2ip2psync"); trace2.setStartTime(trace1.getStartTime() + 2000); Consumer c2 = new Consumer(); c2.setUri("testuri2"); c2.setDuration(TimeUnit.NANOSECONDS.convert(1000, TimeUnit.MILLISECONDS)); c2.addInteractionCorrelationId("cid1_2ip2psync"); trace2.getNodes().add(c2); try { publisher.publish(null, Arrays.asList(trace1, trace2)); } catch (Exception e1) { fail("Failed to store: " + e1); } Wait.until(() -> service.searchFragments(null, new Criteria()).size() == 2); Wait.until(() -> analytics.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<CompletionTime> times = analytics.getTraceCompletionTimes(null, new Criteria()); assertNotNull(times); assertEquals(1, times.size()); assertEquals(5000, times.get(0).getDuration()); }

Target:
public void testGetCompletionTimesTwoFragmentInteractionP2PSync() throws Exception { Trace trace1 = new Trace(); trace1.setId("1_2ip2psync"); trace1.setStartTime(System.currentTimeMillis() - 60000); Consumer c1 = new Consumer(); c1.setUri("testuri"); c1.setDuration(TimeUnit.NANOSECONDS.convert(5000, TimeUnit.MILLISECONDS)); trace1.getNodes().add(c1); Producer p1 = new Producer(); p1.setUri("testuri2"); p1.setBaseTime(TimeUnit.NANOSECONDS.convert(500, TimeUnit.MILLISECONDS)); p1.setDuration(TimeUnit.NANOSECONDS.convert(4000, TimeUnit.MILLISECONDS)); p1.addInteractionCorrelationId("cid1_2ip2psync"); c1.getNodes().add(p1); Trace trace2 = new Trace(); trace2.setId("2_2ip2psync"); trace2.setStartTime(trace1.getStartTime() + 2000); Consumer c2 = new Consumer(); c2.setUri("testuri2"); c2.setDuration(TimeUnit.NANOSECONDS.convert(1000, TimeUnit.MILLISECONDS)); c2.addInteractionCorrelationId("cid1_2ip2psync"); trace2.getNodes().add(c2); publisher.publish(null, Arrays.asList(trace1, trace2)); Wait.until(() -> service.searchFragments(null, new Criteria()).size() == 2); Wait.until(() -> analytics.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<CompletionTime> times = analytics.getTraceCompletionTimes(null, new Criteria()); assertNotNull(times); assertEquals(1, times.size()); assertEquals(5000, times.get(0).getDuration()); }
Source:
protected void executeCommand() { StoragePoolIsoMap map = loadStoragePoolIsoMap(); changeDomainStatusWithCompensation(map, StorageDomainStatus.Unknown, StorageDomainStatus.Locked, getCompensationContext()); if (shouldPerformOvfUpdate()) { ActionReturnValue returnValue = runInternalAction(ActionType.UpdateOvfStoreForStorageDomain, createUpdateOvfStoreParams(), cloneContext().withoutCompensationContext()); if (!returnValue.getSucceeded()) { return; } } if (noAsyncOperations()) { executeDeactivateCommand(); } setSucceeded(true); }

Target:
protected void executeCommand() { StoragePoolIsoMap map = loadStoragePoolIsoMap(); changeDomainStatusWithCompensation(map, StorageDomainStatus.Unknown, StorageDomainStatus.Locked, getCompensationContext()); if (shouldPerformOvfUpdate()) { ActionReturnValue returnValue = runInternalAction(ActionType.UpdateOvfStoreForStorageDomain, createUpdateOvfStoreParams(), cloneContext().withoutCompensationContext()); if (!returnValue.getSucceeded()) { getReturnValue().getValidationMessages().addAll(returnValue.getValidationMessages()); getReturnValue().getExecuteFailedMessages().addAll(returnValue.getExecuteFailedMessages()); return; } } if (noAsyncOperations()) { executeDeactivateCommand(); } setSucceeded(true); }
Source:
public void testGetItemId() { Long expected = CoreArtifactTokens.OseeTypesFolder.getId(); Long actual = item.getItemId().getId(); assertEquals(expected, actual); }

Target:
public void testGetItemId() { assertEquals(CoreArtifactTokens.OseeTypesFolder, item.getItemId()); }
Source:
protected void changeParamgumentName(ParameterInfo info) { VariableDeclaration param= getParameter(info.getOldIndex()); if (!info.getOldName().equals(param.getName().getIdentifier())) return; String msg= RefactoringCoreMessages.ChangeSignatureRefactoring_update_parameter_references; TextEditGroup description= fCuRewrite.createGroupDescription(msg); TempOccurrenceAnalyzer analyzer= new TempOccurrenceAnalyzer(param, false); analyzer.perform(); SimpleName[] paramOccurrences= analyzer.getReferenceAndDeclarationNodes(); for (SimpleName occurence : paramOccurrences) { getASTRewrite().set(occurence, SimpleName.IDENTIFIER_PROPERTY, info.getNewName(), description); } }

Target:
protected void changeParamgumentName(ParameterInfo info) { VariableDeclaration param= getParameter(info.getOldIndex()); if (!info.getOldName().equals(param.getName().getIdentifier())) return; String msg= RefactoringCoreMessages.ChangeSignatureRefactoring_update_parameter_references; TextEditGroup description= fCuRewrite.createGroupDescription(msg); TempOccurrenceAnalyzer analyzer= new TempOccurrenceAnalyzer(param, false); analyzer.perform(); for (SimpleName occurrence : analyzer.getReferenceAndDeclarationNodes()) { getASTRewrite().set(occurrence, SimpleName.IDENTIFIER_PROPERTY, info.getNewName(), description); } }
Source:
public void shouldGetAllGatewayAccounts() { when(getMockGatewayAccountEntity1.getType()).thenReturn("test"); when(getMockGatewayAccountEntity2.getType()).thenReturn("test"); when(mockGatewayAccountDao.listAll()).thenReturn(Arrays.asList(getMockGatewayAccountEntity1, getMockGatewayAccountEntity2)); List<GatewayAccountResourceDTO> gatewayAccounts = gatewayAccountService.getAllGatewayAccounts(); assertThat(gatewayAccounts, hasSize(2)); }

Target:
public void shouldGetAllGatewayAccounts() { when(mockGatewayAccountDao.listAll()).thenReturn(Arrays.asList(getMockGatewayAccountEntity1, getMockGatewayAccountEntity2)); List<GatewayAccountResourceDTO> gatewayAccounts = gatewayAccountService.getAllGatewayAccounts(); assertThat(gatewayAccounts, hasSize(2)); assertThat(gatewayAccounts.get(0).getServiceName(), is("service one")); assertThat(gatewayAccounts.get(1).getServiceName(), is("service two")); }
Source:
private void releaseExternally() { if (state == State.ALLOCATED && requestedLogicalSlots.values().isEmpty()) { externalReleaseCallback.accept(executionSlotSharingGroup); state = State.RELEASED; } }

Target:
private void releaseExternally() { if (state == State.ALLOCATED && requestedLogicalSlots.values().isEmpty()) { state = State.RELEASED; externalReleaseCallback.accept(executionSlotSharingGroup); } }
Source:
public Map<String, Map<String, Session>> loadSessions() { checkValidity(); return null; }

Target:
public Map<String, Map<String, Session>> loadSessions() { checkValidity(); return new ConcurrentHashMap<>(); }
Source:
private DefaultPreparedStatement cache(DefaultPreparedStatement preparedStatement) { DefaultPreparedStatement previous = preparedStatementsCache.putIfAbsent(preparedStatement.getId(), preparedStatement); if (previous != null) { LOG.warn( "Re-preparing already prepared query. " + "This is generally an anti-pattern and will likely affect performance. " + "The cached version of the PreparedStatement will be returned which may have a " + "different base Statement configuration than the base Statement that was prepared. " + "Consider preparing the statement only once. Query='{}'", preparedStatement.getQuery()); return previous; } else { return preparedStatement; } }

Target:
private DefaultPreparedStatement cache(DefaultPreparedStatement preparedStatement) { DefaultPreparedStatement previous = preparedStatementsCache.putIfAbsent(preparedStatement.getId(), preparedStatement); if (previous != null) { LOG.warn( "Re-preparing already prepared query. " + "This is generally an anti-pattern and will likely affect performance. " + "The cached version of the PreparedStatement will be returned, which may use " + "different bound statement execution parameters (CL, timeout, etc.) from the " + "current session.prepare call. Consider preparing the statement only once. " + "Query='{}'", preparedStatement.getQuery()); return previous; } else { return preparedStatement; } }
Source:
public synchronized void pauseJob(final String groupName) throws SchedulerException { if (!ifJobExist(groupName)) { logger.warn("can not find job with " + groupName + " in quartz."); } else { this.scheduler.pauseJob(new JobKey(DEFAULT_JOB_NAME, groupName)); } }

Target:
public synchronized void pauseJob(final String groupName) throws SchedulerException { if (!ifJobExist(groupName)) { throw new SchedulerException("can not find job with group name: " + groupName + " in quartz."); } else { this.scheduler.pauseJob(new JobKey(DEFAULT_JOB_NAME, groupName)); } }
Source:
private ImageTicket getTestTicket() { ImageTicket ticket = new ImageTicket(); ticket.setId(Guid.createGuidFromString("799030aa-97c3-4354-871e-0adf0556fcbf")); ticket.setSize(1073741824L); ticket.setUrl("file:/ ticket.setTimeout(300); ticket.setOps(new String[]{"read", "write"}); return ticket; }

Target:
private ImageTicket getTestTicket() { ImageTicket ticket = new ImageTicket(); ticket.setId(Guid.createGuidFromString("799030aa-97c3-4354-871e-0adf0556fcbf")); ticket.setSize(1073741824L); ticket.setUrl("https://server:port/imageio/799030aa-97c3-4354-871e-0adf0556fcbf"); ticket.setTimeout(300); ticket.setOps(new String[]{"read", "write"}); return ticket; }
Source:
public static void main(String[] args) throws IOException { System.out.println("Copying rsdl.xml, rsdl_gluster.xml to: " + args[0]); copyRsdl(args[0]); }

Target:
public static void main(String[] args) throws IOException { System.out.println("Copying rsdl.xml, rsdl_gluster.xml, api.xsd to: " + args[0]); copyRsdl(args[0]); }
Source:
public boolean checkUsable() { var optionalVersionMessage = attemptHandshakeForVersionMessage(); handleHandshakeAttempt(optionalVersionMessage); return isUsable().get(); }

Target:
private void checkUsable() { var optionalVersionMessage = attemptHandshakeForVersionMessage(); handleHandshakeAttempt(optionalVersionMessage); }
Source:
public static void main(String[] args) throws Exception { FProtocolFactory protocolFactory = new FProtocolFactory(new TBinaryProtocol.Factory()); ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(); Connection connection = connectionFactory.createConnection(); connection.start(); FSubscriberTransportFactory subscriberFactory = new FJmsSubscriberTransport.Factory(connection, "Consumer.frugal-examples.VirtualTopic.", true); FScopeProvider provider = new FScopeProvider(null, subscriberFactory, protocolFactory); AlbumWinnersSubscriber.Iface subscriber = new AlbumWinnersSubscriber.Client(provider); subscriber.subscribeWinner((ctx, album) -> System.out.println("You won! " + album)); subscriber.subscribeContestStart((ctx, albums) -> System.out.println("Contest started, available albums: " + albums)); System.out.println("Subscriber started..."); }

Target:
public static void main(String[] args) throws Exception { FProtocolFactory protocolFactory = new FProtocolFactory(new TBinaryProtocol.Factory()); ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(); Connection connection = connectionFactory.createConnection(); connection.start(); FSubscriberTransportFactory subscriberFactory = new FJmsSubscriberTransport.Factory.Builder(connection).build(); FScopeProvider provider = new FScopeProvider(null, subscriberFactory, protocolFactory); AlbumWinnersSubscriber.Iface subscriber = new AlbumWinnersSubscriber.Client(provider); subscriber.subscribeWinner((ctx, album) -> System.out.println("You won! " + album)); subscriber.subscribeContestStart((ctx, albums) -> System.out.println("Contest started, available albums: " + albums)); System.out.println("Subscriber started..."); }
Source:
HashMap<String, Object> removeFromList(Model model, @PathVariable String profileIdentifier) throws Exception { logger.info("Attempting to remove {}", profileIdentifier); String[] toRemove = profileIdentifier.split(","); for( int i = 0; i < toRemove.length; i++ ) { Integer profileId = ControllerUtils.convertProfileIdentifier(toRemove[i]); logger.info("Want to (preRemove) DELETE on id {}", profileId); profileService.remove(profileId); } return Utils.getJQGridJSON(profileService.findAllProfiles(), "profiles"); }

Target:
HashMap<String, Object> removeFromList(Model model, @PathVariable String profileIdentifier) throws Exception { Integer profileId = ControllerUtils.convertProfileIdentifier(profileIdentifier); logger.info("Want to (preRemove) DELETE on id {}", profileId); profileService.remove(profileId); return Utils.getJQGridJSON(profileService.findAllProfiles(), "profiles"); }
Source:
public void onMapReady(final GoogleMap map) { mMap = map; LatLngBounds.Builder builder = new LatLngBounds.Builder(); for (Pair<Entity<TreeReference>, LatLng> entityLocation: entityLocations) { Marker marker = map.addMarker(new MarkerOptions() .position(entityLocation.second) .title(entityLocation.first.getFieldString(0)) .snippet(entityLocation.first.getFieldString(1))); markerReferences.put(marker, entityLocation.first.getElement()); builder.include(entityLocation.second); } final LatLngBounds bounds = builder.build(); map.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() { @Override public void onMapLoaded() { map.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, MAP_PADDING)); } }); map.setOnInfoWindowClickListener(this); if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) { map.setMyLocationEnabled(true); } }

Target:
public void onMapReady(final GoogleMap map) { mMap = map; if (entityLocations.size() > 0) { LatLngBounds.Builder builder = new LatLngBounds.Builder(); for (Pair<Entity<TreeReference>, LatLng> entityLocation : entityLocations) { Marker marker = mMap.addMarker(new MarkerOptions() .position(entityLocation.second) .title(entityLocation.first.getFieldString(0)) .snippet(entityLocation.first.getFieldString(1))); markerReferences.put(marker, entityLocation.first.getElement()); builder.include(entityLocation.second); } final LatLngBounds bounds = builder.build(); mMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() { @Override public void onMapLoaded() { mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, MAP_PADDING)); } }); } mMap.setOnInfoWindowClickListener(this); if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) { mMap.setMyLocationEnabled(true); } }
Source:
public long getLastModified() { long lastMod = -1; for (Iterator<Path> i = dirIterator(); i.hasNext(); ) { Path dir = i.next(); try { for (FileStatus st : fileSystem.listStatus(dir)) { if (lastMod < st.getModificationTime()) { lastMod = st.getModificationTime(); } } } catch (IOException e) { throw new DatasetIOException("Cannot find last modified time of of " + dir, e); } } long viewModified = unbounded.getLastModified(); if (lastMod < viewModified) { lastMod = viewModified; } return lastMod; }

Target:
public long getLastModified() { return unbounded.getLastModified(); }
Source:
private ImportTestFilesAndData prepareTestFiles() throws Throwable { Configuration defaultConf = new Configuration(); Path tempFile = new Path("target/accumulo-test/import/sample.rf"); Path failures = new Path("target/accumulo-test/failures/"); FileSystem fs = FileSystem.get(new URI("file:/ fs.deleteOnExit(tempFile); fs.deleteOnExit(failures); fs.delete(failures, true); fs.delete(tempFile, true); fs.mkdirs(failures); fs.mkdirs(tempFile.getParent()); FileSKVWriter writer = FileOperations.getInstance().openWriter().ofFile(tempFile.toString(), fs, defaultConf) .withTableConfiguration(AccumuloConfiguration.getDefaultConfiguration()).execute(); writer.startDefaultLocalityGroup(); List<Pair<Key,Value>> keyVals = new ArrayList<Pair<Key,Value>>(); for (int i = 0; i < 5; i++) { keyVals.add(new Pair<Key,Value>(new Key("a" + i, "b" + i, "c" + i, new ColumnVisibility(""), 1000l + i), new Value(Integer.toString(i).getBytes()))); } for (Pair<Key,Value> keyVal : keyVals) { writer.append(keyVal.getFirst(), keyVal.getSecond()); } writer.close(); ImportTestFilesAndData files = new ImportTestFilesAndData(); files.failurePath = failures; files.importPath = tempFile.getParent(); files.keyVals = keyVals; return files; }

Target:
private ImportTestFilesAndData prepareTestFiles() throws Throwable { Configuration defaultConf = new Configuration(); Path tempFile = new Path("target/accumulo-test/import/sample.rf"); Path failures = new Path("target/accumulo-test/failures/"); FileSystem fs = FileSystem.get(new URI("file:/ fs.deleteOnExit(tempFile); fs.deleteOnExit(failures); fs.delete(failures, true); fs.delete(tempFile, true); fs.mkdirs(failures); fs.mkdirs(tempFile.getParent()); FileSKVWriter writer = FileOperations.getInstance().newWriterBuilder().forFile(tempFile.toString(), fs, defaultConf) .withTableConfiguration(AccumuloConfiguration.getDefaultConfiguration()).build(); writer.startDefaultLocalityGroup(); List<Pair<Key,Value>> keyVals = new ArrayList<Pair<Key,Value>>(); for (int i = 0; i < 5; i++) { keyVals.add(new Pair<Key,Value>(new Key("a" + i, "b" + i, "c" + i, new ColumnVisibility(""), 1000l + i), new Value(Integer.toString(i).getBytes()))); } for (Pair<Key,Value> keyVal : keyVals) { writer.append(keyVal.getFirst(), keyVal.getSecond()); } writer.close(); ImportTestFilesAndData files = new ImportTestFilesAndData(); files.failurePath = failures; files.importPath = tempFile.getParent(); files.keyVals = keyVals; return files; }
Source:
private void validate(Schema inputSchema) { Schema.Field field = inputSchema.getField(inputCol); if (field == null) { throw new IllegalArgumentException(String.format("Input column %s does not exist in the input schema", inputCol)); } Schema schema = field.getSchema(); Schema.Type type = schema.isNullable() ? schema.getNonNullable().getType() : schema.getType(); if (!(type.equals(Schema.Type.STRING) || type.equals(Schema.Type.BOOLEAN) || (type.equals(Schema.Type.ARRAY) && (schema.getComponentSchema().getType().equals(Schema.Type.STRING) || schema.getComponentSchema().getType().equals(Schema.Type.BOOLEAN))))) { throw new IllegalArgumentException(String.format("Input column can be of type string, boolean or array of " + "string or boolean. But was %s for %s.", type, inputCol)); } }

Target:
public void validate(Schema inputSchema) { SparkUtils.validateTextField(inputSchema, inputCol); try { Pattern.compile(pattern); } catch (PatternSyntaxException e) { throw new IllegalArgumentException(String.format("Invalid expression - %s. Please provide a valid pattern " + "for splitting the string. %s.", pattern, e.getMessage()), e); } validateConfigParameters("vector size", vectorSize); validateConfigParameters("minimum count", minCount); validateConfigParameters("number of partitions", numPartitions); validateConfigParameters("number of iterations", numIterations); validateConfigParameters("window size", windowSize); }
Source:
private final byte[] buildTREBytes() { String result; String defaltEncoding = System.getProperty("file.encoding"); Charset defaultCharset = Charset.forName(defaltEncoding); Charset iso88591charset = Charset.forName("ISO-8859-1"); ByteBuffer inputBuffer = ByteBuffer.wrap(mTestDataGzip.getBytes()); CharBuffer data = defaultCharset.decode(inputBuffer); ByteBuffer outputBuffer = iso88591charset.encode(data); byte[] outputData = outputBuffer.array(); byte[] gzipped = new byte[outputData.length + secuirtyGzipped.length]; System.arraycopy(outputData, 0, gzipped, 0, outputData.length); System.arraycopy(secuirtyGzipped, 0, gzipped, outputData.length, secuirtyGzipped.length); return gzipped; }

Target:
private final byte[] buildTREBytes() { String result; ByteBuffer inputBuffer = ByteBuffer.wrap(mTestDataGzip.getBytes()); CharBuffer data = StandardCharsets.UTF_8.decode(inputBuffer); ByteBuffer outputBuffer = StandardCharsets.ISO_8859_1.encode(data); byte[] outputData = outputBuffer.array(); byte[] gzipped = new byte[outputData.length + securityGzipped.length]; System.arraycopy(outputData, 0, gzipped, 0, outputData.length); System.arraycopy(securityGzipped, 0, gzipped, outputData.length, securityGzipped.length); return gzipped; }
Source:
public PartitionUpsertMetadataManager getOrCreatePartitionManager(int partitionId) { return _partitionMetadataManagerMap .computeIfAbsent(partitionId, k -> new PartitionUpsertMetadataManager(_tableName, partitionId, _serverMetrics)); }

Target:
public PartitionUpsertMetadataManager getOrCreatePartitionManager(int partitionId) { return _partitionMetadataManagerMap.computeIfAbsent(partitionId, k -> new PartitionUpsertMetadataManager(_tableNameWithType, k, _serverMetrics)); }
Source:
public SolutionFileIO<TspSolution> createSolutionFileIO() { return new TspXStreamSolutionFileIO(); }

Target:
public SolutionFileIO<TspSolution> createSolutionFileIO() { return new XStreamSolutionFileIO<>(TspSolution.class); }