auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static FileSystem write(final FileSystem fs, final Path path, final Iterable<? extends CharSequence> lines, final Charset cs) throws IOException { Objects.requireNonNull(path); Objects.requireNonNull(lines); Objects.requireNonNull(cs); CharsetEncoder encoder = cs.newEncoder(); try (FSDataOutputStream out = fs.create(path); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, encoder))) { for (CharSequence line : lines) { writer.append(line); writer.newLine(); } } return fs; }

Target:
public static FileSystem write(final FileSystem fs, final Path path, final Iterable<? extends CharSequence> lines, final Charset cs) throws IOException { Objects.requireNonNull(path); Objects.requireNonNull(lines); Objects.requireNonNull(cs); CharsetEncoder encoder = cs.newEncoder(); try (FSDataOutputStream out = fs.createFile(path).overwrite(true).build(); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, encoder))) { for (CharSequence line : lines) { writer.append(line); writer.newLine(); } } return fs; }
Source:
IRemoteAndroidTestRunner createRemoteAndroidTestRunner(String packageName, String runnerName, IDevice device) throws DeviceNotAvailableException { RemoteAndroidTestRunner runner = new DefaultRemoteAndroidTestRunner(packageName, runnerName, device); String abiName = resolveAbiName(); String runOptions = ""; if (!mHiddenApiChecks && getDevice().getApiLevel() >= 28) { runOptions += "--no-hidden-api-checks "; } if (!mIsolatedStorage && getDevice().checkApiLevelAgainstNextRelease(29)) { runOptions += "--no-isolated-storage "; } if (!mWindowAnimation && getDevice().checkApiLevelAgainstNextRelease(14)) { runOptions += "--no-window-animation "; } if (abiName != null) { mInstallArgs.add(String.format("--abi %s", abiName)); runOptions += String.format("--abi %s", abiName); } if (!runOptions.isEmpty()) { runner.setRunOptions(runOptions); } runner.setEnforceTimeStamp(mShouldEnforceFormat); return runner; }

Target:
IRemoteAndroidTestRunner createRemoteAndroidTestRunner(String packageName, String runnerName, IDevice device) throws DeviceNotAvailableException { RemoteAndroidTestRunner runner = new DefaultRemoteAndroidTestRunner(packageName, runnerName, device); String abiName = resolveAbiName(); String runOptions = ""; int apiLevel = getDevice().getApiLevel(); if (!mHiddenApiChecks && apiLevel >= 28) { runOptions += "--no-hidden-api-checks "; } if (!mIsolatedStorage && getDevice().checkApiLevelAgainstNextRelease(29)) { runOptions += "--no-isolated-storage "; } if (!mWindowAnimation && apiLevel >= 14) { runOptions += "--no-window-animation "; } if (abiName != null) { mInstallArgs.add(String.format("--abi %s", abiName)); runOptions += String.format("--abi %s", abiName); } if (!runOptions.isEmpty()) { runner.setRunOptions(runOptions); } runner.setEnforceTimeStamp(mShouldEnforceFormat); return runner; }
Source:
public void testGetCSR() throws Exception { keyCodec.writePublicKey(publicKey); keyCodec.writePrivateKey(privateKey); PKCS10CertificationRequest csr = service.getCSR(client, conf); Assert.assertNotNull(csr); csr = service.getCSR(client, conf); Assert.assertNotNull(csr); csr = service.getCSR(client, conf); Assert.assertNotNull(csr); csr = service.getCSR(client, conf); Assert.assertNotNull(csr); }

Target:
public void testGetCSR() throws Exception { keyCodec.writePublicKey(publicKey); keyCodec.writePrivateKey(privateKey); service.setCertificateClient(client); PKCS10CertificationRequest csr = service.getCSR(conf); Assert.assertNotNull(csr); csr = service.getCSR(conf); Assert.assertNotNull(csr); csr = service.getCSR(conf); Assert.assertNotNull(csr); csr = service.getCSR(conf); Assert.assertNotNull(csr); }
Source:
public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if(getContext()!=null){ if(Utils.isNetworkConnected(getContext())){ Call<Search> call = apiClient.getTotalProductCount(); call.enqueue(new Callback<Search>() { @Override public void onResponse(Call<Search> call, Response<Search> response) { textHome.setText("Open Food Facts is an open database of more than "+response.body().getCount()+" food products (plus the ones you'll contribute) with ingredients, allergens, nutrition facts and all the tidbits of information we can find on product labels."); } @Override public void onFailure(Call<Search> call, Throwable t) { textHome.setText(R.string.txtHome); } }); } else { textHome.setText(R.string.txtHome); } } }

Target:
public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if(getContext()!=null){ if(Utils.isNetworkConnected(getContext())){ Call<Search> call = apiClient.getTotalProductCount(); call.enqueue(new Callback<Search>() { @Override public void onResponse(Call<Search> call, Response<Search> response) { String txtHomeOnline = getResources().getString(R.string.txtHomeOnline); int totalProductCount = Integer.parseInt(response.body().getCount()); textHome.setText(String.format(txtHomeOnline,totalProductCount)); } @Override public void onFailure(Call<Search> call, Throwable t) { textHome.setText(R.string.txtHome); } }); } else { textHome.setText(R.string.txtHome); } } }
Source:
public ExtensionManagerBus create(final CreationalContext< ExtensionManagerBus > ctx) { final ExtensionManagerBus instance = injectionTarget.produce(ctx); if ("true".equals(SystemPropertyAction.getProperty("org.apache.cxf.cdi.useCdiUnwrapper", "true"))) { instance.setProperty(ClassUnwrapper.class.getName(), new CdiClassUnwrapper()); } BusFactory.possiblySetDefaultBus(instance); instance.initialize(); injectionTarget.inject(instance, ctx); injectionTarget.postConstruct(instance); return instance; }

Target:
public ExtensionManagerBus create(final CreationalContext< ExtensionManagerBus > ctx) { final ExtensionManagerBus instance = injectionTarget.produce(ctx); if ("true".equals(SystemPropertyAction.getProperty("org.apache.cxf.cdi.unwrap.proxies", "true"))) { instance.setProperty(ClassUnwrapper.class.getName(), new CdiClassUnwrapper()); } BusFactory.possiblySetDefaultBus(instance); instance.initialize(); injectionTarget.inject(instance, ctx); injectionTarget.postConstruct(instance); return instance; }
Source:
public void testIscsiLunCannotBeAddedIfAddingFloatingDisk() { LunDisk disk = createISCSILunDisk(ScsiGenericIO.UNFILTERED, true, DiskInterface.IDE); AddDiskParameters parameters = createParameters(); parameters.setDiskInfo(disk); initializeCommand(Guid.newGuid(), parameters); assertFalse("Floating disk with SCSI reservation set successfully added", command.checkIfLunDiskCanBeAdded(spyDiskValidator(disk))); assertTrue(command.getReturnValue() .getCanDoActionMessages() .contains(VdcBllMessages.ACTION_TYPE_FAILED_SCSI_RESERVATION_NOT_VALID_FOR_FLOATING_DISK.toString())); }

