auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public CompletableFuture<? extends JobClient> execute( Pipeline pipeline, Configuration configuration) throws Exception { Plan plan = (Plan) pipeline; CollectionExecutor exec = new CollectionExecutor(plan.getExecutionConfig()); JobExecutionResult result = exec.execute(plan); return CompletableFuture.completedFuture(new JobClient() { @Override public JobID getJobID() { return new JobID(); } @Override public CompletableFuture<JobStatus> getJobStatus() { return CompletableFuture.completedFuture(JobStatus.FINISHED); } @Override public CompletableFuture<Void> cancel() { <START> return null; <END> } @Override public CompletableFuture<String> stopWithSavepoint( boolean advanceToEndOfEventTime, @Nullable String savepointDirectory) { return null; } @Override public CompletableFuture<String> triggerSavepoint(@Nullable String savepointDirectory) { return null; } @Override public CompletableFuture<Map<String, Object>> getAccumulators(ClassLoader classLoader) { return null; } @Override public CompletableFuture<JobExecutionResult> getJobExecutionResult(ClassLoader userClassloader) { return CompletableFuture.completedFuture(result); } }); }</code><technical_language>return CompletableFuture.completedFuture(null);? for following</technical_language>

Target:
public CompletableFuture<? extends JobClient> execute( Pipeline pipeline, Configuration configuration) throws Exception { Plan plan = (Plan) pipeline; CollectionExecutor exec = new CollectionExecutor(plan.getExecutionConfig()); JobExecutionResult result = exec.execute(plan); return CompletableFuture.completedFuture(new JobClient() { @Override public JobID getJobID() { return new JobID(); } @Override public CompletableFuture<JobStatus> getJobStatus() { return CompletableFuture.completedFuture(JobStatus.FINISHED); } @Override public CompletableFuture<Void> cancel() { return CompletableFuture.completedFuture(null); } @Override public CompletableFuture<String> stopWithSavepoint( boolean advanceToEndOfEventTime, @Nullable String savepointDirectory) { return CompletableFuture.completedFuture("null"); } @Override public CompletableFuture<String> triggerSavepoint(@Nullable String savepointDirectory) { return CompletableFuture.completedFuture("null"); } @Override public CompletableFuture<Map<String, Object>> getAccumulators(ClassLoader classLoader) { return CompletableFuture.completedFuture(Collections.emptyMap()); } @Override public CompletableFuture<JobExecutionResult> getJobExecutionResult(ClassLoader userClassloader) { return CompletableFuture.completedFuture(result); } }); }
Source:
<code>public void init(FilterConfig filterConfig) throws ServletException { Histogram.Builder builder = Histogram.build() .labelNames("path", "method"); if (filterConfig == null && isEmpty(metricName)) { throw new ServletException("No configuration object provided, and no metricName passed via constructor"); } if (filterConfig != null) { if (isEmpty(metricName)) { metricName = filterConfig.getInitParameter(METRIC_NAME_PARAM); if (isEmpty(metricName)) { throw new ServletException("Init parameter \"" + METRIC_NAME_PARAM + "\" is required; please supply a value"); } } if (!isEmpty(filterConfig.getInitParameter(HELP_PARAM))) { help = filterConfig.getInitParameter(HELP_PARAM); } if (!isEmpty(filterConfig.getInitParameter(PATH_COMPONENT_PARAM))) { pathComponents = Integer.valueOf(filterConfig.getInitParameter(PATH_COMPONENT_PARAM)); } if (!isEmpty(filterConfig.getInitParameter(BUCKET_CONFIG_PARAM))) { String[] bucketParams = filterConfig.getInitParameter(BUCKET_CONFIG_PARAM).split(","); buckets = new double[bucketParams.length]; for (int i = 0; i < bucketParams.length; i++) { buckets[i] = Double.parseDouble(bucketParams[i]); } } } if (buckets != null) { builder = builder.buckets(buckets); } histogram = builder .help(help) .name(metricName) .register(); <START> statusCounter = Counter.build(metricName + "_status", "HTTP status codes of " + help) <END> .labelNames("path", "method", "status") .register(); }</code><technical_language>Counters end in _total a label name in a metric name is generally anti-pattern, sense if label is aggregated away. though</technical_language>

Target:
public void init(FilterConfig filterConfig) throws ServletException { Histogram.Builder builder = Histogram.build() .labelNames("path", "method"); if (filterConfig == null && isEmpty(metricName)) { throw new ServletException("No configuration object provided, and no metricName passed via constructor"); } if (filterConfig != null) { if (isEmpty(metricName)) { metricName = filterConfig.getInitParameter(METRIC_NAME_PARAM); if (isEmpty(metricName)) { throw new ServletException("Init parameter \"" + METRIC_NAME_PARAM + "\" is required; please supply a value"); } } if (!isEmpty(filterConfig.getInitParameter(HELP_PARAM))) { help = filterConfig.getInitParameter(HELP_PARAM); } if (!isEmpty(filterConfig.getInitParameter(PATH_COMPONENT_PARAM))) { pathComponents = Integer.valueOf(filterConfig.getInitParameter(PATH_COMPONENT_PARAM)); } if (!isEmpty(filterConfig.getInitParameter(BUCKET_CONFIG_PARAM))) { String[] bucketParams = filterConfig.getInitParameter(BUCKET_CONFIG_PARAM).split(","); buckets = new double[bucketParams.length]; for (int i = 0; i < bucketParams.length; i++) { buckets[i] = Double.parseDouble(bucketParams[i]); } } } if (buckets != null) { builder = builder.buckets(buckets); } histogram = builder .help(help) .name(metricName) .register(); statusCounter = Counter.build(metricName + "_status_total", "HTTP status codes of " + help) .labelNames("path", "method", "status") .register(); }
Source:
<code>public ListenableFuture<Void> reportFeedback(AuthHeader authHeader, ConjureTimeLockClientFeedback feedbackReport) { <START> return null; <END> }</code><technical_language>This null pointer exceptions if add listeners chain futures. Is else supply</technical_language>

