auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testInvalidSequenceOffset() throws IOException { byte[] compressed = Resources.toByteArray(getClass().getClassLoader().getResource("data/zstd/invalid-offset.zst")); byte[] output = new byte[compressed.length * 10]; getDecompressor().decompress(compressed, 0, compressed.length, output, 0, output.length); }

Target:
public void testInvalidSequenceOffset() throws IOException { byte[] compressed = Resources.toByteArray(getClass().getClassLoader().getResource("data/zstd/offset-before-start.zst")); byte[] output = new byte[compressed.length * 10]; getDecompressor().decompress(compressed, 0, compressed.length, output, 0, output.length); }
Source:
public synchronized void start() { log.info("Loading stored supervisors from database"); Map<String, SupervisorSpec> supervisors = metadataSupervisorManager.getLatest(); for (String id : supervisors.keySet()) { SupervisorSpec spec = supervisors.get(id); if (!(spec instanceof NoopSupervisorSpec)) { createAndStartSupervisorInternal(spec, false); } } }

Target:
public void start() { Preconditions.checkState(!started, "SupervisorManager already started"); log.info("Loading stored supervisors from database"); synchronized (lock) { Map<String, SupervisorSpec> supervisors = metadataSupervisorManager.getLatest(); for (String id : supervisors.keySet()) { SupervisorSpec spec = supervisors.get(id); if (!(spec instanceof NoopSupervisorSpec)) { createAndStartSupervisorInternal(spec, false); } } started = true; } }
Source:
private void handleAdditionalConfiguration() { new DefaultHyperlink().activate(); new DefaultShell("Modify Faceted Project"); new LabeledCombo("Type:").setSelection("Pure JEE6 Implementation"); Button okButton = new OkButton(); assertTrue("OK Button should be enabled.", okButton.isEnabled()); okButton.click(); new WaitWhile(new ShellIsActive("Modify Faceted Project")); new DefaultHyperlink().activate(); new DefaultShell("Modify Faceted Project"); new OkButton().click(); new WaitWhile(new ShellIsActive("Modify Faceted Project")); }

Target:
private void handleAdditionalConfiguration() { new DefaultHyperlink().activate(); new DefaultShell("Modify Faceted Project"); new LabeledCombo("Type:").setSelection("Pure JEE6 Implementation"); Button okButton = new OkButton(); assertTrue("OK Button should be enabled.", okButton.isEnabled()); okButton.click(); new WaitWhile(new ShellIsAvailable("Modify Faceted Project")); new DefaultHyperlink().activate(); new DefaultShell("Modify Faceted Project"); new OkButton().click(); new WaitWhile(new ShellIsAvailable("Modify Faceted Project")); }
Source:
protected Void doInBackground(Void... voids) { SyncthingService syncthingService = refSyncthingService.get(); if (syncthingService == null) { cancel(true); } try { syncthingService.mConfig = new ConfigXml(syncthingService); syncthingService.mConfig.updateIfNeeded(); } catch (ConfigXml.OpenConfigException e) { syncthingService.mNotificationHandler.showCrashedNotification(R.string.config_create_failed, true); synchronized (syncthingService.mStateLock) { syncthingService.onServiceStateChange(State.ERROR); } cancel(true); } return null; }

Target:
protected Void doInBackground(Void... voids) { SyncthingService syncthingService = refSyncthingService.get(); if (syncthingService == null) { cancel(true); return null; } try { syncthingService.mConfig = new ConfigXml(syncthingService); syncthingService.mConfig.updateIfNeeded(); } catch (ConfigXml.OpenConfigException e) { syncthingService.mNotificationHandler.showCrashedNotification(R.string.config_create_failed, true); synchronized (syncthingService.mStateLock) { syncthingService.onServiceStateChange(State.ERROR); } cancel(true); } return null; }
Source:
public void decorate(World world, Random random, Chunk source) { int sourceX = (source.getX() << 4) + random.nextInt(16); int sourceZ = (source.getZ() << 4) + random.nextInt(16); int sourceY = random.nextInt(random.nextInt(type == Material.LAVA ? random.nextInt(240) + 8 : 248) + 8); final Block block = world.getBlockAt(sourceX, sourceY, sourceZ); if (block.getType() != Material.STONE && block.getType() != Material.AIR && block.getRelative(BlockFace.DOWN).getType() == Material.STONE && block.getRelative(BlockFace.UP).getType() == Material.STONE) { int stoneBlockCount = 0; if (block.getRelative(BlockFace.EAST).getType() == Material.STONE) { stoneBlockCount++; } if (block.getRelative(BlockFace.WEST).getType() == Material.STONE) { stoneBlockCount++; } if (block.getRelative(BlockFace.NORTH).getType() == Material.STONE) { stoneBlockCount++; } if (block.getRelative(BlockFace.SOUTH).getType() == Material.STONE) { stoneBlockCount++; } if (stoneBlockCount == 3) { int airBlockCount = 0; if (block.getRelative(BlockFace.EAST).isEmpty()) { airBlockCount++; } if (block.getRelative(BlockFace.WEST).isEmpty()) { airBlockCount++; } if (block.getRelative(BlockFace.NORTH).isEmpty()) { airBlockCount++; } if (block.getRelative(BlockFace.SOUTH).isEmpty()) { airBlockCount++; } if (airBlockCount == 1) { final BlockState state = block.getState(); state.setType(type); state.update(true); } } } }

Target:
public void decorate(World world, Random random, Chunk source) { int sourceX = (source.getX() << 4) + random.nextInt(16); int sourceZ = (source.getZ() << 4) + random.nextInt(16); int sourceY = random.nextInt(random.nextInt(type == Material.LAVA ? random.nextInt(240) + 8 : 248) + 8); final Block block = world.getBlockAt(sourceX, sourceY, sourceZ); if (block.getType() != Material.STONE && block.getType() != Material.AIR && block.getRelative(BlockFace.DOWN).getType() == Material.STONE && block.getRelative(BlockFace.UP).getType() == Material.STONE) { int stoneBlockCount = 0; for (BlockFace face : SIDES) { if (block.getRelative(face).getType() == Material.STONE) { stoneBlockCount++; } } if (stoneBlockCount == 3) { int airBlockCount = 0; for (BlockFace face : SIDES) { if (block.getRelative(face).isEmpty()) { airBlockCount++; } } if (airBlockCount == 1) { final BlockState state = block.getState(); state.setType(type); state.update(true); } } } }
Source:
protected void postLoad(Group group, Version loadedVersion) { if (loadedVersion.compareTo(MIGRATION_VERSION) < 0) { for (Viewpoint viewpoint : group.getOwnedViewpoints()) { for (DiagramDescription diagramDescription : Iterables.filter(viewpoint.getOwnedRepresentations(), DiagramDescription.class)) { migrateStyleOfContainerMappingInLayer(LayerHelper.getAllLayers(diagramDescription)); migrateStyleOfContainerMapping(diagramDescription.getAllContainerMappings()); } for (DiagramExtensionDescription diagramExtensionDescription : Iterables.filter(viewpoint.getOwnedRepresentationExtensions(), DiagramExtensionDescription.class)) { migrateStyleOfContainerMappingInLayer(diagramExtensionDescription.getLayers()); } } } }