Target:
public void testIscsiLunCannotBeAddedIfAddingFloatingDisk() { LunDisk disk = createISCSILunDisk(ScsiGenericIO.UNFILTERED, true, DiskInterface.IDE); AddDiskParameters parameters = createParameters(); parameters.setDiskInfo(disk); initializeCommand(Guid.newGuid(), parameters); assertFalse("Floating disk with SCSI reservation set successfully added", command.checkIfLunDiskCanBeAdded(spyDiskValidator(disk))); verifyCanDoActionMessagesContainMessage(VdcBllMessages.ACTION_TYPE_FAILED_SCSI_RESERVATION_NOT_VALID_FOR_FLOATING_DISK); }
Source:
public void parseBasicEvent() throws Exception { GCModel model = getGCModelFromLogFile("SampleShenandoahBasic.txt"); assertThat("size", model.size(), is(5)); assertThat("amount of STW GC pause types", model.getGcEventPauses().size(), is(2)); assertThat("amount of STW Full GC pause types", model.getFullGcEventPauses().size(), is(0)); assertThat("amount of concurrent pause types", model.getConcurrentEventPauses().size(), is(3)); assertThat("total pause time", model.getPause().getSum(), is(0.001318)); assertThat("gc pause time", model.getGCPause().getSum(), is(0.001318)); assertThat("full gc pause time", model.getFullGCPause().getSum(), is(0.0)); assertThat("heap size after concurrent cycle", model.getPostConcurrentCycleHeapUsedSizes().getMax(), is(33 * 1024)); assertThat("max memory freed during STW pauses", model.getFreedMemoryByGC().getMax(), is(34 * 1024)); }

Target:
public void parseBasicEvent() throws Exception { GCModel model = getGCModelFromLogFile("SampleShenandoahBasic.txt"); assertThat("size", model.size(), is(5)); assertThat("amount of STW GC pause types", model.getGcEventPauses().size(), is(2)); assertThat("amount of STW Full GC pause types", model.getFullGcEventPauses().size(), is(0)); assertThat("amount of concurrent pause types", model.getConcurrentEventPauses().size(), is(3)); assertThat("total pause time", model.getPause().getSum(), closeTo(0.001318, 0.000001)); assertThat("gc pause time", model.getGCPause().getSum(), closeTo(0.001318, 0.000001)); assertThat("full gc pause time", model.getFullGCPause().getSum(), is(0.0)); assertThat("heap size after concurrent cycle", model.getPostConcurrentCycleHeapUsedSizes().getMax(), is(33 * 1024)); assertThat("max memory freed during STW pauses", model.getFreedMemoryByGC().getMax(), is(34 * 1024)); }
Source:
private void logTransferBytes(File[] files){ long bytes = 0; for (File file : files) { if (!isSupportedFiletype(file)) { continue; } bytes += file.length(); } Log.d(TAG, "Storing " + bytes + " form bytes"); }

Target:
private static void logTransferBytes(File[] files){ long bytes = 0; for (File file : files) { if (!isSupportedFiletype(file)) { continue; } bytes += file.length(); } Log.d(TAG, "Storing " + bytes + " form bytes"); }
Source:
public @Nullable static <F> F[] purgeUnwantedElements(F[] fileArray, Predicate<F> predicate) { List<F> files = new LinkedList<>(Arrays.asList(fileArray)); Iterator<F> iterator = files.iterator(); boolean removed = false; while (iterator.hasNext()) { F next = iterator.next(); if (predicate.test(next)) { iterator.remove(); removed = true; } } if (!removed) { return fileArray; } else if (files.size() == 0) { return null; } else { return toGenericArray(files); } }

Target:
public static <F> F[] purgeUnwantedElements(F[] fileArray, Predicate<F> predicate) { if (ObjectUtils.isEmpty(fileArray)) { return fileArray; } else { return Arrays.stream(fileArray) .filter(predicate.negate()) .toArray(size -> (F[]) Array.newInstance(fileArray[0].getClass(), size)); } }
Source:
public String getAlias() { if (alias == null) { return null; } return alias; }

Target:
public String getAlias() { return alias; }
Source:
protected S getNext() { S next = super.getNext(); if (next != null) { for (KeyWatchingCompletionListener keyWatchingCompletionListener : completionListeners) { keyWatchingCompletionListener.valueIterated(next); } } else { completionListeners.forEach(KeyWatchingCompletionListener::completed); } return next; }

Target:
protected S getNext() { S next = super.getNext(); if (next != null) { completionRehashPublisherDecorator.valueIterated(next); } else { completionRehashPublisherDecorator.complete(); } return next; }
Source:
public void testSetCheckpointWhenModified() throws Exception { CouchDB mockRemoteDb = mock(CouchDB.class); when(mockRemoteDb.changes((PullFilter) null, "9-d9e5b0147af143e5b6d1979378ad957b", 1000)).then(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { FileReader fr = new FileReader(TestUtils.loadFixture ("fixture/empty_changes.json")); return JSONUtils.fromJson(fr, ChangesResult.class); } }); when(mockRemoteDb.exists()).thenReturn(true); DatastoreWrapper mockLocalDb = mock(DatastoreWrapper.class); when(mockLocalDb.getCheckpoint(any(String.class))).thenReturn("9" + "-d9e5b0147af143e5b6d1979378ad957b"); StrategyListener mockListener = mock(StrategyListener.class); PullStrategy pullStrategy = super.getPullStrategy(); pullStrategy.sourceDb = mockRemoteDb; pullStrategy.targetDb = mockLocalDb; pullStrategy.getEventBus().register(mockListener); pullStrategy.run(); verify(mockListener).complete(any(ReplicationStrategyCompleted.class)); verify(mockListener, never()).error(any(ReplicationStrategyErrored.class)); verify(mockLocalDb).putCheckpoint(anyString(), eq("10-d9e5b0147af143e5b6d1979378ad957b")); }

