auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static JsonRpcClient createClient(String hostname, int port, ClientPolicy connectionPolicy, ClientPolicy clientPolicy, boolean isSecure, ReactorType type, String protocol, int parallelism) { ManagerProvider provider = null; if (isSecure) { provider = new EngineManagerProvider(protocol); } try { final Reactor reactor = ReactorFactory.getReactor(provider, type); return getJsonClient(reactor, hostname, port, connectionPolicy, clientPolicy, parallelism); } catch (ClientConnectionException e) { log.error("Exception occured during building ssl context or obtaining selector"); log.debug("Exception", e); throw new IllegalStateException(e); } }

Target:
private static JsonRpcClient createClient(String hostname, int port, ClientPolicy connectionPolicy, ClientPolicy clientPolicy, boolean isSecure, ReactorType type, String protocol, int parallelism) { ManagerProvider provider = null; if (isSecure) { provider = new EngineManagerProvider(protocol); } try { final Reactor reactor = ReactorFactory.getReactor(provider, type); return getJsonClient(reactor, hostname, port, connectionPolicy, clientPolicy, parallelism); } catch (ClientConnectionException e) { log.error("Exception occurred during building ssl context or obtaining selector for '{}': {}", hostname, e.getMessage()); log.debug("Exception", e); throw new IllegalStateException(e); } }
Source:
protected void handlePropertyChangeEvent(PropertyChangeEvent event) { String key= event.getProperty(); if (key.equals(ICompareUIConstants.PROP_ANCESTOR_VISIBLE)) { fAncestorVisible= Utilities.getBoolean(getCompareConfiguration(), ICompareUIConstants.PROP_ANCESTOR_VISIBLE, fAncestorVisible); fComposite.layout(true); updateCursor(fLeftLabel, VERTICAL); updateCursor(fDirectionLabel, HORIZONTAL | VERTICAL); updateCursor(fRightLabel, VERTICAL); return; } if (key.equals(ICompareUIConstants.PROP_IGNORE_ANCESTOR)) { setAncestorVisibility(false, !Utilities.getBoolean(getCompareConfiguration(), ICompareUIConstants.PROP_IGNORE_ANCESTOR, false)); return; } if (key.equals(ComparePreferencePage.LAYOUT)) { leftToRight = event.getNewValue().equals(ICompareUIConstants.PREF_VALUE_LEFT_TO_RIGHT); updateContentProvider(); return; } }

Target:
protected void handlePropertyChangeEvent(PropertyChangeEvent event) { String key= event.getProperty(); if (key.equals(ICompareUIConstants.PROP_ANCESTOR_VISIBLE)) { fAncestorVisible= Utilities.getBoolean(getCompareConfiguration(), ICompareUIConstants.PROP_ANCESTOR_VISIBLE, fAncestorVisible); fComposite.layout(true); updateCursor(fLeftLabel, VERTICAL); updateCursor(fDirectionLabel, HORIZONTAL | VERTICAL); updateCursor(fRightLabel, VERTICAL); return; } if (key.equals(ICompareUIConstants.PROP_IGNORE_ANCESTOR)) { setAncestorVisibility(false, !Utilities.getBoolean(getCompareConfiguration(), ICompareUIConstants.PROP_IGNORE_ANCESTOR, false)); return; } if (key.equals(ComparePreferencePage.LAYOUT)) { leftToRight = ICompareUIConstants.PREF_VALUE_LEFT_TO_RIGHT .equals(event.getNewValue()); updateContentProvider(); return; } }
Source:
public void run() { try { updateFile(); lastJobSucceeded = true; lastException = null; } catch (Exception e) { log.warn("Failed to run fetch file job for {}: {}", config.remoteUrl(), e.getMessage()); lastException = e; lastJobSucceeded = false; } }

Target:
public void run() { try { updateFile(); lastJobSucceeded = true; lastException = null; } catch (Exception e) { log.warn("Failed to run fetch file job for {}", config.remoteUrl(), e); lastException = e; lastJobSucceeded = false; } }
Source:
TmfXmlStateChange(Element statechange, XmlStateProvider provider) { fProvider = provider; Node ifNode = statechange.getElementsByTagName(TmfXmlStrings.IF).item(0); if (ifNode != null) { fChange = new XmlConditionalChange(statechange); } else { fChange = new XmlStateValueChange(statechange); } }

Target:
public TmfXmlStateChange(Element statechange, XmlStateProvider provider) { fProvider = provider; Node ifNode = statechange.getElementsByTagName(TmfXmlStrings.IF).item(0); if (ifNode != null) { fChange = new XmlConditionalChange(statechange); } else { fChange = new XmlStateValueChange(statechange); } }
Source:
private void updateExternalNics(){ Map<VmDeviceId, VmDevice> nicDevices = Entities.businessEntitiesById(vmDeviceDao.getVmDeviceByVmIdAndType(getVmId(), VmDeviceGeneralType.INTERFACE)); for (VmNetworkInterface nic : vmNetworkInterfaceDao.getAllForVm(getVmId())) { VnicProfile vnicProfile = vnicProfileDao.get(nic.getVnicProfileId()); Network network = networkDao.get(vnicProfile.getNetworkId()); if (network.isExternal()) { Provider<?> provider = providerDao.get(network.getProvidedBy().getProviderId()); NetworkProviderProxy providerProxy = providerProxyFactory.create(provider); Map<String, String> deviceProperties = providerProxy.allocate(network, vnicProfile, nic, destinationVds, true); VmDevice vmDevice = nicDevices.get(new VmDeviceId(nic.getId(), getVmId())); getVm().getRuntimeDeviceCustomProperties().put(vmDevice.getId(), deviceProperties); } } }

