auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public ResponseEntity putStringPattern(@PathVariable("tenant") final String tenant, <END> @PathVariable("name") final String name, @RequestBody final StringPatternModel stringPatternModel) { final StringPattern stringPattern; switch (stringPatternModel.getPatternType()) { case STRING: stringPattern = new SimpleStringPattern(name, stringPatternModel.getPattern()); break; case REGEX: stringPattern = new RegexStringPattern(name, stringPatternModel.getPattern(), false); break; case REGEX_MATCH_ENTIRE_STRING: stringPattern = new RegexStringPattern(name, stringPatternModel.getPattern(), true); break; default: throw new IllegalArgumentException("No such string pattern type"); } final TenantContext context = _contextFactory.getContext(tenant); _referenceDataDao.removeStringPattern(context, name); _referenceDataDao.addStringPattern(context, stringPattern); return ResponseEntity.created(ServletUriComponentsBuilder.fromCurrentRequestUri().build().toUri()).build(); }</code><technical_language>ResponseEntity is a raw type. References generic type ResponseEntity<T> parameterized</technical_language>

Target:
public ResponseEntity<Void> putStringPattern(@PathVariable("tenant") final String tenant, @PathVariable("name") final String name, @RequestBody final StringPatternModel stringPatternModel) { final StringPattern stringPattern; switch (stringPatternModel.getPatternType()) { case STRING: stringPattern = new SimpleStringPattern(name, stringPatternModel.getPattern()); break; case REGEX: stringPattern = new RegexStringPattern(name, stringPatternModel.getPattern(), false); break; case REGEX_MATCH_ENTIRE_STRING: stringPattern = new RegexStringPattern(name, stringPatternModel.getPattern(), true); break; default: throw new IllegalArgumentException("No such string pattern type, " + stringPatternModel.getPatternType()); } final TenantContext context = _contextFactory.getContext(tenant); _referenceDataDao.removeStringPattern(context, name); _referenceDataDao.addStringPattern(context, stringPattern); return ResponseEntity.created(ServletUriComponentsBuilder.fromCurrentRequestUri().build().toUri()).build(); }
Source:
<code>public void createRecoveryKey() { Task<String> task = new RecoveryKeyCreationTask(); task.setOnScheduled(event -> { LOG.debug("Creating recovery key for {}.", vault.getDisplayablePath()); }); task.setOnSucceeded(event -> { String recoveryKey = task.getValue(); recoveryKeyProperty.set(recoveryKey); window.setScene(successScene.get()); }); task.setOnFailed(event -> { if (task.getException() instanceof InvalidPassphraseException) { Animations.createShakeWindowAnimation(window).play(); } else { LOG.error("Creation of recovery key failed.", task.getException()); <START> errorComponent.cause(task.getException()).window(window).returnToScene(createScene.get()).build().showErrorScene(); <END> } }); executor.submit(task); }</code><technical_language>applies same: alternative get current scene window: window.getScene() benefit in reducing code (variable definitions object injections)</technical_language>

Target:
public void createRecoveryKey() { Task<String> task = new RecoveryKeyCreationTask(); task.setOnScheduled(event -> { LOG.debug("Creating recovery key for {}.", vault.getDisplayablePath()); }); task.setOnSucceeded(event -> { String recoveryKey = task.getValue(); recoveryKeyProperty.set(recoveryKey); window.setScene(successScene.get()); }); task.setOnFailed(event -> { if (task.getException() instanceof InvalidPassphraseException) { Animations.createShakeWindowAnimation(window).play(); } else { LOG.error("Creation of recovery key failed.", task.getException()); } }); executor.submit(task); }
Source:
<code>public void run() { Message msg = null; AsyncSubscriptionImpl sub = null; ConnectionImpl nc = null; MessageHandler mcb = null; long max = 0; long delivered = 0; this.mu.lock(); while (true) { <START> while (this.msgs.isEmpty() && !this.shutdown) { <END> this.inWait = true; try { this.cond.await(); } catch (InterruptedException e) this.inWait = false; } if (this.msgs.isEmpty() && this.shutdown) { break; } msg = this.msgs.remove(0); sub = (AsyncSubscriptionImpl) msg.getSubscription(); nc = (ConnectionImpl) sub.getConnection(); mcb = sub.getMessageHandler(); max = sub.max; sub.pMsgs--; sub.pBytes -= (msg.getData() == null ? 0 : msg.getData().length); if (sub.closed) { continue; } delivered = ++(sub.delivered); this.mu.unlock(); if ((max == 0) || (delivered <= max)) { try { mcb.onMessage(msg); } catch (Throwable t) { } } if ((max > 0) && (delivered >= max)) { nc.mu.lock(); try { nc.removeSub(sub); } finally { nc.mu.unlock(); } } this.mu.lock(); } this.mu.unlock(); }</code><technical_language>Nice, this accounts for a spurious wakeup in cond.await()</technical_language>

Target:
public void run() { Message msg = null; AsyncSubscriptionImpl sub = null; ConnectionImpl nc = null; MessageHandler mcb = null; long max = 0; long delivered = 0; this.mu.lock(); while (true) { while (this.msgs.isEmpty() && !this.shutdown) { this.inWait = true; try { this.cond.await(); } catch (InterruptedException e) this.inWait = false; } if (this.msgs.isEmpty() && this.shutdown) { break; } msg = this.msgs.remove(0); sub = (AsyncSubscriptionImpl) msg.getSubscription(); if (sub.closed) { continue; } nc = sub.conn; mcb = sub.msgHandler; max = sub.max; sub.pMsgs--; sub.pBytes -= (msg.getData() == null ? 0 : msg.getData().length); delivered = ++(sub.delivered); this.mu.unlock(); if ((max == 0) || (delivered <= max)) { try { mcb.onMessage(msg); } catch (Throwable t) { } } if ((max > 0) && (delivered >= max)) { nc.mu.lock(); try { nc.removeSub(sub); } finally { nc.mu.unlock(); } } this.mu.lock(); } this.mu.unlock(); }
Source:
<code>public void handleMessageLog(TelemetryMessageLog messageLog) { LOG.debug("Received telemetry messages", messageLog.getMessageList().size()); final List<P> flowPackets = new LinkedList<>(); final List<Flow> flows = new LinkedList<>(); try (Timer.Context ctx = logParsingTimer.time()) { for (TelemetryMessageLogEntry eachMessage : messageLog.getMessageList()) { LOG.trace("Parsing packet: {}", eachMessage); final P flowPacket = parse(eachMessage); if (flowPacket != null) { flowPackets.add(flowPacket); flows.addAll(converter.convert(flowPacket)); } } packetsPerLogHistogram.update(flowPackets.size()); } try { LOG.debug("Persisting packets, flows.", flowPackets.size(), flows.size()); final FlowSource source = new FlowSource(messageLog.getLocation(), messageLog.getSourceAddress()); flowRepository.persist(flows, source); } catch (DetailedFlowException ex) { LOG.error("Error while persisting flows: {}", ex.getMessage(), ex); for (final String logMessage: ex.getDetailedLogMessages()) { LOG.error(logMessage); } } catch (FlowException ex) { LOG.error("Error while persisting flows: {}", ex.getMessage(), ex); <START> if (ex.getMessage().equals("Connection pool shut down")) { <END> LOG.error("Connection pool was shut down. Cannot recover. messages are lost", messageLog.getMessageList().size()); return; } } LOG.debug("Completed processing telemetry messages.", messageLog.getMessageList().size()); }</code><technical_language>Is a catch this, match exception? this break easily</technical_language>