Target:
public void testSetCheckpointWhenModified() throws Exception { try { CouchDB mockRemoteDb = mock(CouchDB.class); when(mockRemoteDb.changes((PullFilter) null, "9-d9e5b0147af143e5b6d1979378ad957b", 1000)).then(new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { FileReader fr = new FileReader(TestUtils.loadFixture ("fixture/empty_changes.json")); return JSONUtils.fromJson(fr, ChangesResult.class); } }); when(mockRemoteDb.exists()).thenReturn(true); DatastoreWrapper mockLocalDb = mock(DatastoreWrapper.class); when(mockLocalDb.getCheckpoint(any(String.class))).thenReturn("9" + "-d9e5b0147af143e5b6d1979378ad957b"); StrategyListener mockListener = mock(StrategyListener.class); PullStrategy pullStrategy = super.getPullStrategy(); pullStrategy.sourceDb = mockRemoteDb; pullStrategy.targetDb = mockLocalDb; pullStrategy.getEventBus().register(mockListener); pullStrategy.run(); verify(mockListener).complete(any(ReplicationStrategyCompleted.class)); verify(mockListener, never()).error(any(ReplicationStrategyErrored.class)); verify(mockLocalDb).putCheckpoint(anyString(), eq("10" + "-d9e5b0147af143e5b6d1979378ad957b")); } catch (UnsupportedOperationException uoe) { assumeNoException("Cannot proxy DatastoreWrapper on Dalvik", uoe); } }
Source:
private void augmentDirectoryWithAsyncDeletes(org.infinispan.lucene.directory.BuildContext directoryBuildContext) { Executor executor = deletesExecutor.getExecutor(); try { Method operationsExecutor = directoryBuildContext.getClass().getMethod( "deleteOperationsExecutor", Executor.class ); operationsExecutor.invoke( directoryBuildContext, executor ); } catch (NoSuchMethodException e) { log.notSettingAsyncDeletes(); } catch (InvocationTargetException e) { log.notSettingAsyncDeletes(); } catch (IllegalAccessException e) { log.notSettingAsyncDeletes(); } }

Target:
private void augmentDirectoryWithAsyncDeletes(org.infinispan.lucene.directory.BuildContext directoryBuildContext) { Executor executor = deletesExecutor.getExecutor(); try { Method operationsExecutor = directoryBuildContext.getClass().getMethod( "deleteOperationsExecutor", Executor.class ); operationsExecutor.invoke( directoryBuildContext, executor ); } catch (NoSuchMethodException e) { log.asyncDeletesNotSupported(); } catch (InvocationTargetException e) { log.asyncDeletesInvocationError( e.getMessage() ); } catch (IllegalAccessException e) { log.asyncDeletesIllegalAccess( e.getMessage() ); } }
Source:
private static FileSystem getCachedHttpFileSystem(final Configuration conf, final AzkabanCommonModuleConfig azConfig) { if (azConfig.getOriginDependencyRootUri() == null) return null; else validateURI(azConfig.getOriginDependencyRootUri(), CHTTP_SCHEME); try { return FileSystem.get(azConfig.getOriginDependencyRootUri(), conf); } catch (final IOException e) { log.error("Unable to initialize CachedHttpFileSystem.", e); throw new AzkabanException(e); } }

Target:
private static FileSystem getCachedHttpFileSystem(final Configuration conf, final AzkabanCommonModuleConfig azConfig) { if (azConfig.getOriginDependencyRootUri() == null) { return null; } validateURI(azConfig.getOriginDependencyRootUri(), CHTTP_SCHEME, true); try { return FileSystem.get(azConfig.getOriginDependencyRootUri(), conf); } catch (final IOException e) { log.error("Unable to initialize CachedHttpFileSystem.", e); throw new AzkabanException(e); } }
Source:
public static Slice urlExtractRawParameter(@SqlType("varchar(x)") Slice url, @SqlType("varchar(y)") Slice parameterName) { URI uri = parseUrl(url); if ((uri == null) || (uri.getRawQuery() == null)) { return null; } Slice query = slice(uri.getRawQuery()); String parameter = parameterName.toStringUtf8(); Iterable<String> queryArgs = QUERY_SPLITTER.split(query.toStringUtf8()); for (String queryArg : queryArgs) { Iterator<String> arg = ARG_SPLITTER.split(queryArg).iterator(); if (arg.next().equals(parameter)) { if (arg.hasNext()) { return utf8Slice(arg.next()); } return Slices.EMPTY_SLICE; } } return null; }

Target:
public static Slice urlExtractRawParameter(@SqlType("varchar(x)") Slice url, @SqlType("varchar(y)") Slice parameterName) { URI uri = parseUrl(url); if ((uri == null) || (uri.getRawQuery() == null)) { return null; } return extractParameter(uri.getRawQuery(), parameterName); }
Source:
public void testDeserialize() throws IOException { String json = resource("topup.json"); Topup topup = APIResource.GSON.fromJson(json, Topup.class); assertEquals("tu_HASH", topup.getId()); assertEquals("topup", topup.getObject()); assertEquals(1000, topup.getAmount().intValue()); assertEquals("usd", topup.getCurrency()); assertEquals("Testing", topup.getDescription()); assertEquals(1518134400, topup.getExpectedAvailabilityDate().intValue()); assertEquals(1517619386, topup.getCreated().intValue()); assertEquals("pending", topup.getStatus()); assertEquals("statement_descriptor", topup.getStatementDescriptor()); assertEquals("txn_HASH", topup.getBalanceTransaction()); assertFalse(topup.getLivemode()); assertFalse(topup.getMetadata().isEmpty()); assertTrue(topup.getMetadata().containsKey("email")); assertEquals("test@test.com", topup.getMetadata().get("email")); Source source = topup.getSource(); assertEquals("src_HASH", source.getId()); assertEquals("ach_debit", source.getType()); }