Target:
private void updateExternalNics(){ Map<VmDeviceId, VmDevice> nicDevices = Entities.businessEntitiesById(vmDeviceDao.getVmDeviceByVmIdAndType(getVmId(), VmDeviceGeneralType.INTERFACE)); for (VmNetworkInterface nic : vmNetworkInterfaceDao.getAllForVm(getVmId())) { VnicProfile vnicProfile = vnicProfileDao.get(nic.getVnicProfileId()); Network network = networkDao.get(vnicProfile.getNetworkId()); if (network.isExternal() && nic.isPlugged()) { Provider<?> provider = providerDao.get(network.getProvidedBy().getProviderId()); NetworkProviderProxy providerProxy = providerProxyFactory.create(provider); Map<String, String> deviceProperties = providerProxy.allocate(network, vnicProfile, nic, destinationVds, true); VmDevice vmDevice = nicDevices.get(new VmDeviceId(nic.getId(), getVmId())); getVm().getRuntimeDeviceCustomProperties().put(vmDevice.getId(), deviceProperties); } } }
Source:
public boolean renameFolder(final Folder folder, final String newName, final User user, final boolean respectFrontEndPermissions) throws DotDataException, DotSecurityException { boolean renamed = false; if (!permissionAPI.doesUserHavePermission(folder, PermissionAPI.PERMISSION_EDIT, user, respectFrontEndPermissions)) { throw new DotSecurityException("User " + (user.getUserId() != null?user.getUserId() : BLANK) + " does not have permission to edit folder" + folder.getPath()); } try { renamed = folderFactory.renameFolder(folder, newName, user, respectFrontEndPermissions); CacheLocator.getNavToolCache().removeNav(folder.getHostId(), folder.getInode()); Identifier folderId = APILocator.getIdentifierAPI().find(folder); CacheLocator.getNavToolCache().removeNavByPath(folderId.getHostId(), folderId.getParentPath()); return renamed; } catch (InvalidFolderNameException e) { Logger.error(FolderAPIImpl.class, e.getMessage()); throw e; } catch (Exception e) { throw new DotDataException(e.getMessage(),e); } }

Target:
public boolean renameFolder(final Folder folder, final String newName, final User user, final boolean respectFrontEndPermissions) throws DotDataException, DotSecurityException { boolean renamed; if (!permissionAPI.doesUserHavePermission(folder, PermissionAPI.PERMISSION_EDIT, user, respectFrontEndPermissions)) { throw new DotSecurityException("User " + (user.getUserId() != null?user.getUserId() : BLANK) + " does not have permission to edit folder" + folder.getPath()); } try { renamed = folderFactory.renameFolder(folder, newName, user, respectFrontEndPermissions); CacheLocator.getNavToolCache().removeNav(folder.getHostId(), folder.getInode()); Identifier folderId = APILocator.getIdentifierAPI().find(folder); CacheLocator.getNavToolCache().removeNavByPath(folderId.getHostId(), folderId.getParentPath()); return renamed; } catch (InvalidFolderNameException e) { Logger.error(FolderAPIImpl.class, "Error renaming folder '" + folder.getPath() + "' with id: " + folder.getIdentifier() + " to name: " + newName + ". Error: " + e.getMessage()); throw e; } catch (Exception e) { Logger.error(FolderAPIImpl.class, "Error renaming folder '" + folder.getPath() + "' with id: " + folder.getIdentifier() + " to name: " + newName + ". Error: " + e.getMessage()); throw new DotDataException(e.getMessage(),e); } }
Source:
public void testDefaults() { assertRecordedDefaults(recordDefaults(DruidConfig.class) .setDruidBrokerUrl(null) .setDruidCoordinatorUrl(null) .setDruidSchema("druid") .setComputePushdownEnabled(false) .setHadoopConfiguration("") .setDruidAuthenticationType(null)); }

Target:
public void testDefaults() { assertRecordedDefaults(recordDefaults(DruidConfig.class) .setDruidBrokerUrl(null) .setDruidCoordinatorUrl(null) .setDruidSchema("druid") .setComputePushdownEnabled(false) .setHadoopConfiguration("") .setDruidAuthenticationType(NONE) .setBasicAuthenticationUsername(null) .setBasicAuthenticationPassword(null)); }
Source:
private void updateMatchedEntries() { if (preferencesService.getDisplayGroupCount()) { BackgroundTask .wrap(() -> groupNode.calculateNumberOfMatches(databaseContext.getDatabase())) .onSuccess(hits::setValue) .executeWith(taskExecutor); BackgroundTask .wrap(() -> groupNode.findMatches(databaseContext.getDatabase())) .onSuccess(entries -> { matchedEntries.clear(); matchedEntries.addAll(entries); }) .executeWith(taskExecutor); } }

Target:
private void updateMatchedEntries() { if (preferencesService.getDisplayGroupCount()) { BackgroundTask .wrap(() -> groupNode.findMatches(databaseContext.getDatabase())) .onSuccess(entries -> { matchedEntries.clear(); matchedEntries.addAll(entries); }) .executeWith(taskExecutor); } }
Source:
public TaskLock lock(final Task task, final Interval interval, long timeoutMs) throws InterruptedException { long nanos = TIME_UNIT.toNanos(timeoutMs); giant.lockInterruptibly(); try { Optional<TaskLock> taskLock; while (!(taskLock = tryLock(task, interval)).isPresent()) { if (nanos <= 0) { return null; } nanos = lockReleaseCondition.awaitNanos(nanos); } return taskLock.get(); } finally { giant.unlock(); } }

Target:
public TaskLock lock(final Task task, final Interval interval, long timeoutMs) throws InterruptedException { long nanos = TimeUnit.MILLISECONDS.toNanos(timeoutMs); giant.lockInterruptibly(); try { Optional<TaskLock> taskLock; while (!(taskLock = tryLock(task, interval)).isPresent()) { if (nanos <= 0) { return null; } nanos = lockReleaseCondition.awaitNanos(nanos); } return taskLock.get(); } finally { giant.unlock(); } }
Source:
private void checkpointNote(NotebookSocket conn, Notebook notebook, Message fromMessage) throws IOException { String noteId = (String) fromMessage.get("noteId"); String commitMessage = (String) fromMessage.get("commitMessage"); AuthenticationInfo subject = new AuthenticationInfo(fromMessage.principal); Revision revision = notebook.checkpointNote(noteId, commitMessage, subject); if (!Revision.EMPTY.equals(revision)) { List<Revision> revisions = notebook.listRevisionHistory(noteId, subject); conn.send(serializeMessage(new Message(OP.LIST_REVISION_HISTORY) .put("revisionList", revisions))); } }