Target:
protected void postLoad(Group group, Version loadedVersion) { if (loadedVersion.compareTo(MIGRATION_VERSION) < 0) { for (Viewpoint viewpoint : group.getOwnedViewpoints()) { for (DiagramDescription diagramDescription : Iterables.filter(viewpoint.getOwnedRepresentations(), DiagramDescription.class)) { migrateStyleOfContainerMappingInLayer(diagramDescription.getAllLayers()); migrateStyleOfContainerMapping(diagramDescription.getAllContainerMappings()); } for (DiagramExtensionDescription diagramExtensionDescription : Iterables.filter(viewpoint.getOwnedRepresentationExtensions(), DiagramExtensionDescription.class)) { migrateStyleOfContainerMappingInLayer(diagramExtensionDescription.getLayers()); } } } }
Source:
public void testValidationChecksumBuilderArtifactsNull() { final Builder builder = new ValidationChecksum.Builder().destination(checksumdirectory); assertThatThrownBy(() -> builder.artifacts(null)) .isExactlyInstanceOf(NullPointerException.class); }

Target:
public void testValidationChecksumBuilderArtifactsNull() { final Builder builder = new ValidationChecksum.Builder().destination(checksumdirectory); assertThatCode(() -> builder.artifacts(null)) .isExactlyInstanceOf(NullPointerException.class); }
Source:
public void testCannotUpdateOSNotSupportVirtioScsi() { prepareVmToPassValidate(); group.setCompatibilityVersion(Version.v4_0); when(command.isVirtioScsiEnabledForVm(any(Guid.class))).thenReturn(true); when(osRepository.getDiskInterfaces(any(Integer.class), any(Version.class))).thenReturn( new ArrayList<>(Collections.singletonList("VirtIO"))); ValidateTestUtils.runAndAssertValidateFailure(command, EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI); }

Target:
public void testCannotUpdateOSNotSupportVirtioScsi() { prepareVmToPassValidate(); group.setCompatibilityVersion(Version.v4_0); when(command.isVirtioScsiEnabledForVm(any(Guid.class))).thenReturn(true); when(osRepository.getDiskInterfaces(any(Integer.class), any(Version.class))).thenReturn( Collections.singletonList("VirtIO")); ValidateTestUtils.runAndAssertValidateFailure(command, EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI); }
Source:
public void run () { while (!Thread.interrupted()) { final byte[] headBuffer = new byte[DMResponse.packetsize]; final byte[] bodyBuffer; DMResponse header; try { in.read(headBuffer, 0, headBuffer.length); header = new DMResponse (headBuffer); if(header.isValid()) { bodyBuffer = new byte[header.getsize()]; in.read(bodyBuffer, 0, bodyBuffer.length); if(header.getsource() == DMResponse.SUBSCRIPTION_MGR) { if(!mbox.containsKey(header.getscriptID())) mbox.put(header.getscriptID (), new LinkedBlockingQueue<byte[]> ()); mbox.get(header.getscriptID()).put(header.tobytes()); mbox.get(header.getscriptID()).put(bodyBuffer); } else { if(!mbox.containsKey(header.getscriptID())) mbox.put(header.getscriptID (), new LinkedBlockingQueue<byte[]> ()); mbox.get(header.getscriptID()).put(header.tobytes()); mbox.get(header.getscriptID()).put(bodyBuffer); } } else { } } catch (InterruptedException ie) { System.err.println ("Interrupted: " + ie.getMessage()); break; } catch (IOException ioe) { new ErrorMessage("I/O Error Check host!", "See stderr for more details").open(); System.err.println ("i/o error: " + ioe.getMessage()); return; } catch (Exception e) { new ErrorMessage("Check if DMD is running", "See stderr for more details").open(); System.err.println ("Server terminated unexpectedly?," + e.getMessage()); return; } } this.destroyConnection(); }

Target:
public void run () { while (!Thread.interrupted()) { final byte[] headBuffer = new byte[DMResponse.packetsize]; final byte[] bodyBuffer; DMResponse header; try { in.read(headBuffer, 0, headBuffer.length); header = new DMResponse (headBuffer); if(header.isValid()) { bodyBuffer = new byte[header.getsize()]; in.read(bodyBuffer, 0, bodyBuffer.length); if(header.getsource() == DMResponse.SUBSCRIPTION_MGR) { if(!mbox.containsKey(header.getscriptID())) mbox.put(header.getscriptID (), new LinkedBlockingQueue<byte[]> ()); mbox.get(header.getscriptID()).put(header.tobytes()); mbox.get(header.getscriptID()).put(bodyBuffer); } else { if(!mbox.containsKey(header.getscriptID())) mbox.put(header.getscriptID (), new LinkedBlockingQueue<byte[]> ()); mbox.get(header.getscriptID()).put(header.tobytes()); mbox.get(header.getscriptID()).put(bodyBuffer); } } else { } } catch (InterruptedException ie) { System.err.println ("Interrupted: " + ie.getMessage()); break; } catch (IOException ioe) { new ErrorMessage("I/O Error Check host!", "See stderr for more details").open(); System.err.println ("i/o error: " + ioe.getMessage()); return; } } this.destroyConnection(); }
Source:
private void setTemperatureMeasurementValue(float temperatureMeasurementValue) { mTemperatureMeasurementCharacteristic.setValue(new byte[]{0b00000000, 0, 0, 0, 0}); int bits = Float.floatToIntBits(temperatureMeasurementValue); int sign = bits >>> 31; int exp = (bits >>> 23 & ((1 << 8) - 1)) - ((1 << 7) - 1); int mantissa = bits & ((1 << 23) - 1); mTemperatureMeasurementCharacteristic.setValue(mantissa, exp, TEMPERATURE_MEASUREMENT_VALUE_FORMAT, 1); }

