auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ListenableFuture<?> execute(CreateView statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, QueryStateMachine stateMachine, List<Expression> parameters) { Session session = stateMachine.getSession(); QualifiedObjectName name = createQualifiedObjectName(session, statement, statement.getName()); accessControl.checkCanCreateView(session.getRequiredTransactionId(), session.getIdentity(), name); String sql = getFormattedSql(statement.getQuery(), sqlParser, Optional.of(parameters)); Analysis analysis = analyzeStatement(statement, session, metadata, accessControl, parameters); List<ViewColumn> columns = analysis.getOutputDescriptor(statement.getQuery()) .getVisibleFields().stream() .map(field -> new ViewColumn(field.getName().get(), field.getType())) .collect(toImmutableList()); String data = codec.toJson(new ViewDefinition(sql, session.getCatalog(), session.getSchema(), columns, Optional.of(session.getUser()))); <START> metadata.createView(session, name.getCatalogName(), new ConnectorViewDefinition(name.asSchemaTableName(), Optional.empty(), data, statement.getComment()), statement.isReplace()); <END> return immediateFuture(null); }</code><technical_language>I this change next diff</technical_language>

Target:
public ListenableFuture<?> execute(CreateView statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, QueryStateMachine stateMachine, List<Expression> parameters) { Session session = stateMachine.getSession(); QualifiedObjectName name = createQualifiedObjectName(session, statement, statement.getName()); accessControl.checkCanCreateView(session.getRequiredTransactionId(), session.getIdentity(), name); String sql = getFormattedSql(statement.getQuery(), sqlParser, Optional.of(parameters)); Analysis analysis = analyzeStatement(statement, session, metadata, accessControl, parameters); List<ViewColumn> columns = analysis.getOutputDescriptor(statement.getQuery()) .getVisibleFields().stream() .map(field -> new ViewColumn(field.getName().get(), field.getType())) .collect(toImmutableList()); String data = codec.toJson(new ViewDefinition(sql, session.getCatalog(), session.getSchema(), columns, Optional.of(session.getUser()))); ConnectorViewDefinition definition = new ConnectorViewDefinition(name.asSchemaTableName(), Optional.empty(), data, statement.getComment()); metadata.createView(session, name.getCatalogName(), definition, statement.isReplace()); return immediateFuture(null); }
Source:
<code>public void shouldStartPreviousSurvivedMutationsAtAStatusOfNotStartedWhenCoverageHasChanged() { final MutationDetails md = makeMutation("foo"); setHistoryForAllMutationsTo(DetectionStatus.SURVIVED); when( this.history.hasCoverageChanged(any(ClassName.class), <START> isNull())).thenReturn(true); <END> final Collection<MutationResult> actual = this.testee.analyse(Collections .singletonList(md)); assertEquals(DetectionStatus.NOT_STARTED, actual.iterator().next() .getStatus()); }</code><technical_language>This change feel right. DefaultCodeHistory.hasCoverageChanged throw a NullPointerException called NULL. I put more effort mocking in order test correct interaction collaborators: java when(this.coverage.getCoverageIdForClass(ClassName.fromString("clazz"))) .thenReturn(BigInteger.valueOf(42L)); when(this.history.hasCoverageChanged(ClassName.fromString("clazz"), BigInteger.valueOf(42L))) .thenReturn(true); (feel free extract constants beautify code above)</technical_language>

Target:
public void shouldStartPreviousSurvivedMutationsAtAStatusOfNotStartedWhenCoverageHasChanged() { final MutationDetails md = makeMutation("foo"); setHistoryForAllMutationsTo(DetectionStatus.SURVIVED); when(coverage.getCoverageIdForClass(any(ClassName.class))) .thenReturn(BigInteger.ONE); when( this.history.hasCoverageChanged(any(ClassName.class), any(BigInteger.class))).thenReturn(true); final Collection<MutationResult> actual = this.testee.analyse(singletonList(md)); assertThat(actual, hasItem(withStatus(NOT_STARTED))); assertThat(logCatcher.logEntries, hasItems( "Incremental analysis set 1 mutations to a status of NOT_STARTED", "Incremental analysis reduced number of mutations by 0" )); }
Source:
<code>public static void assertValidatorMessage(Validator validator, Object object, String fieldName, String error) { String fieldNameAsLabel = fieldName; if (!error.startsWith(" ")) { error = " " + error; } try { Validate.entityThrowingException(validator, object); fail("Should have thrown exception"); } catch(InvalidEntityException e) { for (int i=0; i < e.getErrors().get(fieldName).size(); i++) { String msg = e.getErrors().get(fieldName).get(i); if ((fieldNameAsLabel+error).equals(msg)) { return; } <START> } <END> fail("Did not find error message in errors object"); } }</code><technical_language>e.getErrors().get(fieldName).contains(fieldNameAsLabel+error) work here</technical_language>

Target:
public static void assertValidatorMessage(Validator validator, Object object, String fieldName, String error) { String fieldNameAsLabel = fieldName; if (!error.startsWith(" ")) { error = " " + error; } try { Validate.entityThrowingException(validator, object); fail("Should have thrown exception"); } catch(InvalidEntityException e) { if (e.getErrors().get(fieldName).contains(fieldNameAsLabel+error)) { return; } fail("Did not find error message in errors object"); } }
Source:
<code>public void run() { Future<T> future = null; try { if (done || cancelled || numTries >= maxTries) { return; } ++numTries; runThread = Thread.currentThread(); future = backgroundService.submit(this.callable); try { if (timeout > 0) { result = future.get(timeout, TimeUnit.MILLISECONDS); } else { result = future.get(); } } finally { future.cancel(true); } runThread = null; done(); } catch (Exception e) { if (e instanceof ExecutionException) { Throwable cause = e.getCause(); if (cause != null && cause instanceof Exception) { <START> e = (Exception) e.getCause(); <END> } } LOGGER.log(Level.INFO, "Exception executing task", e); runThread = null; exceptions.add(e); if (!cancelled && numTries < maxTries) { LOGGER.info("Resubmitting task to executor " + numTries + "/" + maxTries + " attempts"); SubmitTaskToExecutor retryTask = new SubmitTaskToExecutor(this); if (retryDelay <= 0L || retryTimer == null) { retryTask.run(); } else { retryTimer.schedule(retryTask, retryDelay); } } else { done(); } } }</code><technical_language>reference e = (Exception) cause;</technical_language>