Target:
public ListenableFuture<Void> reportFeedback(AuthHeader authHeader, ConjureTimeLockClientFeedback feedbackReport) { return Futures.immediateVoidFuture(); }
Source:
<code>protected Artifact createArtifact(final ArtifactItem item) throws MojoExecutionException { assert item != null; if (item.getVersion() == null) { throw new MojoExecutionException("Unable to find artifact version of " + item.getGroupId() + ":" + item.getArtifactId() + " in either project dependencies or in project dependencyManagement."); } <START> if (item.getVersion().trim().startsWith("[") || item.getVersion().trim().startsWith("(") ) { <END> try { item.setVersion(resolveVersionRange(item.getGroupId(), item.getArtifactId(), item.getType(), item.getVersion())); } catch (VersionRangeResolutionException e) { throw new MojoExecutionException("Could not get the highest version from the range: " + item.getVersion(), e); } } return resolveArtifactItem(item); }</code><technical_language>I finding this confusing. need parse version figure out if is a range not? able pass version set in POM (range not) artifact resolver figure out</technical_language>

Target:
protected Artifact createArtifact(final ArtifactItem item) throws MojoExecutionException { assert item != null; if (item.getVersion() == null) { throw new MojoExecutionException("Unable to find artifact without version specified: " + item.getGroupId() + ":" + item.getArtifactId() + ":" + item.getVersion() + " in either project dependencies or in project dependencyManagement."); } if (item.getVersion().trim().startsWith("[") || item.getVersion().trim().startsWith("(") ) { try { item.setVersion(resolveVersionRange(item.getGroupId(), item.getArtifactId(), item.getType(), item.getVersion())); } catch (VersionRangeResolutionException e) { throw new MojoExecutionException("Could not get the highest version from the range: " + item.getVersion(), e); } } return resolveArtifactItem(item); }
Source:
<code>public Map<Measure, Result<?>> calculate( T target, Set<Measure> measures, CalculationParameters parameters, ScenarioMarketData marketData, ReferenceData refData) { Measure derivedMeasure = derivedFunction.measure(); if (!measures.contains(derivedMeasure)) { return delegate.calculate(target, measures, parameters, marketData, refData); } <START> SetView<Measure> allRequiredMeasures = Sets.union(measures, derivedFunction.requiredMeasures()); <END> Set<Measure> requiredMeasures = Sets.difference(allRequiredMeasures, ImmutableSet.of(derivedMeasure)); Map<Measure, Result<?>> delegateResults = delegate.calculate(target, requiredMeasures, parameters, marketData, refData); Result<?> result = calculateMeasure(target, delegateResults, parameters, marketData, refData); Map<Measure, Result<?>> requestedResults = MapStream.of(delegateResults) .filterKeys(measures::contains) .filterKeys(measure -> !measure.equals(derivedMeasure)) .toMap(); return ImmutableMap.<Measure, Result<?>>builder() .put(derivedMeasure, result) .putAll(requestedResults) .build(); }</code><technical_language>SetView type here? I IDE choose type</technical_language>

Target:
public Map<Measure, Result<?>> calculate( T target, Set<Measure> measures, CalculationParameters parameters, ScenarioMarketData marketData, ReferenceData refData) { Measure derivedMeasure = derivedFunction.measure(); if (!measures.contains(derivedMeasure)) { return delegate.calculate(target, measures, parameters, marketData, refData); } Set<Measure> allRequiredMeasures = Sets.union(measures, derivedFunction.requiredMeasures()); Set<Measure> requiredMeasures = Sets.difference(allRequiredMeasures, ImmutableSet.of(derivedMeasure)); Map<Measure, Result<?>> delegateResults = delegate.calculate(target, requiredMeasures, parameters, marketData, refData); Result<?> result = calculateMeasure(target, delegateResults, parameters, marketData, refData); Map<Measure, Result<?>> requestedResults = MapStream.of(delegateResults) .filterKeys(measures::contains) .filterKeys(measure -> !measure.equals(derivedMeasure)) .toMap(); return ImmutableMap.<Measure, Result<?>>builder() .put(derivedMeasure, result) .putAll(requestedResults) .build(); }
Source:
<code>private void acceptTerms() { try { <START> RESTClientImpl client = new RESTClientImpl(usernameTextField.getText(), new String(passwordTextField.getPassword())); <END> client.getResponse(RESTClient.HttpMethod.POST, RemoteDescriptorProvider.DATACLOUD_TERMS_ACCEPT_URL, ""); addRemoteServer(); dontShowAgainCheckBox.setVisible(false); } catch(Exception e) { showError("Cannot send acceptance message to server: " + e.getMessage()); } }</code><technical_language>final</technical_language>

Target:
private void acceptTerms() { try { final RESTClientImpl client = new RESTClientImpl(usernameTextField.getText(), new String(passwordTextField.getPassword())); client.getResponse(RESTClient.HttpMethod.POST, RemoteDescriptorProvider.DATACLOUD_TERMS_ACCEPT_URL, ""); addRemoteServer(); dontShowAgainCheckBox.setVisible(false); } catch(Exception e) { showError("Cannot send acceptance message to server: " + e.getMessage()); } }
Source:
<code>private Runnable handleFailure(final Runnable r) { if (myErrorHandler == null) { myErrorHandler = new Consumer<Throwable>() { @Override public void accept(Throwable t) { ThrowableHandlers.handle(new RuntimeException("Exception in " + ExecutorEdt.this + ": ", t)); } }; } return new Runnable() { @Override public void run() { try { r.run(); } catch (Throwable t) { <START> ThrowableHandlers.handleError(t); <END> myErrorHandler.accept(t); } } }; }</code><technical_language>do need pass "t" ThrowableHandlers times</technical_language>

Target:
private Runnable handleFailure(final Runnable r) { if (myErrorHandler == null) { myErrorHandler = new Consumer<Throwable>() { @Override public void accept(Throwable t) { ThrowableHandlers.handle(new RuntimeException("Exception in " + ExecutorEdt.this + ": ", t)); } }; } return new Runnable() { @Override public void run() { try { r.run(); } catch (Throwable t) { myErrorHandler.accept(t); } } }; }
Source:
<code>private void testArray() throws Exception { if (!getPgJdbcDriver()) { return; } Server server = createPgServer( "-ifNotExists", "-pgPort", "5535", "-pgDaemon", "-key", "pgserver", "mem:pgserver"); try ( Connection conn = DriverManager.getConnection( "jdbc:postgresql://localhost:5535/pgserver", "sa", "sa"); Statement stat = conn.createStatement(); ) { stat.execute("CREATE TABLE test (id int primary key, x1 int array, x2 varchar array)"); stat.execute("INSERT INTO test (id, x1, x2) VALUES (1, ARRAY[2, 3], ARRAY['4', '5'])"); <START> try (ResultSet rs = stat.executeQuery( "SELECT x1, x2 FROM test WHERE id = 1")) { assertTrue(rs.next()); Object[] arr = (Object[]) rs.getArray(1).getArray(); assertEquals("2", arr[0]); <END> assertEquals("3", arr[1]); arr = (Object[]) rs.getArray(2).getArray(); assertEquals("4", arr[0]); assertEquals("5", arr[1]); } } finally { server.stop(); } }</code><technical_language>work setObject(column, Object[] String[])</technical_language>