Target:
private void setTemperatureMeasurementValue(float temperatureMeasurementValue) { mTemperatureMeasurementCharacteristic.setValue(new byte[]{0b00000000, 0, 0, 0, 0}); int bits = Float.floatToIntBits(temperatureMeasurementValue); int exponent = (bits & EXPONENT_MASK) >>> EXPONENT_SHIFT; int mantissa = (bits & MANTISSA_MASK) >>> MANTISSA_SHIFT; mTemperatureMeasurementCharacteristic.setValue(mantissa, exponent, TEMPERATURE_MEASUREMENT_VALUE_FORMAT, 1); }
Source:
public void testApplySessionPropertyConfigurationManager() throws Exception { HttpServletRequest request = new MockHttpServletRequest( ImmutableListMultimap.<String, String>builder() .put(PRESTO_USER, "testUser") .put(PRESTO_SOURCE, "testSource") .put(PRESTO_CATALOG, "testCatalog") .put(PRESTO_SCHEMA, "testSchema") .put(PRESTO_LANGUAGE, "zh-TW") .put(PRESTO_TIME_ZONE, "Asia/Taipei") .put(PRESTO_CLIENT_INFO, "client-info") .put(PRESTO_CLIENT_TAGS, "tag1,tag2 ,tag3, tag2") .put(PRESTO_SESSION, QUERY_MAX_MEMORY + "=1GB") .put(PRESTO_SESSION, DISTRIBUTED_JOIN + "=true," + HASH_PARTITION_COUNT + " = 43") .put(PRESTO_PREPARED_STATEMENT, "query1=select * from foo,query2=select * from bar") .build(), "testRemote"); HttpRequestSessionContext context = new HttpRequestSessionContext(request); QuerySessionSupplier sessionSupplier = new QuerySessionSupplier( createTestTransactionManager(), new AllowAllAccessControl(), new SessionPropertyManager()); SessionPropertyConfigurationManagerFactory factory = new TestingSessionPropertyConfigurationManagerFactory( ImmutableMap.of(QUERY_MAX_MEMORY, "10GB", "key2", "20", "key3", "3"), ImmutableMap.of("testCatalog", ImmutableMap.of("key1", "10"))); sessionSupplier.addConfigurationManager(factory); sessionSupplier.setConfigurationManager(factory.getName(), ImmutableMap.of()); Session session = sessionSupplier.createSession(new QueryId("test_query_id"), context); assertEquals(session.getSystemProperties(), ImmutableMap.<String, String>builder() .put(QUERY_MAX_MEMORY, "1GB") .put(DISTRIBUTED_JOIN, "true") .put(HASH_PARTITION_COUNT, "43") .put("key2", "20") .put("key3", "3") .build()); assertEquals(session.getUnprocessedCatalogProperties(), ImmutableMap.of("testCatalog", ImmutableMap.of("key1", "10"))); }

Target:
public void testApplySessionPropertyConfigurationManager() throws Exception { HttpRequestSessionContext context = new HttpRequestSessionContext(TEST_REQUEST); QuerySessionSupplier sessionSupplier = new QuerySessionSupplier( createTestTransactionManager(), new AllowAllAccessControl(), new SessionPropertyManager()); SessionPropertyConfigurationManagerFactory factory = new TestingSessionPropertyConfigurationManagerFactory( ImmutableMap.of(QUERY_MAX_MEMORY, "10GB", "key2", "20", "key3", "3"), ImmutableMap.of("testCatalog", ImmutableMap.of("key1", "10"))); sessionSupplier.addConfigurationManager(factory); sessionSupplier.setConfigurationManager(factory.getName(), ImmutableMap.of()); Session session = sessionSupplier.createSession(new QueryId("test_query_id"), context); assertEquals(session.getSystemProperties(), ImmutableMap.<String, String>builder() .put(QUERY_MAX_MEMORY, "1GB") .put(DISTRIBUTED_JOIN, "true") .put(HASH_PARTITION_COUNT, "43") .put("key2", "20") .put("key3", "3") .build()); assertEquals(session.getUnprocessedCatalogProperties(), ImmutableMap.of("testCatalog", ImmutableMap.of("key1", "10"))); }
Source:
public void setDeprecated(String itemId, boolean deprecated) { if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.MODIFY_CATALOG_ITEM, StringAndArgument.of(itemId, "deprecated"))) { throw WebResourceUtils.unauthorized("User '%s' is not authorized to modify catalog", Entitlements.getEntitlementContext().user()); } CatalogItem<?, ?> item = CatalogUtils.getCatalogItemOptionalVersion(mgmt(), itemId); if (item==null) throw WebResourceUtils.notFound("Catalog item with id '%s' not found", itemId); item.setDeprecated(deprecated); }

Target:
public void setDeprecated(String itemId, boolean deprecated) { if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.MODIFY_CATALOG_ITEM, StringAndArgument.of(itemId, "deprecated"))) { throw WebResourceUtils.unauthorized("User '%s' is not authorized to modify catalog", Entitlements.getEntitlementContext().user()); } CatalogItem<?, ?> item = CatalogUtils.getCatalogItemOptionalVersion(mgmt(), itemId); if (item==null) throw WebResourceUtils.notFound("Catalog item with id '%s' not found", itemId); item.setDeprecated(deprecated); mgmt().getCatalog().persist(item); }
Source:
private static void killIAM() throws InterruptedException { if (iamProcess != null) { System.out.println("Stopping IAM microservice..."); iamProcess.destroy(); iamProcess.waitFor(); iamProcess = null; } }

Target:
private static void killIAM() throws InterruptedException { if (iamProcess != null) { System.out.println("Stopping IAM microservice..."); iamProcess.destroy(); if (!iamProcess.waitFor(1, TimeUnit.MINUTES)) { iamProcess.destroyForcibly(); iamProcess.waitFor(1, TimeUnit.MINUTES); } iamProcess = null; } }
Source:
public void beforeMethodWithBeforeGroupsShouldOnlyRunBeforeGroupMethods() { TestNG suite = create(new Class[] { BeforeMethodWithGroupFiltersSampleTest.class } ); suite.run(); for (String[] expectedSequence : BeforeMethodWithGroupFiltersSampleTest.EXPECTED_INVOCATION_SEQUENCES) assertThat(BeforeMethodWithGroupFiltersSampleTest.invocations) .containsSequence(expectedSequence); assertThat(BeforeMethodWithGroupFiltersSampleTest.invocations) .hasSize(BeforeMethodWithGroupFiltersSampleTest.EXPECTED_TOTAL_INVOCATIONS); }