Target:
public void run() { Future<T> future = null; try { if (done || cancelled || numTries >= maxTries) { return; } ++numTries; runThread = Thread.currentThread(); future = backgroundService.submit(this.callable); try { if (timeout > 0) { result = future.get(timeout, TimeUnit.MILLISECONDS); } else { result = future.get(); } } finally { future.cancel(true); } runThread = null; setDone(); } catch (Exception e) { if (e instanceof ExecutionException) { Throwable cause = e.getCause(); if (cause != null && cause instanceof Exception) { e = (Exception) cause; } } LOGGER.log(Level.INFO, "Exception executing task", e); runThread = null; exceptions.add(e); if (!cancelled && numTries < maxTries) { LOGGER.info("Resubmitting task to executor " + numTries + "/" + maxTries + " attempts"); SubmitTaskToExecutor retryTask = new SubmitTaskToExecutor(this); if (retryDelay <= 0L || retryTimer == null) { retryTask.run(); } else { retryTimer.schedule(retryTask, retryDelay); } } else { setDone(); } } }
Source:
<code>public void start(Stage stage) throws Exception { FXMLLoader loader = new FXMLLoader(getClass().getResource("/views/window.fxml")); Parent root = loader.load(); final WindowController controller = (WindowController) loader.getController(); Scene scene = new Scene(root, 1200, 800); stage.setTitle("Cool demo!"); stage.setScene(scene); stage.show(); LibraryLoader libraryLoader = new LibraryLoader("library.xml"); libraryLoader.load(); scene.getWindow().setOnHidden(new EventHandler<WindowEvent>() { @Override public void handle(WindowEvent arg0) { PlayerService.getInstance().exit(); if (playlist != null) { XmlExport exporter = new XmlExport("library.xml", library); exporter.export(); } System.exit(0); } }); String directory = ""; DirectoryChooser directoryChooser = new DirectoryChooser(); File selectedDirectory = directoryChooser.showDialog(stage); if (selectedDirectory == null) { System.out.println("No directory selected."); System.exit(-1); } else { directory = selectedDirectory.getAbsolutePath(); } FolderLoader folderLoader = new FolderLoader(directory); playlist = folderLoader.load(); <START> library.add(playlist); <END> PlaylistSorter sorter = new GreedyPlaylistSorter(); Playlist mixablePlaylist = sorter.sort(playlist); controller.setLibrary(mixablePlaylist); }</code><technical_language>library is initialised here, resulting in a NullPointerException</technical_language>

Target:
public void start(Stage stage) throws Exception { FXMLLoader loader = new FXMLLoader(getClass().getResource("/views/window.fxml")); Parent root = (Parent) loader.load(); final WindowController controller = (WindowController) loader.getController(); App.controller = controller; Scene scene = new Scene(root, 1200, 800); stage.setTitle("Demo Sprint 3"); stage.setScene(scene); stage.show(); try { LibraryLoader libraryLoader = new LibraryLoader("library.xml"); library = libraryLoader.load(); if (library.size() < 1) { empty = true; } } catch (IOException e) { library = new Library(); empty = true; } scene.getWindow().setOnHidden(new EventHandler<WindowEvent>() { @Override public void handle(WindowEvent arg0) { PlayerService.getInstance().exit(); if (library != null) { XmlExport exporter = new XmlExport("library.xml", library); exporter.export(); System.out.println(library.size()); } System.exit(0); } }); if (empty) { String directory = ""; DirectoryChooser directoryChooser = new DirectoryChooser(); File selectedDirectory = directoryChooser.showDialog(null); if (selectedDirectory == null) { System.out.println("No directory selected."); System.exit(-1); } else { directory = selectedDirectory.getAbsolutePath(); } FolderLoader folderLoader = new FolderLoader(directory); String playlistname = PlaylistName.getName(directory); Playlist playlist = folderLoader.load(); PlaylistSorter sorter = new GreedyPlaylistSorter(); Playlist mixablePlaylist = sorter.sort(playlist); controller.setEverything(mixablePlaylist, playlistname); } else { controller.setLibrary(library); } }
Source:
<code>public static void setCookieHeaders(@NonNull Map<String, String> headers) { if (cookie == null) { <START> Timber.e("Cookie was empty for some reason, trying to restore cookie"); <END> restoreLoginCookies(AwfulPreferences.getInstance().getContext()); } if (!cookie.isEmpty()) { headers.put(COOKIE_HEADER, cookie); } }</code><technical_language>set this w too? (I set e for colours bad)</technical_language>

Target:
public static void setCookieHeaders(@NonNull Map<String, String> headers) { if (cookie == null) { Timber.w("Cookie was empty for some reason, trying to restore cookie"); restoreLoginCookies(AwfulPreferences.getInstance().getContext()); } if (!cookie.isEmpty()) { headers.put(COOKIE_HEADER, cookie); } }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final TaskStatusPlus that = (TaskStatusPlus) o; if (!id.equals(that.id)) { return false; } if (!type.equals(that.type)) { return false; } if (!createdTime.equals(that.createdTime)) { return false; } if (!queueInsertionTime.equals(that.queueInsertionTime)) { return false; } if (!Objects.equals(state, that.state)) { return false; } if (!Objects.equals(duration, that.duration)) { return false; } if (!Objects.equals(location, that.location)) { return false; } if (!Objects.equals(errorMsg, that.errorMsg)) { return false; } <START> if (!Objects.equals(location, that.location)) { <END> return false; } return Objects.equals(context, that.context); }</code><technical_language>dupe</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TaskStatusPlus that = (TaskStatusPlus) o; return Objects.equals(getId(), that.getId()) && Objects.equals(getType(), that.getType()) && Objects.equals(getCreatedTime(), that.getCreatedTime()) && Objects.equals(getQueueInsertionTime(), that.getQueueInsertionTime()) && getState() == that.getState() && Objects.equals(getDuration(), that.getDuration()) && Objects.equals(getLocation(), that.getLocation()) && Objects.equals(getDataSource(), that.getDataSource()) && Objects.equals(getErrorMsg(), that.getErrorMsg()); }
Source:
<code>private Method findMethod(Class itf, String methodName, Class[] params) { <START> assert itf.isInterface(); <END> Method res = null; try { res = itf.getDeclaredMethod(methodName, params); if (res != null) return res; } catch (NoSuchMethodException ignored) { } Class[] superItfs = itf.getInterfaces(); for (Class superItf: superItfs) { res = findMethod(superItf, methodName, params); if (res != null) return res; } return res; }</code><technical_language>please add clear message for case assert failed</technical_language>