Target:
private void testArray() throws Exception { if (!getPgJdbcDriver()) { return; } Server server = createPgServer( "-ifNotExists", "-pgPort", "5535", "-pgDaemon", "-key", "pgserver", "mem:pgserver"); try ( Connection conn = DriverManager.getConnection( "jdbc:postgresql://localhost:5535/pgserver", "sa", "sa"); Statement stat = conn.createStatement(); ) { stat.execute("CREATE TABLE test (id int primary key, x1 varchar array)"); stat.execute("INSERT INTO test (id, x1) VALUES (1, ARRAY['abc', 'd\\\"e', '{,}'])"); try (ResultSet rs = stat.executeQuery( "SELECT x1 FROM test WHERE id = 1")) { assertTrue(rs.next()); Object[] arr = (Object[]) rs.getArray(1).getArray(); assertEquals("abc", arr[0]); assertEquals("d\\\"e", arr[1]); assertEquals("{,}", arr[2]); } } finally { server.stop(); } }
Source:
<code>public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { <START> if( method.isAnnotationPresent(QueryHandler.class)) result.set(true); <END> }</code><technical_language>indenting is a off</technical_language>

Target:
public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { if (method.isAnnotationPresent(QueryHandler.class)) { result.set(true); } }
Source:
<code>public Optional<SneakingData> fill(DataHolder dataHolder, SneakingData manipulator, MergeFunction overlap) { if (dataHolder instanceof Entity) { final Optional<SneakingData> oldData = from(dataHolder); <START> final SneakingData newData = checkNotNull(overlap, "Merge function was null!").merge(oldData.orNull(), manipulator); <END> final Value<Boolean> newValue = newData.sneaking(); return Optional.of(manipulator.set(newValue)); } return Optional.absent(); }</code><technical_language>merge is flipped. fill provided SneakingData data Entity, read similar follows: java final SneakingData mergedData = overlap.merge(manipulator, oldData.orNull()); in end, applying merged data provided SneakingData, offering DataHolder</technical_language>

Target:
public Optional<SneakingData> fill(DataHolder dataHolder, SneakingData manipulator, MergeFunction overlap) { if (dataHolder instanceof Entity) { final Optional<SneakingData> oldData = from(dataHolder); final SneakingData newData = checkNotNull(overlap, "Merge function was null!").merge(manipulator, oldData.orNull()); final Value<Boolean> newValue = newData.sneaking(); return Optional.of(manipulator.set(newValue)); } return Optional.absent(); }
Source:
<code>public boolean remove(Run run) throws IOException { if (run.isDeletable()) { currentSession().delete(run); <START> Run testIfExists = get(run.getId()); <END> return testIfExists == null; } else { return false; } }</code><technical_language>This check is out of order. do get delete</technical_language>

Target:
public boolean remove(Run run) throws IOException { if (run.isDeletable()) { Long runId = run.getId(); currentSession().delete(run); Run testIfExists = get(runId); return testIfExists == null; } else { return false; } }
Source:
<code>private void stowMetaDataAndBulkData(File file) { Attributes metadata; if (mediaType == StowMetaDataType.JSON) { try { metadata = parseJSON(file.getPath()); } catch (Exception e) { LOG.error("error parsing metadata JSON file {}: {}", file, e.getMessage()); <START> e.printStackTrace(); <END> return; } } else if (mediaType == StowMetaDataType.XML) { metadata = new Attributes(); try { ContentHandlerAdapter ch = new ContentHandlerAdapter(metadata); SAXParserFactory.newInstance().newSAXParser().parse(file, ch); Attributes fmi = ch.getFileMetaInformation(); if (fmi != null) metadata.addAll(fmi); } catch (Exception e) { LOG.error("error parsing metadata XML file {}: {}", file, e.getMessage()); e.printStackTrace(); return; } } else { throw new IllegalArgumentException("Unsupported media type " + mediaType); } ExtractedBulkData extractedBulkData = extractBulkData(metadata); if (isMultiFrame(metadata)) { if (extractedBulkData.pixelDataBulkData.size() > 1) { LOG.error("Compressed multiframe with multiple fragments in file is not supported by STOW-RS in the current DICOM standard (2015b)", file); return; } } if (!extractedBulkData.pixelDataBulkData.isEmpty()) { metadata.setValue(Tag.PixelData, metadata.getVR(Tag.PixelData), new BulkData(null, extractedBulkData.pixelDataBulkDataURI, extractedBulkData.pixelDataBulkData.get(0).bigEndian)); } try { addResponse(sendMetaDataAndBulkData(metadata, extractedBulkData)); } catch (IOException e) { LOG.error("Error for file {}", file, e); } }</code><technical_language>Hi, Kevin! a Logger here, I e.printStackTrace() (which print standard out). I if do this stack trace visible: LOG.error("error parsing metadata JSON file {}: {}", file, e); try out please</technical_language>

Target:
private void stowMetaDataAndBulkData(File file) { Attributes metadata; if (mediaType == StowMetaDataType.JSON) { try { metadata = parseJSON(file.getPath()); } catch (Exception e) { LOG.error("error parsing metadata JSON file {}", file, e); return; } } else if (mediaType == StowMetaDataType.XML) { metadata = new Attributes(); try { ContentHandlerAdapter ch = new ContentHandlerAdapter(metadata); SAXParserFactory.newInstance().newSAXParser().parse(file, ch); Attributes fmi = ch.getFileMetaInformation(); if (fmi != null) metadata.addAll(fmi); } catch (Exception e) { LOG.error("error parsing metadata XML file {}", file, e); return; } } else { throw new IllegalArgumentException("Unsupported media type " + mediaType); } ExtractedBulkData extractedBulkData = extractBulkData(metadata); if (isMultiFrame(metadata)) { if (extractedBulkData.pixelDataBulkData.size() > 1) { LOG.error("Compressed multiframe with multiple fragments in file is not supported by STOW-RS in the current DICOM standard (2015b)", file); return; } } if (!extractedBulkData.pixelDataBulkData.isEmpty()) { metadata.setValue(Tag.PixelData, metadata.getVR(Tag.PixelData), new BulkData(null, extractedBulkData.pixelDataBulkDataURI, extractedBulkData.pixelDataBulkData.get(0).bigEndian)); } try { addResponse(sendMetaDataAndBulkData(metadata, extractedBulkData)); } catch (IOException e) { LOG.error("Error for file {}", file, e); } }
Source:
<code>public void setUp() throws Exception { super.setUp(); <START> when(getQuery().getDbFacade()).thenReturn(dbFacade); <END> when(dbFacade.getVmGuestAgentInterfaceDao()).thenReturn(vmGuestAgentInterfaceDao); }</code><technical_language>getDbFacadeMockInstance() instead of mocking</technical_language>