Target:
public void beforeMethodWithBeforeGroupsShouldOnlyRunBeforeGroupMethods() { InvokedMethodNameListener nameListener = run(BeforeMethodWithGroupFiltersSampleTest.class); assertThat(nameListener.getInvokedMethodNames()) .containsExactly(BeforeMethodWithGroupFiltersSampleTest.EXPECTED_INVOCATIONS); }
Source:
public void testValidateSuccessful() { PlanNode root = new OutputNode(idAllocator.getNextId(), new ProjectNode(idAllocator.getNextId(), new ValuesNode( idAllocator.getNextId(), ImmutableList.of(), ImmutableList.of(), ImmutableList.of()), Assignments.of() ), ImmutableList.of(), ImmutableList.of(), ImmutableList.of()); new VerifyOnlyOneOutputNode().validate(root, null, null, null, null, WarningCollector.NOOP); }

Target:
public void testValidateSuccessful() { PlanNode root = new OutputNode(idAllocator.getNextId(), new ProjectNode(idAllocator.getNextId(), new ValuesNode( idAllocator.getNextId(), ImmutableList.of(), ImmutableList.of()), Assignments.of() ), ImmutableList.of(), ImmutableList.of()); new VerifyOnlyOneOutputNode().validate(root, null, null, null, null, WarningCollector.NOOP); }
Source:
protected void configureParameters(InterfaceList interfaceList, String parentNodeName) throws TypeImportException, XMLStreamException { processChildren(parentNodeName, name -> { if (name.equals(LibraryElementTags.PARAMETER_ELEMENT)) { VarDeclaration paramter = parseParameter(); VarDeclaration vInput = getVarNamed(interfaceList, paramter.getName(), true); if (null != vInput) { vInput.setValue(paramter.getValue()); } return true; } return false; }); }

Target:
protected void configureParameters(InterfaceList interfaceList, String parentNodeName) throws TypeImportException, XMLStreamException { processChildren(parentNodeName, name -> { if (LibraryElementTags.PARAMETER_ELEMENT.equals(name)) { VarDeclaration paramter = parseParameter(); VarDeclaration vInput = getVarNamed(interfaceList, paramter.getName(), true); if (null != vInput) { vInput.setValue(paramter.getValue()); } return true; } return false; }); }
Source:
public Array<T> dropUntil(Predicate<? super T> predicate) { Objects.requireNonNull(predicate, "predicate is null"); for (int i = 0; i < length(); i++) { if (predicate.test(get(i))) { return drop(i); } } return empty(); }

Target:
public Array<T> dropUntil(Predicate<? super T> predicate) { return Collections.dropUntil(this, predicate); }
Source:
public static CoordinateReferenceSystem get( int tableId, int code ) { CRSTable table = CRSTable.find( tableId ); return new CoordinateReferenceSystem( table.name + "-" + code, table, code ); }

Target:
public static CoordinateReferenceSystem get( int tableId, int code ) { CRSTable table = CRSTable.find( tableId ); if ( tableId == CRSTable.SR_ORG.getTableId() && code == Cartesian.code ) { return CoordinateReferenceSystem.Cartesian; } else if ( tableId == CRSTable.EPSG.getTableId() && code == WGS84.code ) { return CoordinateReferenceSystem.WGS84; } else { return new CoordinateReferenceSystem( table.getName() + "-" + code, table, code ); } }
Source:
private void checkTarUntarRoundTrip(String filePrefix, long fileSize) throws Exception { File tempFile = null, tarFile = null; FilePath outDir = null; try { tempFile = File.createTempFile(filePrefix, ".log"); RandomAccessFile file = new RandomAccessFile(tempFile, "rw"); tarFile = new File(tempFile.getParent(), filePrefix + ".tar"); file.setLength(fileSize); assumeTrue(fileSize == file.length()); file.close(); final FilePath tmpDir = new FilePath(tempFile.getParentFile()); int tar = tmpDir.tar(new FileOutputStream(tarFile), tempFile.getName()); assertEquals("One file should have been compressed", 1, tar); outDir = tmpDir.createTempDir(filePrefix, "out"); final FilePath outFile = outDir.child(tempFile.getName()); tmpDir.child( filePrefix + ".tar").untar(outDir, TarCompression.NONE); assertEquals("Result file after the roundtrip differs from the initial file", new FilePath(tempFile).digest(), outFile.digest()); } finally { if (tempFile != null && tempFile.exists()) { tempFile.delete(); } if (tarFile != null && tarFile.exists()) { tarFile.delete(); } if (outDir != null && outDir.exists()) { outDir.deleteRecursive(); } } }

Target:
private void checkTarUntarRoundTrip(String filePrefix, long fileSize) throws Exception { final File tmpDir = temp.newFolder(filePrefix); final File tempFile = new File(tmpDir, filePrefix + ".log"); RandomAccessFile file = new RandomAccessFile(tempFile, "rw"); final File tarFile = new File(tmpDir, filePrefix + ".tar"); file.setLength(fileSize); assumeTrue(fileSize == file.length()); file.close(); final FilePath tmpDirPath = new FilePath(tmpDir); int tar = tmpDirPath.tar(new FileOutputStream(tarFile), tempFile.getName()); assertEquals("One file should have been compressed", 1, tar); FilePath outDir = new FilePath(temp.newFolder(filePrefix + "_out")); final FilePath outFile = outDir.child(tempFile.getName()); tmpDirPath.child( filePrefix + ".tar").untar(outDir, TarCompression.NONE); assertEquals("Result file after the roundtrip differs from the initial file", new FilePath(tempFile).digest(), outFile.digest()); }
Source:
public void testFilterNicsWithUnmanagedNetworksUmngmtNetRemoved(){ VdsNetworkInterface nicWithUnmanagedToBeRemoved = createNicWithNetworkImplementationDetails("eth_unmanaged1_toBeRemoved", false); VdsNetworkInterface nicWithUnmanaged = createNicWithNetworkImplementationDetails("eth_unmanaged", false); VdsNetworkInterface nicWithManagedToBeRemoved = createNicWithNetworkImplementationDetails("eth_managed_toBeRemoved", true); VdsNetworkInterface nicWithManaged = createNicWithNetworkImplementationDetails("eth_managed", true); List<VdsNetworkInterface> existingInterfaces = Arrays.asList(nicWithUnmanagedToBeRemoved, nicWithUnmanaged, nicWithManagedToBeRemoved, nicWithManaged); Set<String> removedUnmanagedNetworks = new HashSet<>(Arrays.asList("eth_unmanaged1_toBeRemoved", "eth_managed_toBeRemoved")); List<VdsNetworkInterface> unmanagedNicsList = validator.filterNicsWithUnmanagedNetworks(existingInterfaces, removedUnmanagedNetworks); assertEquals(1, unmanagedNicsList.size()); assertEquals("eth_unmanaged", unmanagedNicsList.get(0).getName()); }