Target:
public void testDeserialize() throws IOException { String json = resource("topup.json"); Topup topup = APIResource.GSON.fromJson(json, Topup.class); assertEquals("tu_123", topup.getId()); assertEquals("topup", topup.getObject()); assertEquals(1000, topup.getAmount().intValue()); assertEquals("usd", topup.getCurrency()); assertEquals("Testing", topup.getDescription()); assertEquals(1518134400, topup.getExpectedAvailabilityDate().longValue()); assertEquals(1517619386, topup.getCreated().longValue()); assertEquals("pending", topup.getStatus()); assertEquals("statement_descriptor", topup.getStatementDescriptor()); assertEquals("txn_123", topup.getBalanceTransaction()); assertFalse(topup.getLivemode()); assertFalse(topup.getMetadata().isEmpty()); assertTrue(topup.getMetadata().containsKey("email")); assertEquals("test@test.com", topup.getMetadata().get("email")); Source source = topup.getSource(); assertEquals("src_123", source.getId()); assertEquals("ach_debit", source.getType()); }
Source:
public static void renderHUD(RenderGameOverlayEvent event) { Entity renderViewEntity = Minecraft.getInstance().renderViewEntity; if (event.getType() == ElementType.TEXT && renderViewEntity instanceof PlayerEntity) { PlayerEntity player = (PlayerEntity) renderViewEntity; ItemStack chestStack = player.getItemStackFromSlot(EquipmentSlotType.CHEST); Item chestItem = chestStack.getItem(); if (chestItem instanceof ScubaArmorItem) { LazyOptional<ScubaData> data = player.getCapability(ScubaData.CAPABILITY); int airRemaining = ((ScubaArmorItem)chestItem).getRemainingAir(chestStack); TextFormatting airColor; if (airRemaining < 20 * 60) { int speed = airRemaining < 20 * 10 ? 5 : 10; airColor = (player.world.getGameTime() / speed) % 4 == 0 ? TextFormatting.WHITE : TextFormatting.RED; } else if (airRemaining < 20 * 60 * 5) { airColor = TextFormatting.GOLD; } else { airColor = TextFormatting.GREEN; } double depth = ScubaData.getDepth(player); String depthStr; if (depth > 0) { depthStr = String.format("%.1fm", depth); } else { depthStr = "N/A"; } data.ifPresent(d -> drawHUDStrings( TropicraftLangKeys.SCUBA_AIR_TIME.format(airColor + DurationFormatUtils.formatDuration(airRemaining * (1000 / 20), "HH:mm:ss")), TropicraftLangKeys.SCUBA_DIVE_TIME.format(DurationFormatUtils.formatDuration(d.getDiveTime() * (1000 / 20), "HH:mm:ss")), TropicraftLangKeys.SCUBA_DEPTH.format(depthStr), TropicraftLangKeys.SCUBA_MAX_DEPTH.format(String.format("%.1fm", d.getMaxDepth())))); } } }

Target:
public static void renderHUD(RenderGameOverlayEvent event) { Entity renderViewEntity = Minecraft.getInstance().renderViewEntity; if (event.getType() == ElementType.TEXT && renderViewEntity instanceof PlayerEntity) { PlayerEntity player = (PlayerEntity) renderViewEntity; ItemStack chestStack = player.getItemStackFromSlot(EquipmentSlotType.CHEST); Item chestItem = chestStack.getItem(); if (chestItem instanceof ScubaArmorItem) { LazyOptional<ScubaData> data = player.getCapability(ScubaData.CAPABILITY); int airRemaining = ((ScubaArmorItem)chestItem).getRemainingAir(chestStack); TextFormatting airColor = getAirTimeColor(airRemaining, player.world); double depth = ScubaData.getDepth(player); String depthStr; if (depth > 0) { depthStr = String.format("%.1fm", depth); } else { depthStr = TropicraftLangKeys.NA.getLocalizedText(); } data.ifPresent(d -> drawHUDStrings( TropicraftLangKeys.SCUBA_AIR_TIME.format(airColor + formatTime(airRemaining)), TropicraftLangKeys.SCUBA_DIVE_TIME.format(formatTime(d.getDiveTime())), TropicraftLangKeys.SCUBA_DEPTH.format(depthStr), TropicraftLangKeys.SCUBA_MAX_DEPTH.format(String.format("%.1fm", d.getMaxDepth())))); } } }
Source:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); HorizonBindingConfig config = new HorizonBindingConfig(); parseBindingConfig(bindingConfig, config); addBindingConfig(item, config); }

Target:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { HorizonBindingConfig config = new HorizonBindingConfig(); parseBindingConfig(bindingConfig, config); addBindingConfig(item, config); super.processBindingConfiguration(context, item, bindingConfig); }
Source:
public Map<StoreKey, StoreKey> retrieveAndMaybeConvertStoreKeys(File[] replicas) throws Exception { Map<File, IndexProcessingResults> results = processIndex(new HashSet<>(Arrays.asList(replicas)), null, 1); boolean success = true; for (DumpIndexTool.IndexProcessingResults result : results.values()) { if (!result.isIndexSane()) { success = false; break; } } if (success) { return createConversionKeyMap(replicas, results); } return null; }

Target:
public Map<StoreKey, StoreKey> retrieveAndMaybeConvertStoreKeys(File[] replicas) throws Exception { Map<File, IndexProcessingResults> results = processIndex(new HashSet<>(Arrays.asList(replicas)), null, 1, false); boolean success = true; for (DumpIndexTool.IndexProcessingResults result : results.values()) { if (!result.isIndexSane()) { success = false; break; } } if (success) { return createConversionKeyMap(replicas, results); } return null; }
Source:
private SqlAggFunction createSqlAggFunction(@Nullable FunctionIdentifier identifier, FunctionDefinition definition) { if (definition instanceof AggregateFunctionDefinition) { final AggregateFunctionDefinition aggDef = (AggregateFunctionDefinition) definition; final AggregateFunction<?, ?> aggFunc = aggDef.getAggregateFunction(); final FunctionIdentifier adjustedIdentifier; if (identifier != null) { adjustedIdentifier = identifier; } else { adjustedIdentifier = FunctionIdentifier.of(aggFunc.functionIdentifier()); } return new AggSqlFunction( adjustedIdentifier, aggFunc.toString(), aggFunc, fromLegacyInfoToDataType(aggDef.getResultTypeInfo()), fromLegacyInfoToDataType(aggDef.getAccumulatorTypeInfo()), ShortcutUtils.unwrapTypeFactory(relBuilder), aggFunc.getRequirements().contains(FunctionRequirement.OVER_WINDOW_ONLY), scala.Option.empty()); } else if (definition instanceof TableAggregateFunctionDefinition) { final TableAggregateFunctionDefinition aggDef = (TableAggregateFunctionDefinition) definition; final TableAggregateFunction<?, ?> aggFunc = aggDef.getTableAggregateFunction(); final FunctionIdentifier adjustedIdentifier; if (identifier != null) { adjustedIdentifier = identifier; } else { adjustedIdentifier = FunctionIdentifier.of(aggFunc.functionIdentifier()); } return new AggSqlFunction( adjustedIdentifier, aggFunc.toString(), aggFunc, fromLegacyInfoToDataType(aggDef.getResultTypeInfo()), fromLegacyInfoToDataType(aggDef.getAccumulatorTypeInfo()), ShortcutUtils.unwrapTypeFactory(relBuilder), false, scala.Option.empty()); } final DataTypeFactory dataTypeFactory = ShortcutUtils.unwrapContext(relBuilder) .getCatalogManager() .getDataTypeFactory(); final TypeInference typeInference = definition.getTypeInference(dataTypeFactory); return BridgingSqlAggFunction.of( dataTypeFactory, ShortcutUtils.unwrapTypeFactory(relBuilder), SqlKind.OTHER_FUNCTION, identifier, definition, typeInference); }