Target:
private Method findMethod(Class itf, String methodName, Class[] params) { assert itf.isInterface() : itf + " must represent the interface"; Method res = null; try { res = itf.getDeclaredMethod(methodName, params); if (res != null) return res; } catch (NoSuchMethodException ignored) { } Class[] superItfs = itf.getInterfaces(); for (Class superItf: superItfs) { res = findMethod(superItf, methodName, params); if (res != null) return res; } return res; }
Source:
<code>public void subscribedEntityChanged(SubscriptionAwareEntity entity, Collection<JCUser> excludeFromNotification) { Collection<JCUser> subscribers = subscriptionService.getAllowedSubscribers(entity); filterSubscribers(subscribers, entity); <START> for (JCUser user : subscribers) { <END> if (!excludeFromNotification.contains(user)) { mailService.sendUpdatesOnSubscription(user, entity); } } }</code><technical_language>figured.. do subscribers.removeAll(excludeFromNotification)</technical_language>

Target:
public void subscribedEntityChanged(SubscriptionAwareEntity entity, Collection<JCUser> excludeFromNotification) { Collection<JCUser> subscribers = subscriptionService.getAllowedSubscribers(entity); subscribers.removeAll(excludeFromNotification); filterSubscribers(subscribers, entity); for (JCUser user : subscribers) { mailService.sendUpdatesOnSubscription(user, entity); } }
Source:
<code>public HashSet<String> getValues(final ProgressMonitor pm){ HashSet<String> ret = new HashSet<String>(); try { long rowCount=ds.getRowCount(); pm.startTask(I18N.tr("Retrieving classes"), 10); pm.progressTo(0); double m = rowCount>0 ?(double)10/rowCount : 0; int n =0; int fieldIndex = ds.getFieldIndexByName(fieldName); boolean moveOn = false; final int warn = 100; for(long i=0; i<rowCount; i++){ Value val = ds.getFieldValue(i, fieldIndex); ret.add(val.toString()); if(ret.size() == warn && !moveOn){ final UIPanel cancel = new CancelPanel(warn); try{ SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { if(!UIFactory.showDialog(cancel,true, true)){ pm.setCancelled(true); <START> } <END> } }); } catch (Exception ie){ LOGGER.warn(I18N.tr("The application has ended unexpectedly")); } } if(i*m>n*10){ n++; pm.progressTo(n); } if(pm.isCancelled()){ pm.endTask(); return null; } } } catch (DriverException e) { LOGGER.error("IO error while handling the input data source : " + e.getMessage()); } pm.endTask(); return ret; }</code><technical_language>I plan set moveOn boolean</technical_language>

Target:
public HashSet<String> getValues(final ProgressMonitor pm){ HashSet<String> ret = new HashSet<String>(); try { long rowCount=ds.getRowCount(); pm.startTask(I18N.tr("Retrieving classes"), 10); pm.progressTo(0); double m = rowCount>0 ?(double)10/rowCount : 0; int n =0; int fieldIndex = ds.getFieldIndexByName(fieldName); final int warn = 100; for(long i=0; i<rowCount; i++){ Value val = ds.getFieldValue(i, fieldIndex); ret.add(val.toString()); if(ret.size() == warn){ final UIPanel cancel = new CancelPanel(warn); try{ SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { if(!UIFactory.showDialog(cancel,true, true)){ pm.setCancelled(true); } } }); } catch (Exception ie){ LOGGER.warn(I18N.tr("The application has ended unexpectedly")); } } if(i*m>n*10){ n++; pm.progressTo(n); } if(pm.isCancelled()){ pm.endTask(); return null; } } } catch (DriverException e) { LOGGER.error("IO error while handling the input data source : " + e.getMessage()); } pm.endTask(); return ret; }
Source:
<code>public void cherryPickSameBranch() throws Exception { CherryPickInput in = new CherryPickInput(); in.destination = "master"; in.message = "it generates a new patch set"; PushOneCommit.Result <START> r1 = <END> createChange(); PushOneCommit push = pushFactory.create(db, admin.getIdent(), PushOneCommit.SUBJECT, "another_file.txt", "another content"); PushOneCommit.Result r2 = push.to(git, "refs/for/master"); ChangeApi orig = gApi.changes() .id("p~master~" + r2.getChangeId()); ChangeApi cherry = orig.revision(r2.getCommit().name()) .cherryPick(in); ChangeInfo cherryInfo = cherry.get(); assertThat((Iterable<?>)cherryInfo.messages).hasSize(1); Iterator<ChangeMessageInfo> cherryIt = cherryInfo.messages.iterator(); assertThat(cherryIt.next().message).isEqualTo("Cherry picked as patch set 2."); }</code><technical_language>unused variable, this results in a warning in Eclipse</technical_language>

Target:
public void cherryPickSameBranch() throws Exception { createChange(); PushOneCommit push = pushFactory.create(db, admin.getIdent(), PushOneCommit.SUBJECT, "another_file.txt", "another content"); PushOneCommit.Result r2 = push.to(git, "refs/for/master"); CherryPickInput in = new CherryPickInput(); in.destination = "master"; in.message = "it generates a new patch set\n\nChange-Id: " + r2.getChangeId(); ChangeApi orig = gApi.changes() .id("p~master~" + r2.getChangeId()); ChangeApi cherry = orig.revision(r2.getCommit().name()) .cherryPick(in); ChangeInfo cherryInfo = cherry.get(); assertThat((Iterable<?>)cherryInfo.messages).hasSize(2); Iterator<ChangeMessageInfo> cherryIt = cherryInfo.messages.iterator(); assertThat(cherryIt.next().message).isEqualTo("Uploaded patch set 1."); assertThat(cherryIt.next().message).isEqualTo("Cherry picked as patch set 2."); }
Source:
<code>public SideEffectSet(Map<SideEffect, SideEffect.State> sideEffects) { this.sideEffects = Maps.immutableEnumMap(sideEffects); <START> appliesAny = sideEffects.values().stream().anyMatch(state -> state != SideEffect.State.OFF); <END> appliedSideEffects = sideEffects.entrySet() .stream() .filter(entry -> entry.getValue() != SideEffect.State.OFF) .map(Map.Entry::getKey) .collect(Collectors.toSet()); }</code><technical_language>this line moved next read appliesAny = !appliedSideEffects.isEmpty()</technical_language>