Target:
public void setUp() throws Exception { super.setUp(); }
Source:
<code><START> protected ClientEndpoint initEndpoint() { <END> return endpointManager.getEndpoint(connection); }</code><technical_language>This is problematic (or ugly). is dangerous call overridable method a constructor, if overridden in a subclass, overridden method called super class constructor, subclass constructor completed. example: public class Main { public static void main(String[] args){ Bar bar = new Bar(); } } class Foo{ Foo(){ foo(); } public void foo(){} } class Bar extends Foo{ final int a; Bar(){ a=10; } public void foo(){ System.out.println(a); } } print 0</technical_language>

Target:
private ClientEndpoint initEndpoint() { ClientEndpoint endpoint = endpointManager.getEndpoint(connection); if (endpoint != null) { return endpoint; } return new ClientEndpointImpl(clientEngine, nodeEngine, connection); }
Source:
<code>public URLClassLoader createEngineClassLoader(File engineDirectory) throws IOException { List<File> osgiClasspath = getOsgiBootstrapClasspath(engineDirectory); addToClassPath(osgiClasspath, new File(engineDirectory, OsgiDir.PLUGINS), new WildcardFileFilter("org.eclipse.osgi_*.jar")); getSlf4jJars().forEach(slf4j -> osgiClasspath.add(0, slf4j)); <START> if (maven.log.isDebugEnabled()) <END> { maven.log.debug("Configuring OSGi engine classpath:"); osgiClasspath.stream().forEach(file -> maven.log.debug(" + "+file.getAbsolutePath())); } return new URLClassLoader(toUrls(osgiClasspath)); }</code><technical_language>alternative: osgiClasspath.addAll(0, getSlf4Jars());</technical_language>

Target:
public URLClassLoader createEngineClassLoader(File engineDirectory) throws IOException { List<File> osgiClasspath = getOsgiBootstrapClasspath(engineDirectory); addToClassPath(osgiClasspath, new File(engineDirectory, OsgiDir.PLUGINS), new WildcardFileFilter("org.eclipse.osgi_*.jar")); osgiClasspath.addAll(0, getSlf4jJars()); if (maven.log.isDebugEnabled()) { maven.log.debug("Configuring OSGi engine classpath:"); osgiClasspath.stream().forEach(file -> maven.log.debug(" + "+file.getAbsolutePath())); } return new URLClassLoader(toUrls(osgiClasspath)); }
Source:
<code>public void create(List<Change> changes, PersonIdent author, String commitMessage, ProgressMonitor monitor) throws OrmException, IOException, CodeReviewNoteCreationException { try { revWalk = new RevWalk(db); inserter = db.newObjectInserter(); if (author != null) { this.author = author; } if (monitor == null) { monitor = NullProgressMonitor.INSTANCE; } NoteMap notes = NoteMap.newEmptyMap(); for (Change c : changes) { monitor.update(1); PatchSet ps = schema.patchSets().get(c.currentPatchSetId()); if (ps == null) { <START> continue; <END> } ObjectId commitId = ObjectId.fromString(ps.getRevision().get()); notes.set(commitId, createNoteContent(c, commitId)); } NotesBranchUtil notesBranchUtil = notesBranchUtilFactory.create(db); notesBranchUtil.commitAllNotes(notes, REFS_NOTES_REVIEW, author, commitMessage); } catch (ConcurrentRefUpdateException e) { throw new CodeReviewNoteCreationException(e); } finally { revWalk.release(); inserter.release(); } }</code><technical_language>circumstances a change's current PatchSet null? changes patch set</technical_language>

Target:
public void create(List<Change> changes, PersonIdent author, String commitMessage, ProgressMonitor monitor) throws OrmException, IOException, CodeReviewNoteCreationException { try { revWalk = new RevWalk(db); inserter = db.newObjectInserter(); if (author != null) { this.author = author; } if (monitor == null) { monitor = NullProgressMonitor.INSTANCE; } NoteMap notes = NoteMap.newEmptyMap(); for (Change c : changes) { monitor.update(1); PatchSet ps = schema.patchSets().get(c.currentPatchSetId()); ObjectId commitId = ObjectId.fromString(ps.getRevision().get()); notes.set(commitId, createNoteContent(c, commitId)); } NotesBranchUtil notesBranchUtil = notesBranchUtilFactory.create(db); notesBranchUtil.commitAllNotes(notes, REFS_NOTES_REVIEW, author, commitMessage); } catch (ConcurrentRefUpdateException e) { throw new CodeReviewNoteCreationException(e); } finally { revWalk.release(); inserter.release(); } }
Source:
<code><START> public boolean hasNoForeignBindings(List<Map<String, Object>> bindings, String exchangeNamePrefix) { <END> if (bindings.size() == 0) { return true; } boolean noForeign = true; for (Map<String, Object> binding : bindings) { if (!("queue".equals(binding.get("destination_type"))) || !((String) binding.get("destination")).startsWith(exchangeNamePrefix)) { noForeign = false; break; } } return noForeign; }</code><technical_language>this need public</technical_language>