Target:
public void handleMessageLog(TelemetryMessageLog messageLog) { LOG.debug("Received telemetry messages", messageLog.getMessageList().size()); final List<P> flowPackets = new LinkedList<>(); final List<Flow> flows = new LinkedList<>(); try (Timer.Context ctx = logParsingTimer.time()) { for (TelemetryMessageLogEntry eachMessage : messageLog.getMessageList()) { LOG.trace("Parsing packet: {}", eachMessage); final P flowPacket = parse(eachMessage); if (flowPacket != null) { flowPackets.add(flowPacket); flows.addAll(converter.convert(flowPacket)); } } packetsPerLogHistogram.update(flowPackets.size()); } try { LOG.debug("Persisting packets, flows.", flowPackets.size(), flows.size()); final FlowSource source = new FlowSource(messageLog.getLocation(), messageLog.getSourceAddress()); flowRepository.persist(flows, source); } catch (DetailedFlowException ex) { LOG.error("Error while persisting flows: {}", ex.getMessage(), ex); for (final String logMessage: ex.getDetailedLogMessages()) { LOG.error(logMessage); } } catch(UnrecoverableFlowException ex) { LOG.error("Error while persisting flows. Cannot recover: {}. messages are lost.", ex.getMessage(), messageLog.getMessageList().size(), ex); return; } catch (FlowException ex) { LOG.error("Error while persisting flows: {}", ex.getMessage(), ex); } LOG.debug("Completed processing telemetry messages.", messageLog.getMessageList().size()); }
Source:
<code>public void execute(CommandLine options) throws Exception { super.execute(options); String[] args = options.getArgs(); String input = args[0]; ParquetReader<SimpleRecord> reader = null; try { PrintWriter writer = new PrintWriter(Main.out, true); reader = ParquetReader.builder(new SimpleReadSupport(), new Path(input)).build(); ParquetMetadata metadata = ParquetFileReader.readFooter(new Configuration(), new Path(input)); JsonRecordFormatter.JsonGroupFormatter formatter = JsonRecordFormatter.fromSchema(metadata.getFileMetaData().getSchema()); for (SimpleRecord value = reader.read(); value != null; value = reader.read()) { if (options.hasOption('j')) { writer.write(formatter.formatRecord(value)); } else { value.prettyPrint(writer); } writer.println(); } } catch (Throwable ex) { <START> ex.printStackTrace(); <END> } finally { if (reader != null) { try { reader.close(); } catch (Exception ex) { } } } }</code><technical_language>If want do this, put side of caller of execute(...)</technical_language>

Target:
public void execute(CommandLine options) throws Exception { super.execute(options); String[] args = options.getArgs(); String input = args[0]; ParquetReader<SimpleRecord> reader = null; try { PrintWriter writer = new PrintWriter(Main.out, true); reader = ParquetReader.builder(new SimpleReadSupport(), new Path(input)).build(); ParquetMetadata metadata = ParquetFileReader.readFooter(new Configuration(), new Path(input)); JsonRecordFormatter.JsonGroupFormatter formatter = JsonRecordFormatter.fromSchema(metadata.getFileMetaData().getSchema()); for (SimpleRecord value = reader.read(); value != null; value = reader.read()) { if (options.hasOption('j')) { writer.write(formatter.formatRecord(value)); } else { value.prettyPrint(writer); } writer.println(); } } finally { if (reader != null) { try { reader.close(); } catch (Exception ex) { } } } }
Source:
<code>public boolean setChecked(Object element, boolean state) { <START> if (fObjects.containsKey(element)) { <END> if (!state || (fCheckboxTreeViewer.testFindItem(element) != null)) { fObjects.put(element, state); } } return fCheckboxTreeViewer.setChecked(element, state); }</code><technical_language>Actual bug! This check prevents a checked element in map if previously put ICheckStateListener. For example if a parent is checked programatically of child checked. map out of synch check state, element checked state change if apply filter</technical_language>

Target:
public boolean setChecked(Object element, boolean state) { boolean checkable = fCheckboxTreeViewer.setChecked(element, state); if (!state) { fObjects.remove(element); } else if (checkable) { fObjects.add(element); } return checkable; }
Source:
<code>private static ServiceTracker<LoggerFactory, Logger> openLoggerTracker() { try { ServiceTracker<LoggerFactory, Logger> tracker = new ServiceTracker<>( FrameworkUtil.getBundle(ResourceBundleHelper.class).getBundleContext(), LoggerFactory.class, new ServiceTrackerCustomizer<LoggerFactory, Logger>() { @Override public Logger addingService(ServiceReference<LoggerFactory> reference) { <START> LoggerFactory factory = reference.getBundle().getBundleContext().getService(reference); <END> if (factory != null) { return factory.getLogger(ResourceBundleHelper.class); } return null; } @Override public void modifiedService(ServiceReference<LoggerFactory> reference, Logger service) { } @Override public void removedService(ServiceReference<LoggerFactory> reference, Logger service) { } }); tracker.open(); return tracker; } catch (Throwable t) { return null; } }</code><technical_language>This is wrong. context of bundle registers service get service. a context construct tracker. context (it is in a protected field of tracker) service. LoggerFactory factory = context.getService(reference);</technical_language>