Target:
public SideEffectSet(Map<SideEffect, SideEffect.State> sideEffects) { this.sideEffects = Maps.immutableEnumMap(sideEffects); appliedSideEffects = sideEffects.entrySet() .stream() .filter(entry -> entry.getValue() != SideEffect.State.OFF) .map(Map.Entry::getKey) .collect(Collectors.toSet()); appliesAny = !appliedSideEffects.isEmpty(); }
Source:
<code>public OrcInputStream( OrcDataSourceId orcDataSourceId, FixedLengthSliceInput sliceInput, Optional<OrcDecompressor> decompressor, AggregatedMemoryContext systemMemoryContext, long sliceInputRetainedSizeInBytes) { this.orcDataSourceId = requireNonNull(orcDataSourceId, "orcDataSource is null"); requireNonNull(sliceInput, "sliceInput is null"); this.decompressor = requireNonNull(decompressor, "decompressor is null"); requireNonNull(systemMemoryContext, "systemMemoryContext is null"); this.bufferMemoryUsage = systemMemoryContext.newLocalMemoryContext(OrcInputStream.class.getSimpleName()); checkArgument(sliceInputRetainedSizeInBytes >= 0, "sliceInputRetainedSizeInBytes is negative"); systemMemoryContext.newLocalMemoryContext(OrcInputStream.class.getSimpleName()).setBytes(sliceInputRetainedSizeInBytes); if (!decompressor.isPresent()) { <START> long sliceInputPosition = sliceInput.position(); <END> this.buffer = new byte[toIntExact(sliceInput.remaining())]; this.length = buffer.length; sliceInput.readFully(buffer, toIntExact(sliceInput.position()), toIntExact(sliceInput.remaining())); sliceInput.setPosition(sliceInputPosition); this.compressedSliceInput = EMPTY_SLICE.getInput(); } else { this.compressedSliceInput = sliceInput; this.buffer = new byte[0]; } }</code><technical_language>sliceInput.position() sliceInput.remaining() is called multiple times in this block; I suggest re-write - I understand call sliceInput.setPosition(sliceInputPosition); - explain? this.length = toIntExact(sliceInput.remaining()); this.buffer = new byte[this.length]; int sliceInputPosition = toIntExact(sliceInput.position()); sliceInput.readFully(buffer, sliceInputPosition, this.length); sliceInput.setPosition(sliceInputPosition); this.compressedSliceInput = EMPTY_SLICE.getInput();</technical_language>

Target:
public OrcInputStream( OrcDataSourceId orcDataSourceId, FixedLengthSliceInput sliceInput, Optional<OrcDecompressor> decompressor, AggregatedMemoryContext systemMemoryContext, long sliceInputRetainedSizeInBytes) { this.orcDataSourceId = requireNonNull(orcDataSourceId, "orcDataSource is null"); requireNonNull(sliceInput, "sliceInput is null"); this.decompressor = requireNonNull(decompressor, "decompressor is null"); requireNonNull(systemMemoryContext, "systemMemoryContext is null"); this.bufferMemoryUsage = systemMemoryContext.newLocalMemoryContext(OrcInputStream.class.getSimpleName()); checkArgument(sliceInputRetainedSizeInBytes >= 0, "sliceInputRetainedSizeInBytes is negative"); systemMemoryContext.newLocalMemoryContext(OrcInputStream.class.getSimpleName()).setBytes(sliceInputRetainedSizeInBytes); if (!decompressor.isPresent()) { int sliceInputPosition = toIntExact(sliceInput.position()); int sliceInputRemaining = toIntExact(sliceInput.remaining()); this.buffer = new byte[sliceInputRemaining]; this.length = buffer.length; sliceInput.readFully(buffer, sliceInputPosition, sliceInputRemaining); this.compressedSliceInput = EMPTY_SLICE.getInput(); } else { this.compressedSliceInput = sliceInput; this.buffer = new byte[0]; } }
Source:
<code>public void testTableWithInvalidBucketNumber() throws Exception { long ts = nextTimestamp(); String url = PHOENIX_JDBC_URL + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 5); Properties props = new Properties(TEST_PROPERTIES); Connection conn = DriverManager.getConnection(url, props); try { <START> String query = "create table salted_table (a_integer integer not null CONSTRAINT pk PRIMARY KEY (a_integer)) SALT_BUCKETS = 129"; <END> PreparedStatement stmt = conn.prepareStatement(query); stmt.execute(); fail("Should have caught exception"); } catch (SQLException e) { assertTrue(e.getMessage(), e.getMessage().contains("ERROR 1021 (42Y80): Salt bucket numbers should be with 1 and 128.")); } finally { conn.close(); } }</code><technical_language>8 bits allow 255. reason positive</technical_language>

Target:
public void testTableWithInvalidBucketNumber() throws Exception { long ts = nextTimestamp(); String url = PHOENIX_JDBC_URL + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 5); Properties props = new Properties(TEST_PROPERTIES); Connection conn = DriverManager.getConnection(url, props); try { String query = "create table salted_table (a_integer integer not null CONSTRAINT pk PRIMARY KEY (a_integer)) SALT_BUCKETS = 257"; PreparedStatement stmt = conn.prepareStatement(query); stmt.execute(); fail("Should have caught exception"); } catch (SQLException e) { assertTrue(e.getMessage(), e.getMessage().contains("ERROR 1021 (42Y80): Salt bucket numbers should be with 1 and 256.")); } finally { conn.close(); } }
Source:
<code>private void pingHandlerClaim(final DirectBuffer buffer, final int offset, final int length, final Header header) { if (buffer.getByte(offset + 0) == (byte)'q') { running.set(false); return; } if (pongPub.tryClaim(length, bufferClaim) >= 0) { try { final MutableDirectBuffer newBuffer = bufferClaim.buffer(); newBuffer.putBytes(bufferClaim.offset(), buffer, offset, length); } <START> catch (final Exception e) <END> { e.printStackTrace(); } finally { bufferClaim.commit(); } } else { pingHandlerClaim(buffer, offset, length, header); } }</code><technical_language>is exception expecting catch</technical_language>