Target:
private void checkpointNote(NotebookSocket conn, Notebook notebook, Message fromMessage) throws IOException { String noteId = (String) fromMessage.get("noteId"); String commitMessage = (String) fromMessage.get("commitMessage"); AuthenticationInfo subject = new AuthenticationInfo(fromMessage.principal); Revision revision = notebook.checkpointNote(noteId, commitMessage, subject); if (!Revision.isEmpty(revision)) { List<Revision> revisions = notebook.listRevisionHistory(noteId, subject); conn.send(serializeMessage(new Message(OP.LIST_REVISION_HISTORY) .put("revisionList", revisions))); } else { conn.send(serializeMessage(new Message(OP.ERROR_INFO).put("info", "Couldn't checkpoint note revision: possibly storage doesn't support versioning. " + "Please check the logs for more details."))); } }
Source:
public static Collection<Object[]> namesParams() { return Arrays.asList(new Object[][] { { null, false, false, true }, { "", false, false, false }, { "a.a.a.a", false, false, false }, { "255.255.0", false, false, false }, { "255.255.0", false, false, false }, { "255.255.0.0.0", false, false, false }, { "255.255.0.0.", false, false, false }, { "31 ", false, false, false }, { "33", false, false, false }, { "33", false, false, false }, { "31/", false, false, false }, { "31*", false, false, false }, { " { "/31 ", false, false, false }, { "01", false, false, true }, { "01/", false, false, false }, { "33", false, false, false }, { "/33", false, false, false }, { "255.255.0.1", true, false, false }, { "255.255.0.1", true, false, false }, { "255.0.255.0", true, false, false }, { "255.0.0.255", true, false, false }, { "224.0.255.0", true, false, false }, { "255.255.0.0", true, true, false }, { "255.255.0.0", true, true, false }, { "255.255.255.255", true, true, false }, { "31", false, true, true }, { "/31", false, true, true }, { "7", false, true, true }, { "/7", false, true, true }, { "255.255.0.1", true, false, true }, { "255.255.0.1", true, false, false }, { "255.255.0.0", true, true, false }, }); }

Target:
public static Collection<Object[]> namesParams() { Random random = new Random(); return Arrays.asList(new Object[][] { { null, false, random.nextBoolean(), false }, { "", false, random.nextBoolean(), false }, { "a.a.a.a", false, random.nextBoolean(), false }, { "255.255.0", false, random.nextBoolean(), false }, { "255.255.0.0.0", false, random.nextBoolean(), false }, { "255.255.0.0.", false, random.nextBoolean(), false }, { "31 ", false, random.nextBoolean(), false }, { "/31 ", false, random.nextBoolean(), false }, { "31/", false, random.nextBoolean(), false }, { "31*", false, random.nextBoolean(), false }, { " { "33", false, random.nextBoolean(), false }, { "/33", false, random.nextBoolean(), false }, { "01", false, random.nextBoolean(), false }, { "01/", false, random.nextBoolean(), false }, { "255.255.0.1", true, false, false }, { "255.0.255.0", true, false, false }, { "255.0.0.255", true, false, false }, { "224.0.255.0", true, false, false }, { "255.255.0.0", true, true, false }, { "255.255.255.255", true, true, false }, { "31", false, random.nextBoolean(), true }, { "/31", false, random.nextBoolean(), true }, { "7", false, random.nextBoolean(), true }, { "/7", false, random.nextBoolean(), true }, }); }
Source:
private static <T> Set<T> findDuplicates(Collection<T> list) { Set<T> duplicates = new HashSet<>(); Set<T> uniques = new HashSet<>(); for(T t : list) { if(!uniques.add(t)) { duplicates.add(t); } } return duplicates; }

Target:
private static <T> Set<T> findDuplicates(Collection<T> list) { Set<T> duplicates = new HashSet<>(); Set<T> uniques = new HashSet<>(); list.stream().forEach(t -> { if (!uniques.add(t)) { duplicates.add(t); } }); return duplicates; }
Source:
private static Iterable<List<List<Object>>> asBatches(Iterator<List<Object>> dataRows) { return () -> new Iterator<List<List<Object>>>() { @Override public boolean hasNext() { return dataRows.hasNext(); } @Override public List<List<Object>> next() { List<List<Object>> batch = new ArrayList<>(); while (dataRows.hasNext() || batch.size() < BATCH_SIZE) { batch.add(ImmutableList.copyOf(dataRows.next())); } return batch; } }; }

Target:
private static Iterable<List<List<Object>>> asBatches(Iterator<List<Object>> dataRows) { return () -> new Iterator<List<List<Object>>>() { @Override public boolean hasNext() { return dataRows.hasNext(); } @Override public List<List<Object>> next() { List<List<Object>> batch = new ArrayList<>(); while (dataRows.hasNext() && batch.size() < BATCH_SIZE) { batch.add(dataRows.next()); } return batch; } }; }
Source:
public int compare(StreamInputReader a, StreamInputReader b) { EventDefinition event_a = a.getCurrentEvent(); EventDefinition event_b = b.getCurrentEvent(); if (event_a == null || event_b == null) { return 0; } long ta = event_a.getTimestamp(); long tb = event_b.getTimestamp(); return Utils.unsignedCompare(ta, tb); }

Target:
public int compare(StreamInputReader a, StreamInputReader b) { EventDefinition event_a = a.getCurrentEvent(); EventDefinition event_b = b.getCurrentEvent(); if (event_a == null || event_b == null) { throw new IllegalArgumentException(); } long ta = event_a.getTimestamp(); long tb = event_b.getTimestamp(); return Utils.unsignedCompare(ta, tb); }
Source:
public synchronized BigtableTableAdminClient getTableAdminClient() { if (this.tableAdminClient == null) { Channel channel = createChannel( createTransportOptions(options.getTableAdminHost()), options.getChannelOptions(), batchPool, 1); this.tableAdminClient = new BigtableTableAdminGrpcClient(channel); } return tableAdminClient; }

Target:
public synchronized BigtableTableAdminClient getTableAdminClient() { if (this.tableAdminClient == null) { Channel channel = createChannel( createTransportOptions(options.getTableAdminHost()), 1); this.tableAdminClient = new BigtableTableAdminGrpcClient(channel); } return tableAdminClient; }
Source:
public void destruct(Nd nd, long address) { Database db = nd.getDB(); short poolId = getMemoryPoolId(nd); long headerStartAddress = address + this.offset; long firstBlockAddress = FIRST_BLOCK.get(nd, headerStartAddress); int elementCount = getElementSize(); if (this.inlineElementCount > 0) { long firstAddress = headerStartAddress + LIST_HEADER_BYTES; boolean blockFull = (firstBlockAddress != 0); int blockSize = blockFull ? this.inlineElementCount : db.getShort(firstAddress + this.inlineElementCount * elementCount - Database.SHORT_SIZE); destructElements(nd, firstAddress, blockSize); } long nextBlockAddress = firstBlockAddress; while (pointsToAnotherBlock(nextBlockAddress)) { long currentBlockAddress = nextBlockAddress; nextBlockAddress = BlockHeader.NEXT_BLOCK.get(nd, nextBlockAddress); boolean blockFull = (nextBlockAddress != 0); long firstElementInBlockAddress = currentBlockAddress + BlockHeader.BLOCK_HEADER_BYTES; int blockSize = blockFull ? this.elementsPerBlock : db.getShort( firstElementInBlockAddress + this.elementsPerBlock * elementCount - Database.SHORT_SIZE); destructElements(nd, firstElementInBlockAddress, blockSize); db.free(currentBlockAddress, poolId); } db.clearRange(headerStartAddress, getRecordSize()); }

Target:
public void destruct(Nd nd, long address) { Database db = nd.getDB(); short poolId = getMemoryPoolId(nd); long headerStartAddress = address + this.offset; long firstBlockAddress = FIRST_BLOCK.get(nd, headerStartAddress); long nextBlockAddress = firstBlockAddress; while (nextBlockAddress != 0) { long currentBlockAddress = nextBlockAddress; nextBlockAddress = BlockHeader.NEXT_BLOCK.get(nd, currentBlockAddress); int elementsInBlock = BlockHeader.ELEMENTS_IN_USE.get(nd, currentBlockAddress); destructElements(nd, currentBlockAddress + BlockHeader.BLOCK_HEADER_BYTES, elementsInBlock); db.free(currentBlockAddress, poolId); } db.clearRange(headerStartAddress, getRecordSize()); }
Source:
public void testListForTraces() { TmfTraceStub trace = null; final URL location = FileLocator.find(TmfCoreTestPlugin.getDefault().getBundle(), new Path(DIRECTORY + File.separator + TEST_STREAM), null); try { File test = new File(FileLocator.toFileURL(location).toURI()); trace = new TmfTraceStub(test.toURI().getPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null, null); Map<String, IAnalysisModule> map = TmfAnalysisManager.getAnalysisModules(trace); assertTrue(map.containsKey("org.eclipse.linuxtools.tmf.core.tests.analysis.test")); assertTrue(map.containsKey("org.eclipse.linuxtools.tmf.core.tests.analysis.test2")); assertFalse(map.containsKey("org.eclipse.linuxtools.tmf.core.tests.analysis.testctf")); } catch (URISyntaxException e) { fail("Cannot generate trace"); } catch (IOException e) { fail("Cannot generate trace"); } catch (TmfTraceException e) { fail("Cannot generate trace"); } finally { if (trace != null) { trace.dispose(); } } CtfTmfTrace ctftrace = null; try { String PATH = CtfTmfTestTraces.getTestTracePath(0); ctftrace = new CtfTmfTrace(); ctftrace.initTrace((IResource) null, PATH, CtfTmfEvent.class); Map<String, IAnalysisModule> map = TmfAnalysisManager.getAnalysisModules(ctftrace); assertTrue(map.containsKey("org.eclipse.linuxtools.tmf.core.tests.analysis.test")); assertTrue(map.containsKey("org.eclipse.linuxtools.tmf.core.tests.analysis.test2")); assertTrue(map.containsKey("org.eclipse.linuxtools.tmf.core.tests.analysis.testctf")); } catch (TmfTraceException e) { fail("Cannot generate ctf trace"); } finally { if (ctftrace != null) { ctftrace.dispose(); } } }

Target:
public void testListForTraces() { ITmfTrace trace = TmfTestTrace.A_TEST_10K.getTrace(); Map<String, IAnalysisModule> map = TmfAnalysisManager.getAnalysisModules(trace); assertTrue(map.containsKey(MODULE_PARAM)); assertTrue(map.containsKey(MODULE_PARAM_DEFAULT)); assertFalse(map.containsKey(MODULE_CTF)); CtfTmfTrace ctftrace = CtfTmfTestTrace.KERNEL.getTrace(); map = TmfAnalysisManager.getAnalysisModules(ctftrace); assertTrue(map.containsKey(MODULE_PARAM)); assertTrue(map.containsKey(MODULE_PARAM_DEFAULT)); assertTrue(map.containsKey(MODULE_CTF)); }
Source:
public static LanguageServer getLanguageServer(@NonNull IFile file, @NonNull LanguageServerDefinition lsDefinition) throws IOException { ProjectSpecificLanguageServerWrapper wrapper = getLSWrapper(file, capabilites -> Boolean.TRUE, lsDefinition); if (wrapper != null) { wrapper.connect(file.getLocation(), null); return wrapper.getServer(); } return null; }

Target:
public static LanguageServer getLanguageServer(@NonNull IFile file, @NonNull LanguageServerDefinition lsDefinition) throws IOException { ProjectSpecificLanguageServerWrapper wrapper = getLSWrapperForConnection(file.getProject(), lsDefinition); if (wrapper != null) { wrapper.connect(file.getLocation(), null); return wrapper.getServer(); } return null; }
Source:
public void notifyBuildEnded(GerritTriggeredEvent event) { if (event instanceof ChangeBasedEvent) { IGerritHudsonTriggerConfig serverConfig = getServerConfig(event); if ((serverConfig != null && serverConfig.isGerritBuildCurrentPatchesOnly()) || this.getBuildCancellationPolicy().isEnabled()) { getRunningJobs().remove((ChangeBasedEvent)event); } } }

Target:
public void notifyBuildEnded(GerritTriggeredEvent event) { if (event instanceof ChangeBasedEvent) { IGerritHudsonTriggerConfig serverConfig = getServerConfig(event); if ((serverConfig != null && serverConfig.isGerritBuildCurrentPatchesOnly()) || (this.getBuildCancellationPolicy() != null && this.getBuildCancellationPolicy().isEnabled())) { getRunningJobs().remove((ChangeBasedEvent)event); } } }
Source:
protected void onPostExecute(@Nullable Address address) { if (address == null) { return; } if (address.getMaxAddressLineIndex() > 0) { StringBuilder sb = new StringBuilder(); for (int i = 0; ; ++i) { sb.append(address.getAddressLine(i)); if (i == address.getMaxAddressLineIndex()) { sb.append("."); break; } else { sb.append(", "); } } mLocationTextView.setText(sb.toString()); } }

Target:
protected void onPostExecute(@Nullable Address address) { if (!isAdded() || address == null || address.getMaxAddressLineIndex() == 0) { return; } StringBuilder sb = new StringBuilder(); for (int i = 0; ; ++i) { sb.append(address.getAddressLine(i)); if (i == address.getMaxAddressLineIndex()) { sb.append("."); break; } else { sb.append(", "); } } mLocationTextView.setText(sb.toString()); }
Source:
public Network(String addr, String description, Guid id, String name, String vdsmName, String subnet, String gateway, Integer type, Integer vlan_id, boolean stp, int mtu, boolean vmNetwork) { this(); this.addr = addr; this.setDescription(description); this.id = id; this.name = name; this.vdsmName = vdsmName; this.subnet = subnet; this.gateway = gateway; this.type = type; this.vlanId = vlan_id; this.stp = stp; this.mtu = mtu; this.vmNetwork = vmNetwork; this.comment = ""; }

Target:
public Network(String addr, String description, Guid id, String name, String vdsmName, String subnet, String gateway, Integer type, Integer vlan_id, boolean stp, int mtu, boolean vmNetwork) { this(); this.addr = addr; this.setDescription(description); this.id = id; this.setName(name); this.vdsmName = vdsmName; this.subnet = subnet; this.gateway = gateway; this.type = type; this.vlanId = vlan_id; this.stp = stp; this.mtu = mtu; this.vmNetwork = vmNetwork; this.comment = ""; }
Source:
public void setHeaderFields() throws Exception { String authUser = "user"; RuntimeEngine runtimeEngine = RemoteRuntimeEngineFactory.newRestBuilder() .addUserName(authUser) .addPassword("pass") .addUrl(new URL("http://localhost:8080/business-central")) .addHeader("HEADER-NAME", "header-value") .build(); try { runtimeEngine.getTaskService().claim(23l, "user"); fail( "This should have failed because there's no server running... "); } catch( org.kie.remote.client.api.exception.RemoteCommunicationException rce ) { logger.info("The " + NoSuchAlgorithmException.class.getSimpleName() + " above is expected, nothing is wrong."); } }

Target:
public void setHeaderFields() throws Exception { RuntimeEngine runtimeEngine = RemoteRuntimeEngineFactory.newRestBuilder() .addUserName("user") .addPassword("pass") .addUrl(new URL("http://localhost:8080/business-central")) .addHeader("HEADER-NAME", "header-value") .clearHeaderFields() .clearCorrelationProperties() .addDeploymentId("dep-id") .build(); try { runtimeEngine.getTaskService().claim(23l, "user"); fail( "This should have failed because there's no server running... "); } catch( org.kie.remote.client.api.exception.RemoteCommunicationException rce ) { } }
Source:
public static ISymbolProvider getSymbolProvider(ITmfTrace trace) { return new DefaultSymbolProvider(trace); }

Target:
public ISymbolProvider getSymbolProvider(ITmfTrace trace) { return getSymbolProviders(trace).iterator().next(); }
Source:
public Void call() throws Exception { Objects.requireNonNull(acl, "New acl to be added not specified."); OzoneAddress address = new OzoneAddress(uri); address.ensureBucketAddress(); OzoneClient client = address.createClient(createOzoneConfiguration()); String volumeName = address.getVolumeName(); String bucketName = address.getBucketName(); if (isVerbose()) { System.out.printf("Volume Name : %s%n", volumeName); System.out.printf("Bucket Name : %s%n", bucketName); } OzoneObj obj = OzoneObjInfo.Builder.newBuilder() .setBucketName(bucketName) .setVolumeName(volumeName) .setResType(OzoneObj.ResourceType.BUCKET) .setStoreType(storeType == null ? OZONE : OzoneObj.StoreType.valueOf(storeType)) .build(); boolean result = client.getObjectStore().addAcl(obj, OzoneAcl.parseAcl(acl)); System.out.printf("%s%n", result ? "ACL set successfully" : "ACL not set"); client.close(); return null; }

Target:
public Void call() throws Exception { Objects.requireNonNull(acl, "New acl to be added not specified."); OzoneAddress address = new OzoneAddress(uri); address.ensureBucketAddress(); OzoneClient client = address.createClient(createOzoneConfiguration()); String volumeName = address.getVolumeName(); String bucketName = address.getBucketName(); if (isVerbose()) { System.out.printf("Volume Name : %s%n", volumeName); System.out.printf("Bucket Name : %s%n", bucketName); } OzoneObj obj = OzoneObjInfo.Builder.newBuilder() .setBucketName(bucketName) .setVolumeName(volumeName) .setResType(OzoneObj.ResourceType.BUCKET) .setStoreType(storeType == null ? OZONE : OzoneObj.StoreType.valueOf(storeType)) .build(); boolean result = client.getObjectStore().addAcl(obj, OzoneAcl.parseAcl(acl)); System.out.printf("%s%n", "Acl added successfully: " + result); client.close(); return null; }
Source:
Mono<DecryptResult> decryptAsync(EncryptionAlgorithm algorithm, byte[] cipherText, byte[] iv, byte[] authenticationData, byte[] authenticationTag, Context context, JsonWebKey jsonWebKey) { if (iv != null || authenticationData != null || authenticationTag != null) { return Mono.error(new IllegalArgumentException( "iv, " + "authenticationData and authenticationTag parameters are not supported for Rsa decrypt operation")); } keyPair = getKeyPair(jsonWebKey); Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithm.toString()); if (baseAlgorithm == null) { if (serviceCryptoAvailable()) { return serviceClient.decrypt(algorithm, cipherText, context); } return Mono.error(new NoSuchAlgorithmException(algorithm.toString())); } else if (!(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) { return Mono.error(new NoSuchAlgorithmException(algorithm.toString())); } if (keyPair.getPrivate() == null) { if (serviceCryptoAvailable()) { return serviceClient.decrypt(algorithm, cipherText, context); } return Mono.error(new IllegalArgumentException( "Private portion of the key not available to perform decrypt operation")); } AsymmetricEncryptionAlgorithm algo = (AsymmetricEncryptionAlgorithm) baseAlgorithm; ICryptoTransform transform; try { transform = algo.createDecryptor(keyPair); return Mono.just(new DecryptResult(transform.doFinal(cipherText))); } catch (InvalidKeyException | NoSuchAlgorithmException | NoSuchPaddingException | IllegalBlockSizeException | BadPaddingException e) { return Mono.error(e); } }

Target:
Mono<DecryptResult> decryptAsync(EncryptionAlgorithm algorithm, byte[] cipherText, byte[] iv, byte[] authenticationData, byte[] authenticationTag, Context context, JsonWebKey jsonWebKey) { if (iv != null || authenticationData != null || authenticationTag != null) { return Mono.error(new IllegalArgumentException( "iv, authenticationData and authenticationTag parameters are not supported for Rsa decrypt operation")); } keyPair = getKeyPair(jsonWebKey); Algorithm baseAlgorithm = AlgorithmResolver.Default.get(algorithm.toString()); if (baseAlgorithm == null) { if (serviceCryptoAvailable()) { return serviceClient.decrypt(algorithm, cipherText, context); } return Mono.error(new NoSuchAlgorithmException(algorithm.toString())); } else if (!(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) { return Mono.error(new NoSuchAlgorithmException(algorithm.toString())); } if (keyPair.getPrivate() == null) { if (serviceCryptoAvailable()) { return serviceClient.decrypt(algorithm, cipherText, context); } return Mono.error(new IllegalArgumentException( "Private portion of the key not available to perform decrypt operation")); } AsymmetricEncryptionAlgorithm algo = (AsymmetricEncryptionAlgorithm) baseAlgorithm; ICryptoTransform transform; try { transform = algo.createDecryptor(keyPair); return Mono.just(new DecryptResult(transform.doFinal(cipherText))); } catch (InvalidKeyException | NoSuchAlgorithmException | NoSuchPaddingException | IllegalBlockSizeException | BadPaddingException e) { return Mono.error(e); } }
Source:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_GROUP_RESOURCE_ATTR_DEF); attr.setFriendlyName("projectDirPermissions"); attr.setDisplayName("projectDirPermissions"); attr.setType(Integer.class.getName()); attr.setDescription("Permissions (ACL) to directory, where the project exists. Standard unix file system permissions in numeric format."); return attr; }

Target:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_GROUP_RESOURCE_ATTR_DEF); attr.setFriendlyName("projectDirPermissions"); attr.setDisplayName("Project directory permission"); attr.setType(Integer.class.getName()); attr.setDescription("Permissions (ACL) to directory, where the project exists. Standard unix file system permissions in numeric format."); return attr; }
Source:
public PropertyInvertedRegexTester(IPersonAttributesGroupTestDefinition definition) { super(definition); final String propertyName = definition.getTestValue(); String regexExpression = PropertiesManager.getProperty (propertyName, ""); if (StringUtils.isBlank(regexExpression)) { logger.error("Unable to find property name in portal.properties or has empty value." + " PAGS PropertyInvertedRegexTester will always return true for attribute {}", propertyName, definition.getAttributeName()); } setPattern(regexExpression); }

Target:
public PropertyInvertedRegexTester(IPersonAttributesGroupTestDefinition definition) { super(definition); setPattern(definition.getAttributeName(), definition.getTestValue()); }
Source:
public static byte[] encodeOSCoreResponse(OSCoreCtx ctx, final boolean newPartialIV) { int firstByte = 0x00; ByteArrayOutputStream bRes = new ByteArrayOutputStream(); if(ctx.getIncludeContextId() == true) { firstByte = firstByte | 0x10; } if (newPartialIV) { byte[] partialIV = OSSerializer.processPartialIV(ctx.getSenderSeq()); firstByte = firstByte | (partialIV.length & 0x07); bRes.write(firstByte); try { bRes.write(partialIV); } catch (IOException e) { e.printStackTrace(); } } else { bRes.write(firstByte); } if(ctx.getIncludeContextId() == true) { try { bRes.write(ctx.getIdContext().length); bRes.write(ctx.getIdContext()); } catch (IOException e) { e.printStackTrace(); } } byte[] optionBytes = bRes.toByteArray(); if(optionBytes.length == 1 && optionBytes[0] == 0x00) { return Bytes.EMPTY; } else { return optionBytes; } }

Target:
public static byte[] encodeOSCoreResponse(OSCoreCtx ctx, final boolean newPartialIV) { int firstByte = 0x00; ByteArrayOutputStream bRes = new ByteArrayOutputStream(); if (ctx.getIncludeContextId()) { firstByte = firstByte | 0x10; } if (newPartialIV) { byte[] partialIV = OSSerializer.processPartialIV(ctx.getSenderSeq()); firstByte = firstByte | (partialIV.length & 0x07); bRes.write(firstByte); try { bRes.write(partialIV); } catch (IOException e) { e.printStackTrace(); } } else { bRes.write(firstByte); } if (ctx.getIncludeContextId()) { try { bRes.write(ctx.getIdContext().length); bRes.write(ctx.getIdContext()); } catch (IOException e) { e.printStackTrace(); } } byte[] optionBytes = bRes.toByteArray(); if (optionBytes.length == 1 && optionBytes[0] == 0x00) { return Bytes.EMPTY; } else { return optionBytes; } }
Source:
public void start() { parseOptions(); if(inlineHash) { if(excludes == null || excludes.isEmpty()) { stackHasher = new StackHasher(); } else { stackHasher = new StackHasher(StackElementFilter.byPattern(excludes)); } } super.start(); }

Target:
public void start() { parseOptions(); if(excludes == null || excludes.isEmpty()) { if(inlineHash) { addInfo("[inlineHash] is active with no exclusion pattern: use non null source info filter to exclude generated classnames (see doc)"); stackElementFilter = StackElementFilter.withSourceInfo(); } else { stackElementFilter = StackElementFilter.any(); } } else { stackElementFilter = StackElementFilter.byPattern(excludes); } if(inlineHash) { stackHasher = new StackHasher(stackElementFilter); } super.start(); }
Source:
private void closeLockServiceIfPossible() { if (lockService instanceof Closeable) { try { ((Closeable) lockService).close(); } catch (IOException e) { throw Throwables.rewrapAndThrowUncheckedException(e); } } }

Target:
private void closeLockServiceIfPossible() { if (lockService instanceof AutoCloseable) { try { ((AutoCloseable) lockService).close(); } catch (Exception e) { throw Throwables.rewrapAndThrowUncheckedException("Exception when closing the lock service", e); } } }
Source:
public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); ImageView image = (ImageView) view.findViewById(R.id.promo_dialog_image); image.setImageResource(mDrawableId); LinearLayout imageContainer = (LinearLayout) view.findViewById(R.id.promo_dialog_image_container); imageContainer.setVisibility(DisplayUtils.isLandscape(getActivity()) ? View.GONE : View.VISIBLE); WPTextView title = (WPTextView) view.findViewById(R.id.promo_dialog_title); title.setText(mTitleId); WPTextView description = (WPTextView) view.findViewById(R.id.promo_dialog_description); description.setText(mDescriptionId); WPTextView link = (WPTextView) view.findViewById(R.id.promo_dialog_link); if (mLinkId != 0) { link.setText(mLinkId); link.setOnClickListener(mLinkOnClickListener); } else { link.setVisibility(View.GONE); } Button buttonNegative = (Button) view.findViewById(R.id.promo_dialog_button_negative); if (mButtonNegativeId != 0) { buttonNegative.setText(mButtonNegativeId); buttonNegative.setOnClickListener(mNegativeButtonOnClickListener); } else { buttonNegative.setVisibility(View.GONE); } Button buttonPositive = (Button) view.findViewById(R.id.promo_dialog_button_positive); buttonPositive.setText(mButtonPositiveId); buttonPositive.setOnClickListener(mPositiveButtonOnClickListener); }

Target:
public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); ImageView image = (ImageView) view.findViewById(R.id.promo_dialog_image); image.setImageResource(mDrawableResId); LinearLayout imageContainer = (LinearLayout) view.findViewById(R.id.promo_dialog_image_container); imageContainer.setVisibility(DisplayUtils.isLandscape(getActivity()) ? View.GONE : View.VISIBLE); WPTextView title = (WPTextView) view.findViewById(R.id.promo_dialog_title); title.setText(mTitleResId); WPTextView description = (WPTextView) view.findViewById(R.id.promo_dialog_description); description.setText(mDescriptionResId); WPTextView link = (WPTextView) view.findViewById(R.id.promo_dialog_link); if (mLinkResId != 0) { link.setText(mLinkResId); link.setOnClickListener(mLinkOnClickListener); } else { link.setVisibility(View.GONE); } Button buttonNegative = (Button) view.findViewById(R.id.promo_dialog_button_negative); if (mButtonNegativeResId != 0) { buttonNegative.setText(mButtonNegativeResId); buttonNegative.setOnClickListener(mNegativeButtonOnClickListener); } else { buttonNegative.setVisibility(View.GONE); } Button buttonPositive = (Button) view.findViewById(R.id.promo_dialog_button_positive); buttonPositive.setText(mButtonPositiveResId); buttonPositive.setOnClickListener(mPositiveButtonOnClickListener); }
Source:
private void showErrorsAndCleanupState(FactModelTuple factModelTuple) { StringBuilder builder = new StringBuilder(); boolean showError = false; if (factModelTuple.getTopLevelCollectionError().size() > 0) { showError = true; builder.append("Top-level collections are not supported! Violated by:<br/>"); factModelTuple.getTopLevelCollectionError().forEach(error -> builder.append("<b>" + error + "</b><br/>")); builder.append("<br/>"); } if (factModelTuple.getMultipleNestedCollectionError().size() > 0) { showError = true; builder.append("Nested collections are not supported! Violated by:<br/>"); factModelTuple.getMultipleNestedCollectionError().forEach(error -> builder.append("<b>" + error + "</b><br/>")); builder.append("<br/>"); } if (factModelTuple.getMultipleNestedObjectError().size() > 0) { showError = true; builder.append("Complex nested objects inside a collection are not supported! Violated by:<br/>"); factModelTuple.getMultipleNestedObjectError().forEach(error -> builder.append("<b>" + error + "</b><br/>")); } if (showError) { factModelTuple.getTopLevelCollectionError().clear(); factModelTuple.getMultipleNestedCollectionError().clear(); factModelTuple.getMultipleNestedObjectError().clear(); eventBus.fireEvent(new UnsupportedDMNEvent(builder.toString())); } }

Target:
private void showErrorsAndCleanupState(FactModelTuple factModelTuple) { StringBuilder builder = new StringBuilder(); boolean showError = false; if (factModelTuple.getMultipleNestedCollectionError().size() > 0) { showError = true; builder.append("Nested collections are not supported! Violated by:<br/>"); factModelTuple.getMultipleNestedCollectionError().forEach(error -> builder.append("<b>" + error + "</b><br/>")); builder.append("<br/>"); } if (factModelTuple.getMultipleNestedObjectError().size() > 0) { showError = true; builder.append("Complex nested objects inside a collection are not supported! Violated by:<br/>"); factModelTuple.getMultipleNestedObjectError().forEach(error -> builder.append("<b>" + error + "</b><br/>")); } if (showError) { factModelTuple.getMultipleNestedCollectionError().clear(); factModelTuple.getMultipleNestedObjectError().clear(); eventBus.fireEvent(new UnsupportedDMNEvent(builder.toString())); } }
Source:
private DataNodeId getCloudDataNode() throws ReplicationException { if (vcrNodes.get().size() == 0) { logger.error("No vcr node found to replicate partition from cloud."); throw new ReplicationException("No vcr node found to replicate partition from cloud."); } return vcrNodes.get().toArray(new CloudDataNode[0])[Utils.getRandomShort(new Random()) % vcrNodes.get().size()]; }

Target:
DataNodeId getCloudDataNode() throws ReplicationException { List<CloudDataNode> nodes = vcrNodes.get(); if (nodes.isEmpty()) { throw new ReplicationException("No VCR node found to replicate partition from cloud."); } return nodes.get(Utils.getRandomShort(random) % nodes.size()); }
Source:
private TokenMap getTokenMap() { Optional<? extends TokenMap> maybeTokenMap = session().getMetadata().getTokenMap(); if (maybeTokenMap.isPresent()) { TokenMap tokenMap = maybeTokenMap.get(); assertThat(tokenMap.getPartitionerName()).isEqualTo(expectedPartitionerName); return tokenMap; } else { fail("Expected token map to be present"); return null; } }

Target:
private TokenMap getTokenMap() { return session() .getMetadata() .getTokenMap() .map( tokenMap -> { assertThat(tokenMap.getPartitionerName()).isEqualTo(expectedPartitionerName); return tokenMap; }) .orElseThrow(() -> new AssertionError("Expected token map to be present")); }
Source:
public StatsManager(StorageManager storageManager, List<PartitionId> partitionIds, MetricRegistry registry, StatsManagerConfig config, Time time) throws IOException { this.storageManager = storageManager; initialPartitionIds = partitionIds; statsOutputFile = new File(config.outputFilePath); publishPeriodInSecs = config.publishPeriodInSecs; metrics = new StatsManagerMetrics(registry); this.time = time; scheduler = Utils.newScheduler(1, false); }

Target:
public StatsManager(StorageManager storageManager, List<PartitionId> partitionIds, MetricRegistry registry, StatsManagerConfig config, Time time) throws IOException { this.storageManager = storageManager; totalPartitionIds = partitionIds; statsOutputFile = new File(config.outputFilePath); publishPeriodInSecs = config.publishPeriodInSecs; metrics = new StatsManagerMetrics(registry); this.time = time; }
Source:
public Entity getEntity(IGroupMember member) { if (member != null) { EntityEnum entityEnum = getEntityType(member); Entity entity; if (entityEnum.isGroup()) { entity = EntityFactory.createEntity((IEntityGroup) member, entityEnum); } else { entity = EntityFactory.createEntity(member, entityEnum); } if (entity.getName() == null) { entity.setName(lookupEntityName(entity)); } if (EntityEnum.GROUP.toString().equals(entity.getEntityType()) || EntityEnum.PERSON.toString().equals(entity.getEntityType())) { IAuthorizationPrincipal authP = getPrincipalForEntity(entity); Principal principal = new PrincipalImpl(authP.getKey(), authP.getPrincipalString()); entity.setPrincipal(principal); } return entity; } return null; }

Target:
public Entity getEntity(IGroupMember member) { if (member == null) { return null; } EntityEnum entityEnum = getEntityType(member); Entity entity; if (entityEnum.isGroup()) { entity = EntityFactory.createEntity((IEntityGroup) member, entityEnum); } else { entity = EntityFactory.createEntity(member, entityEnum); } if (entity.getName() == null) { entity.setName(lookupEntityName(entity)); } if (EntityEnum.GROUP.toString().equals(entity.getEntityType()) || EntityEnum.PERSON.toString().equals(entity.getEntityType())) { IAuthorizationPrincipal authP = getPrincipalForEntity(entity); Principal principal = new PrincipalImpl(authP.getKey(), authP.getPrincipalString()); entity.setPrincipal(principal); } return entity; }
Source:
public void presentation(String programName, String programEditor, String editorURL, String scriptorName, String prefixName) throws CancelException { StringBuffer buffer = new StringBuffer(); Formatter formatter = new Formatter(buffer); formatter.format("This wizard will help you install %1$s on your computer.\n\nThis program was created by: %2$s\n%3$s\n\nThis installation program is provided by: %4$s\n\n%1$s will be installed in: ${application.user.wineprefix}%5$s\n\n${application.name} is not responsible for anything that might happen as a result of using these scripts.\n\nClick Next to start", programName, programEditor, editorURL, scriptorName, prefixName); presentation(translate(buffer.toString())); }

Target:
public void presentation(String programName, String programEditor, String editorURL, String scriptorName, String prefixName) throws CancelException { final String textToShow = String.format(translate("This wizard will help you install %1$s on your computer.\n\n" + "This program was created by: %2$s\n%3$s\n\nThis installation program is provided by: %4$s" + "\n\n%1$s will be installed in: ${application.user.wineprefix}%5$s\n\n" + "${application.name} is not responsible for anything that might happen as a result of using" + " these scripts.\n\nClick Next to start") , programName, programEditor, editorURL, scriptorName, prefixName); presentation(textToShow); }
Source:
protected String currentTimestampDatabaseQuery() { return "SELECT CURRENT_TIMESTAMP;"; }

Target:
protected String currentTimestampDatabaseQuery() { return "SELECT CURRENT_TIMESTAMP"; }
Source:
public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); if (isVisibleToUser && unit != null) { initializeYoutubePlayer(); } else { removeFragment(); fromLandscape = false; transcriptsHandler.removeCallbacksAndMessages(null); subtitleDisplayHandler.removeCallbacks(subtitlesProcessorRunnable); initializeHandler.removeCallbacks(null); } }