Target:
private boolean hasNoForeignBindings(List<Map<String, Object>> bindings, String exchangeNamePrefix) { if (bindings.size() == 0) { return true; } boolean noForeign = true; for (Map<String, Object> binding : bindings) { if (!("queue".equals(binding.get("destination_type"))) || !((String) binding.get("destination")).startsWith(exchangeNamePrefix)) { noForeign = false; break; } } return noForeign; }
Source:
<code>protected TreeViewer doCreateTreeViewer(Composite cparent, int style) { treeViewer = new LaunchConfigurationViewer(cparent, style); treeViewer.setLabelProvider(new DecoratingLabelProvider(DebugUITools.newDebugModelPresentation(), PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator())); treeViewer.setComparator(new WorkbenchViewerComparator()); treeViewer.setContentProvider(new LaunchConfigurationTreeContentProvider(fLaunchGroup.getMode(), cparent.getShell())); treeViewer.addFilter(new LaunchGroupFilter(fLaunchGroup)); treeViewer.setUseHashlookup(true); treeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot()); if(fFilters != null) { for (ViewerFilter <START> fFilter : <END> fFilters) { treeViewer.addFilter(fFilter); } } treeViewer.getControl().addHelpListener(new HelpListener() { @Override public void helpRequested(HelpEvent evt) { handleHelpRequest(evt); } }); return treeViewer; }</code><technical_language>rename filter</technical_language>

Target:
protected TreeViewer doCreateTreeViewer(Composite cparent, int style) { treeViewer = new LaunchConfigurationViewer(cparent, style); treeViewer.setLabelProvider(new DecoratingLabelProvider(DebugUITools.newDebugModelPresentation(), PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator())); treeViewer.setComparator(new WorkbenchViewerComparator()); treeViewer.setContentProvider(new LaunchConfigurationTreeContentProvider(fLaunchGroup.getMode(), cparent.getShell())); treeViewer.addFilter(new LaunchGroupFilter(fLaunchGroup)); treeViewer.setUseHashlookup(true); treeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot()); if(fFilters != null) { for (ViewerFilter filter : fFilters) { treeViewer.addFilter(filter); } } treeViewer.getControl().addHelpListener(new HelpListener() { @Override public void helpRequested(HelpEvent evt) { handleHelpRequest(evt); } }); return treeViewer; }
Source:
<code>public void addVm(V1VirtualMachine vm) { try { getKubevirtApi().createNamespacedVirtualMachine(vm, vm.getMetadata().getNamespace()); } catch (ApiException e) { KubevirtUtils.auditAuthorizationIssues(e, auditLogDirector, provider); throw new EngineException(EngineError.unexpected, "failed to interact with kubevirt <START> start endpoint"); <END> } }</code><technical_language>related patch, 'createNamespacedVirtualMachine' instead of 'start'</technical_language>

Target:
public void addVm(V1VirtualMachine vm) { try { getKubevirtApi().createNamespacedVirtualMachine(vm, vm.getMetadata().getNamespace()); } catch (ApiException e) { handleException(e, "failed to interact with kubevirt create namespaced virtual machine endpoint"); } }
Source:
<code>public ValidationResult isUsingScsiReservationValid(VM vm, LunDisk lunDisk) { if (vm == null && Boolean.TRUE.equals(lunDisk.isUsingScsiReservation())) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_SCSI_RESERVATION_NOT_VALID_FOR_FLOATING_DISK); } if (lunDisk.isUsingScsiReservation() != null && <START> lunDisk.isUsingScsiReservation() <END> && lunDisk.getSgio() == ScsiGenericIO.FILTERED) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_SGIO_IS_FILTERED); } return ValidationResult.VALID; }</code><technical_language>Boolean.TRUE.equals()</technical_language>

Target:
public ValidationResult isUsingScsiReservationValid(VM vm, LunDisk lunDisk) { if (vm == null && Boolean.TRUE.equals(lunDisk.isUsingScsiReservation())) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_SCSI_RESERVATION_NOT_VALID_FOR_FLOATING_DISK); } if (Boolean.TRUE.equals(lunDisk.isUsingScsiReservation()) && lunDisk.getSgio() == ScsiGenericIO.FILTERED) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_SGIO_IS_FILTERED); } return ValidationResult.VALID; }
Source:
<code>private MetricsHub(@Parameter(Parameters.DashboardHostAddress.class) final String hostAddress, @Parameter(Parameters.DashboardPort.class) final int port) { this.workerEvalParams = Collections.synchronizedList(new LinkedList<>()); this.serverEvalParams = Collections.synchronizedList(new LinkedList<>()); if (!hostAddress.isEmpty()) { <START> this.dolphinURL = "http://" + hostAddress + ":" + port + "/"; <END> } else { dolphinURL = ""; } }</code><technical_language>variable name is misleading; please change dashboardURL</technical_language>

Target:
private MetricsHub(@Parameter(Parameters.DashboardHostAddress.class) final String hostAddress, @Parameter(Parameters.DashboardPort.class) final int port) { this.workerEvalParams = Collections.synchronizedList(new LinkedList<>()); this.serverEvalParams = Collections.synchronizedList(new LinkedList<>()); this.dashboardEnabled = !hostAddress.isEmpty(); this.dashboardURL = "http://" + hostAddress + ":" + port + "/"; if (this.dashboardEnabled) { LOG.log(Level.INFO, "Dashboard url: {0}", dashboardURL); } else { LOG.log(Level.INFO, "Dashboard is not in use"); } }
Source:
<code>public void testCollectStatsAvro() throws Exception { methodWatcher.executeUpdate(String.format("create external table t1_avro (col1 int, col2 char(24))" + " STORED AS AVRO LOCATION '%s'", getExternalResourceDirectory()+"t1_avro_test")); int insertCount = methodWatcher.executeUpdate(String.format("insert into t1_avro values (1,'XXXX')," + "(2,'YYYY')," + "(3,'ZZZZ')")); Assert.assertEquals("insertCount is wrong",3,insertCount); ResultSet rs; PreparedStatement ps = spliceClassWatcher.prepareCall("CALL SYSCS_UTIL.COLLECT_TABLE_STATISTICS(?,?,?) "); ps.setString(1, "EXTERNALTABLEIT"); ps.setString(2, "T1_AVRO"); ps.setBoolean(3, true); rs = ps.executeQuery(); rs.next(); Assert.assertEquals("Error with COLLECT_TABLE_STATISTICS for external table","EXTERNALTABLEIT", rs.getString(1)); rs.close(); ResultSet rs2 = methodWatcher.executeQuery("select total_row_count from sys.systablestatistics where schemaname = 'EXTERNALTABLEIT' and tablename = 'T1_AVRO'"); String expected = "TOTAL_ROW_COUNT |\n" + "------------------\n" + " 3 |"; Assert.assertEquals(expected, TestUtils.FormattedResult.ResultFactory.toString(rs2)); <START> rs2.close(); <END> }</code><technical_language>run select query collect stats</technical_language>