Target:
private void pingHandlerClaim(final DirectBuffer buffer, final int offset, final int length, final Header header) { if (buffer.getByte(offset + 0) == (byte)'q') { running.set(false); return; } if (pongPub.tryClaim(length, bufferClaim) >= 0) { final MutableDirectBuffer newBuffer = bufferClaim.buffer(); newBuffer.putBytes(bufferClaim.offset(), buffer, offset, length); bufferClaim.commit(); } else { pingHandlerClaim(buffer, offset, length, header); } }
Source:
<code>private ConnectorBucketNodeMap getConnectorBucketNodeMap(Session session, PartitioningHandle partitioningHandle) { checkArgument(!(partitioningHandle.getConnectorHandle() instanceof SystemPartitioningHandle)); ConnectorNodePartitioningProvider partitioningProvider = partitioningProviders.get(partitioningHandle.getConnectorId().get()); checkArgument(partitioningProvider != null, "No partitioning provider for connector %s", partitioningHandle.getConnectorId().get()); ConnectorBucketNodeMap connectorBucketNodeMap = partitioningProvider.getBucketNodeMap( partitioningHandle.getTransactionHandle().orElse(null), session.toConnectorSession(), partitioningHandle.getConnectorHandle()); checkArgument(connectorBucketNodeMap != null, "No partition map %s", partitioningHandle); if (connectorBucketNodeMap.hasFixedMapping()) { <START> checkArgument(!connectorBucketNodeMap.getFixedMapping().isEmpty(), "Partition map %s is empty", partitioningHandle); <END> } return connectorBucketNodeMap; }</code><technical_language>Partition map is empty %s (to consistent other error messages)</technical_language>

Target:
private ConnectorBucketNodeMap getConnectorBucketNodeMap(Session session, PartitioningHandle partitioningHandle) { checkArgument(!(partitioningHandle.getConnectorHandle() instanceof SystemPartitioningHandle)); ConnectorNodePartitioningProvider partitioningProvider = partitioningProviders.get(partitioningHandle.getConnectorId().get()); checkArgument(partitioningProvider != null, "No partitioning provider for connector %s", partitioningHandle.getConnectorId().get()); ConnectorBucketNodeMap connectorBucketNodeMap = partitioningProvider.getBucketNodeMap( partitioningHandle.getTransactionHandle().orElse(null), session.toConnectorSession(), partitioningHandle.getConnectorHandle()); checkArgument(connectorBucketNodeMap != null, "No partition map %s", partitioningHandle); return connectorBucketNodeMap; }
Source:
<code>public void run() { PrivilegedExceptionAction<Object> doAsAction = new PrivilegedExceptionAction<Object>() { @Override public Object run() throws HiveSQLException { Hive.set(parentHive); SessionState.setCurrentSessionState(parentSessionState); PerfLogger.setPerfLogger(SessionState.getPerfLogger()); LogUtils.registerLoggingContext(queryState.getConf()); try { if (asyncPrepare) { prepare(queryState); } runQuery(); } catch (HiveSQLException e) { setOperationException(e); LOG.error("Error running hive query: ", e); } finally { <START> Hive.closeCurrent(); <END> LogUtils.unregisterLoggingContext(); } return null; } }; try { currentUGI.doAs(doAsAction); } catch (Exception e) { setOperationException(new HiveSQLException(e)); LOG.error("Error running hive query as user : " + currentUGI.getShortUserName(), e); } finally { if (ThreadWithGarbageCleanup.currentThread() instanceof ThreadWithGarbageCleanup) { ThreadWithGarbageCleanup currentThread = (ThreadWithGarbageCleanup) ThreadWithGarbageCleanup.currentThread(); currentThread.cacheThreadLocalRawStore(); } } }</code><technical_language>place this needs happen</technical_language>