Target:
public void testFilterNicsWithUnmanagedNetworksUmngmtNetRemoved(){ VdsNetworkInterface nicWithUnmanagedToBeRemoved = createNicWithNetworkImplementationDetails("eth_unmanaged1_toBeRemoved", false); VdsNetworkInterface nicWithUnmanaged = createNicWithNetworkImplementationDetails("eth_unmanaged", false); VdsNetworkInterface nicWithManagedToBeRemoved = createNicWithNetworkImplementationDetails("eth_managed_toBeRemoved", true); VdsNetworkInterface nicWithManaged = createNicWithNetworkImplementationDetails("eth_managed", true); List<VdsNetworkInterface> existingInterfaces = Arrays.asList(nicWithUnmanagedToBeRemoved, nicWithUnmanaged, nicWithManagedToBeRemoved, nicWithManaged); Collection<String> removedUnmanagedNetworks = Arrays.asList("eth_unmanaged1_toBeRemoved", "eth_managed_toBeRemoved"); Set<String> unmanagedNicsSet = validator.filterNicsWithUnmanagedNetworks(existingInterfaces, removedUnmanagedNetworks); assertEquals(1, unmanagedNicsSet.size()); assertTrue(unmanagedNicsSet.contains("eth_unmanaged")); }
Source:
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); exclusiveBusMethods = new ExclusiveBusConsumer(); disposables.add(WikipediaApp.getInstance().getBus().subscribe(new NonExclusiveBusConsumer())); setTheme(); removeSplashBackground(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1 && AppShortcuts.ACTION_APP_SHORTCUT.equals(getIntent().getAction())) { getIntent().putExtra(INTENT_EXTRA_INVOKE_SOURCE, Constants.InvokeSource.APP_SHORTCUTS); String shortcutId = getIntent().getStringExtra(APP_SHORTCUT_ID); if (!TextUtils.isEmpty(shortcutId)) { getApplicationContext().getSystemService(ShortcutManager.class) .reportShortcutUsed(shortcutId); } } if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); } PeriodicWorkRequest editorReactivationWorker = new PeriodicWorkRequest.Builder(SuggestedEditsReactivationWorker.class, 1, TimeUnit.DAYS) .setConstraints(new Constraints.Builder().build()) .setInitialDelay(1, TimeUnit.HOURS) .build(); WorkManager.getInstance(this) .enqueueUniquePeriodicWork("suggested-edits-worker", KEEP, editorReactivationWorker); new RecurringTasksExecutor(WikipediaApp.getInstance()).run(); if (Prefs.isReadingListsFirstTimeSync() && AccountUtil.isLoggedIn()) { Prefs.setReadingListsFirstTimeSync(false); Prefs.setReadingListSyncEnabled(true); ReadingListSyncAdapter.manualSyncWithForce(); } IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION); registerReceiver(networkStateReceiver, filter); DeviceUtil.setLightSystemUiVisibility(this); setNavigationBarColor(ResourceUtil.getThemedColor(this, R.attr.paper_color)); maybeShowLoggedOutInBackgroundDialog(); }

Target:
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); exclusiveBusMethods = new ExclusiveBusConsumer(); disposables.add(WikipediaApp.getInstance().getBus().subscribe(new NonExclusiveBusConsumer())); setTheme(); removeSplashBackground(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1 && AppShortcuts.ACTION_APP_SHORTCUT.equals(getIntent().getAction())) { getIntent().putExtra(INTENT_EXTRA_INVOKE_SOURCE, Constants.InvokeSource.APP_SHORTCUTS); String shortcutId = getIntent().getStringExtra(APP_SHORTCUT_ID); if (!TextUtils.isEmpty(shortcutId)) { getApplicationContext().getSystemService(ShortcutManager.class) .reportShortcutUsed(shortcutId); } } if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); } NotificationPollBroadcastReceiver.startPollTask(WikipediaApp.getInstance()); new RecurringTasksExecutor(WikipediaApp.getInstance()).run(); if (Prefs.isReadingListsFirstTimeSync() && AccountUtil.isLoggedIn()) { Prefs.setReadingListsFirstTimeSync(false); Prefs.setReadingListSyncEnabled(true); ReadingListSyncAdapter.manualSyncWithForce(); } IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION); registerReceiver(networkStateReceiver, filter); DeviceUtil.setLightSystemUiVisibility(this); setNavigationBarColor(ResourceUtil.getThemedColor(this, R.attr.paper_color)); maybeShowLoggedOutInBackgroundDialog(); }
Source:
public AggregatedVcfLineMapper(VariantSource source) { switch (source.getAggregation()) { case EVS: factory = new VariantVcfEVSFactory(); break; case EXAC: factory = new VariantVcfExacFactory(); break; case BASIC: factory = new VariantAggregatedVcfFactory(); break; case NONE: factory = null; throw new IllegalArgumentException( this.getClass().getSimpleName() + " should not take non-aggregated " + "VCFs, but the VariantSource is marked as Aggregation.NONE"); } this.source = source; }

Target:
public AggregatedVcfLineMapper(VariantSource source) { switch (source.getAggregation()) { case EVS: factory = new VariantVcfEVSFactory(); break; case EXAC: factory = new VariantVcfExacFactory(); break; case BASIC: factory = new VariantAggregatedVcfFactory(); break; case NONE: throw new IllegalArgumentException( this.getClass().getSimpleName() + " should be used to read aggregated VCFs only, " + "but the VariantSource.Aggregation is set to NONE"); } this.source = source; }
Source:
public FailureInfo getLastFailureInfo() { Exception lastFailureException = getLastFailureException(); if (lastFailureException == null) { return null; } else { return Failures.toFailure(lastFailureException).toFailureInfo(); } }

Target:
public FailureInfo getLastFailureInfo() { Exception lastFailureException = getLastFailureException(); if (lastFailureException == null) { return null; } return Failures.toFailure(lastFailureException).toFailureInfo(); }
Source:
public TestRunner addConfig(String key, String value) { Preconditions.checkNotNull(key); Preconditions.checkNotNull(value); String configKeyPrefix = String.format(JobConfig.CONFIG_JOB_PREFIX(), JOB_NAME); configs.put(String.format("%s%s", configKeyPrefix, key), value); return this; }