Target:
private SqlAggFunction createSqlAggFunction(@Nullable FunctionIdentifier identifier, FunctionDefinition definition) { if (definition instanceof AggregateFunctionDefinition) { return createLegacySqlAggregateFunction(identifier, (AggregateFunctionDefinition) definition); } else if (definition instanceof TableAggregateFunctionDefinition) { return createLegacySqlTableAggregateFunction(identifier, (TableAggregateFunctionDefinition) definition); } final DataTypeFactory dataTypeFactory = ShortcutUtils.unwrapContext(relBuilder) .getCatalogManager() .getDataTypeFactory(); final TypeInference typeInference = definition.getTypeInference(dataTypeFactory); return BridgingSqlAggFunction.of( dataTypeFactory, ShortcutUtils.unwrapTypeFactory(relBuilder), SqlKind.OTHER_FUNCTION, identifier, definition, typeInference); }
Source:
public Object deserialize(Object object) { if (object instanceof String) { return DoubleMeanHolder.fromBytes(StringUtils.decodeBase64(StringUtils.toUtf8((String) object))); } else if (object instanceof DoubleMeanHolder) { return object; } else if (object instanceof byte[]) { return DoubleMeanHolder.fromBytes((byte[]) object); } else { throw new IAE("Unknown object type [%s]", Utils.safeObjectClassGetName(object)); } }

Target:
public Object deserialize(Object object) { if (object instanceof byte[]) { return DoubleMeanHolder.fromBytes((byte[]) object); } else if (object instanceof String) { return DoubleMeanHolder.fromBytes(StringUtils.decodeBase64(StringUtils.toUtf8((String) object))); } else if (object instanceof DoubleMeanHolder) { return object; } else { throw new IAE("Unknown object type [%s]", Utils.safeObjectClassGetName(object)); } }
Source:
public List<RenderPipelineTask> generateFrom(List<Node> orderedNodes) { logger.info("Task List: "); List<RenderPipelineTask> taskList = Lists.newArrayList(); for (Node node : orderedNodes) { for (StateChange stateChange : node.getStateChanges()) { taskList.add(generateTask(stateChange)); } RenderPipelineTask task = generateTask(node); taskList.add(task); } return taskList; }

Target:
public List<RenderPipelineTask> generateFrom(List<Node> orderedNodes) { generateIntermediateList(orderedNodes); logList("-- Intermediate List --", intermediateList); generateTaskList(); logList("-- Task List --", taskList); return taskList; }
Source:
public DosingInstructions getDosingInstructions(DrugOrder order) { if (!order.getDosingType().equals(this.getClass())) { throw new APIException("DrugOrder.error.dosingTypeIsMismatched", new Object[] { this.getClass().getName(), order.getDosingType() }); } ChemoDosingInstructions chemoDosingInstructions = new ChemoDosingInstructions(); StringTokenizer tokenizeDosingInstructions = new StringTokenizer(order.getDosingInstructions(), "\n"); while (tokenizeDosingInstructions.hasMoreTokens()) { String instructionLine = tokenizeDosingInstructions.nextToken(); int indexOfColon = instructionLine.indexOf(':'); String instructionLineType = instructionLine.substring(0, indexOfColon - 1); String instructionLineValue = instructionLine.substring(indexOfColon + 2); if (instructionLineType.equals("Dosage Adjustment Percentage")) { chemoDosingInstructions.dosageAdjustmentPercentage = Double.parseDouble(instructionLineValue); } else if (instructionLineType.equals("Dosage Delivered Timing")) { chemoDosingInstructions.dosageDeliveredTiming = instructionLineValue; } else { chemoDosingInstructions.dosageDilutionInstructions = instructionLineValue; } } return chemoDosingInstructions; }

Target:
public DosingInstructions getDosingInstructions(DrugOrder order) { if (!order.getDosingType().equals(this.getClass())) { throw new APIException("DrugOrder.error.dosingTypeIsMismatched", new Object[] { this.getClass().getName(), order.getDosingType() }); } ChemoDosingInstructions chemoDosingInstructions = new ChemoDosingInstructions(); StringTokenizer tokenizeDosingInstructions = new StringTokenizer(order.getDosingInstructions(), "\n"); while (tokenizeDosingInstructions.hasMoreTokens()) { String instructionLine = tokenizeDosingInstructions.nextToken(); int indexOfColon = instructionLine.indexOf(':'); String instructionLineType = instructionLine.substring(0, indexOfColon - 1); String instructionLineValue = instructionLine.substring(indexOfColon + 2); if (instructionLineType.equals(ADJUSTMENT_PERCENTAGE)) { chemoDosingInstructions.dosageAdjustmentPercentage = Double.parseDouble(instructionLineValue); } else if (instructionLineType.equals(DELIVERED_TIMING)) { chemoDosingInstructions.dosageDeliveredTiming = instructionLineValue; } else { chemoDosingInstructions.dosageDilutionInstructions = instructionLineValue; } } return chemoDosingInstructions; }
Source:
public void fireDiscoveryComplete() { try { inventoryListenerRWLock.readLock().lock(); LOG.debugf("Firing inventory event for discovery complete"); DiscoveryEvent<L> event = new DiscoveryEvent<L>(EndpointService.this, getResourceManager(), getResourceTypeManager()); for (InventoryListener inventoryListener : inventoryListeners) { inventoryListener.discoveryCompleted(event); } } finally { inventoryListenerRWLock.readLock().unlock(); } }