Target:
private static ServiceTracker<LoggerFactory, Logger> openLoggerTracker() { try { BundleContext context = FrameworkUtil.getBundle(ResourceBundleHelper.class).getBundleContext(); ServiceTracker<LoggerFactory, Logger> tracker = new ServiceTracker<>( context, LoggerFactory.class, new ServiceTrackerCustomizer<LoggerFactory, Logger>() { @Override public Logger addingService(ServiceReference<LoggerFactory> reference) { LoggerFactory factory = context.getService(reference); if (factory != null) { return factory.getLogger(ResourceBundleHelper.class); } return null; } @Override public void modifiedService(ServiceReference<LoggerFactory> reference, Logger service) { } @Override public void removedService(ServiceReference<LoggerFactory> reference, Logger service) { context.ungetService(reference); } }); tracker.open(); return tracker; } catch (Throwable t) { return null; } }
Source:
<code>public OracleServer(Environment env) throws Exception { this.env = env; <START> stampsHistogram = env.getSharedResources().getMetricRegistry().histogram(FluoConfiguration.FLUO_PREFIX + ".oracle.server.stamps"); <END> this.cnxnListener = new CuratorCnxnListener(); this.maxTsPath = ZookeeperPath.ORACLE_MAX_TIMESTAMP; this.curTsPath = ZookeeperPath.ORACLE_CUR_TIMESTAMP; this.oraclePath = ZookeeperPath.ORACLE_SERVER; TimerTask tt = new TimerTask() { @Override public void run() { long lastTs = currentTs-1; if (isLeader && (zkTs != lastTs)) { try { curatorFramework.setData().forPath(curTsPath, LongUtil.toByteArray(lastTs)); } catch (Exception e) { throw new IllegalStateException(e); } zkTs = lastTs; } } }; timer = new Timer("Oracle timestamp timer", true); timer.schedule(tt, ZookeeperUtil.ZK_UPDATE_PERIOD_MS, ZookeeperUtil.ZK_UPDATE_PERIOD_MS); }</code><technical_language>nice if metric name a constant if metrics constants resided in utility class in core. This encourage of constant prevent of name for metrics</technical_language>

Target:
public OracleServer(Environment env) throws Exception { this.env = env; stampsHistogram = env.getSharedResources().getMetricRegistry().histogram(MetricNames.ORACLE_SERVER_STAMPS); this.cnxnListener = new CuratorCnxnListener(); this.maxTsPath = ZookeeperPath.ORACLE_MAX_TIMESTAMP; this.curTsPath = ZookeeperPath.ORACLE_CUR_TIMESTAMP; this.oraclePath = ZookeeperPath.ORACLE_SERVER; TimerTask tt = new TimerTask() { @Override public void run() { long lastTs = currentTs-1; if (isLeader && (zkTs != lastTs)) { try { curatorFramework.setData().forPath(curTsPath, LongUtil.toByteArray(lastTs)); } catch (Exception e) { throw new IllegalStateException(e); } zkTs = lastTs; } } }; timer = new Timer("Oracle timestamp timer", true); timer.schedule(tt, ZookeeperUtil.ZK_UPDATE_PERIOD_MS, ZookeeperUtil.ZK_UPDATE_PERIOD_MS); }
Source:
<code>public void testClientCanConnectBothSecureAndUnsecure() throws Exception { System.clearProperty(NettyServerCnxnFactory.PORT_UNIFICATION_KEY); System.clearProperty(ZKClientConfig.SECURE_CLIENT); final int SERVER_COUNT = 3; final int[] clientPorts = new int[SERVER_COUNT]; int[] secureClientPorts = new int[SERVER_COUNT]; MainThread[] mt = startThreeNodeSSLCluster(clientPorts, secureClientPorts); for (int i = 0; i < SERVER_COUNT; i++) { ZKClientConfig secureClientConfig = new ZKClientConfig(); secureClientConfig.setProperty(ZKClientConfig.SECURE_CLIENT, "true"); ZooKeeper zkSecure = ClientBase.createZKClient("127.0.0.1:" + secureClientPorts[i], TIMEOUT, secureClientConfig); <START> zkSecure.create("/test", "".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); <END> ZKClientConfig unsecureClientConfig = new ZKClientConfig(); unsecureClientConfig.setProperty(ZKClientConfig.SECURE_CLIENT, "false"); ZooKeeper zkUnsecure = ClientBase.createZKClient("127.0.0.1:" + clientPorts[i], TIMEOUT, unsecureClientConfig); zkUnsecure.delete("/test", -1); zkSecure.close(); zkUnsecure.close(); } for (int i = 0; i < mt.length; i++) { mt[i].shutdown(); } }</code><technical_language>Is a check a secure connection</technical_language>

Target:
public void testClientCanConnectBothSecureAndUnsecure() throws Exception { System.clearProperty(NettyServerCnxnFactory.PORT_UNIFICATION_KEY); System.clearProperty(ZKClientConfig.SECURE_CLIENT); final int SERVER_COUNT = 3; final int[] clientPorts = new int[SERVER_COUNT]; int[] secureClientPorts = new int[SERVER_COUNT]; MainThread[] mt = startThreeNodeSSLCluster(clientPorts, secureClientPorts); for (int i = 0; i < SERVER_COUNT; i++) { ZKClientConfig secureClientConfig = new ZKClientConfig(); secureClientConfig.setProperty(ZKClientConfig.SECURE_CLIENT, "true"); ZooKeeper zkSecure = ClientBase.createZKClient("127.0.0.1:" + secureClientPorts[i], TIMEOUT, secureClientConfig); zkSecure.create("/test", "".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); assertTrue(zkSecure.isSSL()); ZKClientConfig unsecureClientConfig = new ZKClientConfig(); unsecureClientConfig.setProperty(ZKClientConfig.SECURE_CLIENT, "false"); ZooKeeper zkUnsecure = ClientBase.createZKClient("127.0.0.1:" + clientPorts[i], TIMEOUT, unsecureClientConfig); zkUnsecure.delete("/test", -1); assertFalse(zkUnsecure.isSSL()); zkSecure.close(); zkUnsecure.close(); } for (int i = 0; i < mt.length; i++) { mt[i].shutdown(); } }
Source:
<code>@Test public void testAliasUnnestArrayPlanWithSingleColumn() { final String sql = "select d.deptno, employee.empno\n" + "from dept_nested_expanded as d,\n" + " UNNEST(d.employees) as t(employee)"; <START> sql(sql).conformance(SqlConformanceEnum.PRESTO).decorrelate(false).ok(); <END> }</code><technical_language>is, fix RelStructuredTypeFlattener</technical_language>