Target:
public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); if (isVisibleToUser && unit != null) { setVideoModel(); initializeHandler.postDelayed(() -> { initializeYoutubePlayer(); }, 1000); } else { releaseYoutubePlayer(); allowFullScreen = true; transcriptsHandler.removeCallbacksAndMessages(null); subtitleDisplayHandler.removeCallbacks(subtitlesProcessorRunnable); initializeHandler.removeCallbacks(null); } }
Source:
static List<String> generateRandomLogSegmentName(int count) { List<String> randomLogSegmentNames = new ArrayList<>(); while (randomLogSegmentNames.size() < count) { String logSegmentNames = Integer.toString(TestUtils.RANDOM.nextInt(20)) + '_' + Integer.toString(TestUtils.RANDOM.nextInt(20)); if (randomLogSegmentNames.contains(logSegmentNames)) { continue; } randomLogSegmentNames.add(logSegmentNames); } Collections.sort(randomLogSegmentNames, LogSegmentNameHelper.COMPARATOR); return randomLogSegmentNames; }

Target:
static List<String> generateRandomLogSegmentName(int count) { List<String> randomLogSegmentNames = new ArrayList<>(); while (randomLogSegmentNames.size() < count) { String logSegmentName = LogSegmentNameHelper.getName(TestUtils.RANDOM.nextInt(count * 1000), TestUtils.RANDOM.nextInt(count * 1000)); if (!randomLogSegmentNames.contains(logSegmentName)) { randomLogSegmentNames.add(logSegmentName); } } Collections.sort(randomLogSegmentNames, LogSegmentNameHelper.COMPARATOR); return randomLogSegmentNames; }
Source:
private final IonType load_annotation_start_with_value_type() throws IOException { IonType value_type; int alen = readVarUInt(); _annotations.start(getPosition(), 0); skip(alen); _annotations.markEnd(); _value_tid = read_type_id(); if (_value_tid == PrivateIonConstants.tidNopPad) { throwErrorAt("NOP padding is not allowed within annotation wrappers."); } if (_value_tid == UnifiedInputStreamX.EOF) { throwErrorAt("unexpected EOF encountered where a type descriptor byte was expected"); } if (_value_tid == PrivateIonConstants.tidTypedecl) { throwErrorAt("Malformed ION, annotation of an annotation found."); } value_type = get_iontype_from_tid(_value_tid); assert( value_type != null ); return value_type; }

Target:
private final IonType load_annotation_start_with_value_type() throws IOException { IonType value_type; int alen = readVarUInt(); _annotations.start(getPosition(), 0); skip(alen); _annotations.markEnd(); _value_tid = read_type_id(); if (_value_tid == PrivateIonConstants.tidNopPad) { throwErrorAt("NOP padding is not allowed within annotation wrappers."); } if (_value_tid == UnifiedInputStreamX.EOF) { throwErrorAt("unexpected EOF encountered where a type descriptor byte was expected"); } if (_value_tid == PrivateIonConstants.tidTypedecl) { throwErrorAt("An annotation wrapper may not contain another annotation wrapper."); } value_type = get_iontype_from_tid(_value_tid); assert( value_type != null ); return value_type; }