Target:
public TestRunner addConfig(String key, String value) { Preconditions.checkNotNull(key); Preconditions.checkNotNull(value); String configPrefix = String.format(JobConfig.CONFIG_OVERRIDE_JOBS_PREFIX(), getJobNameAndId()); configs.put(String.format("%s%s", configPrefix, key), value); return this; }
Source:
protected Control createPageControls(final Composite parent) { setTitle("Rebase Change"); setMessage(""); Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); Label label = new Label(composite, SWT.NONE); label.setText("Rebase Change?"); parent.getDisplay().asyncExec(new Runnable() { @Override public void run() { if (!parent.isDisposed()) { setReturnCode(Window.OK); close(); } } }); return composite; }

Target:
protected Control createPageControls(final Composite parent) { setTitle("Rebase Patch Set"); setMessage(""); Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(1, false)); Label label = new Label(composite, SWT.NONE); label.setText(NLS.bind("Rebase patch set {0}", patchSet.getRefName())); parent.getDisplay().asyncExec(new Runnable() { @Override public void run() { if (!parent.isDisposed()) { setReturnCode(Window.OK); close(); } } }); return composite; }
Source:
private static ParametersRunnerFactory getParametersRunnerFactory( Class<?> klass) throws InstantiationException, IllegalAccessException { UseParametersRunnerFactory annotation = klass .getAnnotation(UseParametersRunnerFactory.class); if (annotation == null) { return DEFAULT_FACTORY; } else { Class<? extends ParametersRunnerFactory> factoryClass = annotation .value(); return factoryClass.newInstance(); } }

Target:
private ParametersRunnerFactory getParametersRunnerFactory(Class<?> klass) throws InstantiationException, IllegalAccessException { UseParametersRunnerFactory annotation = klass .getAnnotation(UseParametersRunnerFactory.class); if (annotation == null) { return DEFAULT_FACTORY; } else { Class<? extends ParametersRunnerFactory> factoryClass = annotation .value(); return factoryClass.newInstance(); } }
Source:
public static ConnectionInfo fromURI(URI originalUri) { final String uriStr = originalUri.toASCIIString(); URI uri = originalUri; final ConnectionInfo connInfo = new ConnectionInfo(); connInfo.scheme = uriStr.substring(0, uriStr.indexOf("://")); if (connInfo.scheme.split(":").length > 1) { int idx = uriStr.indexOf(':'); uri = URI.create(uriStr.substring(idx + 1)); } String path = uri.getPath(); if (path != null && !path.isEmpty()) { String pathElements = path.substring(1).split("/"); if (pathElements.length != 1) { throw new TajoInternalError("Invalid JDBC path: " + path); } connInfo.dbName = pathElements[0]; } Map<String, String> params = new HashMap<>(); int paramIndex = uriStr.indexOf("?"); if (paramIndex > 0) { String parameterPart = uriStr.substring(paramIndex+1, uriStr.length()); String eachParam = parameterPart.split("&"); for (String each: eachParam) { String keyValues = each.split("="); if (keyValues.length != 2) { throw new TajoInternalError("Invalid URI Parameters: " + parameterPart); } params.put(keyValues[0], keyValues[1]); } } if (params.containsKey("table")) { connInfo.tableName = params.remove("table"); } if (params.containsKey("user")) { connInfo.user = params.remove("user"); } if (params.containsKey("password")) { connInfo.password = params.remove("password"); } connInfo.params = params; return connInfo; }

Target:
public static ConnectionInfo fromURI(URI originalUri) { final String uriStr = originalUri.toASCIIString(); URI uri = originalUri; final ConnectionInfo connInfo = new ConnectionInfo(); connInfo.scheme = uriStr.substring(0, uriStr.indexOf("://")); if (connInfo.scheme.split(":").length > 1) { int idx = uriStr.indexOf(':'); uri = URI.create(uriStr.substring(idx + 1)); } connInfo.host = uri.getHost(); String path = uri.getPath(); if (path != null && !path.isEmpty()) { String pathElements = path.substring(1).split("/"); if (pathElements.length != 1) { throw new TajoInternalError("Invalid JDBC path: " + path); } connInfo.dbName = pathElements[0]; } Map<String, String> params = new HashMap<>(); int paramIndex = uriStr.indexOf("?"); if (paramIndex > 0) { String parameterPart = uriStr.substring(paramIndex+1, uriStr.length()); String eachParam = parameterPart.split("&"); for (String each: eachParam) { String keyValues = each.split("="); if (keyValues.length != 2) { throw new TajoInternalError("Invalid URI Parameters: " + parameterPart); } params.put(keyValues[0], keyValues[1]); } } if (params.containsKey("table")) { connInfo.tableName = params.remove("table"); } if (params.containsKey("user")) { connInfo.user = params.remove("user"); } if (params.containsKey("password")) { connInfo.password = params.remove("password"); } connInfo.params = params; return connInfo; }
Source:
public List<ScheduledSystemJob> getScheduledSystemJobsForUser() throws SchedulerException { List<ScheduledSystemJob> ssJobs = new ArrayList<ScheduledSystemJob>(); Scheduler scheduler = getScheduler(); for (String group : scheduler.getTriggerGroupNames()) { for (TriggerKey triggerKey : scheduler.getTriggerKeys(groupEquals(group))) { if (scheduler.getTrigger(triggerKey).getJobKey().getGroup().equalsIgnoreCase(SYSTEM_JOBS_KEY)) { if (doesUserHavePermissionToTrigger(scheduler.getTrigger(triggerKey))) { Trigger curTrigger = getScheduler().getTrigger(triggerKey); String jobName = curTrigger.getKey().getName(); JobDetail jobDetail = getScheduler().getJobDetail(getScheduler().getTrigger(triggerKey).getJobKey()); String jobDescription = jobDetail.getDescription(); Date nextRunDate = curTrigger.getNextFireTime(); if (curTrigger instanceof CronTrigger) { ssJobs.add(new ScheduledSystemJob(jobName, jobDescription, nextRunDate, TriggerSchedule.REPEATABLE)); } else if (curTrigger instanceof SimpleTrigger) { jobName = curTrigger.getJobKey().getName(); ssJobs.add(new ScheduledSystemJob(jobName, jobDescription, nextRunDate, TriggerSchedule.ONE_TIME)); } } } } } return ssJobs; }