Target:
@Test public void testAliasUnnestArrayPlanWithSingleColumn() { final String sql = "select d.deptno, employee.empno\n" + "from dept_nested_expanded as d,\n" + " UNNEST(d.employees) as t(employee)"; sql(sql).conformance(SqlConformanceEnum.PRESTO).ok(); }
Source:
<code>@NonNull List<PageTitle> langLinks() { List<PageTitle> result = new ArrayList<>(); <START> if (pages == null || pages.get(0).langLinks() == null) { <END> return result; } for (MwQueryPage.LangLink link : pages.get(0).langLinks()) { PageTitle title = new PageTitle(link.title(), WikiSite.forLanguageCode(link.lang())); result.add(title); } return result; }</code><technical_language>If want totally safe here, add || pages.isEmpty()</technical_language>

Target:
@NonNull List<PageTitle> langLinks() { List<PageTitle> result = new ArrayList<>(); if (pages == null || pages.isEmpty() || pages.get(0).langLinks() == null) { return result; } for (MwQueryPage.LangLink link : pages.get(0).langLinks()) { PageTitle title = new PageTitle(link.title(), WikiSite.forLanguageCode(link.lang())); result.add(title); } return result; }
Source:
<code>public void uncaughtException(Thread t, Throwable e) { if (e instanceof OperationCanceledException) { } else { <START> if (diagnostic != null) { <END> diagnostic.add(BasicDiagnostic.toDiagnostic(e)); } else { EMFCompareIDEUIPlugin.getDefault().log(e); } } }</code><technical_language>Un-nest this if</technical_language>

Target:
public void uncaughtException(Thread t, Throwable e) { if (e instanceof OperationCanceledException) { } else if (diagnostic != null) { diagnostic.add(BasicDiagnostic.toDiagnostic(e)); } else { EMFCompareIDEUIPlugin.getDefault().log(e); } }
Source:
<code>private void filterExplosionBlocks(EntityExplodeEvent event, StateFlag flag, WorldConfiguration wcfg, RegionManager mgr){ Iterator<Block> it = event.blockList().iterator(); <START> while(it.hasNext()){ <END> if (!mgr.getApplicableRegions(toVector(it.next())).allows(flag)) { it.remove(); if (wcfg.explosionFlagCancellation) { event.setCancelled(true); break; } } } }</code><technical_language>This "while (it.hasNext()) {" "while(it.hasNext()) {"</technical_language>

Target:
private void filterExplosionBlocks(EntityExplodeEvent event, StateFlag flag, WorldConfiguration wcfg, RegionManager mgr){ Iterator<Block> it = event.blockList().iterator(); while (it.hasNext()){ if (!mgr.getApplicableRegions(toVector(it.next())).allows(flag)) { if (!wcfg.useExplosionBlockFiltering || wcfg.explosionFlagCancellation) { if (wcfg.explosionFlagCancellation) { event.setCancelled(true); } else { event.blockList().clear(); } break; } it.remove(); } } }
Source:
<code>public List<String> getOptionsNoSupport() { <START> return optionsNoSupport; <END> }</code><technical_language>a defensive copy of list? internal modified accident outsider. for other returned collections Map a lines below</technical_language>

Target:
public List<String> getOptionsNoSupport() { return Collections.unmodifiableList(this.optionsNoSupport); }
Source:
<code><START> private synchronized Thread getOwnerThread(final ReentrantLock lock) throws Exception{ <END> final Method method = lock.getClass().getDeclaredMethod("getOwner"); if(!method.isAccessible()){ method.setAccessible(true); } return Thread.class.cast(method.invoke(lock)); }</code><technical_language>synchronized</technical_language>

Target:
private Thread getOwnerThread(final ReentrantLock lock) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { final Method method = lock.getClass().getDeclaredMethod("getOwner"); if(!method.isAccessible()){ method.setAccessible(true); } return Thread.class.cast(method.invoke(lock)); }
Source:
<code>public void test() throws Exception { if (isJumpInstruction(testInput.opcode)) { test_jumps(); return; } BytecodeCFGBuilder.BytecodeCFG cfg; <START> if (Instructions.TYPE_INSN.contains(testInput.opcode)) { <END> cfg = new Instructions() .visitTypeInsn(testInput.opcode, MoreObjects.firstNonNull(testInput.type, "SomeType")) .cfg(); } else { cfg = new Instructions().cfg(testInput.opcode, testInput.operandOrVar); } assertThat(cfg.blocks.size()).isEqualTo(2); if(expected == null) { expected = inst(testInput.opcode); } BytecodeCFGBuilder.Instruction actual = cfg.blocks.get(1).instructions.get(0); assertThat(isEquivalentInstruction(actual, expected)).isTrue(); }</code><technical_language>This if part of Instructions class. of this test</technical_language>

Target:
public void test() throws Exception { if (isJumpInstruction(testInput.opcode)) { test_jumps(); return; } BytecodeCFGBuilder.BytecodeCFG cfg = new Instructions().cfg(testInput.opcode, testInput.operandOrVar, testInput.type); assertThat(cfg.blocks.size()).isEqualTo(2); if(expected == null) { expected = inst(testInput.opcode); } BytecodeCFGBuilder.Instruction actual = cfg.blocks.get(1).instructions.get(0); assertThat(isEquivalentInstruction(actual, expected)).isTrue(); }
Source:
<code>protected void release(boolean wait, boolean writer) { final int refCount = this.refCount.decrementAndGet(); <START> if (refCount == 0 && storage != null && canRelease(writer)) { <END> assert (next != null); final Runnable storer = getStorer(data, readingOffset, writingOffset, storage); if (future != null && future.cancel(false)) { logger.debug("Block future is cancelled", this); } final int numberOfInMemBlockPermits = DataList.this.numberOfInMemBlockPermits.get(); if (wait && numberOfInMemBlockPermits == 0) { future = null; storer.run(); } else if (numberOfInMemBlockPermits < MAX_COUNT_OF_INMEM_BLOCKS / 2) { future = storageExecutor.submit(storer); } else { future = null; } } else { logger.debug("Holding in memory due to references.", this, refCount); } }</code><technical_language>check in *switchToNewBufferOrSuspendRead* ? *backPressureCheck* method, code changes release method</technical_language>