Target:
public void run() { PrivilegedExceptionAction<Object> doAsAction = new PrivilegedExceptionAction<Object>() { @Override public Object run() throws HiveSQLException { Hive.set(parentHive); SessionState.setCurrentSessionState(parentSessionState); PerfLogger.setPerfLogger(SessionState.getPerfLogger()); LogUtils.registerLoggingContext(queryState.getConf()); try { if (asyncPrepare) { prepare(queryState); } runQuery(); } catch (HiveSQLException e) { setOperationException(e); LOG.error("Error running hive query: ", e); } finally { LogUtils.unregisterLoggingContext(); Hive hiveDb = Hive.getThreadLocal(); if (hiveDb != null && hiveDb != parentHive) { Hive.closeCurrent(); } } return null; } }; try { currentUGI.doAs(doAsAction); } catch (Exception e) { setOperationException(new HiveSQLException(e)); LOG.error("Error running hive query as user : " + currentUGI.getShortUserName(), e); } finally { if (ThreadWithGarbageCleanup.currentThread() instanceof ThreadWithGarbageCleanup) { ThreadWithGarbageCleanup currentThread = (ThreadWithGarbageCleanup) ThreadWithGarbageCleanup.currentThread(); currentThread.cacheThreadLocalRawStore(); } } }
Source:
<code>public void call(final Subscriber<? super T> o) { final Iterator<? extends T> it = is.iterator(); <START> final Scheduler.Worker trampoline = Schedulers.trampoline().createWorker(); <END> o.add(trampoline); o.setProducer(new Producer() { final AtomicInteger requested = new AtomicInteger(); @Override public void request(int n) { int _c = requested.getAndAdd(n); if (_c == 0) { trampoline.schedule(new Action0() { @Override public void call() { while (it.hasNext()) { if (o.isUnsubscribed()) { return; } int c = requested.decrementAndGet(); T t = it.next(); o.onNext(t); if (c == 0) { return; } } if (o.isUnsubscribed()) { return; } o.onCompleted(); } }); } } }); }</code><technical_language>Is this trampoline necessary? java final Iterator<? extends T> = is.iterator(); o.setProducer(new Producer() { // TODO migrate AFU final AtomicInteger requested = new AtomicInteger(); @Override public void request(int n) { int _c = requested.getAndAdd(n); if (_c == 0) { while (it.hasNext()) { if (o.isUnsubscribed()) { return; } T t = it.next(); o.onNext(t); _c = requested.decrementAndGet(); if (_c == 0) { // done emitting number requested return return; } } if (o.isUnsubscribed()) { return; } o.onCompleted(); } } });</technical_language>

Target:
public void call(final Subscriber<? super T> o) { final Iterator<? extends T> it = is.iterator(); o.setProducer(new Producer() { final AtomicInteger requested = new AtomicInteger(); @Override public void request(int n) { System.out.println("onSubscribeFromIterable.request: " + n); int _c = requested.getAndAdd(n); if (_c == 0) { while (it.hasNext()) { if (o.isUnsubscribed()) { return; } T t = it.next(); o.onNext(t); if (requested.decrementAndGet() == 0) { return; } } o.onCompleted(); } } }); }
Source:
<code>private void completeWithEmptyResponse( CollectCoordinationRequest request, CompletableFuture<CoordinationResponse> future) { try { future.complete(new CollectCoordinationResponse<>( request.getVersion(), <START> 0, <END> Collections.emptyList(), LongSerializer.INSTANCE)); } catch (IOException e) { future.completeExceptionally(e); } }</code><technical_language>return -1 here? 0 is a valid checkpointed offset</technical_language>

Target:
private void completeWithEmptyResponse( CollectCoordinationRequest request, CompletableFuture<CoordinationResponse> future) { try { future.complete(new CollectCoordinationResponse<>( request.getVersion(), -1, Collections.emptyList(), LongSerializer.INSTANCE)); } catch (IOException e) { future.completeExceptionally(e); } }
Source:
<code>public List<MemorySegment> requestMemorySegments() throws IOException { <START> if (numberOfSegmentsToRequest <= 0) { <END> return Collections.emptyList(); } synchronized (factoryLock) { if (isDestroyed) { throw new IllegalStateException("Network buffer pool has already been destroyed."); } tryRedistributeBuffers(); } final List<MemorySegment> segments = new ArrayList<>(numberOfSegmentsToRequest); try { final Deadline deadline = Deadline.fromNow(requestSegmentsTimeout); while (true) { if (isDestroyed) { throw new IllegalStateException("Buffer pool is destroyed."); } MemorySegment segment; synchronized (availableMemorySegments) { if ((segment = internalRequestMemorySegment()) == null) { availableMemorySegments.wait(2000); } } if (segment != null) { segments.add(segment); } if (segments.size() >= numberOfSegmentsToRequest) { break; } if (!deadline.hasTimeLeft()) { throw new IOException(String.format("Timeout triggered when requesting exclusive buffers: %s, " + " or you may increase the timeout which is %dms by setting the key '%s'.", getConfigDescription(), requestSegmentsTimeout.toMillis(), NettyShuffleEnvironmentOptions.NETWORK_EXCLUSIVE_BUFFERS_REQUEST_TIMEOUT_MILLISECONDS.key())); } } } catch (Throwable e) { try { recycleMemorySegments(segments, numberOfSegmentsToRequest); } catch (IOException inner) { e.addSuppressed(inner); } ExceptionUtils.rethrowIOException(e); } return segments; }</code><technical_language>numberOfSegmentsToRequest negative check this argument in constructor. if (numberOfSegmentsToRequest == 0) instead</technical_language>

Target:
public List<MemorySegment> requestMemorySegments() throws IOException { synchronized (factoryLock) { if (isDestroyed) { throw new IllegalStateException("Network buffer pool has already been destroyed."); } if (numberOfSegmentsToRequest == 0) { return Collections.emptyList(); } tryRedistributeBuffers(); } final List<MemorySegment> segments = new ArrayList<>(numberOfSegmentsToRequest); try { final Deadline deadline = Deadline.fromNow(requestSegmentsTimeout); while (true) { if (isDestroyed) { throw new IllegalStateException("Buffer pool is destroyed."); } MemorySegment segment; synchronized (availableMemorySegments) { if ((segment = internalRequestMemorySegment()) == null) { availableMemorySegments.wait(2000); } } if (segment != null) { segments.add(segment); } if (segments.size() >= numberOfSegmentsToRequest) { break; } if (!deadline.hasTimeLeft()) { throw new IOException(String.format("Timeout triggered when requesting exclusive buffers: %s, " + " or you may increase the timeout which is %dms by setting the key '%s'.", getConfigDescription(), requestSegmentsTimeout.toMillis(), NettyShuffleEnvironmentOptions.NETWORK_EXCLUSIVE_BUFFERS_REQUEST_TIMEOUT_MILLISECONDS.key())); } } } catch (Throwable e) { try { recycleMemorySegments(segments, numberOfSegmentsToRequest); } catch (IOException inner) { e.addSuppressed(inner); } ExceptionUtils.rethrowIOException(e); } return segments; }
Source:
<code>public void testXmlToObject() throws Exception { SimpleBean obj = new SimpleBean(); Reader in = new StringReader(xml); handler.toObject(ai, in, obj); assertNotNull(obj); <START> assertEquals(obj.getName(), "Jan"); <END> assertEquals(obj.getAge().longValue(), 12L); assertNotNull(obj.getParents()); assertThat(obj.getParents()) .hasSize(2) .containsExactly("Adam", "Ewa"); }</code><technical_language>params order for assertEquals expected, actual</technical_language>

Target:
public void testXmlToObject() throws Exception { SimpleBean obj = new SimpleBean(); Reader in = new StringReader(xml); handler.toObject(ai, in, obj); assertNotNull(obj); assertEquals("Jan", obj.getName()); assertEquals(12L, obj.getAge().longValue()); assertNotNull(obj.getParents()); assertThat(obj.getParents()) .hasSize(2) .containsExactly("Adam", "Ewa"); }
Source:
<code>public void setMenuItems(@Nullable List<CarMenuItem> items) { mMenuItems = items; mOverflowMenuItems.clear(); mActionViews.forEach(this::removeView); mActionViews.clear(); List<CarMenuItem> actionItems = new ArrayList<>(); List<CarMenuItem> ifRoomItems = new ArrayList<>(); if (mMenuItems != null) { for (CarMenuItem item : mMenuItems) { if <START> (item.getDisplayBehavior() == <END> CarMenuItem.DisplayBehavior.ALWAYS) { actionItems.add(item); } else if (item.getDisplayBehavior() == CarMenuItem.DisplayBehavior.IF_ROOM) { ifRoomItems.add(item); } else { mOverflowMenuItems.add(item); } } } for (CarMenuItem item : ifRoomItems) { if (item.isCheckable() || actionItems.size() < RECOMMENDED_ACTION_ITEM_LIMIT) { actionItems.add(item); } else { mOverflowMenuItems.add(0, item); } } mOverflowButtonView.setVisibility(mOverflowMenuItems.isEmpty() ? GONE : VISIBLE); for (CarMenuItem item : actionItems) { View action = item.isCheckable() ? createCheckableAction(item) : createAction(item); MarginLayoutParams marginLayoutParams = new MarginLayoutParams(LayoutParams.WRAP_CONTENT, mActionButtonHeight); action.setLayoutParams(marginLayoutParams); mActionViews.add(action); addView(action); } requestLayout(); }</code><technical_language>3 cases, a switch instead of if/else chain</technical_language>

Target:
public void setMenuItems(@Nullable List<CarMenuItem> items) { mMenuItems = items; mActionItems.forEach(indexedItem -> removeView(indexedItem.mView)); mActionItems.clear(); mOverflowMenuItems.clear(); if (mMenuItems != null) { int alwaysItemCount = 0; for (CarMenuItem item : mMenuItems) { if (item.getDisplayBehavior() == CarMenuItem.DisplayBehavior.ALWAYS) { alwaysItemCount++; } } int ifRoomActionCapacity = ACTION_ITEM_COUNT_LIMIT - alwaysItemCount; for (int i = 0; i < mMenuItems.size(); i++) { CarMenuItem item = mMenuItems.get(i); if (item.getDisplayBehavior() == CarMenuItem.DisplayBehavior.ALWAYS || (item.getDisplayBehavior() == CarMenuItem.DisplayBehavior.IF_ROOM && ifRoomActionCapacity > 0)) { View action = item.isCheckable() ? createCheckableAction(item) : createAction(item); mActionItems.add(new IndexedMenuItem(item, action, i)); addView(action); if (item.getDisplayBehavior() == CarMenuItem.DisplayBehavior.IF_ROOM) { ifRoomActionCapacity--; } } else { mOverflowMenuItems.add(new IndexedMenuItem(item, null, i)); } } } mOverflowButtonView.setVisibility(mOverflowMenuItems.isEmpty() ? GONE : VISIBLE); requestLayout(); }
Source:
<code>@Override protected void stop0(boolean cancel, boolean destroy) { <START> <END> cctx.kernalContext().cache().cleanup(cctx.config(),plc,cctx.isNear()); }</code><technical_language>Mind whitespaces: - more empty line - add empty lines needed (e.g. line 325) - add spaces commas, operators, etc. here: <LINK_0></technical_language>

Target:
@Override protected void stop0(boolean cancel, boolean destroy) { cleanup(cctx.config(),plc,cctx.isNear()); }
Source:
<code>private boolean isRecoverable(List<ExecutionFailureInfo> failures) { return stageTaskRecoveryCallback.isPresent() && failedTasks.size() + 1 < allTasks.size() * maxFailedTaskPercentage && <START> failures.stream().map(ExecutionFailureInfo::getErrorCode).allMatch(RECOVERABLE_ERROR_CODES::contains); <END> }</code><technical_language>I writes for-loop for case. stream readability benefit , imperative programming style is self-explained</technical_language>

Target:
private boolean isRecoverable(List<ExecutionFailureInfo> failures) { for (ExecutionFailureInfo failure : failures) { if (!RECOVERABLE_ERROR_CODES.contains(failure.getErrorCode())) { return false; } } return stageTaskRecoveryCallback.isPresent() && failedTasks.size() + 1 < allTasks.size() * maxFailedTaskPercentage; }
Source:
<code>public void testUnapplyNull() { if (NullHandling.sqlCompatible()) { Assert.assertEquals(Collections.emptyList(), loadingLookup.unapply(null)); } else { <START> Assert.assertEquals(null, loadingLookup.unapply(null)); <END> } }</code><technical_language>Assert.assertNull()</technical_language>

Target:
public void testUnapplyNull() { if (NullHandling.sqlCompatible()) { Assert.assertEquals(Collections.emptyList(), loadingLookup.unapply(null)); } else { Assert.assertNull(loadingLookup.unapply(null)); } }
Source:
<code>protected void runAutonomous() throws InterruptedException, AutonomousModeOverException { setClampHeight(1.0f); collectTote(); <START> if (containerToCollect.get() && collectContainers.get()) { <END> setClampHeight(0.0f); setClampOpen(true); drive(nudge.get()); setClampOpen(false); setClampHeight(1.0f); } drive(toteDistance.get()); collectTote(); if (!containerToCollect.get() && collectContainers.get()) { setClampHeight(0.0f); setClampOpen(true); drive(nudge.get()); setClampOpen(false); setClampHeight(1.0f); } drive(toteDistance.get()); collectTote(); turn(90); drive(autoZoneDistance.get()); if (collectContainers.get()) { setClampHeight(0.0f); setClampOpen(true); setClampHeight(1.0f); DriveCode.octocanumShifting.set(true); strafe(1.0f, strafeTime.get()); } ejectTotes(); DriveCode.octocanumShifting.set(false); }</code><technical_language>variable for container instead of enable a select</technical_language>

Target:
protected void runAutonomous() throws InterruptedException, AutonomousModeOverException { boolean bothEnabled = collectFirstContainer.get() && collectSecondContainer.get(); if (bothEnabled) { Logger.warning("Can't collect two containers! Go sit in the corner and think about what you've done."); } setClampHeight(1.0f); collectTote(); if (collectFirstContainer.get() || bothEnabled) { setClampHeight(0.0f); setClampOpen(true); drive(nudge.get()); setClampOpen(false); setClampHeight(1.0f); } drive(toteDistance.get()); collectTote(); if (collectSecondContainer.get() ^ bothEnabled) { setClampHeight(0.0f); setClampOpen(true); drive(nudge.get()); setClampOpen(false); setClampHeight(1.0f); } drive(toteDistance.get()); collectTote(); turn(90); drive(autoZoneDistance.get()); if (collectFirstContainer.get() || collectSecondContainer.get()) { setClampHeight(0.0f); setClampOpen(true); setClampHeight(1.0f); DriveCode.octocanumShifting.set(true); strafe(1.0f, strafeTime.get()); } ejectTotes(); DriveCode.octocanumShifting.set(false); }
Source:
<code>private void fillModelList() { modelDisplay = new ArrayList<DisplayPair>(); modelIds = new ArrayList<Long>(); for (int i = 0; i < models.size(); i++) { try { modelIds.add(models.get(i).getLong("id")); modelDisplay.add(new DisplayPair(models.get(i).getString("name"), cardCounts.get(i))); } catch (JSONException e) { closeActivity(DB_ERROR_EXIT); } } noteTypeArrayAdapter = new DisplayPairAdapter(this, modelDisplay); noteTypeListView.setAdapter(noteTypeArrayAdapter); noteTypeListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { long noteTypeID = modelIds.get(position); currentPos = position; Intent noteOpenIntent = new Intent(ModelBrowser.this, ModelFieldEditor.class); noteOpenIntent.putExtra("title", modelDisplay.get(position).getName()); noteOpenIntent.putExtra("noteTypeID", noteTypeID); startActivityForResultWithAnimation(noteOpenIntent, 0, ActivityTransitionAnimation.LEFT); } }); noteTypeListView.setOnItemLongClickListener(new OnItemLongClickListener() { public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { String cardName = modelDisplay.get(position).getName(); currentID = modelIds.get(position); currentPos = position; <START> cMenu = new ModelBrowserContextMenu().newInstance(cardName, mContextMenuListener); <END> showDialogFragment(cMenu); return true; } }); updateSubtitleText(); }</code><technical_language>This is a static method need instantiate object. do ModelBrowserContextMenu.newInstance()</technical_language>