Target:
public void fireDiscoveryComplete() { inventoryListenerRWLock.readLock().lock(); try { LOG.debugf("Firing inventory event for discovery complete"); DiscoveryEvent<L> event = new DiscoveryEvent<L>(EndpointService.this, getResourceManager(), getResourceTypeManager()); for (InventoryListener inventoryListener : inventoryListeners) { inventoryListener.discoveryCompleted(event); } } finally { inventoryListenerRWLock.readLock().unlock(); } }
Source:
public int hashCode() { return (mDestination.hashCode() * 41) + (mGateway == null ? 0 :mGateway.hashCode() * 47) + (mInterface == null ? 0 :mInterface.hashCode() * 67) + (mType * 71); }

Target:
public int hashCode() { return (mDestination.hashCode() * 41) + (mGateway == null ? 0 :mGateway.hashCode() * 47) + (mInterface == null ? 0 :mInterface.hashCode() * 67) + (mType * 71) + (mMtu * 89); }
Source:
public Object getItem(int position) { return itemsList.get(position); }

Target:
public T getItem(int position){ return itemsList.get(position); }
Source:
public boolean matches(Object o) { return (this.getClass().isInstance(o) && ((AbstractEventStreamEvent) o).getEvent().equals(this.event)); }

Target:
public boolean matches(Object o) { return (this.getClass().isInstance(o)); }
Source:
public synchronized IPAddress getAllocatedTask(final String appId) { if (!appTaskListMap.containsKey(appId)) { appTaskListMap.putIfAbsent(appId, new ArrayList<>()); modifyTaskListLockMap.putIfAbsent(appId, new ReentrantLock()); } final List<IPAddress> taskList = appTaskListMap.get(appId); double minTaskLoad = Double.MAX_VALUE; IPAddress minLoadTask = null; for (final IPAddress task: taskList) { final double currentTaskLoad = taskInfoMap.get(task).getCpuLoad(); if (minTaskLoad > currentTaskLoad) { minLoadTask = task; minTaskLoad = currentTaskLoad; } } boolean isThereNotOverloadedTask = false; if (minTaskLoad > overloadedTaskThreshold) { for (final Map.Entry<IPAddress, TaskInfo> entry: taskInfoMap.entrySet()) { final IPAddress task = entry.getKey(); final double currentTaskLoad = entry.getValue().getCpuLoad(); if (!taskList.contains(task) && minTaskLoad > currentTaskLoad) { isThereNotOverloadedTask = true; minLoadTask = task; minTaskLoad = currentTaskLoad; } } if (isThereNotOverloadedTask) { taskList.add(minLoadTask); } else { } } return minLoadTask; }

Target:
public IPAddress getAllocatedTask(final String appId) { if (!appTaskListMap.containsKey(appId)) { appTaskListMap.putIfAbsent(appId, new ArrayList<>()); } final List<IPAddress> taskList = appTaskListMap.get(appId); double minTaskLoad = Double.MAX_VALUE; IPAddress minLoadTask = null; synchronized (taskList) { for (final IPAddress task : taskList) { final double currentTaskLoad = taskInfoMap.get(task).getCpuLoad(); if (minTaskLoad > currentTaskLoad) { minLoadTask = task; minTaskLoad = currentTaskLoad; } } boolean isThereNotOverloadedTask = false; if (minTaskLoad > overloadedTaskThreshold) { for (final Map.Entry<IPAddress, TaskInfo> entry : taskInfoMap.entrySet()) { final IPAddress task = entry.getKey(); final double currentTaskLoad = entry.getValue().getCpuLoad(); if (!taskList.contains(task) && minTaskLoad > currentTaskLoad) { isThereNotOverloadedTask = true; minLoadTask = task; minTaskLoad = currentTaskLoad; } } if (isThereNotOverloadedTask) { taskList.add(minLoadTask); } else { } } } return minLoadTask; }
Source:
protected void executeQueryCommand() { clusterId = getParameters().getClusterId(); detailRequired = getParameters().isDetailRequired(); volumeId = getParameters().getVolumeId(); if (volumeId != null) { brick = getBrick(getParameters().getBrickId()); getQueryReturnValue().setReturnValue(fetchAdvancedDetails(getGlusterVolumeDao().getById(volumeId).getName())); } else { getQueryReturnValue().setReturnValue(getServiceInfo()); } }

Target:
protected void executeQueryCommand() { clusterId = getParameters().getClusterId(); detailRequired = getParameters().isDetailRequired(); volumeId = getParameters().getVolumeId(); if (volumeId != null) { GlusterVolumeEntity volume = getGlusterVolumeDao().getById(volumeId); if (volume == null) { throw new RuntimeException(String.format("Invalid volume id %s", volumeId)); } brick = getBrick(getParameters().getBrickId()); getQueryReturnValue().setReturnValue(fetchAdvancedDetails(volume.getName())); } else { getQueryReturnValue().setReturnValue(getServiceInfo()); } }
Source:
public ATCommand(String command) { this.command = command; this.parameter = null; }

Target:
public ATCommand(String command) { if (command == null) throw new NullPointerException("Command cannot be null."); this.command = command; this.parameter = null; }
Source:
public byte[] update(byte[] input, int offset, int len) { if (inDirectBuffer == null) { inDirectBuffer = ByteBuffer.allocateDirect(BUFFER_SIZE); } if (outDirectBuffer == null) { outDirectBuffer = ByteBuffer.allocateDirect(BUFFER_SIZE + transformation.getAlgorithmBlockSize()); } int estimatedOutputLen = estimateUpdateOutputSize(len); byte[] estimatedOutput = new byte[estimatedOutputLen]; int outputLen = 0; byte[] output = null; int cursor = 0; while (len > BUFFER_SIZE) { updateSlice(input, offset, BUFFER_SIZE); int outputSliceLength = outDirectBuffer.remaining(); outDirectBuffer.get(estimatedOutput, cursor, outputSliceLength); cursor += outputSliceLength; len -= BUFFER_SIZE; offset += BUFFER_SIZE; } updateSlice(input, offset, len); int outputSliceLength = outDirectBuffer.remaining(); outputLen = cursor + outputSliceLength; if (outputLen == estimatedOutputLen) { outDirectBuffer.get(estimatedOutput, cursor, outputSliceLength); output = estimatedOutput; } else { output = new byte[outputLen]; System.arraycopy(estimatedOutput, 0, output, 0, cursor); outDirectBuffer.get(output, cursor, outputSliceLength); } return output; }