Target:
protected void release(boolean wait, boolean writer) { final int refCount = this.refCount.decrementAndGet(); if (canEvict(refCount, writer)) { assert (next != null); final Runnable storer = getStorer(data, readingOffset, writingOffset, storage); if (future != null && future.cancel(false)) { logger.debug("Block future is cancelled", this); } final int numberOfInMemBlockPermits = DataList.this.numberOfInMemBlockPermits.get(); if (wait && numberOfInMemBlockPermits == 0) { future = null; storer.run(); } else if (numberOfInMemBlockPermits < MAX_COUNT_OF_INMEM_BLOCKS / 2) { future = storageExecutor.submit(storer); } else { future = null; } } }
Source:
<code>public static PartnerMotionTimeSeries create(final List<TrackerMotion> leftMotions, final List<TrackerMotion> rightMotions) { final DateTime leftStart = TrackerMotionTimeSeries.alignedStartTime(leftMotions); final DateTime rightStart = TrackerMotionTimeSeries.alignedStartTime(rightMotions); final DateTime leftEnd = TrackerMotionTimeSeries.alignedEndTime(leftMotions); final DateTime rightEnd = TrackerMotionTimeSeries.alignedEndTime(rightMotions); final DateTime start; if (leftStart.isBefore(rightStart)) { start = leftStart; } else { start = rightStart; } final DateTime end; <START> if (leftEnd.isAfter(rightEnd)) { <END> end = leftEnd; } else { end = rightEnd; } final TrackerMotionTimeSeries leftTimeSeries = TrackerMotionTimeSeries.create(leftMotions, start, end); final TrackerMotionTimeSeries rightTimeSeries = TrackerMotionTimeSeries.create(rightMotions, start, end); return new PartnerMotionTimeSeries(leftTimeSeries, rightTimeSeries); }</code><technical_language>this more readable ternary operator</technical_language>

Target:
public static PartnerMotionTimeSeries create(final List<TrackerMotion> leftMotions, final List<TrackerMotion> rightMotions) { final DateTime leftStart = TrackerMotionTimeSeries.alignedStartTime(leftMotions); final DateTime rightStart = TrackerMotionTimeSeries.alignedStartTime(rightMotions); final DateTime leftEnd = TrackerMotionTimeSeries.alignedEndTime(leftMotions); final DateTime rightEnd = TrackerMotionTimeSeries.alignedEndTime(rightMotions); final DateTime start = leftStart.isBefore(rightStart) ? leftStart : rightStart; final DateTime end = leftEnd.isAfter(rightEnd) ? leftEnd : rightEnd; final TrackerMotionTimeSeries leftTimeSeries = TrackerMotionTimeSeries.create(leftMotions, start, end); final TrackerMotionTimeSeries rightTimeSeries = TrackerMotionTimeSeries.create(rightMotions, start, end); return new PartnerMotionTimeSeries(leftTimeSeries, rightTimeSeries); }
Source:
<code>private Object createPropertyValueFromString(final String value) { if (mostRecentlyCreatedProperty == null) { return new LayoutOptionProxy(value); } else { <START> return mostRecentlyCreatedProperty.parseValue(value); <END> } }</code><technical_language>This code assumes a is parsed property. Is this assumption valid? I more robust create LayoutOptionProxies for lazy resolution of values. performance impact negligible</technical_language>

Target:
private Object createPropertyValueFromString(final String value) { return new LayoutOptionProxy(value); }
Source:
<code>public Mapper process(ProcessorContext context, TypeElement mapperTypeElement, Mapper mapper) { this.typeFactory = context.getTypeFactory(); String componentModel = MapperConfiguration.getInstanceOn( mapperTypeElement ).componentModel( context.getOptions() ); if ( !getComponentModelIdentifier().equalsIgnoreCase( componentModel ) ) { return mapper; } for ( Annotation typeAnnotation : getTypeAnnotations( mapper ) ) { mapper.addAnnotation( typeAnnotation ); } if ( !requiresGenerationOfDecoratorClass() ) { mapper.removeDecorator(); } else if ( mapper.getDecorator() != null ) { adjustDecorator( mapper ); } List<Annotation> annotations = getMapperReferenceAnnotations(); <START> List<MapperReference> referencedMappers = mapper.getReferencedMappers(); <END> ListIterator<MapperReference> iterator = mapper.getReferencedMappers().listIterator(); while ( iterator.hasNext() ) { MapperReference reference = iterator.next(); iterator.remove(); iterator.add( replacementMapperReference( reference, annotations ) ); } Decorator decorator = mapper.getDecorator(); if ( !referencedMappers.isEmpty() || decorator != null ) { AnnotatedConstructor annotatedConstructor = buildAnnotatedConstructorForMapper( mapper ); if ( !annotatedConstructor.getMapperReferences().isEmpty() ) { mapper.setConstructor( annotatedConstructor ); } if ( decorator != null ) { AnnotatedConstructor decoratorConstructor = buildAnnotatedConstructorForDecorator( decorator ); if ( !decoratorConstructor.getMapperReferences().isEmpty() ) { decorator.setConstructor( decoratorConstructor ); } } } return mapper; }</code><technical_language>This is fine, I if move this modification of referencedMappers mapper</technical_language>

Target:
public Mapper process(ProcessorContext context, TypeElement mapperTypeElement, Mapper mapper) { this.typeFactory = context.getTypeFactory(); MapperConfiguration mapperConfiguration = MapperConfiguration.getInstanceOn( mapperTypeElement ); String componentModel = mapperConfiguration.componentModel( context.getOptions() ); InjectionStrategyPrism injectionStrategy = mapperConfiguration.getInjectionStrategy(); if ( !getComponentModelIdentifier().equalsIgnoreCase( componentModel ) ) { return mapper; } for ( Annotation typeAnnotation : getTypeAnnotations( mapper ) ) { mapper.addAnnotation( typeAnnotation ); } if ( !requiresGenerationOfDecoratorClass() ) { mapper.removeDecorator(); } else if ( mapper.getDecorator() != null ) { adjustDecorator( mapper, injectionStrategy ); } List<Annotation> annotations = getMapperReferenceAnnotations(); ListIterator<MapperReference> iterator = mapper.getReferencedMappers().listIterator(); while ( iterator.hasNext() ) { MapperReference reference = iterator.next(); iterator.remove(); iterator.add( replacementMapperReference( reference, annotations, injectionStrategy ) ); } if ( injectionStrategy == InjectionStrategyPrism.CONSTRUCTOR ) { buildConstructors( mapper ); } return mapper; }
Source:
<code>public void copyValues() { if (batchSize == 0) { return; } verify(decodedBlock != null); int[] positions = getPositions(); <START> verify(positionsOffset + batchSize - 1 < positions.length && positions[positionsOffset] >= 0 && <END> positions[positionsOffset + batchSize - 1] < decodedBlock.getPositionCount()); appendValuesToBuffer(); appendNulls(); bufferedPositionCount += batchSize; }</code><technical_language>remove this check. If decide it, consider separating conjuncts separate calls moving appendValuesToBuffer. verify(positionsOffset + batchSize - 1 < positions.length); verify(positions[positionsOffset] >= 0); verify(positions[positionsOffset + batchSize - 1] < decodedBlock.getPositionCount());</technical_language>