Target:
public List<ScheduledSystemJob> getScheduledSystemJobsForUser() throws SchedulerException { List<ScheduledSystemJob> ssJobs = new ArrayList<ScheduledSystemJob>(); Scheduler scheduler = getScheduler(); for (String group : scheduler.getTriggerGroupNames()) { for (TriggerKey triggerKey : scheduler.getTriggerKeys(groupEquals(group))) { if (scheduler.getTrigger(triggerKey).getJobKey().getGroup().equalsIgnoreCase(SYSTEM_JOBS_KEY)) { Trigger curTrigger = getScheduler().getTrigger(triggerKey); String jobName = curTrigger.getKey().getName(); JobDetail jobDetail = getScheduler().getJobDetail(getScheduler().getTrigger(triggerKey).getJobKey()); String jobDescription = jobDetail.getDescription(); Date nextRunDate = curTrigger.getNextFireTime(); if (curTrigger instanceof CronTrigger) { ssJobs.add(new ScheduledSystemJob(jobName, jobDescription, nextRunDate, TriggerSchedule.REPEATABLE)); } else if (curTrigger instanceof SimpleTrigger) { jobName = curTrigger.getJobKey().getName(); ssJobs.add(new ScheduledSystemJob(jobName, jobDescription, nextRunDate, TriggerSchedule.ONE_TIME)); } } } } return ssJobs; }
Source:
public static int getBookmark(final String fullPathToFile) { boolean trace = LOGGER.isTraceEnabled(); int result = 0; try (Connection connection = database.getConnection()) { String query = "SELECT BOOKMARK FROM " + TABLE_NAME + " WHERE FILENAME = " + sqlQuote(fullPathToFile); if (trace) { LOGGER.trace("Searching " + TABLE_NAME + " with \"{}\"", query); } TABLE_LOCK.readLock().lock(); try (Statement statement = connection.createStatement()) { try (ResultSet resultSet = statement.executeQuery(query)) { if (resultSet.next()) { result = resultSet.getInt("BOOKMARK"); } } } finally { TABLE_LOCK.readLock().unlock(); } } catch (SQLException e) { LOGGER.error("Database error while looking up file status in " + TABLE_NAME + " for \"{}\": {}", fullPathToFile, e.getMessage()); LOGGER.trace("", e); } return result; }

Target:
public static int getBookmark(final String fullPathToFile) { boolean trace = LOGGER.isTraceEnabled(); int result = 0; try (Connection connection = database.getConnection()) { String query = "SELECT BOOKMARK FROM " + TABLE_NAME + " WHERE FILENAME = " + sqlQuote(fullPathToFile); if (trace) { LOGGER.trace("Searching " + TABLE_NAME + " with \"{}\"", query); } TABLE_LOCK.readLock().lock(); try (Statement statement = connection.createStatement()) { try (ResultSet resultSet = statement.executeQuery(query)) { if (resultSet.next()) { result = resultSet.getInt("BOOKMARK"); } } } finally { TABLE_LOCK.readLock().unlock(); } } catch (SQLException e) { LOGGER.error("Database error while looking up file bookmark in " + TABLE_NAME + " for \"{}\": {}", fullPathToFile, e.getMessage()); LOGGER.trace("", e); } return result; }
Source:
public void serialize( final Duration duration, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider ) throws IOException { if (duration != null) { jsonGenerator.writeString(Util.encode(duration.toString())); } else { jsonGenerator.writeNull(); } }

Target:
public void serialize( final Duration duration, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider ) throws IOException { if (duration != null) { jsonGenerator.writeString(duration.toString()); } else { jsonGenerator.writeNull(); } }
Source:
protected void doStart() throws Exception { FirebaseDatabase .getInstance(endpoint.getFirebaseApp()) .getReference(firebaseConfig.getRootReference()) .addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String s) { forwardMessage(new FirebaseMessage.Builder(Operation.CHILD_ADD, dataSnapshot) .setPreviousChildName(s).build()); } @Override public void onChildChanged(DataSnapshot dataSnapshot, String s) { forwardMessage(new FirebaseMessage.Builder(Operation.CHILD_CHANGED, dataSnapshot) .setPreviousChildName(s).build()); } @Override public void onChildRemoved(DataSnapshot dataSnapshot) { forwardMessage(new FirebaseMessage.Builder(Operation.CHILD_REMOVED, dataSnapshot).build()); } @Override public void onChildMoved(DataSnapshot dataSnapshot, String s) { forwardMessage(new FirebaseMessage.Builder(Operation.CHILD_MOVED, dataSnapshot) .setPreviousChildName(s).build()); } @Override public void onCancelled(DatabaseError databaseError) { forwardMessage(new FirebaseMessage.Builder(Operation.CANCELLED).setDatabaseError(databaseError) .build()); } }); }

Target:
protected void doStart() throws Exception { FirebaseDatabase .getInstance(endpoint.getFirebaseApp()) .getReference(firebaseConfig.getRootReference()) .addChildEventListener(new FirebaseConsumerEventListener()); }
Source:
public Repository open(final HttpServletRequest req, final String repositoryName) throws RepositoryNotFoundException, ServiceNotEnabledException { if (isUnreasonableName(repositoryName)) throw new RepositoryNotFoundException(repositoryName); final Repository db; try { final File gitdir = new File(basePath, repositoryName); db = RepositoryCache.open(FileKey.lenient(gitdir), true); } catch (IOException e) { final RepositoryNotFoundException notFound; notFound = new RepositoryNotFoundException(repositoryName); notFound.initCause(e); throw notFound; } try { if (isExportOk(req, repositoryName, db)) return db; else throw new ServiceNotEnabledException(); } catch (RuntimeException e) { db.close(); final RepositoryNotFoundException notFound; notFound = new RepositoryNotFoundException(repositoryName); notFound.initCause(e); throw notFound; } catch (IOException e) { db.close(); final RepositoryNotFoundException notFound; notFound = new RepositoryNotFoundException(repositoryName); notFound.initCause(e); throw notFound; } catch (ServiceNotEnabledException e) { db.close(); throw e; } }