Target:
public byte[] update(byte[] input, int offset, int len) { byte[] output = null; try { output = updateOrDoFinal(input, offset, len, false); } catch (IllegalBlockSizeException ibse) { } catch (BadPaddingException bpe) { } catch (ShortBufferException sbe) { } return output; }
Source:
private InternalCDOObject createObject(CDOID id) { if (TRACER.isEnabled()) { TRACER.trace("Creating object for " + id); } InternalCDORevision revision = getRevision(id, true); if (revision == null) { throw new ObjectNotFoundException(id, this); } EClass eClass = revision.getEClass(); InternalCDOObject object; if (CDOModelUtil.isResource(eClass) && id != getSession().getRepositoryInfo().getRootResourceID()) { object = (InternalCDOObject)newResourceInstance(revision); } else { object = newInstance(eClass); } cleanObject(object, revision); CDOStateMachine.INSTANCE.dispatchLoadNotification(object); if (!CDOModelUtil.isResourceNode(eClass)) { getStore().getResource(object); } return object; }

Target:
private InternalCDOObject createObject(CDOID id) { if (TRACER.isEnabled()) { TRACER.trace("Creating object for " + id); } InternalCDORevision revision = getRevision(id, true); if (revision == null) { throw new ObjectNotFoundException(id, this); } EClass eClass = revision.getEClass(); InternalCDOObject object; if (CDOModelUtil.isResource(eClass) && id != getSession().getRepositoryInfo().getRootResourceID()) { object = (InternalCDOObject)newResourceInstance(revision); } else { object = newInstance(eClass); } cleanObject(object, revision); CDOStateMachine.INSTANCE.dispatchLoadNotification(object); if (!CDOModelUtil.isResource(eClass)) { getStore().getResource(object); } return object; }
Source:
public String create(Request req, Response res) { PipelineConfig pipelineConfigFromRequest = buildEntityFromRequestBody(req); haltIfEntityBySameNameInRequestExists(pipelineConfigFromRequest); String group = getOrHaltForGroupName(req); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); Username userName = SessionUtils.currentUsername(); pipelineConfigService.createPipelineConfig(userName, pipelineConfigFromRequest, result, group); if(shouldPausePipelineOnCreate(req)){ pipelinePauseService.pause(pipelineConfigFromRequest.name().toString(), null, userName); } return handleCreateOrUpdateResponse(req, res, pipelineConfigFromRequest, result); }

Target:
public String create(Request req, Response res) { PipelineConfig pipelineConfigFromRequest = buildEntityFromRequestBody(req); haltIfEntityBySameNameInRequestExists(pipelineConfigFromRequest); String group = getOrHaltForGroupName(req); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); Username userName = SessionUtils.currentUsername(); pipelineConfigService.createPipelineConfig(userName, pipelineConfigFromRequest, result, group); return handleCreateOrUpdateResponse(req, res, pipelineConfigFromRequest, result); }
Source:
public void commitMigration(PartitionMigrationEvent event) { if (event.getMigrationEndpoint() == DESTINATION) { populateIndexes(event, TargetIndexes.GLOBAL); } else { depopulateIndexes(event); } if (SOURCE == event.getMigrationEndpoint()) { removeRecordStoresHavingLesserBackupCountThan(event.getPartitionId(), event.getNewReplicaIndex()); mapServiceContext .getWbqCapacityCounter() .release(event.getPartitionId()); } PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(event.getPartitionId()); for (RecordStore recordStore : partitionContainer.getAllRecordStores()) { recordStore.startLoading(); } mapServiceContext.reloadOwnedPartitions(); removeOrRegenerateNearCacheUuid(event); }

Target:
public void commitMigration(PartitionMigrationEvent event) { if (event.getMigrationEndpoint() == DESTINATION) { populateIndexes(event, TargetIndexes.GLOBAL); } else { depopulateIndexes(event); } if (SOURCE == event.getMigrationEndpoint()) { removeWbqCountersHavingLesserBackupCountThan(event.getPartitionId(), event.getNewReplicaIndex()); removeRecordStoresHavingLesserBackupCountThan(event.getPartitionId(), event.getNewReplicaIndex()); } PartitionContainer partitionContainer = mapServiceContext.getPartitionContainer(event.getPartitionId()); for (RecordStore recordStore : partitionContainer.getAllRecordStores()) { recordStore.startLoading(); } mapServiceContext.reloadOwnedPartitions(); removeOrRegenerateNearCacheUuid(event); }
Source:
public static TopologyDef parseResource(String resource, boolean dumpYaml, boolean processIncludes, String propertiesFile, boolean envSub) throws IOException { InputStream in = FluxParser.class.getResourceAsStream(resource); InputStream propertiesIn = null; if (propertiesFile != null) { propertiesIn = FluxParser.class.getResourceAsStream(propertiesFile); } TopologyDef topology = parseInputStream(in, dumpYaml, processIncludes, propertiesIn, propertiesFile, envSub); in.close(); return topology; }

Target:
public static TopologyDef parseResource(String resource, boolean dumpYaml, boolean processIncludes, String propertiesFile, boolean envSub) throws IOException { InputStream in = FluxParser.class.getResourceAsStream(resource); TopologyDef topology = parseInputStream(in, dumpYaml, processIncludes, propertiesFile, envSub); in.close(); return topology; }
Source:
public static EnumSet<ElementKind> getElementKindsForElementType(ElementType elementType) { switch (elementType) { case TYPE: EnumSet<ElementKind> typeKinds = EnumSet.noneOf(ElementKind.class); for (ElementKind kind : ElementKind.values()) { if (kind.isClass() || kind.isInterface()) { typeKinds.add(kind); } } return typeKinds; case FIELD: return EnumSet.of(ElementKind.FIELD, ElementKind.ENUM_CONSTANT); case METHOD: return EnumSet.of(ElementKind.METHOD); case PARAMETER: return EnumSet.of(ElementKind.PARAMETER); case CONSTRUCTOR: return EnumSet.of(ElementKind.CONSTRUCTOR); case LOCAL_VARIABLE: return EnumSet.of( ElementKind.LOCAL_VARIABLE, ElementKind.RESOURCE_VARIABLE, ElementKind.EXCEPTION_PARAMETER); case ANNOTATION_TYPE: return EnumSet.of(ElementKind.ANNOTATION_TYPE); case PACKAGE: return EnumSet.of(ElementKind.PACKAGE); case TYPE_PARAMETER: return EnumSet.of(ElementKind.TYPE_PARAMETER); case TYPE_USE: return EnumSet.noneOf(ElementKind.class); default: if (elementType.name().contentEquals("MODULE")) { return EnumSet.noneOf(ElementKind.class); } if (elementType.name().equals("RECORD_COMPONENT")) { return EnumSet.of(ElementKind.valueOf("RECORD_COMPONENT")); } throw new BugInCF("Unrecognized ElementType: " + elementType); } }