Target:
public void testCollectStatsAvro() throws Exception { methodWatcher.executeUpdate(String.format("create external table t1_avro (col1 int, col2 char(24))" + " STORED AS AVRO LOCATION '%s'", getExternalResourceDirectory()+"t1_avro_test")); int insertCount = methodWatcher.executeUpdate(String.format("insert into t1_avro values (1,'XXXX')," + "(2,'YYYY')," + "(3,'ZZZZ')")); Assert.assertEquals("insertCount is wrong",3,insertCount); ResultSet rs; PreparedStatement ps = spliceClassWatcher.prepareCall("CALL SYSCS_UTIL.COLLECT_TABLE_STATISTICS(?,?,?) "); ps.setString(1, "EXTERNALTABLEIT"); ps.setString(2, "T1_AVRO"); ps.setBoolean(3, true); rs = ps.executeQuery(); rs.next(); Assert.assertEquals("Error with COLLECT_TABLE_STATISTICS for external table","EXTERNALTABLEIT", rs.getString(1)); rs.close(); ResultSet rs2 = methodWatcher.executeQuery("select total_row_count from sys.systablestatistics where schemaname = 'EXTERNALTABLEIT' and tablename = 'T1_AVRO'"); String expected = "TOTAL_ROW_COUNT |\n" + "------------------\n" + " 3 |"; Assert.assertEquals(expected, TestUtils.FormattedResult.ResultFactory.toString(rs2)); rs2.close(); ResultSet rs3 = methodWatcher.executeQuery("select * from t1_avro"); Assert.assertEquals("COL1 |COL2 |\n" + "------------\n" + " 1 |XXXX |\n" + " 2 |YYYY |\n" + " 3 |ZZZZ |",TestUtils.FormattedResult.ResultFactory.toString(rs3)); rs3.close(); }
Source:
<code><START> public Mono<Response<BlockBlobItem>> stageBlock(String base64BlockID, Flux<ByteBuf> data, <END> long length) { return this.stageBlock(base64BlockID, data, length, null); }</code><technical_language>I impression Raw clients (or Raw methods) accept Flux<ByteBuf> "simple" clients accept/return Flux<ByteBuffer></technical_language>

Target:
public Mono<VoidResponse> stageBlock(String base64BlockID, Flux<ByteBuf> data, long length) { return this.stageBlock(base64BlockID, data, length, null); }
Source:
<code>public JedisSentinelPool(String masterName, Set<String> sentinels, final GenericObjectPoolConfig poolConfig, final int timeout, final int soTimeout, final String password, final int database, final Boolean isRedisSslEnabled) { <START> this(masterName, sentinels, poolConfig, timeout, soTimeout, password, database, null, isRedisSslEnabled); <END> }</code><technical_language>a need add a constructor final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters, final HostnameVerifier hostnameVerifier</technical_language>

Target:
public JedisSentinelPool(String masterName, Set<String> sentinels, final GenericObjectPoolConfig poolConfig, final int timeout, final int soTimeout, final String password, final int database, final Boolean isRedisSslEnabled) { this(masterName, sentinels, poolConfig, timeout, soTimeout, password, database, null, isRedisSslEnabled, null, null, null); }
Source:
<code>public static String CreateTmpFile(String fileName) { fileName = isFilenameValid(fileName) ? fileName : KEY_FILENAME; File tempFile = getUniqueFile(fileName); try { tempFile.createNewFile(); } catch (IOException e) { <START> System.err.println("Error: " + e.getMessage()); <END> e.printStackTrace(); return ""; } return tempFile.getPath(); }</code><technical_language>don catch exception, fail return ""</technical_language>

Target:
public static String CreateTmpFile(String fileName) throws IOException { fileName = isFilenameValid(fileName) ? fileName : KEY_FILENAME; File tempFile = getUniqueFile(fileName); tempFile.createNewFile(); return tempFile.getPath(); }
Source:
<code>public static SweepStrategyManager createDefault(KeyValueService kvs) { LoadingCache<TableReference, SweepStrategy> cache = Caffeine.newBuilder() .build(tableRef -> getSweepStrategy(kvs.getMetadataForTable(tableRef))); return tableRef -> { if (cache.estimatedSize() == 0) { cache.putAll(getSweepStrategies(kvs)); } <START> SweepStrategy strategy = cache.get(tableRef); <END> return Preconditions.checkNotNull(strategy, "unknown table", SafeArg.of("tableRef", tableRef)); }; }</code><technical_language>wrote this, this return null</technical_language>