Target:
public void copyValues() { if (batchSize == 0) { return; } appendValuesToBuffer(); appendNulls(); bufferedPositionCount += batchSize; }
Source:
<code>public PullFromServerException(List<FormStatus> forms, Throwable cause) { <START> super("Failure pulling forms from server. FormIds: " + forms.stream().map(f -> f.getFormDefinition().getFormId()).collect(joining(", ")), cause); <END> }</code><technical_language>Hmm, I this argument before? :-)</technical_language>

Target:
PullFromServerException(List<FormStatus> forms, Throwable cause) { super(buildMessage(forms), cause); }
Source:
<code>public int size() { <START> return this.getAllEvents().size(); <END> }</code><technical_language>Get size getAllEvents()</technical_language>

Target:
public int size() { return primaryKeyData.size(); }
Source:
<code>public String getBody() { <START> return body == null ? null : Ascii.truncate(body, 20000, "..."); <END> }</code><technical_language>Is 20000 a github limit</technical_language>

Target:
public String getBody() { return body == null ? null : Ascii.truncate(body, GithubIssueClient.REPORT_BODY_MAX_LENGTH, "..."); }
Source:
<code>public void testAggregateRealm() throws Exception { <START> KernelServices services = super.createKernelServicesBuilder(new TestEnvironment()).setSubsystemXmlResource("realms-test.xml").build(); <END> if (!services.isSuccessfulBoot()) { Assert.fail(services.getBootError().toString()); } ServiceName serviceName = Capabilities.SECURITY_REALM_RUNTIME_CAPABILITY.getCapabilityServiceName("AggregateRealm"); SecurityRealm securityRealm = (SecurityRealm) services.getContainer().getService(serviceName).getValue(); Assert.assertNotNull(securityRealm); }</code><technical_language>I good expand this test check if configured principal transformer properly, similar tests in Elytron testsuite</technical_language>

Target:
public void testAggregateRealm() throws Exception { KernelServices services = super.createKernelServicesBuilder(new TestEnvironment()).setSubsystemXmlResource("realms-test.xml").build(); if (!services.isSuccessfulBoot()) { Assert.fail(services.getBootError().toString()); } ServiceName serviceName = Capabilities.SECURITY_REALM_RUNTIME_CAPABILITY.getCapabilityServiceName("AggregateRealmOne"); SecurityRealm securityRealm = (SecurityRealm) services.getContainer().getService(serviceName).getValue(); Assert.assertNotNull(securityRealm); RealmIdentity identity1 = securityRealm.getRealmIdentity(fromName("firstUser")); Assert.assertTrue(identity1.exists()); Assert.assertEquals(3, identity1.getAuthorizationIdentity().getAttributes().size()); Assert.assertEquals("[Jane]", identity1.getAuthorizationIdentity().getAttributes().get("firstName").toString()); Assert.assertEquals("[Doe]", identity1.getAuthorizationIdentity().getAttributes().get("lastName").toString()); Assert.assertEquals("[Employee, Manager, Admin]", identity1.getAuthorizationIdentity().getAttributes().get("roles").toString()); identity1.dispose(); }
Source:
<code>public Page getOutput() { if (probe == null && pageBuilder.isEmpty()) { return null; } <START> checkState(lookupSourceProvider != null, "Input has been accepted before lookup source provided"); <END> try (LookupSourceProvider.LookupSourceLease lookupSourceLease = lookupSourceProvider.leaseLookupSource()) { return getOutput(lookupSourceLease.getLookupSource()); } }</code><technical_language>"before lookup source provider provider"</technical_language>

Target:
public Page getOutput() { if (!spillInProgress.isDone()) { return null; } checkSuccess(spillInProgress, "spilling failed"); if (probe == null && pageBuilder.isEmpty() && !finishing) { return null; } if (!tryFetchLookupSourceProvider()) { return null; } if (probe == null && finishing && !unspilling) { verify(partitionedConsumption == null, "partitioned consumption already started"); partitionedConsumption = lookupSourceFactory.finishProbeOperator(lookupJoinsCount); unspilling = true; } if (probe == null && unspilling && !finished) { tryUnspillNext(); } if (probe != null) { processProbe(); } if (pageBuilder.isFull() || (!pageBuilder.isEmpty() && probe == null && finished)) { Page page = pageBuilder.build(); pageBuilder.reset(); return page; } return null; }
Source:
<code>public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() == 0) { return ExprEval.of(null); } else { final StringBuilder builder = new StringBuilder(Strings.nullToEmpty(args.get(0).eval(bindings).asString())); for (int i = 1; i < args.size(); i++) { final String s = args.get(i).eval(bindings).asString(); if (s != null) { builder.append(s); } else { <START> return ExprEval.of(null); <END> } } return ExprEval.of(builder.toString()); } }</code><technical_language>need change behavior for args.get(0) (a lines up)</technical_language>

