auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean provideJavaClasses(IPackageFragment packageFragment, SearchEngine engine, IJavaSearchScope searchScope, IProgressMonitor monitor) throws JavaModelException, CoreException { Requestor requestor; IJavaElement[] children = packageFragment.getChildren(); SubMonitor subMonitor = SubMonitor.convert(monitor, "", children.length); for (int j = 0; j < children.length; j++) { IType[] types = null; if (children[j] instanceof ICompilationUnit) { types = ((ICompilationUnit) children[j]).getAllTypes(); } else if (children[j] instanceof IClassFile) { types = new IType[] { ((IClassFile) children[j]).getType() }; } if (types != null) { for (int t = 0; t < types.length; t++) { requestor = new Requestor(); engine.search(SearchPattern.createPattern(types[t], IJavaSearchConstants.REFERENCES), new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, searchScope, <START> requestor, subMonitor.newChild(1)); <END> if (requestor.foundMatches()) { return true; } } } } return false; }</code><technical_language>Ticks line if is more type iteration. Consider allocating a SubMonitor for for loop: SubMonitor loopMonitor = subMonitor.newChild(1).setWorkRemaining(types.length); for (int t = 0; t < types.length; t++) { engine.search(..., loopMonitor.newChild(1)) }</technical_language>

Target:
private boolean provideJavaClasses(IPackageFragment packageFragment, SearchEngine engine, IJavaSearchScope searchScope, IProgressMonitor monitor) throws JavaModelException, CoreException { Requestor requestor; IJavaElement[] children = packageFragment.getChildren(); SubMonitor subMonitor = SubMonitor.convert(monitor, children.length); for (int j = 0; j < children.length; j++) { IType[] types = null; if (children[j] instanceof ICompilationUnit) { types = ((ICompilationUnit) children[j]).getAllTypes(); } else if (children[j] instanceof IClassFile) { types = new IType[] { ((IClassFile) children[j]).getType() }; } if (types != null) { SubMonitor iterationbMonitor = subMonitor.newChild(1).setWorkRemaining(types.length); for (int t = 0; t < types.length; t++) { requestor = new Requestor(); engine.search(SearchPattern.createPattern(types[t], IJavaSearchConstants.REFERENCES), new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, searchScope, requestor, iterationbMonitor.newChild(1)); if (requestor.foundMatches()) { return true; } } } else { subMonitor.worked(1); } } return false; }
Source:
<code>private void consumerLoop() { while (true) { try { LogEventQueueEntry entry = incomingQueue.poll(POLL_TIME, TimeUnit.MILLISECONDS); if (null != entry) { Timber.LogEvent event = entry.getLogEvent(); for (LogEventHandler handler : handlers) { handler.handle(event); if (event.getConsistencyLevel() != Timber.ConsistencyLevel.BESTEFFORT) { handler.flush(); } } maybeAcknowledgeEvent(entry); <START> } else { <END> if (isShutdown.get()) { if (! incomingQueue.isEmpty()) { log.info("Shutdown called but queue was not empty"); continue; } log.fine("Shutdown called and queue verified to be empty"); assert incomingQueue.isEmpty(); for (LogEventHandler handler : handlers) { log.info("Closing handler " + handler.getName()); handler.close(); } log.info("exiting consumer loop"); return; } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }</code><technical_language>I spy "else". exercise I checked out code if I solve :) catch catches exceptions thrown incomingQueue.poll, caught handled if/else block. if do a continue maybeAcknowledgeEvent(entry), making else "invariant". Thoughts</technical_language>

Target:
private void consumerLoop() { while (true) { LogEventQueueEntry entry = null; try { entry = incomingQueue.poll(POLL_TIME, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; } if (null != entry) { processEvent(entry); continue; } if (isShutdown.get()) { if (! incomingQueue.isEmpty()) { log.info("Shutdown called but queue was not empty"); continue; } log.fine("Shutdown called and queue verified to be empty"); assert incomingQueue.isEmpty(); for (LogEventHandler handler : handlers) { log.info("Closing handler " + handler.getName()); handler.close(); } log.info("exiting consumer loop"); return; } } }
Source:
<code>public Object execute() throws Exception { InetAddress inetAddress = InetAddress.getByName(ipAddress); CompletableFuture<SnmpAgentConfig> future = fitProfile(label, inetAddress, location, oid); while (true) { try { SnmpAgentConfig agentConfig = future.get(1, TimeUnit.SECONDS); if (agentConfig != null) { System.out.printf("Fitted IpAddress '%s' with profile '%s', agent config: \n", ipAddress, agentConfig.getProfileLabel()); <START> System.out.println(agentConfig.toString()); <END> if (save) { agentConfigFactory.saveAgentConfigAsDefinition(agentConfig, location, "karaf-shell"); System.out.println("***Saved above config in definitions***"); } } break; } catch (TimeoutException e1) { } System.out.print("."); } return null; }</code><technical_language>display config is done in ShowConfigCommand? refactor this out public static void prettyPrint(SnmpAgentConfig agent)</technical_language>

Target:
public Object execute() throws Exception { InetAddress inetAddress = InetAddress.getByName(ipAddress); CompletableFuture<Optional<SnmpAgentConfig>> future = snmpProfileMapper.fitProfile(label, inetAddress, location, oid); while (true) { try { Optional<SnmpAgentConfig> agentConfig = future.get(1, TimeUnit.SECONDS); if (agentConfig.isPresent()) { System.out.printf("Fitted IP address '%s' with profile '%s', agent config: \n", ipAddress, agentConfig.get().getProfileLabel()); ShowConfigCommand.prettyPrint(agentConfig.get()); if (save) { agentConfigFactory.saveAgentConfigAsDefinition(agentConfig.get(), location, "karaf-shell"); System.out.println("*** Saved above config in definitions ***"); } break; } else { if (Strings.isNullOrEmpty(label)) { System.out.printf("\nDidn't find any matching profile for IP address %s \n", ipAddress); } else { System.out.printf("\nProfile with label '%s' didn't fit for IP address '%s'\n", label, ipAddress); } break; } } catch (TimeoutException e1) { } System.out.print("."); } return null; }
Source:
<code><START> public Expression getBuildTargetFilter() { <END> return buildTargetFilter; }</code><technical_language>@Nullable public</technical_language>

Target:
@Nullable public Expression getBuildTargetFilter() { return buildTargetFilter; }
Source:
<code><START> public void setVirtual(final boolean virtual) { <END> this.isVirtual = virtual; }</code><technical_language>I this method private</technical_language>

Target:
private void setVirtual(final boolean virtual) { this.isVirtual = virtual; }
Source:
<code>Collection<Slice> writeDeltaDeleteFile(BitSet rowsToDelete) { if (rowsToDelete.isEmpty()) { return ImmutableList.of(); } <START> List<Long> columnIds = ImmutableList.of(0L); <END> List<Type> columnTypes = ImmutableList.of(BIGINT); oldDeltaDeleteShardUuid.ifPresent(oldDeltaDeleteShardUuid -> mergeToRowsToDelete(rowsToDelete, oldDeltaDeleteShardUuid)); if (rowsToDelete.cardinality() == oldShardRowCount) { return shardDeleteDelta(oldShardUuid, oldDeltaDeleteShardUuid, Optional.empty()); } BlockBuilder blockBuilder = new LongArrayBlockBuilder(null, rowsToDelete.size()); for (int i = rowsToDelete.nextSetBit(0); i >= 0; i = rowsToDelete.nextSetBit(i + 1)) { blockBuilder.writeLong(i); } Block blockToDelete = blockBuilder.build(); StoragePageSink pageSink = createStoragePageSinkFunc.apply(columnIds, columnTypes); pageSink.appendPages(ImmutableList.of(new Page(blockToDelete))); List<ShardInfo> shardInfos = getFutureValue(pageSink.commit()); ShardInfo newDeltaDeleteShard = Iterables.getOnlyElement(shardInfos); return shardDeleteDelta(oldShardUuid, oldDeltaDeleteShardUuid, Optional.of(newDeltaDeleteShard)); }</code><technical_language>inline consts</technical_language>

Target:
Collection<Slice> writeDeltaDeleteFile(BitSet rowsToDelete) { if (rowsToDelete.isEmpty()) { return ImmutableList.of(); } oldDeltaDeleteShardUuid.ifPresent(oldDeltaDeleteShardUuid -> mergeToRowsToDelete(rowsToDelete, oldDeltaDeleteShardUuid)); if (rowsToDelete.cardinality() == oldShardRowCount) { return shardDeleteDelta(oldShardUuid, oldDeltaDeleteShardUuid, Optional.empty()); } BlockBuilder blockBuilder = new LongArrayBlockBuilder(null, rowsToDelete.size()); for (int i = rowsToDelete.nextSetBit(0); i >= 0; i = rowsToDelete.nextSetBit(i + 1)) { blockBuilder.writeLong(i); } StoragePageSink pageSink = orcStorageManager.createStoragePageSink(fileSystemContext, transactionId, bucketNumber, ImmutableList.of(0L), ImmutableList.of(BIGINT), true); pageSink.appendPages(ImmutableList.of(new Page(blockBuilder.build()))); List<ShardInfo> shardInfos = getFutureValue(pageSink.commit()); ShardInfo newDeltaDeleteShard = Iterables.getOnlyElement(shardInfos); return shardDeleteDelta(oldShardUuid, oldDeltaDeleteShardUuid, Optional.of(newDeltaDeleteShard)); }
Source:
<code>public void testObjectEncoder() { GenericJbossMarshallerEncoder encoder = new GenericJbossMarshallerEncoder(org.infinispan.dataconversion.DataConversionTest.class.getClassLoader()); withCacheManager(new CacheManagerCallable( createCacheManager(new ConfigurationBuilder())) { GenericJBossMarshaller marshaller = new GenericJBossMarshaller(); private byte[] marshall(Object o) { try { return marshaller.objectToByteBuffer(o); } catch (IOException | InterruptedException e) { <START> Assert.fail("Cannot marshall content"); <END> } return null; } @Override public void call() { GlobalComponentRegistry registry = cm.getGlobalComponentRegistry(); EncoderRegistry encoderRegistry = registry.getComponent(EncoderRegistry.class); encoderRegistry.registerEncoder(encoder); cm.getClassWhiteList().addClasses(Person.class); Cache<byte[], byte[]> cache = cm.getCache(); Person key1 = new Person("key1"); Person value1 = new Person("value1"); byte[] encodedKey1 = marshall(key1); byte[] encodedValue1 = marshall(value1); cache.put(encodedKey1, encodedValue1); assertEquals(cache.get(encodedKey1), encodedValue1); AdvancedCache<Person, Person> encodingCache = (AdvancedCache<Person, Person>) cache.getAdvancedCache().withEncoding(GenericJbossMarshallerEncoder.class); assertEquals(encodingCache.get(key1), value1); } }); }</code><technical_language>throw new AssertionError(e) instead</technical_language>

Target:
public void testObjectEncoder() { GenericJbossMarshallerEncoder encoder = new GenericJbossMarshallerEncoder(org.infinispan.dataconversion.DataConversionTest.class.getClassLoader()); withCacheManager(new CacheManagerCallable( createCacheManager(new ConfigurationBuilder())) { GenericJBossMarshaller marshaller = new GenericJBossMarshaller(); private byte[] marshall(Object o) { try { return marshaller.objectToByteBuffer(o); } catch (IOException | InterruptedException e) { throw new AssertionError("Cannot marshall content", e); } } @Override public void call() { GlobalComponentRegistry registry = cm.getGlobalComponentRegistry(); EncoderRegistry encoderRegistry = registry.getComponent(EncoderRegistry.class); encoderRegistry.registerEncoder(encoder); cm.getClassWhiteList().addClasses(Person.class); Cache<byte[], byte[]> cache = cm.getCache(); Person key1 = new Person("key1"); Person value1 = new Person("value1"); byte[] encodedKey1 = marshall(key1); byte[] encodedValue1 = marshall(value1); cache.put(encodedKey1, encodedValue1); assertEquals(cache.get(encodedKey1), encodedValue1); AdvancedCache<Person, Person> encodingCache = (AdvancedCache<Person, Person>) cache.getAdvancedCache().withEncoding(GenericJbossMarshallerEncoder.class); assertEquals(encodingCache.get(key1), value1); } }); }
Source:
<code>public Appendable write(Appendable appendable, Context context) throws IOException { writeAnnotations(appendable, context); writeModifiers(appendable); if (!typeVariables.isEmpty()) { appendable.append('<'); Joiner.on(", ").appendTo(appendable, typeVariables); <START> appendable.append('>'); <END> } returnType.write(appendable, context); appendable.append(' ').append(name).append('('); Iterator<VariableWriter> parameterWritersIterator = parameterWriters.values().iterator(); if (parameterWritersIterator.hasNext()) { parameterWritersIterator.next().write(appendable, context); } while (parameterWritersIterator.hasNext()) { appendable.append(", "); parameterWritersIterator.next().write(appendable, context); } appendable.append(")"); if (body.isPresent()) { appendable.append(" {"); body.get().write(new IndentingAppendable(appendable), context); appendable.append("}\n"); } else { appendable.append(";\n"); } return appendable; }</code><technical_language>I this "> "</technical_language>

Target:
public Appendable write(Appendable appendable, Context context) throws IOException { writeAnnotations(appendable, context); writeModifiers(appendable); Iterator<TypeVariableName> typeVariablesIterator = typeVariables.iterator(); if (typeVariablesIterator.hasNext()) { appendable.append('<'); typeVariablesIterator.next().write(appendable, context); while (typeVariablesIterator.hasNext()) { appendable.append(", "); typeVariablesIterator.next().write(appendable, context); } appendable.append("> "); } returnType.write(appendable, context); appendable.append(' ').append(name).append('('); Iterator<VariableWriter> parameterWritersIterator = parameterWriters.values().iterator(); if (parameterWritersIterator.hasNext()) { parameterWritersIterator.next().write(appendable, context); } while (parameterWritersIterator.hasNext()) { appendable.append(", "); parameterWritersIterator.next().write(appendable, context); } appendable.append(")"); if (body.isPresent()) { appendable.append(" {"); body.get().write(new IndentingAppendable(appendable), context); appendable.append("}\n"); } else { appendable.append(";\n"); } return appendable; }
Source:
<code>public HostSetupNetworksModel(SearchableListModel listModel, VDS host) { this.sourceListModel = listModel; setEntity(host); setTitle(ConstantsManager.getInstance().getMessages().setupHostNetworksTitle(host.getName())); setHelpTag(HelpTag.host_setup_networks); setHashName("host_setup_networks"); setNicsChangedEvent(new Event<>(NICS_CHANGED_EVENT_DEFINITION)); setOperationCandidateEvent(new Event<OperationCandidateEventArgs>(OPERATION_CANDIDATE_EVENT_DEFINITION)); <START> setLldpChangedEvent(new Event<>(LLDP_CHANGED_EVENT_DEFINITION)); <END> setLldpChangedEvent(new Event<>(LLDP_CHANGED_EVENT_DEFINITION)); setCheckConnectivity(new EntityModel<Boolean>()); getCheckConnectivity().setEntity(true); setConnectivityTimeout(new EntityModel<Integer>()); setCommitChanges(new EntityModel<Boolean>()); getCommitChanges().setEntity(true); setShowVf(new EntityModel<>()); getShowVf().setEntity(false); getShowVf().getPropertyChangedEvent().addListener((ev, sender, args) -> redraw()); okCommand = UICommand.createDefaultOkUiCommand("OnSetupNetworks", this); getCommands().add(okCommand); getCommands().add(UICommand.createCancelUiCommand("Cancel", this)); newLabelModel = new NewNetworkLabelModel(this); }</code><technical_language>reason of here</technical_language>

Target:
public HostSetupNetworksModel(SearchableListModel listModel, VDS host) { this.sourceListModel = listModel; setEntity(host); setTitle(ConstantsManager.getInstance().getMessages().setupHostNetworksTitle(host.getName())); setHelpTag(HelpTag.host_setup_networks); setHashName("host_setup_networks"); setNicsChangedEvent(new Event<>(NICS_CHANGED_EVENT_DEFINITION)); setOperationCandidateEvent(new Event<OperationCandidateEventArgs>(OPERATION_CANDIDATE_EVENT_DEFINITION)); setLldpChangedEvent(new Event<>(LLDP_CHANGED_EVENT_DEFINITION)); setCheckConnectivity(new EntityModel<Boolean>()); getCheckConnectivity().setEntity(true); setConnectivityTimeout(new EntityModel<Integer>()); setCommitChanges(new EntityModel<Boolean>()); getCommitChanges().setEntity(true); setShowVf(new EntityModel<>()); getShowVf().setEntity(false); getShowVf().getPropertyChangedEvent().addListener((ev, sender, args) -> redraw()); okCommand = UICommand.createDefaultOkUiCommand("OnSetupNetworks", this); getCommands().add(okCommand); getCommands().add(UICommand.createCancelUiCommand("Cancel", this)); newLabelModel = new NewNetworkLabelModel(this); }
Source:
<code>public Response remove() { Cluster cluster = parent.getClusterEntity(); <START> for (SupportedAdditionalClusterFeature feature : cluster.getAddtionalFeaturesSupported()) { if (feature.getFeature().getId().equals(asGuid(id))) { feature.setEnabled(false); } } <END> return parent.updateClusterEntity(cluster); }</code><technical_language>here. Simple call filter() is more readable</technical_language>

Target:
public Response remove() { Cluster cluster = parent.getClusterEntity(); SupportedAdditionalClusterFeature feature = cluster.getAddtionalFeaturesSupported() .stream() .filter(f -> f.getFeature().getId().equals(asGuid(id))) .findFirst() .orElse(null); if (feature != null) { feature.setEnabled(false); } return parent.updateClusterEntity(cluster); }
Source:
<code>private String getBodyContentAsString() { if (this.body == null) { return null; } try { String contentType = (this.messageProperties != null) ? this.messageProperties.getContentType() : null; if (MessageProperties.CONTENT_TYPE_SERIALIZED_OBJECT.equals(contentType)) { return SerializationUtils.deserialize(new ByteArrayInputStream(this.body), whiteListPatterns, ClassUtils.getDefaultClassLoader()).toString(); } <START> String encoding = this.messageProperties.getContentEncoding(); <END> if (encoding == null) { encoding = bodyEncoding; } if (MessageProperties.CONTENT_TYPE_TEXT_PLAIN.equals(contentType) || MessageProperties.CONTENT_TYPE_JSON.equals(contentType) || MessageProperties.CONTENT_TYPE_JSON_ALT.equals(contentType) || MessageProperties.CONTENT_TYPE_XML.equals(contentType)) { return new String(this.body, encoding); } } catch (Exception e) { } return this.body.toString() + "(byte[" + this.body.length + "])"; }</code><technical_language>I see, messageProperties null here</technical_language>

Target:
private String getBodyContentAsString() { if (this.body == null) { return null; } try { boolean nullProps = this.messageProperties == null; String contentType = nullProps ? null : this.messageProperties.getContentType(); if (MessageProperties.CONTENT_TYPE_SERIALIZED_OBJECT.equals(contentType)) { return SerializationUtils.deserialize(new ByteArrayInputStream(this.body), whiteListPatterns, ClassUtils.getDefaultClassLoader()).toString(); } String encoding = nullProps ? null : this.messageProperties.getContentEncoding(); if (encoding == null) { encoding = bodyEncoding; } if (MessageProperties.CONTENT_TYPE_TEXT_PLAIN.equals(contentType) || MessageProperties.CONTENT_TYPE_JSON.equals(contentType) || MessageProperties.CONTENT_TYPE_JSON_ALT.equals(contentType) || MessageProperties.CONTENT_TYPE_XML.equals(contentType)) { return new String(this.body, encoding); } } catch (Exception e) { } return this.body.toString() + "(byte[" + this.body.length + "])"; }
Source:
<code>public void clickGuestRight(Right right) { try { getDriver().executeJavascript( "window.__oldConfirm = window.confirm; window.confirm = function() { return true; };"); final By buttonLocator = By.xpath("* final WebElement button = getDriver().findElement(buttonLocator); State currentState = State.getButtonState(button); button.click(); getDriver().waitUntilCondition(webDriver -> { return webDriver.findElement(buttonLocator).getAttribute("src") .contains(currentState.getNextState().imageURL); <START> }); <END> } finally { getDriver().executeJavascript("window.confirm = window.__oldConfirm;"); } }</code><technical_language>introduce a waitUntilElementContainsAttributeValue</technical_language>

Target:
public void clickGuestRight(Right right) { try { getDriver().executeJavascript( "window.__oldConfirm = window.confirm; window.confirm = function() { return true; };"); final By buttonLocator = By.xpath("* final WebElement button = getDriver().findElement(buttonLocator); State currentState = State.getButtonState(button); button.click(); getDriver().waitUntilElementContainsAttributeValue(buttonLocator, "src", currentState.getNextState().imageURL); } finally { getDriver().executeJavascript("window.confirm = window.__oldConfirm;"); } }
Source:
<code>public @NonNull String getName() { if (fQuark == ITmfStateSystem.ROOT_ATTRIBUTE) { return <START> ""; <END> } return fStateSystem.getAttributeName(fQuark); }</code><technical_language>stringutils.empty</technical_language>

Target:
public @NonNull String getName() { if (fQuark == ITmfStateSystem.ROOT_ATTRIBUTE) { return StringUtils.EMPTY; } return fStateSystem.getAttributeName(fQuark); }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } <START> if (getClass() != obj.getClass()) { return false; } <END> JobSubjectEntity other = (JobSubjectEntity) obj; if (entityId == null) { if (other.entityId != null) { return false; } } else if (!entityId.equals(other.entityId)) { return false; } if (entityType != other.entityType) { return false; } if (jobId == null) { if (other.jobId != null) { return false; } } else if (!jobId.equals(other.jobId)) { return false; } return true; }</code><technical_language>I prefer smallest equals() proposed in Effective Java: @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof JobSubjectEntity)) { return false; } JobSubjectEntity other = (JobSubjectEntity) obj; ... }</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof JobSubjectEntity)) { return false; } JobSubjectEntity other = (JobSubjectEntity) obj; return Objects.equals(entityId, other.entityId) && Objects.equals(jobId, other.jobId); }
Source:
<code><START> public void registerIdentifier( String name, IDeclaration declaration) throws ParseException{ <END> if (identifiers.containsKey(name)) { throw new ParseException(Messages.IdentifierAlreadyDefined + ':' + name); } identifiers.put(name, declaration); }</code><technical_language>space String missing space { seriously... time a bunch of that. want add auto-format a save action in workspace</technical_language>

Target:
public void registerIdentifier(String name, IDeclaration declaration) throws ParseException { if (identifiers.containsKey(name)) { throw new ParseException("Identifier has already been defined:" + name); } identifiers.put(name, declaration); }
Source:
<code>public void testReqPasswordNullConsole() { char[] password = new ConsolePasswordFinder(null) <START> .reqPassword(Mockito.mock(Resource.class)); <END> Assert.assertNull("Password should be null with null console", password); }</code><technical_language>reason mocking Resource here? verify called upon..</technical_language>

Target:
public void testReqPasswordNullConsole() { Resource<?> resource = Mockito.mock(Resource.class); char[] password = new ConsolePasswordFinder(null, FORMAT, 1).reqPassword(resource); Assert.assertNull("Password should be null with null console", password); Mockito.verifyNoMoreInteractions(resource); }
Source:
<code>private DiskImage isMemoryDiskAlreadyExistsInDb(Snapshot snapshot, Guid diskId, Guid imageId) { DiskImage disk = diskImageDao.get(imageId); if (disk != null) { <START> log.warn("Memory <END> disk '{}'/'{}' of snapshot '{}'(id: '{}') already exists on storage domain '{}'", diskId, imageId, snapshot.getDescription(), snapshot.getId(), disk.getStoragesNames().get(0)); } return disk; }</code><technical_language>warning info? ok memory volume exists</technical_language>

Target:
private DiskImage isMemoryDiskAlreadyExistsInDb(Snapshot snapshot, Guid diskId, Guid imageId) { DiskImage disk = diskImageDao.get(imageId); if (disk != null) { log.info("Memory disk '{}'/'{}' of snapshot '{}'(id: '{}') already exists on storage domain '{}'", diskId, imageId, snapshot.getDescription(), snapshot.getId(), disk.getStoragesNames().get(0)); } return disk; }
Source:
<code><START> public FeatureVector classify(Object __example) { <END> if (!(__example instanceof Word)) { String type = __example == null ? "null" : __example.getClass().getName(); logger.error("Classifier 'Forms(Word)' defined on line 20 of CommonFeatures.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); } Word word = (Word) __example; FeatureVector __result; __result = new FeatureVector(); String __id; String __value; int i; Word w = word, last = word; for (i = 0; i <= 2 && last != null; ++i) { last = (Word) last.next; } for (i = 0; i > -2 && w.previous != null; --i) { w = (Word) w.previous; } for (; w != last; w = (Word) w.next) { __id = "" + (i++); __value = "" + (w.form); __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); } return __result; }</code><technical_language>exiting, STDERR</technical_language>

Target:
public FeatureVector classify(Object __example) { if (!(__example instanceof Word)) { String type = __example == null ? "null" : __example.getClass().getName(); System.err.println("Classifier 'Forms(Word)' defined on line 20 of CommonFeatures.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); } Word word = (Word) __example; FeatureVector __result; __result = new FeatureVector(); String __id; String __value; int i; Word w = word, last = word; for (i = 0; i <= 2 && last != null; ++i) { last = (Word) last.next; } for (i = 0; i > -2 && w.previous != null; --i) { w = (Word) w.previous; } for (; w != last; w = (Word) w.next) { __id = "" + (i++); __value = "" + (w.form); __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); } return __result; }
Source:
<code>private void removeLayers(Document doc) throws XPathExpressionException { List<Layer> layers = layerService.findAll(); List<String> layerNames = new ArrayList<>(); for (Layer layer : layers) { if (layer.getSource() instanceof ImageWmsLayerDataSource) { ImageWmsLayerDataSource source = (ImageWmsLayerDataSource) layer.getSource(); layerNames.add(source.getLayerNames()); } else if (layer.getSource() instanceof WfsLayerDataSource) { WfsLayerDataSource source = (WfsLayerDataSource) layer.getSource(); layerNames.add(source.getTypeName()); layerNames.add(source.getTypeNames()); } } XPath xpath = XPathFactory.newInstance().newXPath(); xpath.setNamespaceContext(CommonNamespaces.getNamespaceContext(). addNamespace("wfs", "<LINK_0>")); NodeList list = (NodeList) xpath.compile(" List<Element> toRemove = new ArrayList<>(); for (int i = 0; i < list.getLength(); ++i) { Element name = (Element) list.item(i); String str = name.getTextContent(); if (!layerNames.contains(str)) { toRemove.add((Element) name.getParentNode()); } } xpath.setNamespaceContext(CommonNamespaces.getNamespaceContext(). addNamespace("wfs", "<LINK_0>/2.0")); list = (NodeList) xpath.compile(" for (int i = 0; i < list.getLength(); ++i) { Element name = (Element) list.item(i); String str = name.getTextContent(); if (!layerNames.contains(str)) { <START> toRemove.add((Element) name.getParentNode()); <END> } } toRemove.forEach(element -> element.getParentNode().removeChild(element)); }</code><technical_language>add parentNode? Line 177 parentNode, isnt level much</technical_language>

Target:
private void removeLayers(Document doc) throws XPathExpressionException { List<Layer> layers = layerService.findAll(); List<String> layerNames = new ArrayList<>(); for (Layer layer : layers) { if (layer.getSource() instanceof ImageWmsLayerDataSource) { ImageWmsLayerDataSource source = (ImageWmsLayerDataSource) layer.getSource(); layerNames.add(source.getLayerNames()); } else if (layer.getSource() instanceof WfsLayerDataSource) { WfsLayerDataSource source = (WfsLayerDataSource) layer.getSource(); layerNames.add(source.getTypeName()); layerNames.add(source.getTypeNames()); } } XPath xpath = XPathFactory.newInstance().newXPath(); xpath.setNamespaceContext(CommonNamespaces.getNamespaceContext(). addNamespace("wfs", "<LINK_0>")); NodeList list = (NodeList) xpath.compile(" List<Element> toRemove = new ArrayList<>(); determineFeatureTypeNodesToRemove(layerNames, list, toRemove); xpath.setNamespaceContext(CommonNamespaces.getNamespaceContext(). addNamespace("wfs", "<LINK_0>/2.0")); list = (NodeList) xpath.compile(" determineFeatureTypeNodesToRemove(layerNames, list, toRemove); toRemove.forEach(element -> element.getParentNode().removeChild(element)); }
Source:
<code>private void unblockCommands() { for (Iterator<CompletableFuture<Void>> delayedEvent = delayedEvents.iterator(); delayedEvent.hasNext(); ) { <START> CompletableFuture<Void> cf = delayedEvent.next(); <END> delayedEvent.remove(); cf.complete(null); } }</code><technical_language>Nitpick, delayedEvent named delayedEventIter cf delayedEvent. delayedEvent.next() sound right me</technical_language>

Target:
private void unblockCommands() { for (Iterator<CompletableFuture<Void>> delayedEventIter = delayedEvents.iterator(); delayedEventIter.hasNext(); ) { CompletableFuture<Void> cf = delayedEventIter.next(); delayedEventIter.remove(); cf.complete(null); } }
Source:
<code><START> public String shell(String cmd) { <END> CommandOutputCapture capture = new CommandOutputCapture(); try { device.executeShellCommand(cmd, capture); } catch (TimeoutException e) { LOG.log(Level.SEVERE, "Error executing command: " + cmd, e); return null; } catch (ShellCommandUnresponsiveException e) { LOG.log(Level.SEVERE, "Error executing command: " + cmd, e); return null; } catch (AdbCommandRejectedException e) { LOG.log(Level.SEVERE, "Error executing command: " + cmd, e); return null; } catch (IOException e) { LOG.log(Level.SEVERE, "Error executing command: " + cmd, e); return null; } return capture.toString(); }</code><technical_language>change this method call new method instead? pass 5 seconds timeout change meaning of this function</technical_language>

Target:
public String shell(String cmd) { return shell(cmd, 5000); }
Source:
<code>public void provisionInputWithPathSpaces() { File helloWDL = new File(ResourceHelpers.resourceFilePath("helloSpaces.wdl")); File helloJSON = new File(ResourceHelpers.resourceFilePath("helloSpaces.json")); ArrayList<String> args = new ArrayList<String>() {{ add("--local-entry"); add("--json"); add(helloJSON.getPath()); }}; WorkflowsApi api = mock(WorkflowsApi.class); UsersApi usersApi = mock(UsersApi.class); Client client = new Client(); <START> client.setConfigFile(ResourceHelpers.resourceFilePath("config")); <END> WorkflowClient workflowClient = new WorkflowClient(api, usersApi, client, false); workflowClient.checkEntryFile(helloWDL.getAbsolutePath(), args, null); assertTrue("output should include a successful cromwell run", systemOutRule.getLog().contains("Cromwell exit code: 0")); }</code><technical_language>file contents of this</technical_language>

Target:
public void provisionInputWithPathSpaces() { File helloWDL = new File(ResourceHelpers.resourceFilePath("helloSpaces.wdl")); File helloJSON = new File(ResourceHelpers.resourceFilePath("helloSpaces.json")); ArrayList<String> args = new ArrayList<String>() {{ add("workflow"); add("launch"); add("--local-entry"); add(helloWDL.getAbsolutePath()); add("--json"); add(helloJSON.getPath()); }}; File config = new File(ResourceHelpers.resourceFilePath("clientConfig")); runClientCommandConfig(args, config); assertTrue("output should include a successful cromwell run", systemOutRule.getLog().contains("Cromwell exit code: 0")); }
Source:
<code>static Consumer<List<BatchElement<Integer, TimestampRange>>> consumer(TimestampService delegate) { return batch -> { long totalTimestamps = batch.stream().mapToLong(BatchElement::argument).reduce(0, Math::addExact); long startInclusive = 0; long endExclusive = 0; for (BatchElement<Integer, TimestampRange> element : batch) { int timestampsRequired = element.argument(); if (element.argument() == 0) { element.result().setException(new IllegalArgumentException("Cannot ask for 0 timestamps")); } else if (element.argument() <= endExclusive - startInclusive) { element.result().set(createExclusiveRange(startInclusive, startInclusive + timestampsRequired)); startInclusive += timestampsRequired; totalTimestamps -= timestampsRequired; } else { TimestampRange requested = getFreshTimestampsFromDelegate( delegate, Ints.saturatedCast(totalTimestamps)); startInclusive = requested.getLowerBound(); endExclusive = Math.addExact(requested.getUpperBound(), 1); int toTake = Math.min(Ints.checkedCast(endExclusive - startInclusive), timestampsRequired); element.result().set(createExclusiveRange(startInclusive, startInclusive + toTake)); startInclusive += toTake; totalTimestamps -= timestampsRequired; } } }; <START> } <END></code><technical_language>Nice (and this adds support for batching getFreshTimestamps). multiple case correct (considering need return at-least-1 timestamp). a bit funky "cannot ask for 0 timestamps" making request(s), a major concern</technical_language>

Target:
static Consumer<List<BatchElement<Integer, TimestampRange>>> consumer(TimestampService delegate) { return batch -> { long totalTimestamps = batch.stream().mapToLong(BatchElement::argument).reduce(0, Math::addExact); long startInclusive = 0; long endExclusive = 0; for (BatchElement<Integer, TimestampRange> element : batch) { int timestampsRequired = element.argument(); if (element.argument() <= endExclusive - startInclusive) { element.result().set(createExclusiveRange(startInclusive, startInclusive + timestampsRequired)); startInclusive += timestampsRequired; totalTimestamps -= timestampsRequired; } else { TimestampRange requested = getFreshTimestampsFromDelegate( delegate, Ints.saturatedCast(totalTimestamps)); startInclusive = requested.getLowerBound(); endExclusive = Math.addExact(requested.getUpperBound(), 1); int toTake = Math.min(Ints.checkedCast(endExclusive - startInclusive), timestampsRequired); element.result().set(createExclusiveRange(startInclusive, startInclusive + toTake)); startInclusive += toTake; totalTimestamps -= timestampsRequired; } } }; }
Source:
<code>private void createVolumeProfileDoc() throws DocumentException, IOException { createPdf = new CreatePdf(); ExportData exportData = getParameters().getExportData(); String userId = getParameters().getUserId(); GlusterVolumeProfileInfo profileInfo = getParameters().getProfileInfo(); String filePath = getParameters().getFilePath(); Date today = new Date(); <START> if(filePath == null || filePath.isEmpty()) { <END> filePath = "/home/ababu/" + getGlusterVolumeDao().getById(profileInfo.getVolumeId()).getName() + "-" + exportData.toString()+ "-" + today.getTime() + ".pdf"; } try { Document document = new Document(); PdfWriter.getInstance(document, new FileOutputStream(filePath)); document.open(); createPdf.addMetaData(document, createMetaData(getGlusterVolumeDao().getById(profileInfo.getVolumeId()).getName(), userId)); addContent(document, profileInfo, exportData); document.close(); setSucceeded(true); VdcReturnValueBase returnValue = new VdcReturnValueBase(); returnValue.setDescription("Pdf Saved"); returnValue.setSucceeded(true); setActionReturnValue(returnValue); } catch (Exception e) { setSucceeded(false); setActionReturnValue(e.toString()); } }</code><technical_language>other file please format file formatting rules</technical_language>

Target:
private void createVolumeProfileDoc() throws DocumentException, IOException { createPdf = new CreatePdf(); ExportData exportData = getParameters().getExportData(); String userId = getParameters().getUserId(); GlusterVolumeProfileInfo profileInfo = getParameters().getProfileInfo(); try { Document document = new Document(); ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); PdfWriter.getInstance(document, byteStream); document.open(); createPdf.addMetaData(document, createMetaData(getGlusterVolumeDao().getById(profileInfo.getVolumeId()).getName(), userId)); addContent(document, profileInfo, exportData); document.close(); setSucceeded(true); VdcReturnValueBase returnValue = new VdcReturnValueBase(); returnValue.setDescription("Pdf Saved"); returnValue.setSucceeded(true); setActionReturnValue(byteStream.toByteArray()); } catch (Exception e) { setSucceeded(false); setActionReturnValue(e.toString()); } }
Source:
<code>public void copy(INDArray x, INDArray y) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, x, y); if(x.isSparse() || y.isSparse()){ Nd4j.getSparseBlasWrapper().level1().copy(x, y); } if (x.data().dataType() == DataBuffer.Type.DOUBLE) { <START> DefaultOpExecutioner.validateDataType(DataBuffer.Type.DOUBLE, x, y); <END> dcopy(x.length(), x, BlasBufferUtil.getBlasStride(x), y, BlasBufferUtil.getBlasStride(y)); } else { DefaultOpExecutioner.validateDataType(DataBuffer.Type.FLOAT, x, y); scopy(x.length(), x, BlasBufferUtil.getBlasStride(x), y, BlasBufferUtil.getBlasStride(y)); } }</code><technical_language>@raver119 I feel this in a util class of some kind</technical_language>

Target:
public void copy(INDArray x, INDArray y) { if (Nd4j.getExecutioner().getProfilingMode() == OpExecutioner.ProfilingMode.ALL) OpProfiler.getInstance().processBlasCall(false, x, y); if (x.isSparse() || y.isSparse()) { Nd4j.getSparseBlasWrapper().level1().copy(x, y); return; } if (x.data().dataType() == DataBuffer.Type.DOUBLE) { DefaultOpExecutioner.validateDataType(DataBuffer.Type.DOUBLE, x, y); dcopy(x.length(), x, BlasBufferUtil.getBlasStride(x), y, BlasBufferUtil.getBlasStride(y)); } else { DefaultOpExecutioner.validateDataType(DataBuffer.Type.FLOAT, x, y); scopy(x.length(), x, BlasBufferUtil.getBlasStride(x), y, BlasBufferUtil.getBlasStride(y)); } }
Source:
<code>public void deleteRecording(final String callID, final String legID, final String recordingID) <START> throws NotFoundException, GeneralException, UnauthorizedException { <END> String url = String.format( "%s%s/%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, callID, LEGSPATH, legID, RECORDINGPATH ); messageBirdService.deleteByID(url, recordingID); }</code><technical_language>null check throw exception for call id leg id recording id below; if (callID == null) { throw new IllegalArgumentException("Call ID specified."); }</technical_language>

Target:
public void deleteRecording(final String callID, final String legID, final String recordingID) throws NotFoundException, GeneralException, UnauthorizedException { if (callID == null) { throw new IllegalArgumentException("Call ID must be specified."); } if (legID == null) { throw new IllegalArgumentException("Leg ID must be specified."); } if (recordingID == null) { throw new IllegalArgumentException("Recording ID must be specified."); } String url = String.format( "%s%s/%s%s/%s%s", VOICE_CALLS_BASE_URL, VOICECALLSPATH, callID, LEGSPATH, legID, RECORDINGPATH ); messageBirdService.deleteByID(url, recordingID); }
Source:
<code>private void buildStatisticsTree(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } Map<ITmfTrace, Job> updateJobs; if (isGlobal) { updateJobs = fUpdateJobsGlobal; fTimeRange = timeRange; } else { updateJobs = fUpdateJobsPartial; fTimeRangePartial = timeRange; } <START> synchronized (statsData) { <END> for (final ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = aTrace.getAnalysisModuleOfClass(TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Job job = updateJobs.get(aTrace); if (job == null) { job = new UpdateJob("Statistics update", aTrace, isGlobal, statsMod); updateJobs.put(aTrace, job); job.setSystem(true); job.schedule(); } } } }</code><technical_language>Is synchronized block necessary here</technical_language>

Target:
private void buildStatisticsTree(final ITmfTrace trace, final TmfTimeRange timeRange, final boolean isGlobal) { final TmfStatisticsTree statsData = TmfStatisticsTreeManager.getStatTree(getTreeID()); if (statsData == null) { return; } Map<ITmfTrace, Job> updateJobs; if (isGlobal) { updateJobs = fUpdateJobsGlobal; fTimeRange = timeRange; } else { updateJobs = fUpdateJobsPartial; fTimeRangePartial = timeRange; } for (final ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) { if (!isListeningTo(aTrace)) { continue; } final TmfStatisticsModule statsMod = aTrace.getAnalysisModuleOfClass(TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } Job job = updateJobs.get(aTrace); if (job == null) { job = new UpdateJob("Statistics update", aTrace, isGlobal, statsMod); updateJobs.put(aTrace, job); job.setSystem(true); job.schedule(); } } }
Source:
<code>public static synchronized void setEnabled(boolean enabled) { <START> ENABLED = enabled && isEventLoggingEnabled(); <END> if (ENABLED) { OutputBuffer.sendAllScheduled(); } }</code><technical_language>Hint 2</technical_language>

Target:
public static synchronized void setEnabled(boolean enabled) { ENABLED = enabled; if (ENABLED) { OutputBuffer.sendAllScheduled(); } }
Source:
<code>@Override public void init() { <START> localInputSource = Objects.equals(System.getenv("HYDRA_JOBID"), jobId); <END> if (!localInputSource) { throw new IllegalStateException("At this time only queries to ${hydra.task.jobid} are supported"); } if (fields != null) { fieldsIn = new IndexField[fields.length]; fieldsOut = new AutoField[fields.length]; for (int i = 0; i < fields.length; i++) { fieldsIn[i] = new IndexField(i); fieldsOut[i] = AutoField.newAutoField(fields[i]); } } try { File dir = Paths.get(treeDir).toFile(); tempDir = Files.createTempDir(); queryEngine = new QueryEngineSourceSingle(new ReadTree(dir)); Query query = new Query(jobId, new String[] {path}, null); QueryOpProcessor proc = new QueryOpProcessor.Builder(this, new String[]{ops}) .tempDir(tempDir).build(); queryHandle = queryEngine.query(query, proc); } catch (Exception ex) { throw Throwables.propagate(ex); } }</code><technical_language>alternatives: - job id optional null imply local source (can rename "remoteJobId") - check data directory is a descendant of working directory - another field called "localJobId" default check</technical_language>

Target:
@Override public void init() { super.init(); localInputSource = (jobId == null); if (!localInputSource) { throw new UnsupportedOperationException("At this time only local queries are supported"); } try { File dir = Paths.get(treeDir).toFile(); tempDir = LessFiles.createTempDir(); queryEngine = new QueryEngineSourceSingle(new ReadTree(dir)); Query query = new Query(config.jobId, new String[] {path}, null); QueryOpProcessor proc = new QueryOpProcessor.Builder(this, new String[]{ops}) .tempDir(tempDir).build(); queryHandle = queryEngine.query(query, proc); initialized.countDown(); localInitialized = true; } catch (Exception ex) { throw Throwables.propagate(ex); } }
Source:
<code>public void notAccruedTest() { ZonedDateTime valuationDate = DateUtils.getUTCDate(2013, 8, 10); SwapFixedCoupon<Coupon> fixedCouponSwap = SWAP_FIXED_3M_S_DEFINITION.toDerivative(valuationDate, TS_ARRAY_USDLIBOR3M); MulticurveProviderDiscount multicurve = MULTICURVE_SET[1]; Calendar calendar = USD6MLIBOR3M.getCalendar(); DayCount dcIbor = USD6MLIBOR3M.getIborIndex().getDayCount(); DayCount dcFixed = USD6MLIBOR3M.getFixedLegDayCount(); double parRate = CPRC.parRate(SWAP_FIXED_3M_S_DEFINITION, dcFixed, dcIbor, calendar, valuationDate, TS_USDLIBOR3M, multicurve); double accruedInterest = CPRC.accruedInterest(SWAP_FIXED_3M_S_DEFINITION, dcFixed, dcIbor, calendar, valuationDate, TS_USDLIBOR3M, multicurve).getAmount(Currency.USD); double refParRate = fixedCouponSwap.accept(PRDC, multicurve); assertRelative("", refParRate, parRate, TOL); <START> assertRelative("", 0.0, accruedInterest, TOL); <END> }</code><technical_language>Add a message assert</technical_language>

Target:
public void notAccruedTest() { ZonedDateTime valuationDate = DateUtils.getUTCDate(2013, 8, 10); for (SwapFixedIborDefinition swapDefinition : new SwapFixedIborDefinition[] {SWAP_FIXED_3M_PAY_DEFINITION, SWAP_FIXED_3M_REC_DEFINITION_ }) { SwapFixedCoupon<Coupon> fixedCouponSwap = swapDefinition.toDerivative(valuationDate, TS_ARRAY_USDLIBOR3M); MulticurveProviderDiscount multicurve = MULTICURVE_SET[1]; Calendar calendar = USD6MLIBOR3M.getCalendar(); DayCount dcIbor = USD6MLIBOR3M.getIborIndex().getDayCount(); DayCount dcFixed = USD6MLIBOR3M.getFixedLegDayCount(); double parRate = CPRC.parRate(swapDefinition, dcFixed, dcIbor, calendar, valuationDate, TS_USDLIBOR3M, multicurve); double accruedInterest = CPRC.accruedInterest(swapDefinition, dcFixed, dcIbor, calendar, valuationDate, TS_USDLIBOR3M, multicurve).getAmount(Currency.USD); double refParRate = fixedCouponSwap.accept(PRDC, multicurve); assertRelative("notAccruedTest", refParRate, parRate, TOL); assertRelative("notAccruedTest", 0.0, accruedInterest, TOL); } }
Source:
<code>public void stop(BundleContext context) throws Exception { <START> Preferences.getInstance().dispose(); <END> super.stop(context); }</code><technical_language>feel right. is required</technical_language>

Target:
public void stop(BundleContext context) throws Exception { try { Preferences.getInstance().dispose(); } finally { super.stop(context); } }
Source:
<code>public static String extractBirthdate(PRPAMT201306UV02ParameterList params) { LOG.trace("Entering HL7Parser201305.ExtractBirthdate method..."); String birthDate = null; if (CollectionUtils.isNotEmpty(params.getLivingSubjectBirthTime()) && params.getLivingSubjectBirthTime().get(0) != null) { PRPAMT201306UV02LivingSubjectBirthTime birthTime = params.getLivingSubjectBirthTime().get(0); if (CollectionUtils.isNotEmpty(birthTime.getValue()) && birthTime.getValue().get(0) != null) { IVLTSExplicit birthday = birthTime.getValue().get(0); <START> LOG.info("Found birthTime in query parameters = ", birthday.getValue()); <END> birthDate = birthday.getValue(); } else { LOG.info("message does not contain a birthtime"); } } else { LOG.info("message does not contain a birthtime"); } LOG.trace("Exiting HL7Parser201305.ExtractBirthdate method..."); return birthDate; }</code><technical_language>missing placeholders, "{ }", for parameterized logging</technical_language>

Target:
public static String extractBirthdate(PRPAMT201306UV02ParameterList params) { LOG.trace("Entering HL7Parser201305.ExtractBirthdate method..."); String birthDate = null; if (CollectionUtils.isNotEmpty(params.getLivingSubjectBirthTime()) && params.getLivingSubjectBirthTime().get(0) != null) { PRPAMT201306UV02LivingSubjectBirthTime birthTime = params.getLivingSubjectBirthTime().get(0); if (CollectionUtils.isNotEmpty(birthTime.getValue()) && birthTime.getValue().get(0) != null) { IVLTSExplicit birthday = birthTime.getValue().get(0); LOG.info("Found birthTime in query parameters{} ", birthday.getValue()); birthDate = birthday.getValue(); } else { LOG.info("message does not contain a birthtime"); } } else { LOG.info("message does not contain a birthtime"); } LOG.trace("Exiting HL7Parser201305.ExtractBirthdate method..."); return birthDate; }
Source:
<code>private String getOidFromExpression(String expression, int patternIndex, int expressionIndex) throws OpenClinicaSystemException { String[] splitExpression = expression.split(ESCAPED_SEPERATOR); if (!match(splitExpression[splitExpression.length - 1 - expressionIndex], pattern[patternIndex])) { if (!match(splitExpression[splitExpression.length - 1 - expressionIndex], ruleActionPattern[patternIndex])) { <START> return expression; <END> } } return splitExpression[splitExpression.length - 1 - expressionIndex]; }</code><technical_language>Do making this change</technical_language>

Target:
private String getOidFromExpression(String expression, int patternIndex, int expressionIndex) throws OpenClinicaSystemException { String[] splitExpression = expression.split(ESCAPED_SEPERATOR); if (!match(splitExpression[splitExpression.length - 1 - expressionIndex], pattern[patternIndex])) { if (!match(splitExpression[splitExpression.length - 1 - expressionIndex], ruleActionPattern[patternIndex])) { throw new OpenClinicaSystemException("OCRER'R_0019", new String[] { expression }); } } return splitExpression[splitExpression.length - 1 - expressionIndex]; }