Target:
private void fillModelList() { mModelDisplayList = new ArrayList<DisplayPair>(); mModelIds = new ArrayList<Long>(); for (int i = 0; i < mModels.size(); i++) { try { mModelIds.add(mModels.get(i).getLong("id")); mModelDisplayList.add(new DisplayPair(mModels.get(i).getString("name"), mCardCounts.get(i))); } catch (JSONException e) { throw new RuntimeException(e); } } mModelDisplayAdapter = new DisplayPairAdapter(this, mModelDisplayList); mModelListView.setAdapter(mModelDisplayAdapter); mModelListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { long noteTypeID = mModelIds.get(position); mModelListPosition = position; Intent noteOpenIntent = new Intent(ModelBrowser.this, ModelFieldEditor.class); noteOpenIntent.putExtra("title", mModelDisplayList.get(position).getName()); noteOpenIntent.putExtra("noteTypeID", noteTypeID); startActivityForResultWithAnimation(noteOpenIntent, 0, ActivityTransitionAnimation.LEFT); } }); mModelListView.setOnItemLongClickListener(new OnItemLongClickListener() { public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { String cardName = mModelDisplayList.get(position).getName(); mCurrentID = mModelIds.get(position); mModelListPosition = position; mContextMenu = ModelBrowserContextMenu.newInstance(cardName, mContextMenuListener); showDialogFragment(mContextMenu); return true; } }); updateSubtitleText(); }
Source:
<code><START> synchronized public boolean isDue() { <END> if(neverUpdate) return false; if(dataTimestamp == 0) dataTimestamp = getDataFile().file.lastModified(); long now = System.currentTimeMillis(); retryWindow = Math.max(retryWindow,SECONDS.toMillis(15)); boolean due = now - dataTimestamp > DAY && now - lastAttempt > retryWindow; if(due) { lastAttempt = now; retryWindow = Math.min(retryWindow*2, HOURS.toMillis(1)); } return due; }</code><technical_language>Adding synchronized automatic tool, I a bad idea. > If users trigger updateDirectly -> isDue, wait is modifying behavior of code a separate PR? I this done manually, compared other</technical_language>