Target:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() == 0) { return ExprEval.of(null); } else { String first = NullHandling.nullToEmptyIfNeeded(args.get(0).eval(bindings).asString()); if (first == null) { return ExprEval.of(null); } final StringBuilder builder = new StringBuilder(first); for (int i = 1; i < args.size(); i++) { final String s = NullHandling.nullToEmptyIfNeeded(args.get(i).eval(bindings).asString()); if (s == null) { return ExprEval.of(null); } else { builder.append(s); } } return ExprEval.of(builder.toString()); } }
Source:
<code>public void testBinaryDictionaryFallBack() throws IOException { int slabSize = 100; int maxDictionaryByteSize = 50; final ValuesWriter cw = newPlainBinaryDictionaryValuesWriter(maxDictionaryByteSize, slabSize); int fallBackThreshold = maxDictionaryByteSize; int dataSize=0; for (long i = 0; i < 100; i++) { Binary binary = Binary.fromString("str" + i); cw.writeBytes(binary); dataSize += (binary.length() + 4); if (dataSize < fallBackThreshold) { assertEquals(PLAIN_DICTIONARY, cw.getEncoding()); } else { assertEquals(PLAIN, cw.getEncoding()); } } ValuesReader reader = new BinaryPlainValuesReader(); reader.initFromPage(100, cw.getBytes().toByteBuffer(), 0); for (long i = 0; i < 100; i++) { assertEquals(Binary.fromString("str" + i).toStringUsingUTF8(), <START> reader.readBytes().toStringUsingUTF8()); <END> } cw.reset(); assertEquals(0, cw.getBufferedSize()); }</code><technical_language>this change? Is for error message readability? a helper method for this then</technical_language>

Target:
public void testBinaryDictionaryFallBack() throws IOException { int slabSize = 100; int maxDictionaryByteSize = 50; final ValuesWriter cw = newPlainBinaryDictionaryValuesWriter(maxDictionaryByteSize, slabSize); int fallBackThreshold = maxDictionaryByteSize; int dataSize=0; for (long i = 0; i < 100; i++) { Binary binary = Binary.fromString("str" + i); cw.writeBytes(binary); dataSize += (binary.length() + 4); if (dataSize < fallBackThreshold) { assertEquals(PLAIN_DICTIONARY, cw.getEncoding()); } else { assertEquals(PLAIN, cw.getEncoding()); } } ValuesReader reader = new BinaryPlainValuesReader(); reader.initFromPage(100, cw.getBytes().toByteBuffer(), 0); for (long i = 0; i < 100; i++) { assertEquals(Binary.fromString("str" + i), reader.readBytes()); } cw.reset(); assertEquals(0, cw.getBufferedSize()); }
Source:
<code>private void addSourceDirs(IClasspathDescriptor classpath, IProject project, List<String> sourceRoots, IPath outputPath, IPath[] inclusion, IPath[] exclusion, String sourceEncoding, IProgressMonitor monitor, boolean isTest) throws CoreException { for(int i = 0; i < sourceRoots.size(); i++ ) { IFolder sourceFolder = getFolder(project, sourceRoots.get(i)); if(sourceFolder == null) { continue; } sourceFolder.refreshLocal(IResource.DEPTH_ZERO, monitor); if(sourceFolder.exists() && !sourceFolder.getProject().equals(project)) { continue; } if(sourceFolder.exists()) { sourceFolder.setDefaultCharset(sourceEncoding, monitor); } IClasspathEntryDescriptor enclosing = getEnclosingEntryDescriptor(classpath, sourceFolder.getFullPath()); if(enclosing == null || getEntryDescriptor(classpath, sourceFolder.getFullPath()) != null) { log.info("Adding source folder " + sourceFolder.getFullPath()); IClasspathEntryDescriptor descriptor = classpath.addSourceEntry(sourceFolder.getFullPath(), outputPath, inclusion, exclusion, true ); <START> if(isTest) { descriptor.setClasspathAttribute(IClasspathEntryDescriptor.ATTRIBUTENAME_TEST, IClasspathEntryDescriptor.ATTRIBUTEVALUE_TRUE); } <END> } else { log.info("Not adding source folder " + sourceFolder.getFullPath() + " because it overlaps with " + enclosing.getPath()); } } }</code><technical_language>if statement needs (if moved a test source folder main for instance). descriptor.setClasspathAttribute(IClasspathManager.ATTRIBUTE_TEST, Boolean.valueOf(isTest).toString());</technical_language>

Target:
private void addSourceDirs(IClasspathDescriptor classpath, IProject project, List<String> sourceRoots, IPath outputPath, IPath[] inclusion, IPath[] exclusion, String sourceEncoding, IProgressMonitor monitor, boolean isTest) throws CoreException { for(int i = 0; i < sourceRoots.size(); i++ ) { IFolder sourceFolder = getFolder(project, sourceRoots.get(i)); if(sourceFolder == null) { continue; } sourceFolder.refreshLocal(IResource.DEPTH_ZERO, monitor); if(sourceFolder.exists() && !sourceFolder.getProject().equals(project)) { continue; } if(sourceFolder.exists()) { sourceFolder.setDefaultCharset(sourceEncoding, monitor); } IClasspathEntryDescriptor enclosing = getEnclosingEntryDescriptor(classpath, sourceFolder.getFullPath()); if(enclosing == null || getEntryDescriptor(classpath, sourceFolder.getFullPath()) != null) { log.info("Adding source folder " + sourceFolder.getFullPath()); IClasspathEntryDescriptor descriptor = classpath.addSourceEntry(sourceFolder.getFullPath(), outputPath, inclusion, exclusion, true ); descriptor.setClasspathAttribute(IClasspathManager.TEST_ATTRIBUTE, isTest ? "true" : null); } else { log.info("Not adding source folder " + sourceFolder.getFullPath() + " because it overlaps with " + enclosing.getPath()); } } }
Source:
<code>private IncomingPhoneNumber getIncomingPhoneNumber(final String selector, Object parameter) { final SqlSession session = sessions.openSession(); String inboundPhoneNumber = null; try { final Map<String, Object> result = session.selectOne(namespace + selector, parameter); if (result != null ) { return toIncomingPhoneNumber(result); } <START> if(!(parameter instanceof Sid)){ <END> inboundPhoneNumber = parameter.toString().replace("+1", ""); logger.warn(" Inbound phoneNumber : " + inboundPhoneNumber ); return checkIncomingPhoneNumberRegexMatch(selector, inboundPhoneNumber); } }finally { session.close(); } return null; }</code><technical_language>@croufay check if object parameter is instance of Sid? is point here</technical_language>

Target:
private IncomingPhoneNumber getIncomingPhoneNumber(final String selector, Object parameter) { final SqlSession session = sessions.openSession(); String inboundPhoneNumber = null; try { final Map<String, Object> result = session.selectOne(namespace + selector, parameter); if (result != null ) { return toIncomingPhoneNumber(result); } if(!(parameter instanceof Sid)){ if (logger.isInfoEnabled()) { logger.info("About to check for REGEX incoming phone number for phoneNumber : " + inboundPhoneNumber); } return checkIncomingPhoneNumberRegexMatch(selector, inboundPhoneNumber); } }finally { session.close(); } return null; }
Source:
<code>public List<NoteInfo> list(AuthenticationInfo subject) throws IOException { List<NoteInfo> noteInfos = new ArrayList<>(); for (FileStatus status : fs.globStatus(new Path(notebookDir, "*/note.json"))) { <START> NoteInfo noteInfo = new NoteInfo(status.getPath().getParent().getName(), "", null); <END> noteInfos.add(noteInfo); } return noteInfos; }</code><technical_language>create Note object new NoteInfo(note)? missing name config</technical_language>