Target:
public static SweepStrategyManager createDefault(KeyValueService kvs) { LoadingCache<TableReference, SweepStrategy> cache = Caffeine.newBuilder() .build(tableRef -> getSweepStrategy(kvs.getMetadataForTable(tableRef))); return tableRef -> { if (cache.estimatedSize() == 0) { cache.putAll(getSweepStrategies(kvs)); } return cache.get(tableRef); }; }
Source:
<code><START> private void createFactionList(){ <END> String[] folderList = getFolderList(); for(int i = 0; i < folderList.length; i++) { File factionFile = new File("modules/" + folderList[i] + "/assets/configs/factions.JSON"); JsonParser parser = new JsonParser(); try { FileReader fileReader = new FileReader(factionFile); JsonArray factionJSON = parser.parse(fileReader).getAsJsonArray(); for(int n = 0; n < factionJSON.size(); n++) { factionName.add(factionJSON.get(n).getAsJsonObject().get("name").toString().replace("\"", "")); factionColor.add(factionJSON.get(n).getAsJsonObject().get("color").toString().replace("\"", "")); factionDisposition.add(factionJSON.get(n).getAsJsonObject().get("disposition").getAsInt()); } } catch (FileNotFoundException e) { e.printStackTrace(); } } }</code><technical_language>suggestion private void createFactionList() {</technical_language>

Target:
private void createFactionList() { for (String modulePath : getModuleSet()) { Json factionJson = Assets.getJson(modulePath); Validator.validate(factionJson.getJsonValue(), modulePath); JSONArray factionJsonArray = factionJson.getJsonValue().getJSONArray("factions"); for (int n = 0; n < factionJsonArray.length(); n++) { factionName.add(factionJsonArray.getJSONObject(n).getString("name").replace("\"", "")); factionColor.add(factionJsonArray.getJSONObject(n).getString("color").replace("\"", "")); factionDisposition.add(factionJsonArray.getJSONObject(n).getInt("disposition")); } } }
Source:
<code>protected Command getAlignCommand(AlignmentRequest request) { Command originalAlignCommand = super.getAlignCommand(request); Point delta = request.getMoveDelta(); if (getHost() instanceof AbstractGraphicalEditPart) { Rectangle locationAndSize = new PrecisionRectangle(((AbstractGraphicalEditPart) getHost()).getFigure().getBounds()); ((AbstractGraphicalEditPart) getHost()).getFigure().translateToAbsolute(locationAndSize); Rectangle newLocationAndSize = request.getTransformedRectangle(locationAndSize); delta = newLocationAndSize.getTopLeft().getTranslated(locationAndSize.getTopLeft().getNegated()); } <START> return originalAlignCommand.chain(new ChangeBendpointsOfEdgesCommand(getHost(), new PrecisionPoint(delta), true)); <END> }</code><technical_language>If modify model (GMF, Sirius Semantic) CompositeTransactionalCommand</technical_language>

Target:
protected Command getAlignCommand(AlignmentRequest request) { Command originalAlignCommand = super.getAlignCommand(request); Point delta = request.getMoveDelta(); if (getHost() instanceof AbstractGraphicalEditPart) { Rectangle locationAndSize = new PrecisionRectangle(((AbstractGraphicalEditPart) getHost()).getFigure().getBounds()); ((AbstractGraphicalEditPart) getHost()).getFigure().translateToAbsolute(locationAndSize); Rectangle newLocationAndSize = request.getTransformedRectangle(locationAndSize); delta = newLocationAndSize.getTopLeft().getTranslated(locationAndSize.getTopLeft().getNegated()); } CompositeTransactionalCommand ctc = new CompositeTransactionalCommand(TransactionUtil.getEditingDomain(getHost().getModel()), originalAlignCommand.getLabel()); ctc.add(new CommandProxy(originalAlignCommand)); ctc.add(new ChangeBendpointsOfEdgesCommand(getHost(), new PrecisionPoint(delta), true)); return new ICommandProxy(ctc); }
Source:
<code>protected void applyModificationsSync(List<Modification> mods) throws PersistenceException { <START> List<MarshalledEntry> entriesToWrite = new ArrayList<>(); <END> List<Object> keysToDelete = new ArrayList<>(); for (Modification m : mods) { switch (m.getType()) { case STORE: entriesToWrite.add(((Store) m).getStoredValue()); break; case REMOVE: keysToDelete.add(((Remove) m).getKey()); break; default: throw new IllegalArgumentException("Unknown modification type " + m.getType()); } } actual.writeBatch(entriesToWrite); actual.deleteBatch(keysToDelete); }</code><technical_language>sense coalesce writes key here</technical_language>

Target:
protected void applyModificationsSync(List<Modification> mods) throws PersistenceException { actual.writeBatch( () -> StreamSupport.stream(Spliterators.spliterator(mods, Spliterator.NONNULL), false) .filter(m -> m.getType() == Modification.Type.STORE) .map(Store.class::cast) .map(Store::getStoredValue) .iterator() ); actual.deleteBatch( () -> StreamSupport.stream(Spliterators.spliterator(mods, Spliterator.NONNULL), false) .filter(m -> m.getType() == Modification.Type.REMOVE) .map(Remove.class::cast) .map(Remove::getKey) .iterator() ); }
Source:
<code>public Map<String, RestTag> list(@Context final HttpServletRequest request, @QueryParam("name") final String tagName, @QueryParam("siteOrFolder") final String siteOrFolderId) { final InitDataObject initDataObject = this.webResource.init (null, true, request, true, null); final User user = initDataObject.getUser(); <START> List<Tag> tags; <END> if(UtilMethods.isSet(tagName)) { tags = searchTagsInternal(tagName, siteOrFolderId, user); } else { tags = getTagsInternal(); } Map<String, RestTag> hash = Maps.newHashMapWithExpectedSize(tags.size()); TagTransform transform = new TagTransform(); for (Tag tag : tags) { hash.put(tag.getTagName(), transform.appToRest(tag)); } return hash; }</code><technical_language>reduce this final List<Tag> tags = UtilMethods.isSet(tagName)? searchTagsInternal(tagName, siteOrFolderId, user): getTagsInternal();</technical_language>

Target:
public Map<String, RestTag> list(@Context final HttpServletRequest request, @QueryParam("name") final String tagName, @QueryParam("siteOrFolder") final String siteOrFolderId) { final InitDataObject initDataObject = this.webResource.init (null, true, request, true, null); final User user = initDataObject.getUser(); List<Tag> tags = UtilMethods.isSet(tagName) ? searchTagsInternal(tagName, siteOrFolderId, user) : getTagsInternal(); final Map<String, RestTag> hash = Maps.newHashMapWithExpectedSize(tags.size()); final TagTransform transform = new TagTransform(); for (final Tag tag : tags) { hash.put(tag.getTagName(), transform.appToRest(tag)); } return hash; }
Source:
<code>public void queryLogRotation() throws Exception { final File logsDirectory = new File( testDirectory.graphDbDir(), "logs" ); GraphDatabaseService database = databaseBuilder.setConfig( GraphDatabaseSettings.log_queries, Settings.TRUE ) .setConfig( GraphDatabaseSettings.logs_directory, logsDirectory.getPath() ) .setConfig( GraphDatabaseSettings.log_queries_rotation_threshold, "1" ) .newGraphDatabase(); for ( int i = 0; i < 100; i++ ) { database.execute( QUERY ); } database.shutdown(); File[] queryLogs = fileSystem.get().listFiles( logsDirectory, ( dir, name ) -> name.startsWith( "query.log" ) ); assertThat( "Expect to have more then one query log file.", queryLogs.length, greaterThanOrEqualTo( 2 ) ); List<String> loggedQueries = Arrays.stream( queryLogs ) .map( this::readAllLinesSilent ) .flatMap( Collection::stream ) .collect( Collectors.toList() ); <START> assertTrue( "Expected log file to have at least one log entry", loggedQueries.size() >= 1 ); <END> }</code><technical_language>Hmm. Do miss log statements due rotation here? end in buffer new log file? In case assert loggedQueries.size() == 100 (the number of queries sent)</technical_language>

Target:
public void queryLogRotation() throws Exception { final File logsDirectory = new File( testDirectory.graphDbDir(), "logs" ); GraphDatabaseService database = databaseBuilder.setConfig( GraphDatabaseSettings.log_queries, Settings.TRUE ) .setConfig( GraphDatabaseSettings.logs_directory, logsDirectory.getPath() ) .setConfig( GraphDatabaseSettings.log_queries_max_archives, "100" ) .setConfig( GraphDatabaseSettings.log_queries_rotation_threshold, "1" ) .newGraphDatabase(); for ( int i = 0; i < 100; i++ ) { database.execute( QUERY ); } database.shutdown(); File[] queryLogs = fileSystem.get().listFiles( logsDirectory, ( dir, name ) -> name.startsWith( "query.log" ) ); assertThat( "Expect to have more then one query log file.", queryLogs.length, greaterThanOrEqualTo( 2 ) ); List<String> loggedQueries = Arrays.stream( queryLogs ) .map( this::readAllLinesSilent ) .flatMap( Collection::stream ) .collect( Collectors.toList() ); assertThat( "Expected log file to have at least one log entry", loggedQueries, hasSize( 100 ) ); }
Source:
<code>public ProcessPreconditionsResolution checkPreconditionsApplicable(final @NonNull IProcessPreconditionsContext context) { if (context.isNoSelection()) { return ProcessPreconditionsResolution.rejectBecauseNoSelection(); } if (context.isMoreThanOneSelected()) { return ProcessPreconditionsResolution.rejectBecauseNotSingleSelection(); } final int orderId = context.getSingleSelectedRecordId(); final I_C_Order order = orderDAO.getById(OrderId.ofRepoId(orderId)); final Optional<DocTypeId> docTypeId = DocTypeId.optionalOfRepoId(order.getC_DocTypeTarget_ID()); if (docTypeId.isPresent()) { final boolean isSalesProposalOrQuotation = docTypeBL.isSalesProposalOrQuotation(docTypeId.get()); if (!isSalesProposalOrQuotation) { <START> return ProcessPreconditionsResolution.reject(); <END> } } else { ProcessPreconditionsResolution.reject(); } return ProcessPreconditionsResolution.accept(); }</code><technical_language>suggestion return ProcessPreconditionsResolution.rejectWithInternalReason("is sales proposal quotation");</technical_language>

Target:
public ProcessPreconditionsResolution checkPreconditionsApplicable(final @NonNull IProcessPreconditionsContext context) { if (context.isNoSelection()) { return ProcessPreconditionsResolution.rejectBecauseNoSelection(); } if (context.isMoreThanOneSelected()) { return ProcessPreconditionsResolution.rejectBecauseNotSingleSelection(); } final int orderId = context.getSingleSelectedRecordId(); final I_C_Order order = orderDAO.getById(OrderId.ofRepoId(orderId)); final Optional<DocTypeId> docTypeId = DocTypeId.optionalOfRepoId(order.getC_DocTypeTarget_ID()); if (docTypeId.isPresent()) { final boolean isSalesProposalOrQuotation = docTypeBL.isSalesProposalOrQuotation(docTypeId.get()); if (!isSalesProposalOrQuotation) { return ProcessPreconditionsResolution.rejectWithInternalReason("is not sales proposal or quotation"); } } else { return ProcessPreconditionsResolution.rejectWithInternalReason("no C_DocTypeTarget_ID"); } return ProcessPreconditionsResolution.accept(); }
Source:
<code><START> public void testReadWriteMoney() { <END> assertThat(handle.select("select :money") .bind("money", new PGmoney(1)) .mapTo(PGmoney.class) .findOnly()) .isEqualTo(new PGmoney(1)); assertThat(handle.select("select :moneys") .bind("moneys", new PGmoney[] {new PGmoney(1), new PGmoney(2)}) .mapTo(PGmoney[].class) .findOnly()) .containsExactly(new PGmoney(1), new PGmoney(2)); }</code><technical_language>quote Craig Ringer himself, "Honestly, money type. terrible. Switch numeric"</technical_language>

Target:
public void testReadWriteMoney() { Set<String> moneyTypeOnlySupportsUS = new HashSet<>(Arrays.asList("", Locale.US.getCountry())); Assume.assumeTrue(moneyTypeOnlySupportsUS.contains(Locale.getDefault().getCountry())); assertThat(handle.select("select :money") .bind("money", new PGmoney(1)) .mapTo(PGmoney.class) .findOnly()) .isEqualTo(new PGmoney(1)); assertThat(handle.select("select :moneys") .bind("moneys", new PGmoney[] {new PGmoney(1), new PGmoney(2)}) .mapTo(PGmoney[].class) .findOnly()) .containsExactly(new PGmoney(1), new PGmoney(2)); }
Source:
<code>private void InitializeHelpers() { try { for (StorageType storageType : StorageType.values()) { Class<?> actionType = null; String formattedClassName = String.format("%1$s.%2$s%3$s", ACTION_TYPE_PACKAGE, storageType.name(), ACTION_TYPE_CLASS); try { actionType = Class.forName(formattedClassName); } catch (ClassNotFoundException cnfe) { if (storageType != StorageType.ALL && storageType != StorageType.UNKNOWN) <START> log.debugFormat("StorageHelperDirector Error:: the lookup for following class has failed: {0}" <END> , formattedClassName); } if (actionType != null) { Constructor<?> info = actionType.getConstructors()[0]; IStorageHelper currentHelper = (IStorageHelper) info.newInstance(null); _helpers.put(storageType, currentHelper); } } } catch (Exception ex) { log.error("StorageHelperDirector Error:: exception was encountered during InitializeHelpers() execution", ex); throw new ApplicationException("JTODO missing exception", ex); } }</code><technical_language>Please put this line in a block</technical_language>

Target:
private void InitializeHelpers() { try { for (StorageType storageType : StorageType.values()) { Class<?> actionType = null; String formattedClassName = String.format("%1$s.%2$s%3$s", ACTION_TYPE_PACKAGE, storageType.name(), ACTION_TYPE_CLASS); try { actionType = Class.forName(formattedClassName); } catch (ClassNotFoundException cnfe) { if (storageType != StorageType.ALL && storageType != StorageType.UNKNOWN) { log.debugFormat("StorageHelperDirector Error:: the lookup for following class has failed: {0}" , formattedClassName); } } if (actionType != null) { Constructor<?> info = actionType.getConstructors()[0]; IStorageHelper currentHelper = (IStorageHelper) info.newInstance(null); _helpers.put(storageType, currentHelper); } } } catch (Exception ex) { log.error("StorageHelperDirector Error:: exception was encountered during InitializeHelpers() execution", ex); throw new ApplicationException("JTODO missing exception", ex); } }