Target:
public boolean isDue() { if(neverUpdate) return false; if(dataTimestamp == 0) dataTimestamp = getDataFile().file.lastModified(); long now = System.currentTimeMillis(); retryWindow = Math.max(retryWindow,SECONDS.toMillis(15)); boolean due = now - dataTimestamp > DAY && now - lastAttempt > retryWindow; if(due) { lastAttempt = now; retryWindow = Math.min(retryWindow*2, HOURS.toMillis(1)); } return due; }
Source:
<code>public void processHeaderRow(String[] headerRow) { this.headerRow = headerRow.clone(); for (int i = 0; i < this.headerRow.length; i++) { String value = headerRow[i]; if (value != null) { value = value.trim(); } if (!Strings.isValid(value)) { this.headerRow[i] = null; } else { String str = RowTypeEnum.VERIFICATION_CRITERIA._rowType; <START> if (value.contains(RowTypeEnum.VERIFICATION_CRITERIA._rowType)) { <END> value = RowTypeEnum.VERIFICATION_CRITERIA._rowType; } RowTypeEnum rowTypeEnum = RowTypeEnum.fromString(value); rowIndexToRowTypeMap.put(i, rowTypeEnum); } } }</code><technical_language>is a more clear get _rowType</technical_language>

Target:
public void processHeaderRow(String[] headerRow) { this.headerRow = headerRow.clone(); for (int i = 0; i < this.headerRow.length; i++) { String value = headerRow[i]; if (value != null) { value = value.trim(); } if (!Strings.isValid(value)) { this.headerRow[i] = null; } else { String str = RowTypeEnum.VERIFICATION_CRITERIA.getRowType(); if (value.contains(RowTypeEnum.VERIFICATION_CRITERIA.getRowType())) { value = RowTypeEnum.VERIFICATION_CRITERIA.getRowType(); } RowTypeEnum rowTypeEnum = RowTypeEnum.fromString(value); rowIndexToRowTypeMap.put(i, rowTypeEnum); } } }
Source:
<code>public void onComplete() { <START> try { <END> publishBulkheadEvent(() -> new BulkheadOnCallFinishedEvent(name)); } finally { semaphore.release(); } }</code><technical_language>This is strange piece of code. I understand logic misleading. suggest so: java semaphore.release(); publishBulkheadEvent(() -> new BulkheadOnCallFinishedEvent(name)); if worried exception in publishBulkheadEvent method place try/finally there</technical_language>

Target:
public void onComplete() { semaphore.release(); publishBulkheadEvent(() -> new BulkheadOnCallFinishedEvent(name)); }
Source:
<code><START> private ParamDescriptor createParamDescriptor(final String postfix) { <END> final ParamDescriptor pd = new ParamDescriptor(); pd.setName("Name" + postfix); pd.setDescription("Description" + postfix); return pd; }</code><technical_language>This static</technical_language>

Target:
private static ParamDescriptor createParamDescriptor(final String postfix) { final ParamDescriptor pd = new ParamDescriptor(); pd.setName("Name" + postfix); pd.setDescription("Description" + postfix); return pd; }