Target:
public List<NoteInfo> list(AuthenticationInfo subject) throws IOException { return callHdfsOperation(new HdfsOperation<List<NoteInfo>>() { @Override public List<NoteInfo> call() throws IOException { List<NoteInfo> noteInfos = new ArrayList<>(); for (FileStatus status : fs.globStatus(new Path(notebookDir, "*/note.json"))) { NoteInfo noteInfo = new NoteInfo(status.getPath().getParent().getName(), "", null); noteInfos.add(noteInfo); } return noteInfos; } }); }
Source:
<code>public NettyServerDeployer(NettyConfig nettyConfig, NettyMetrics nettyMetrics, RestRequestHandlerController requestHandlerController) { this.nettyConfig = nettyConfig; this.nettyMetrics = nettyMetrics; this.requestHandlerController = requestHandlerController; <START> bossGroup = new NioEventLoopGroup(nettyConfig.getBossThreadCount()); <END> workerGroup = new NioEventLoopGroup(nettyConfig.getWorkerThreadCount()); }</code><technical_language>new line</technical_language>

Target:
public NettyServerDeployer(NettyConfig nettyConfig, NettyMetrics nettyMetrics, RestRequestHandlerController requestHandlerController) { this.nettyConfig = nettyConfig; this.nettyMetrics = nettyMetrics; this.requestHandlerController = requestHandlerController; bossGroup = new NioEventLoopGroup(nettyConfig.nettyServerBossThreadCount); workerGroup = new NioEventLoopGroup(nettyConfig.nettyServerWorkerThreadCount); }
Source:
<code>private String getInstituteForInstructor(Instructor instructor, List<Account> allAccounts) { if (instructor.getGoogleId() == null) { return null; } String googleId = instructor.getGoogleId(); for (Account account : allAccounts) { <START> if (account.getGoogleId() == googleId && account.getInstitute() != null) { <END> return account.getInstitute(); } } return null; }</code><technical_language>This .equals() instead of ==</technical_language>

Target:
private String getInstituteForInstructor(Instructor instructor, List<Account> allAccounts) { if (instructor.getGoogleId() == null) { return null; } return getInstituteFromGoogleId(instructor.getGoogleId(), allAccounts); }
Source:
<code>public Vertex convertToVertex(final Graph graph, final String vertexName) { <START> return graphProvider.traversal(graph).V().has("name", vertexName).toList().get(0); <END> }</code><technical_language>i started merge this i change artifact rebase some point i style in tp34. making change that. i add change tp33 this merge is done</technical_language>

Target:
public Vertex convertToVertex(final Graph graph, final String vertexName) { return graph.traversal().V().has("name", vertexName).toList().get(0); }
Source:
<code>private boolean illegalForRest(String v) { <START> return v.contains(",") || v.contains("="); <END> }</code><technical_language>judge null place</technical_language>

Target:
private boolean illegalForRest(String v) { if (StringUtils.isNotEmpty(v)) { return v.contains(",") || v.contains("="); } return false; }
Source:
<code>private String getIdentifiersFromRequest(ProvideAndRegisterDocumentSetRequestType request) { String result = ""; if (request == null) { LOG.error("Incoming ProvideAndRegisterDocumentSetRequestType was null"); return null; } if (request.getSubmitObjectsRequest() == null) { LOG.error("Incoming ProvideAndRegisterDocumentSetRequestType metadata was null"); return null; } LOG.debug(request.getSubmitObjectsRequest().getRegistryObjectList().getIdentifiable()); RegistryObjectListType object = request.getSubmitObjectsRequest().getRegistryObjectList(); for (int x = 0; x < object.getIdentifiable().size(); x++) { LOG.debug(object.getIdentifiable().get(x).getName()); if (object.getIdentifiable().get(x).getDeclaredType().equals(RegistryPackageType.class)) { RegistryPackageType registryPackage = (RegistryPackageType) object.getIdentifiable().get(x).getValue(); <START> LOG.debug(registryPackage.getSlot().size()); <END> for (int y = 0; y < registryPackage.getExternalIdentifier().size(); y++) { String test = registryPackage.getExternalIdentifier().get(y).getName().getLocalizedString().get(0) .getValue(); if (test.equals("XDSSubmissionSet.patientId")) { result = registryPackage.getExternalIdentifier().get(y).getValue(); } } } } return result; }</code><technical_language>Please add some message "Slot(s) in registry Package is"</technical_language>

Target:
private String getIdentifiersFromRequest(ProvideAndRegisterDocumentSetRequestType request) { String result = ""; if (request == null) { LOG.error("Incoming ProvideAndRegisterDocumentSetRequestType was null"); return null; } if (request.getSubmitObjectsRequest() == null) { LOG.error("Incoming ProvideAndRegisterDocumentSetRequestType metadata was null"); return null; } LOG.debug("List of All Identifiable Registry Object(s) on Identifiers Form Request {}", request.getSubmitObjectsRequest().getRegistryObjectList().getIdentifiable()); RegistryObjectListType object = request.getSubmitObjectsRequest().getRegistryObjectList(); for (int x = 0; x < object.getIdentifiable().size(); x++) { LOG.debug("Name of Identifiable Registry Object on Identifiers Form Request {}", object.getIdentifiable().get(x).getName()); if (object.getIdentifiable().get(x).getDeclaredType().equals(RegistryPackageType.class)) { RegistryPackageType registryPackage = (RegistryPackageType) object.getIdentifiable().get(x).getValue(); LOG.debug("Slot(s) in registry Package is {}", registryPackage.getSlot().size()); for (int y = 0; y < registryPackage.getExternalIdentifier().size(); y++) { String test = registryPackage.getExternalIdentifier().get(y).getName().getLocalizedString().get(0) .getValue(); if (test.equals("XDSSubmissionSet.patientId")) { result = registryPackage.getExternalIdentifier().get(y).getValue(); } } } } return result; }