Target:
public Repository open(final HttpServletRequest req, final String repositoryName) throws RepositoryNotFoundException, ServiceNotEnabledException { if (isUnreasonableName(repositoryName)) throw new RepositoryNotFoundException(repositoryName); final Repository db; try { final File gitdir = new File(basePath, repositoryName); db = RepositoryCache.open(FileKey.lenient(gitdir), true); } catch (IOException e) { throw new RepositoryNotFoundException(repositoryName, e); } try { if (isExportOk(req, repositoryName, db)) { return db; } else throw new ServiceNotEnabledException(); } catch (RuntimeException e) { db.close(); throw new RepositoryNotFoundException(repositoryName, e); } catch (IOException e) { db.close(); throw new RepositoryNotFoundException(repositoryName, e); } catch (ServiceNotEnabledException e) { db.close(); throw e; } }
Source:
public Response getDatabaseSegments(@Context final HttpServletRequest req) { final Collection<ImmutableDruidDataSource> druidDataSources = metadataSegmentManager.getInventory(); final Stream<DataSegment> metadataSegments = druidDataSources .stream() .flatMap(t -> t.getSegments().stream()); Function<DataSegment, Iterable<ResourceAction>> raGenerator = segment -> Collections.singletonList( AuthorizationUtils.DATASOURCE_READ_RA_GENERATOR.apply(segment.getDataSource())); final Iterable<DataSegment> authorizedSegments = AuthorizationUtils.filterAuthorizedResources( req, () -> metadataSegments.iterator(), raGenerator, authorizerMapper); final StreamingOutput stream = outputStream -> { final JsonFactory jsonFactory = jsonMapper.getFactory(); try (final JsonGenerator jsonGenerator = jsonFactory.createGenerator(outputStream)) { jsonGenerator.writeStartArray(); for (DataSegment ds : authorizedSegments) { jsonGenerator.writeObject(ds); jsonGenerator.flush(); } jsonGenerator.writeEndArray(); } }; Response.ResponseBuilder builder = Response.status(Response.Status.OK); return builder.entity(stream).build(); }

Target:
public Response getDatabaseSegments(@Context final HttpServletRequest req) { final Collection<ImmutableDruidDataSource> druidDataSources = metadataSegmentManager.getInventory(); final Stream<DataSegment> metadataSegments = druidDataSources .stream() .flatMap(t -> t.getSegments().stream()); Function<DataSegment, Iterable<ResourceAction>> raGenerator = segment -> Collections.singletonList( AuthorizationUtils.DATASOURCE_READ_RA_GENERATOR.apply(segment.getDataSource())); final Iterable<DataSegment> authorizedSegments = AuthorizationUtils.filterAuthorizedResources( req, metadataSegments::iterator, raGenerator, authorizerMapper); final StreamingOutput stream = outputStream -> { final JsonFactory jsonFactory = jsonMapper.getFactory(); try (final JsonGenerator jsonGenerator = jsonFactory.createGenerator(outputStream)) { jsonGenerator.writeStartArray(); for (DataSegment ds : authorizedSegments) { jsonGenerator.writeObject(ds); jsonGenerator.flush(); } jsonGenerator.writeEndArray(); } }; Response.ResponseBuilder builder = Response.status(Response.Status.OK); return builder.entity(stream).build(); }
Source:
public static String getHostIP() { try { final Enumeration<NetworkInterface> b = NetworkInterface.getNetworkInterfaces(); while (b.hasMoreElements()) { for (final InterfaceAddress f : b.nextElement().getInterfaceAddresses()) { if (f.getAddress().isSiteLocalAddress()) { return f.getAddress().toString().replace("/", ""); } } } } catch (SocketException e) { e.printStackTrace(); } return null; }

Target:
public static String getHostIP() throws SocketException { String hostIP = null; final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); outer_cycle: while (networkInterfaces.hasMoreElements()) { for (final InterfaceAddress interfaceAddress : networkInterfaces.nextElement().getInterfaceAddresses()) { if (interfaceAddress.getAddress().isSiteLocalAddress()) { hostIP = interfaceAddress.getAddress().toString().replace("/", ""); break outer_cycle; } } } if (hostIP == null) { throw new IllegalStateException("No local network address is found."); } return hostIP; }
Source:
public void addTxContext(ClientTxContext txCtx) { if (txsCnt.incrementAndGet() > ACTIVE_TX_LIMIT) { txsCnt.decrementAndGet(); throw new IgniteClientException(ClientStatus.TX_LIMIT_EXCEEDED, "Active transactions per connection limit " + "(" + ACTIVE_TX_LIMIT + ") exceeded. To start a new transaction you need to wait for some of currently " + "active transactions complete. To change the limit set up " + IGNITE_THIN_MAX_ACTIVE_TX_PER_CONNECTION + " servers system property."); } txs.put(txCtx.txId(), txCtx); }

Target:
public void addTxContext(ClientTxContext txCtx) { if (txsCnt.incrementAndGet() > maxActiveTxCnt) { txsCnt.decrementAndGet(); throw new IgniteClientException(ClientStatus.TX_LIMIT_EXCEEDED, "Active transactions per connection limit " + "(" + maxActiveTxCnt + ") exceeded. To start a new transaction you need to wait for some of currently " + "active transactions complete. To change the limit set up " + "ThinClientConfiguration.MaxActiveTxPerConnection property."); } txs.put(txCtx.txId(), txCtx); }
Source:
public synchronized int join() throws IOException, InterruptedException { try { procHolderForJoin = start(); LOGGER.log(Level.FINER, "Started the process {0}", procHolderForJoin); final int returnCode = procHolderForJoin.join(); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.log(Level.FINER, "Process {0} has finished with the return code {1}", new Object[] {procHolderForJoin, returnCode}); } return returnCode; } finally { procHolderForJoin = null; } }

Target:
public int join() throws IOException, InterruptedException { final Proc procHolderForJoin = start(); LOGGER.log(Level.FINER, "Started the process {0}", procHolderForJoin); try { final int returnCode = procHolderForJoin.join(); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.log(Level.FINER, "Process {0} has finished with the return code {1}", new Object[]{procHolderForJoin, returnCode}); } return returnCode; } finally { if (procHolderForJoin.isAlive()) { LOGGER.log(Level.WARNING, "Process not finished after call to join() completed"); } } }
Source:
public User toNewUser() { User user = new User(username, password, uniqueId, getUserType()); user.setRecordId(recordId); user.setWrappedKey(getWrappedKey()); user.properties = getProperties(); user.setLastSyncToken(syncToken); user.setRememberMe(this.rememberMe == true); return user; }

Target:
public User toNewUser() { User user = new User(username, password, uniqueId, getUserType()); user.setRecordId(recordId); user.setWrappedKey(getWrappedKey()); user.properties = getProperties(); user.setLastSyncToken(syncToken); user.setRememberMe(this.rememberMe); return user; }
Source:
public void testBuildTableBad_02() { try { SSE.parseOp("(table (vars ?x) (row (?x _:anon)))"); Assert.fail("Parsing should fail"); } catch (ExprBuildException e) { } }

Target:
public void testBuildTableBad_02() { SSE.parseOp("(table (vars ?x) (row (?x _)))"); }