Target:
public static EnumSet<ElementKind> getElementKindsForElementType(ElementType elementType) { switch (elementType) { case TYPE: return EnumSet.copyOf(ElementUtils.classElementKinds()); case FIELD: return EnumSet.of(ElementKind.FIELD, ElementKind.ENUM_CONSTANT); case METHOD: return EnumSet.of(ElementKind.METHOD); case PARAMETER: return EnumSet.of(ElementKind.PARAMETER); case CONSTRUCTOR: return EnumSet.of(ElementKind.CONSTRUCTOR); case LOCAL_VARIABLE: return EnumSet.of( ElementKind.LOCAL_VARIABLE, ElementKind.RESOURCE_VARIABLE, ElementKind.EXCEPTION_PARAMETER); case ANNOTATION_TYPE: return EnumSet.of(ElementKind.ANNOTATION_TYPE); case PACKAGE: return EnumSet.of(ElementKind.PACKAGE); case TYPE_PARAMETER: return EnumSet.of(ElementKind.TYPE_PARAMETER); case TYPE_USE: return EnumSet.noneOf(ElementKind.class); default: if (elementType.name().contentEquals("MODULE")) { return EnumSet.noneOf(ElementKind.class); } if (elementType.name().equals("RECORD_COMPONENT")) { return EnumSet.of(ElementKind.valueOf("RECORD_COMPONENT")); } throw new BugInCF("Unrecognized ElementType: " + elementType); } }
Source:
public AnnotationCommandTargetResolver build() { try { return resolver; } finally { resolver = null; } }

Target:
public AnnotationCommandTargetResolver build() { return new AnnotationCommandTargetResolver(this); }
Source:
static EncryptedDataPayload deserialize(ByteBuffer inputBuffer) throws GeneralSecurityException { int startOffset = inputBuffer.position(); Crc32 crc = new Crc32(); short version = inputBuffer.getShort(); if (version != 1) { throw new GeneralSecurityException("Unrecognized version: " + version); } int encryptedKeySize = inputBuffer.getInt(); int encryptedDataSize = (int) inputBuffer.getLong(); if (encryptedKeySize < 0) { throw new GeneralSecurityException("Encrypted key size is less than 0"); } if (encryptedDataSize < 0) { throw new GeneralSecurityException("Encrypted data size is less than 0"); } byte[] encryptedKey = new byte[encryptedKeySize]; byte[] encryptedData = new byte[encryptedDataSize]; try { inputBuffer.get(encryptedKey); } catch (Exception e) { throw new GeneralSecurityException("Reading encrypted key from buffer", e); } try { inputBuffer.get(encryptedData); } catch (Exception e) { throw new GeneralSecurityException("Reading encrypted data from buffer", e); } crc.update(inputBuffer.array(), startOffset, INITIAL_MESSAGE_LENGTH + encryptedKeySize + encryptedDataSize); long expectedCrc; try { expectedCrc = inputBuffer.getLong(); } catch (Exception e) { throw new GeneralSecurityException("Reading crc from buffer", e); } long actualCrc = crc.getValue(); if (actualCrc != expectedCrc) { throw new GeneralSecurityException( "Encrypted blob is corrupt. ExpectedCRC: " + expectedCrc + " ActualCRC: " + actualCrc); } return new EncryptedDataPayload(ByteBuffer.wrap(encryptedKey), ByteBuffer.wrap(encryptedData)); }

Target:
static EncryptedDataPayload deserialize(ByteBuffer inputBuffer) throws GeneralSecurityException { int startOffset = inputBuffer.position(); Crc32 crc = new Crc32(); try { short version = inputBuffer.getShort(); if (version != 1) { throw new GeneralSecurityException("Unrecognized version: " + version); } int encryptedKeySize = inputBuffer.getInt(); int encryptedDataSize = (int) inputBuffer.getLong(); if (encryptedKeySize < 0) { throw new GeneralSecurityException("Encrypted key size is less than 0"); } if (encryptedDataSize < 0) { throw new GeneralSecurityException("Encrypted data size is less than 0"); } byte[] encryptedKey = new byte[encryptedKeySize]; byte[] encryptedData = new byte[encryptedDataSize]; inputBuffer.get(encryptedKey); inputBuffer.get(encryptedData); crc.update(inputBuffer.array(), startOffset, INITIAL_MESSAGE_LENGTH + encryptedKeySize + encryptedDataSize); long expectedCrc = inputBuffer.getLong(); long actualCrc = crc.getValue(); if (actualCrc != expectedCrc) { throw new GeneralSecurityException( "Encrypted blob is corrupt. ExpectedCRC: " + expectedCrc + " ActualCRC: " + actualCrc); } return new EncryptedDataPayload(ByteBuffer.wrap(encryptedKey), ByteBuffer.wrap(encryptedData)); } catch (RuntimeException rex) { throw new GeneralSecurityException("Reading payload from buffer", rex); } }
Source:
private List<Interval> determineIntervals(List<Integer> intervalEndOffsets) { Interval.setNextBegin(LocalDate.now()); List<Interval> intervals = intervalEndOffsets.stream().map(ieo -> Interval.nextInstance(ieo)) .collect(Collectors.toList()); intervals.add(Interval.nextInstance(LocalDate.of(2017, 1, 1))); return intervals; }

Target:
private List<HistoryInterval> determineIntervals(List<Integer> intervalEndOffsets) { HistoryInterval.setNextStart(LocalDate.now()); List<HistoryInterval> intervals = intervalEndOffsets.stream().map(ieo -> HistoryInterval.nextInstance(ieo)) .collect(Collectors.toList()); intervals.add(HistoryInterval.nextInstance(LONG_AGO)); return intervals; }
Source:
public RatpackRetrofitCallException(Request request, Response<?> response) { super(request.url().toString() + ": " + Exceptions.uncheck(() -> { Charset charset = response.errorBody().contentType() == null ? null : response.errorBody().contentType().charset(); if (charset == null) charset = Charset.forName("UTF-8"); return response.errorBody().source().buffer().clone().readString(charset); })); this.response = response; }

Target:
public RatpackRetrofitCallException(Request request, Response<?> response) { super(request.url().toString() + ": " + Exceptions.uncheck(() -> { Charset charset = response.errorBody().contentType() == null ? null : response.errorBody().contentType().charset(); if (charset == null) { charset = Charset.forName("UTF-8"); } return response.errorBody().source().buffer().clone().readString(charset); })); this.response = response; }