auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private static <T> T unwrap(ListenableFuture<T> future) { <END> try { return future.get(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } catch (ExecutionException e) { Throwables.throwIfUnchecked(e.getCause()); throw new RuntimeException(e); } }</code><technical_language>Extract this some utility class, effectively duplicated ConjureTimelockResource, exists in ALP</technical_language>

Target:
private static <T> T unwrap(ListenableFuture<T> future) { return AtlasFutures.getUnchecked(future); }
Source:
<code>private void fileChangedWatchService(File file) { while (file.isFile()) { file = file.getParentFile(); } try { if (watcher != null) { watcher.close(); } watcher = FileSystems.getDefault().newWatchService(); final Path path = FileSystems.getDefault().getPath(file.getAbsolutePath()); path.register(watcher, StandardWatchEventKinds.ENTRY_MODIFY); new Thread(() -> { try { WatchKey key = watcher.take(); while (key != null) { for (WatchEvent<?> event : key.pollEvents()) { final Path changedPath = (Path) event.context(); <START> if (changedPath.toString().endsWith(".html")) { END> Display.getDefault().asyncExec(() -> browser.refresh()); } } key.reset(); key = watcher.take(); } } catch (InterruptedException e) { e.printStackTrace(); } catch (ClosedWatchServiceException e) { } }).start(); } catch (IOException e) { e.printStackTrace(); } }</code><technical_language>watcher is registered specific file, I impression sense check path matches browser URL more stateless reusable. Also, check for path extension is html? If updates for example a .png image this image is open in browser, update too</technical_language>

Target:
private void fileChangedWatchService(File file) { while (file.isFile()) { file = file.getParentFile(); } try { if (watcher != null) { watcher.close(); } watcher = FileSystems.getDefault().newWatchService(); final Path path = FileSystems.getDefault().getPath(file.getAbsolutePath()); path.register(watcher, StandardWatchEventKinds.ENTRY_MODIFY); new Thread(() -> { try { WatchKey key = watcher.take(); while (key != null) { for (WatchEvent<?> event : key.pollEvents()) { final Path changedPath = (Path) event.context(); Display.getDefault().asyncExec(() -> { if (browser.getUrl().endsWith(changedPath.toString())) { browser.refresh(); } }); } key.reset(); key = watcher.take(); } } catch (InterruptedException e) { e.printStackTrace(); } catch (ClosedWatchServiceException e) { } }).start(); } catch (IOException e) { e.printStackTrace(); } }
Source:
<code>public ESClient create(ElasticSearchEmbeddedNode node, ElasticSearchClientConfig config) { String clientType = System.getProperty(CLIENT_PROPERTY); switch (clientType != null ? clientType : DEFAULT_CLIENT) { case TRANSPORT_CLIENT: return createTransportClient(node); case REST_CLIENT: return createRestClient(node); case RANDOM_CLIENT: <START> getRandomClient(); <END> default: throw new IllegalArgumentException(""); } }</code><technical_language>rely a random client, if return here</technical_language>

Target:
public ESClient create(ElasticSearchEmbeddedNode node, ElasticSearchClientConfig config) { String clientType = System.getProperty(CLIENT_PROPERTY); switch (clientType != null ? clientType : DEFAULT_CLIENT) { case TRANSPORT_CLIENT: return createTransportClient(node); case REST_CLIENT: return createRestClient(node); default: throw new IllegalArgumentException("Unknown Elasticsearch client type: " + clientType); } }
Source:
<code>public void testPy4jInstalled() throws IOException, InterruptedException { when(mockPythonProcess.sendAndGetResult(eq("\n\nimport py4j\n"))).thenReturn(">>>"); pythonInterpreter.open(); Integer py4jPort = pythonInterpreter.getPy4jPort(); assertNotNull(py4jPort); assertTrue(cmdHistory.contains("def help()")); assertTrue(cmdHistory.contains("class PyZeppelinContext(object):")); assertTrue(cmdHistory.contains("z = Py4jZeppelinContext")); assertTrue(cmdHistory.contains("def show")); assertTrue(cmdHistory.contains("GatewayClient(port=" + py4jPort + ")")); assertTrue(cmdHistory.contains("org.apache.zeppelin.display.Input")); assertTrue(serverIsListeningOn(py4jPort)); pythonInterpreter.close(); <START> TimeUnit.SECONDS.sleep(1); <END> assertFalse(serverIsListeningOn(py4jPort)); }</code><technical_language>this short for slow Travis CI runs</technical_language>

Target:
public void testPy4jInstalled() throws IOException, InterruptedException { when(mockPythonProcess.sendAndGetResult(eq("\n\nimport py4j\n"))).thenReturn(">>>"); pythonInterpreter.open(); Integer py4jPort = pythonInterpreter.getPy4jPort(); assertNotNull(py4jPort); assertTrue(cmdHistory.contains("def help()")); assertTrue(cmdHistory.contains("class PyZeppelinContext(object):")); assertTrue(cmdHistory.contains("z = Py4jZeppelinContext")); assertTrue(cmdHistory.contains("def show")); assertTrue(cmdHistory.contains("GatewayClient(port=" + py4jPort + ")")); assertTrue(cmdHistory.contains("org.apache.zeppelin.display.Input")); assertTrue(serverIsListeningOn(py4jPort)); pythonInterpreter.close(); TimeUnit.MILLISECONDS.sleep(100); assertFalse(serverIsListeningOn(py4jPort)); }
Source:
<code>public Dialog onCreateDialog(Bundle bundle) { View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_about, null); Dialog aboutDialog = new AlertDialog.Builder(getActivity()) .setView(view) .setTitle(R.string.app_name) <START> .setNeutralButton(R.string.ok, new DialogInterface.OnClickListener() { <END> @Override public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }).create(); aboutDialog.setCanceledOnTouchOutside(true); return aboutDialog; }</code><technical_language>if "android.R.string.ok" is need for changing strings.xml file</technical_language>

Target:
public Dialog onCreateDialog(Bundle bundle) { View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_about, null); Dialog aboutDialog = new AlertDialog.Builder(getActivity()) .setView(view) .setTitle(R.string.about_Dialog) .setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }).create(); aboutDialog.setCanceledOnTouchOutside(true); return aboutDialog; }
Source:
<code>private <C extends WriteCommand> Object writeManyRemoteCallback(WriteManyCommandHelper<C , ?, ?> helper,InvocationContext ctx, C command, Object rv) { LocalizedCacheTopology topology = checkTopologyId(command); ConsistentHash ch = topology.getWriteConsistentHash(); <START> Map<Address, IntSet> backups = backupOwnersOfSegments(ch, IntSets.from(ch.getPrimarySegmentsForOwner(rpcManager.getAddress()))); <END> if (backups.isEmpty()) { return rv; } boolean isSync = isSynchronous(command); CompletableFuture[] futures = isSync ? new CompletableFuture[backups.size()] : null; int future = 0; for (Entry<Address, IntSet> backup : backups.entrySet()) { C copy = helper.copyForBackup(command, topology, backup.getValue()); copy.setTopologyId(command.getTopologyId()); Address backupOwner = backup.getKey(); if (isSync) { futures[future++] = rpcManager .invokeCommand(backupOwner, copy, SingleResponseCollector.validOnly(), rpcManager.getSyncRpcOptions()) .toCompletableFuture(); } else { rpcManager.sendTo(backupOwner, copy, DeliverOrder.PER_SENDER); } } return isSync ? asyncValue(CompletableFuture.allOf(futures).thenApply(nil -> rv)) : rv; }</code><technical_language>LocalizedCacheTopology#getLocalReadSegments</technical_language>

Target:
private <C extends WriteCommand> Object writeManyRemoteCallback(WriteManyCommandHelper<C , ?, ?> helper,InvocationContext ctx, C command, Object rv) { LocalizedCacheTopology topology = checkTopologyId(command); ConsistentHash ch = topology.getWriteConsistentHash(); Map<Address, IntSet> backups = backupOwnersOfSegments(ch, topology.getLocalReadSegments()); if (backups.isEmpty()) { return rv; } boolean isSync = isSynchronous(command); CompletableFuture[] futures = isSync ? new CompletableFuture[backups.size()] : null; int future = 0; for (Entry<Address, IntSet> backup : backups.entrySet()) { C copy = helper.copyForBackup(command, topology, backup.getValue()); copy.setTopologyId(command.getTopologyId()); Address backupOwner = backup.getKey(); if (isSync) { futures[future++] = rpcManager .invokeCommand(backupOwner, copy, SingleResponseCollector.validOnly(), rpcManager.getSyncRpcOptions()) .toCompletableFuture(); } else { rpcManager.sendTo(backupOwner, copy, DeliverOrder.PER_SENDER); } } return isSync ? asyncValue(CompletableFuture.allOf(futures).thenApply(nil -> rv)) : rv; }
Source:
<code>public void testAddFailure() throws Exception{ <START> String message = "can not perform mutation"; <END> when(callable.futureCall(rowMutation)).thenReturn(future); future.setException(new RuntimeException(message)); ApiFuture<Void> result = bulkMutationClient.add(rowMutation); Assert.assertTrue(result.isDone()); result.get(); expect.expectMessage(message); verify(callable).futureCall(rowMutation); }</code><technical_language>exception thrown future.get(). Please move lines it</technical_language>

Target:
public void testAddFailure() throws Exception { when(callable.futureCall(rowMutation)).thenReturn(future); future.setException(new RuntimeException("can not perform mutation")); ApiFuture<Void> result = bulkMutationClient.add(rowMutation); assertTrue(result.isDone()); verify(callable).futureCall(rowMutation); result.get(); }
Source:
<code>public DataContainer toContainer() { return super.toContainer() <START> .set(Keys.HIDE_ENCHANTMENTS, enchantments) <END> .set(Keys.HIDE_ATTRIBUTES, attributes) .set(Keys.HIDE_UNBREAKABLE, unbreakable) .set(Keys.HIDE_CAN_DESTROY, canDestroy) .set(Keys.HIDE_CAN_PLACE, canPlace) .set(Keys.HIDE_MISCELLANEOUS, miscellaneous); }</code><technical_language>this. for of</technical_language>

Target:
public DataContainer toContainer() { return super.toContainer() .set(Keys.HIDE_ENCHANTMENTS, this.enchantments) .set(Keys.HIDE_ATTRIBUTES, this.attributes) .set(Keys.HIDE_UNBREAKABLE, this.unbreakable) .set(Keys.HIDE_CAN_DESTROY, this.canDestroy) .set(Keys.HIDE_CAN_PLACE, this.canPlace) .set(Keys.HIDE_MISCELLANEOUS, this.miscellaneous); }
Source:
<code>public byte getByteUnchecked(int internalPosition) { <START> return value.getByteUnchecked(internalPosition); <END> }</code><technical_language>This squashed commit "Add UncheckedBlock" right? I understand this change -- value.getByteUnchecked(0) right? "penetrating" position underlying block, sounds right behavior for getXUnchecked</technical_language>

Target:
public byte getByteUnchecked(int internalPosition) { assert internalPositionInRange(internalPosition, getOffsetBase(), getPositionCount()); return value.getByte(0); }
Source:
<code><START> public boolean getHasUserEmail() { <END> return !activityLog.getEmail().contains(Const.ActivityLog.UNKNOWN); }</code><technical_language>Is this method called somewhere</technical_language>

Target:
public boolean getHasUserEmail() { return !Const.ActivityLog.UNKNOWN.contentEquals(activityLog.getEmail()); }
Source:
<code>private void doTestRangeScan(int fullBlocks, int partialBlocks, boolean invertLoopIndexes) { int value; int value2; int count = 0; for (int i = 0; i <= 100; i++) { for (int j = 0; j <= 100; j++) { if (invertLoopIndexes) { value = j; value2 = i; } else { value = i; value2 = j; } String[] split = callCalculateSuffix(value, value2, fullBlocks, partialBlocks); for (String suffix : split) { String[] values = suffix.split("\\+"); if (values.length > 1) { value = Integer.parseInt(values[0]); value2 = Integer.parseInt(values[1]); if (value > 5 || value2 > 5) { count++; StringBuilder msg = new StringBuilder(); msg.append("Found incorrect value "); msg.append(suffix); msg.append(". value = "); msg.append(invertLoopIndexes ? j : i); msg.append(" value2 = "); msg.append(invertLoopIndexes ? i : j); msg.append(" fullBlocks = "); msg.append(fullBlocks); msg.append(" partialBlocks = "); msg.append(partialBlocks); } } } } } if (count > 0) { <START> Assert.fail("Incorrect values were founded " + count + " times"); <END> } }</code><technical_language>I do a static import for fail(). Edit: for member of Assert I use</technical_language>

Target:
private void doTestRangeScan(int fullBlocks, int partialBlocks, boolean invertLoopIndexes) { int value; int value2; int count = 0; for (int i = 0; i <= 100; i++) { for (int j = 0; j <= 100; j++) { if (invertLoopIndexes) { value = j; value2 = i; } else { value = i; value2 = j; } String[] split = callCalculateSuffix(value, value2, fullBlocks, partialBlocks); for (String suffix : split) { String[] values = suffix.split("\\+"); if (values.length > 1) { value = Integer.valueOf(values[0]); value2 = Integer.valueOf(values[1]); if (value > 5 || value2 > 5) { count++; StringBuffer msg = new StringBuffer(); msg.append("Found incorrect value "); msg.append(suffix); msg.append(". value = "); msg.append(invertLoopIndexes ? j : i); msg.append(" value2 = "); msg.append(invertLoopIndexes ? i : j); msg.append(" fullBlocks = "); msg.append(fullBlocks); msg.append(" partialBlocks = "); msg.append(partialBlocks); } } } } } if (count > 0) { fail("Incorrect values were founded " + count + " times"); } }
Source:
<code>public Neo4jGraph(String path) { service = new GraphDatabaseFactory().newEmbeddedDatabase(path); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { service.shutdown(); } }); nodeLabel = DynamicLabel.label(NODELABEL); try (Transaction tx = service.beginTx()) { service.schema().getConstraints().forEach(e -> e.drop()); service.schema().getIndexes().forEach(e -> e.drop()); service.schema().constraintFor(nodeLabel) <START> .assertPropertyIsUnique(PropertyTypes.ID.name()) <END> .create(); service.schema().indexFor(nodeLabel) .on(RANK.name()) .create(); tx.success(); } }</code><technical_language>ID.name() anymore import property type statically</technical_language>

Target:
public Neo4jGraph(String path) { service = new GraphDatabaseFactory().newEmbeddedDatabase(path); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { service.shutdown(); } }); nodeLabel = DynamicLabel.label(NODELABEL.name()); execute(new IndexCommand(nodeLabel)); }
Source:
<code><START> public ImmutableList<SimpleColumn> getList() { <END> if (columns == null) { columns = Builder.getDefaultInstance().listBuilder.build(); } return columns; }</code><technical_language>This a simple method returns simpleColumn immutable List. Also, is a preference Dataflow standard java objects List Set guava classes</technical_language>

Target:
public List<SimpleColumn> getList() { return columns; }
Source:
<code>public void verifyRelatedVideoAdded(String videoName) { <START> waitForTextToBePresentInElementByBy(rvFirstVideo, videoName); <END> }</code><technical_language>verify if instead of WebElement</technical_language>

Target:
public void verifyRelatedVideoAdded(String videoName) { waitForTextToBePresentInElementByElement(rvFirstVideo, videoName); }
Source:
<code>public ExtentBufferedCompositePattern(Extent extent, Pattern... patterns) { super(extent); <START> checkArgument(patterns.length == 0, "patterns cannot be empty"); <END> this.patterns = patterns; }</code><technical_language>This is backwards, want expected condition here</technical_language>

Target:
public ExtentBufferedCompositePattern(Extent extent, Pattern... patterns) { super(extent); checkArgument(patterns.length != 0, "patterns cannot be empty"); this.patterns = patterns; }
Source:
<code>public ZeppelinDevServer(int port) throws TException, IOException { <START> super(null, port, ""); <END> }</code><technical_language>default ":" in other cases</technical_language>

Target:
public ZeppelinDevServer(int port) throws TException, IOException { super(null, port, ":"); }
Source:
<code>public void should_fail_if_the_map_under_test_is_empty_whatever_the_assertions_requirements_are() { actual.clear(); try { <START> maps.assertAnySatisfy(someInfo(), actual, ($1,$2) -> assertThat(true).isTrue()); <END> } catch (AssertionError e) { verify(failures).failure(info, elementsShouldSatisfyAny(actual)); return; } failBecauseExpectedAssertionErrorWasNotThrown(); }</code><technical_language>refactor test AssertionUtil.expectAssertionError in <LINK_0> do for other should_fail... tests</technical_language>

Target:
public void should_fail_if_the_map_under_test_is_empty_whatever_the_assertions_requirements_are() { actual.clear(); AssertionError error = expectAssertionError(() -> maps.assertAnySatisfy(someInfo(), actual, ($1, $2) -> assertThat(true).isTrue())); assertThat(error).hasMessage(elementsShouldSatisfyAny(actual).create()); }
Source:
<code>public void run() { try { index.addNotification(TEST_DEFAULT_NOTIFICATION); <START> Assert.assertTrue(exists(TEST_DEFAULT_NOTIFICATION)); <END> index.addNotification(TEST_URL_NOTIFICATION); Assert.assertTrue(exists(TEST_URL_NOTIFICATION)); } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>Asserting sub-thread fail test. refactor</technical_language>

Target:
public void run() { try { index.addNotification(TEST_DEFAULT_NOTIFICATION); defaultNotificationExists = exists(TEST_DEFAULT_NOTIFICATION); index.addNotification(TEST_URL_NOTIFICATION); urlNotificationExists = exists(TEST_URL_NOTIFICATION); } catch (Exception e) { this.exception = e; e.printStackTrace(); } }
Source:
<code>public void equalityTestZoned() { ZonedDateTime zoned = ZonedDateTime.now(); DateTimeType dt1 = new DateTimeType(zoned); <START> DateTimeType dt2 = DateTimeType.valueOf(dt1.toString()); <END> assertTrue(dt1.toString().equals(dt2.toString())); assertTrue(dt1.equals(dt2)); assertTrue(dt1.getZonedDateTime().equals(dt2.getZonedDateTime())); assertTrue(dt1.equals(dt2)); }</code><technical_language>here, please review line 185</technical_language>

Target:
public void equalityTestZoned() { ZonedDateTime zoned = ZonedDateTime.now(); DateTimeType dt1 = new DateTimeType(zoned); DateTimeType dt2 = DateTimeType.valueOf(dt1.toFullString()); assertTrue(dt1.toString().equals(dt2.toFullString())); assertTrue(dt1.getZonedDateTime().equals(dt2.getZonedDateTime())); assertTrue(dt1.equals(dt2)); }
Source:
<code>private static void putReportedMetrics(IndexedSet<Metric> metricSet, String instanceId, List<Metric> reportedMetrics) { for (Metric metric : reportedMetrics) { if (metric.getHostname() == null) { continue; } <START> Metric oldMetric = metricSet.getFirstByField(FULL_NAME_INDEX, metric.getFullMetricName()); <END> if (oldMetric == null) { metricSet.add(metric); } else if (metric.getMetricType() == MetricType.COUNTER) { oldMetric.addValue(metric.getValue()); } else { oldMetric.setValue(metric.getValue()); } } }</code><technical_language>instead of reading first, adding, call add directly? result of add true if successfully add new item, false if exists. Then, if exist, "update" metric setting incrementing it. I if changes, remove synchronized block put methods above</technical_language>

Target:
private static void putReportedMetrics(IndexedSet<Metric> metricSet, String instanceId, List<Metric> reportedMetrics) { for (Metric metric : reportedMetrics) { if (metric.getHostname() == null) { continue; } if (!metricSet.add(metric)) { Metric oldMetric = metricSet.getFirstByField(FULL_NAME_INDEX, metric.getFullMetricName()); if (metric.getMetricType() == MetricType.COUNTER) { if (metric.getValue() != 0L) { oldMetric.addValue(metric.getValue()); } } else { oldMetric.setValue(metric.getValue()); } } } }
Source:
<code>public void processHeader(final ParserContext context) { Options options = getAsciiDocOptionsAndAttributes(context); final Asciidoctor asciidoctor = getEngine(options); DocumentHeader header = asciidoctor.readDocumentHeader(context.getFile()); Map<String, Object> documentModel = context.getDocumentModel(); if (header.getDocumentTitle() != null) { documentModel.put("title", header.getDocumentTitle().getCombined()); } Map<String, Object> attributes = header.getAttributes(); for (Map.Entry<String, Object> attribute : attributes.entrySet()) { String key = attribute.getKey(); Object value = attribute.getValue(); if (hasJBakePrefix(key)) { String pKey = key.substring(6); if(value instanceof String) { processHeader(pKey, (String) value, documentModel); } else { <START> documentModel.put(pKey, value); <END> } } if (hasRevdate(key) && canCastToString(value)) { String dateFormat = context.getConfig().getDateFormat(); DateFormat df = new SimpleDateFormat(dateFormat); try { Date date = df.parse((String) value); context.setDate(date); } catch (ParseException e) { LOGGER.error("Unable to parse revdate. Expected {}", dateFormat, e); } } if (key.equals("jbake-tags")) { if (canCastToString(value)) { context.setTags(((String) value).split(",")); } else { LOGGER.error("Wrong value of 'jbake-tags'. Expected a String got '{}'", getValueClassName(value)); } } else { documentModel.put(key, attributes.get(key)); } } }</code><technical_language>right. asciidoctorj takes a Map<Sting, Object> for attributes. worth a try. other hand postpone for a cleanup session</technical_language>

Target:
public void processHeader(final ParserContext context) { Options options = getAsciiDocOptionsAndAttributes(context); final Asciidoctor asciidoctor = getEngine(options); DocumentHeader header = asciidoctor.readDocumentHeader(context.getFile()); Map<String, Object> documentModel = context.getDocumentModel(); if (header.getDocumentTitle() != null) { documentModel.put("title", header.getDocumentTitle().getCombined()); } Map<String, Object> attributes = header.getAttributes(); for (Map.Entry<String, Object> attribute : attributes.entrySet()) { String key = attribute.getKey(); Object value = attribute.getValue(); if (hasJBakePrefix(key)) { String pKey = key.substring(6); if(canCastToString(value)) { storeHeaderValue(pKey, (String) value, documentModel); } else { documentModel.put(pKey, value); } } if (hasRevdate(key) && canCastToString(value)) { String dateFormat = context.getConfig().getDateFormat(); DateFormat df = new SimpleDateFormat(dateFormat); try { Date date = df.parse((String) value); context.setDate(date); } catch (ParseException e) { LOGGER.error("Unable to parse revdate. Expected {}", dateFormat, e); } } if (key.equals("jbake-tags")) { if (canCastToString(value)) { context.setTags(((String) value).split(",")); } else { LOGGER.error("Wrong value of 'jbake-tags'. Expected a String got '{}'", getValueClassName(value)); } } else { documentModel.put(key, attributes.get(key)); } } }
Source:
<code>public void testConcurrentClose() { List<Type> types = ImmutableList.of(VARCHAR, BIGINT, BIGINT); OperatorContext operatorContext = driverContext.addOperatorContext(0, new PlanNodeId("test"), "values"); ValuesOperator source = new ValuesOperator(operatorContext, rowPagesBuilder(types) .addSequencePage(10, 20, 30, 40) .build()); Operator sink = createSinkOperator(types); Driver driver = Driver.createDriver(driverContext, source, sink); scheduledExecutor.submit(() -> driver.processFor(new Duration(1, TimeUnit.NANOSECONDS))); scheduledExecutor.submit(() -> driver.close()); while (!driverContext.isDone()) { <START> Uninterruptibles.sleepUninterruptibly(10, TimeUnit.MILLISECONDS); <END> } }</code><technical_language>try 1s</technical_language>

Target:
public void testConcurrentClose() { List<Type> types = ImmutableList.of(VARCHAR, BIGINT, BIGINT); OperatorContext operatorContext = driverContext.addOperatorContext(0, new PlanNodeId("test"), "values"); ValuesOperator source = new ValuesOperator(operatorContext, rowPagesBuilder(types) .addSequencePage(10, 20, 30, 40) .build()); Operator sink = createSinkOperator(types); Driver driver = Driver.createDriver(driverContext, source, sink); scheduledExecutor.submit(() -> driver.processFor(new Duration(1, TimeUnit.NANOSECONDS))); scheduledExecutor.submit(() -> driver.close()); while (!driverContext.isDone()) { Uninterruptibles.sleepUninterruptibly(1, TimeUnit.MILLISECONDS); } }
Source:
<code>private static void <START> refreshBorderFigure(final <END> BorderedStyle borderedStyle, final StyledFigure styledFigure) { LineBorder lineBorder = null; if (styledFigure.getBorder() instanceof LineBorder) { lineBorder = (LineBorder) styledFigure.getBorder(); } else { lineBorder = new LineBorder(); if (styledFigure instanceof Shape) { styledFigure.setBorder(null); } else { styledFigure.setBorder(lineBorder); } } if (borderedStyle.getBorderSize() != null) { lineBorder.setWidth(borderedStyle.getBorderSize().intValue()); } else { lineBorder.setWidth(0); } final RGBValues borderColor = borderedStyle.getBorderColor(); if (borderColor != null) { lineBorder.setColor(VisualBindingManager.getDefault().getColorFromRGBValues(borderColor)); } if (borderedStyle.getBorderSize() == null || borderedStyle.getBorderSize().intValue() == 0) { if (!(styledFigure instanceof NoteFigure)) { styledFigure.setBorder(null); } } }</code><technical_language>loo org.eclipse.sirius.diagram.ui.edit.internal.part.DiagramBorderNodeEditPartOperation.refreshBorderedStyle(StyledFigure, BorderedStyle)</technical_language>

Target:
private static void refreshBorderFigure(final BorderedStyle borderedStyle, final StyledFigure styledFigure) { LineBorder lineBorder = null; if (styledFigure.getBorder() instanceof LineBorder) { lineBorder = (LineBorder) styledFigure.getBorder(); } else { lineBorder = new LineBorder(); if (styledFigure instanceof Shape) { styledFigure.setBorder(null); } else { styledFigure.setBorder(lineBorder); } } int borderSize = 0; if (borderedStyle.getBorderSize() != null) { borderSize = borderedStyle.getBorderSize().intValue(); } lineBorder.setWidth(borderSize); final RGBValues borderColor = borderedStyle.getBorderColor(); if (borderColor != null) { lineBorder.setColor(VisualBindingManager.getDefault().getColorFromRGBValues(borderColor)); } if (borderedStyle.getBorderSize() == null || borderedStyle.getBorderSize().intValue() == 0) { if (!(styledFigure instanceof NoteFigure)) { styledFigure.setBorder(null); } } }
Source:
<code>public synchronized void run(JobConfig jobConfig, long jobId) throws JobDoesNotExistException, ResourceExhaustedException { Context forkedCtx = Context.current().fork(); Context prevCtx = forkedCtx.attach(); try { <START> LOG.info("jobConfig class {}", jobConfig.getClass().getCanonicalName()); <END> if (jobConfig instanceof PlanConfig) { mPlanTracker.run((PlanConfig) jobConfig, mCommandManager, mJobServerContext, getWorkerInfoList(), jobId); return; } else if (jobConfig instanceof WorkflowConfig) { mWorkflowTracker.run((WorkflowConfig) jobConfig, jobId); return; } throw new JobDoesNotExistException( ExceptionMessage.JOB_DEFINITION_DOES_NOT_EXIST.getMessage(jobConfig.getName())); } finally { forkedCtx.detach(prevCtx); } }</code><technical_language>debug</technical_language>

Target:
public synchronized void run(JobConfig jobConfig, long jobId) throws JobDoesNotExistException, ResourceExhaustedException { Context forkedCtx = Context.current().fork(); Context prevCtx = forkedCtx.attach(); try { if (jobConfig instanceof PlanConfig) { mPlanTracker.run((PlanConfig) jobConfig, mCommandManager, mJobServerContext, getWorkerInfoList(), jobId); return; } else if (jobConfig instanceof WorkflowConfig) { mWorkflowTracker.run((WorkflowConfig) jobConfig, jobId); return; } throw new JobDoesNotExistException( ExceptionMessage.JOB_DEFINITION_DOES_NOT_EXIST.getMessage(jobConfig.getName())); } finally { forkedCtx.detach(prevCtx); } }
Source:
<code>public CompileCSharpServerResponse compileCSharpServer( File sourcePath, File dependencies, File target) { String runScript = makeRunScript(sourcePath, dependencies, target); try { FileUtils.write(new File("runScript"), runScript, Charsets.UTF_8); } catch (IOException e) { e.printStackTrace(); new RuntimeException(compileScriptWriteErrorMsg + e.getMessage()); } ProcessBuilder runScriptProc = new ProcessBuilder("sh", "runScript"); try { logger.trace("About to run mcs script"); Process process = runScriptProc.start(); if (logger.isTraceEnabled()) { final InputStream inputStream = process.getInputStream(); final InputStreamReader inputStreamReader = new InputStreamReader(inputStream); final BufferedReader bufferedReader = new BufferedReader(inputStreamReader); String line; <START> while ((line = bufferedReader.readLine()) != null) logger.trace(line); <END> } } catch (IOException e) { e.printStackTrace(); return new CompileCSharpServerResponse(false, e.getMessage()); } return new CompileCSharpServerResponse(true, compilationMessage); }</code><technical_language>need consume stream of a trace is enabled - is block</technical_language>

Target:
public CompileCSharpServerResponse compileCSharpServer( File sourcePath, File dependencies, File target) { String runScript = makeRunScript(sourcePath, dependencies, target); Process process = null; logger.trace("About to run mcs script"); try { process = Runtime.getRuntime().exec(runScript); final Process finalProcess = process; new Thread() { public void run() { final InputStream in = finalProcess.getInputStream(); try { final InputStreamReader inputStreamReader = new InputStreamReader(in); final BufferedReader bufferedReader = new BufferedReader(inputStreamReader); String line; while ((line = bufferedReader.readLine()) != null) logger.trace(line); } catch (IOException e) { e.printStackTrace(); } finally { close(in); } } }.start(); new Thread() { public void run() { final InputStream in = finalProcess.getErrorStream(); try { final InputStreamReader inputStreamReader = new InputStreamReader(in); final BufferedReader bufferedReader = new BufferedReader(inputStreamReader); String line; while ((line = bufferedReader.readLine()) != null) logger.error(line); } catch (IOException e) { e.printStackTrace(); } finally { close(in); } } }.start(); process.waitFor(); return new CompileCSharpServerResponse(true, compilationMessage); } catch (IOException e) { e.printStackTrace(); return new CompileCSharpServerResponse(false, e.getMessage()); } catch (InterruptedException e) { return new CompileCSharpServerResponse(false, e.getMessage()); } finally { if (process != null) { try { process.getOutputStream().close(); } catch (IOException e) { e.printStackTrace(); } process.destroy(); } } }
Source:
<code>public Chain get(long key) { <START> EhcacheEntityResponse response = null; <END> try { response = entity.invoke(EhcacheEntityMessage.getOperation(cacheId, key)); if (response != null && response.getType() == EhcacheEntityResponse.Type.GET_RESPONSE) { return ((EhcacheEntityResponse.GetResponse)response).getChain(); } } catch (Exception e) { unwrapException(e, StoreAccessException.class); } return null; }</code><technical_language>is this variable try block</technical_language>

Target:
public Chain get(long key) { EhcacheEntityResponse response; try { response = entity.invoke(EhcacheEntityMessage.getOperation(cacheId, key), false); } catch (Exception e) { throw new ServerStoreProxyException(e); } if (response != null && response.getType() == EhcacheEntityResponse.Type.GET_RESPONSE) { return ((EhcacheEntityResponse.GetResponse)response).getChain(); } else { throw new ServerStoreProxyException("Response for get operation was invalid : " + response != null ? response.getType().toString() : "null message"); } }
Source:
<code>void handleBookieFailure(final Map<Integer, BookieSocketAddress> failedBookies) { <START> blockAddCompletions.incrementAndGet(); <END> synchronized (this) { long lac = getLastAddConfirmed(); LedgerMetadata metadata = getLedgerMetadata(); List<BookieSocketAddress> currentEnsemble = getCurrentEnsemble(); try { List<BookieSocketAddress> newEnsemble = replaceBookiesInEnsemble(metadata, currentEnsemble, failedBookies); Set<Integer> replaced = diffEnsemble(currentEnsemble, newEnsemble); blockAddCompletions.decrementAndGet(); if (!replaced.isEmpty()) { newEnsemblesFromRecovery.put(lac + 1, newEnsemble); unsetSuccessAndSendWriteRequest(newEnsemble, replaced); } } catch (BKException.BKNotEnoughBookiesException e) { LOG.error("Could not get additional bookie to remake ensemble, closing ledger: {}", ledgerId); handleUnrecoverableErrorDuringAdd(e.getCode()); return; } } }</code><technical_language>Do need do this a ReadOnlyLedgerHandle</technical_language>

Target:
void handleBookieFailure(final Map<Integer, BookieSocketAddress> failedBookies) { blockAddCompletions.incrementAndGet(); synchronized (metadataLock) { long lac = getLastAddConfirmed(); LedgerMetadata metadata = getLedgerMetadata(); List<BookieSocketAddress> currentEnsemble = getCurrentEnsemble(); try { List<BookieSocketAddress> newEnsemble = replaceBookiesInEnsemble(metadata, currentEnsemble, failedBookies); Set<Integer> replaced = diffEnsemble(currentEnsemble, newEnsemble); blockAddCompletions.decrementAndGet(); if (!replaced.isEmpty()) { newEnsemblesFromRecovery.put(lac + 1, newEnsemble); unsetSuccessAndSendWriteRequest(newEnsemble, replaced); } } catch (BKException.BKNotEnoughBookiesException e) { LOG.error("Could not get additional bookie to remake ensemble, closing ledger: {}", ledgerId); handleUnrecoverableErrorDuringAdd(e.getCode()); return; } } }
Source:
<code>public static void main(String[] args) { <START> if (args == null || args.length != 3) { <END> usage(); throw new IllegalStateException("No Arguments provided!"); } String modelTarFile = args[0]; String signatureFile = args[1]; String publicKeyName = args[2]; if (verify(tarContents(modelTarFile), signatureFile, getPublicKey(publicKeyName))) { log.info("Successfully Validated " + modelTarFile); } else { log.error("Could not verify " + modelTarFile + " with details provided"); } }</code><technical_language>Please refer <LINK_0> want Options class</technical_language>

Target:
public static void main(String[] args) throws ParseException, InvalidKeyException, NoSuchAlgorithmException, SignatureException, FileNotFoundException, KeyStoreException, IOException { Options options = prepareOptions(); CommandLine cli = new DefaultParser().parse(options, args); if (cli.hasOption("help")) { printHelp(options); return; } if (!cli.hasOption("tarFile") || !cli.hasOption("signatureFile") || !cli.hasOption("publicKeyName")) { printHelp(options); throw new MissingOptionException("Missing required option"); } String modelTarFile = cli.getOptionValue("tarFile"); String signatureFile = cli.getOptionValue("signatureFile"); String publicKeyName = cli.getOptionValue("publicKeyName"); if (verify(readTarContents(modelTarFile), signatureFile, getPublicKey(publicKeyName))) { log.info("Successfully Validated " + modelTarFile); } else { log.error("Could not verify " + modelTarFile + " with details provided"); System.exit(-1); } }
Source:
<code>public void deactivate() { <START> logger.debug("Deactivating FS20 binding"); <END> cul.unregisterListener(this); CULManager.close(cul); }</code><technical_language>copy page issue</technical_language>

Target:
public void deactivate() { logger.debug("Deactivating HMS binding"); cul.unregisterListener(this); CULManager.close(cul); }
Source:
<code>private SpanId getNewSpanId() { <START> Span parentSpan = spanAndEndpoint().state().getCurrentLocalSpan(); <END> if (parentSpan == null) { parentSpan = spanAndEndpoint().state().getCurrentServerSpan().getSpan(); } long newSpanId = randomGenerator().nextLong(); SpanId.Builder builder = SpanId.builder().spanId(newSpanId); if (parentSpan == null) return builder.build(); return builder.traceId(parentSpan.getTrace_id()).parentId(parentSpan.getId()).build(); }</code><technical_language>this is dodgy default state backend people cleared local span of a sudden traces start random local spans parent. internal flag set state store is InheritableServerClientAndLocalSpanState. set accept a local parent. While yakky, this insure existing users behavior change I mentioned. is super confusing try debug spans wrong parent, speaking experience</technical_language>

Target:
private SpanId getNewSpanId() { Span parentSpan = getNewSpanParent(); long newSpanId = randomGenerator().nextLong(); SpanId.Builder builder = SpanId.builder().spanId(newSpanId); if (parentSpan == null) return builder.build(); return builder.traceId(parentSpan.getTrace_id()).parentId(parentSpan.getId()).build(); }
Source:
<code>public boolean hasViewers() { <START> return playerList.size() > 0; <END> }</code><technical_language>this</technical_language>

Target:
public boolean hasViewers() { return this.playerList.size() > 0; }
Source:
<code>private static boolean hasAuthAnnotation(Annotation[] annotations) { for (Annotation annotation : annotations) { <START> if (annotation.annotationType() == CookieParam.class) { <END> return true; } } return false; }</code><technical_language>nit: suggestion if (CookieParam.class.equals(annotation.annotationType())) {</technical_language>

Target:
private static boolean hasAuthAnnotation(Annotation[] annotations) { for (Annotation annotation : annotations) { if (CookieParam.class.equals(annotation.annotationType())) { return true; } } return false; }
Source:
<code>public String toHTMLList() { StringBuilder sb = new StringBuilder(); sb.append("<head>\n") .append( <START> "\t<link rel=\"stylesheet\" href=\"<LINK_0>\">\n") <END> .append("</head>\n") .append("<body>\n"); for (Row row : rows) { sb.append(row.toHTMLList(columns)); } sb.append("</body>"); return sb.toString(); }</code><technical_language>versioned links factored out shared variables. This Bootstrap version match others in this file</technical_language>

Target:
public String toHTMLList() { StringBuilder sb = new StringBuilder(); sb.append("<head>\n") .append(" <link rel=\"stylesheet\" href=\"") .append(BOOTSTRAP_CSS) .append("\">\n") .append("</head>\n") .append("<body>\n"); for (Row row : rows) { sb.append(row.toHTMLList(columns)); } sb.append("</body>"); return sb.toString(); }
Source:
<code>public void createPointBill(String loginName, Long orderId, PointBusinessType businessType, long point, String note) { <START> AccountModel accountModel = accountMapper.lockByLoginName(loginName); <END> if (accountModel == null) { logger.info(String.format("createPointBill: %s no account", loginName)); return; } UserPointModel userPointModel = userPointService.findOrCreate(loginName); long channelPoint = calculateChannelPoint(userPointModel, point, businessType); long sudaiPoint = point - channelPoint; pointBillMapper.create(new PointBillModel(loginName, orderId, sudaiPoint, channelPoint, businessType, note)); userPointMapper.increasePoint(loginName, sudaiPoint, channelPoint, new Date()); }</code><technical_language>lock user_point</technical_language>

Target:
public void createPointBill(String loginName, Long orderId, PointBusinessType businessType, long point, String note) { AccountModel accountModel = accountMapper.findByLoginName(loginName); if (accountModel == null) { logger.info(String.format("createPointBill: %s no account", loginName)); return; } if (!userPointMapper.exists(loginName)) { userPointMapper.createIfNotExist(new UserPointModel(loginName, 0, 0, null)); } UserPointModel userPointModel = userPointMapper.lockByLoginName(loginName); long channelPoint = calculateChannelPoint(userPointModel, point, businessType); long sudaiPoint = point - channelPoint; pointBillMapper.create(new PointBillModel(loginName, orderId, sudaiPoint, channelPoint, businessType, note)); userPointMapper.increasePoint(loginName, sudaiPoint, channelPoint, new Date()); }
Source:
<code><START> public void importGender(@AlsoLoad("gender") String gender) { <END> if (gender == null) { return; } this.gender = Gender.valueOf(gender.toUpperCase()); }</code><technical_language>familiar Objectify. this annotation do here</technical_language>

Target:
public void importGender(@AlsoLoad("gender") String gender) { if (gender == null) { return; } this.gender = Gender.valueOf(gender); }
Source:
<code>@Override public ClientResponse process(ClientConnectionContext ctx) { ClusterState state = ctx.kernalContext().grid().cluster().state(); return ctx.currentProtocolContext().isFeatureSupported(ClientBitmaskFeature.CLUSTER_API) ? new ClientByteResponse(requestId(), (byte)state.ordinal()) : <START> new ClientBooleanResponse(requestId(), state != ClusterState.INACTIVE); <END> }</code><technical_language>ClusterState.active(state)</technical_language>

Target:
@Override public ClientResponse process(ClientConnectionContext ctx) { ClusterState state = ctx.kernalContext().grid().cluster().state(); return ctx.currentProtocolContext().isFeatureSupported(ClientBitmaskFeature.CLUSTER_API) ? new ClientByteResponse(requestId(), (byte)state.ordinal()) : new ClientBooleanResponse(requestId(), ClusterState.active(state)); }
Source:
<code>public void setVpnProxy(@Nullable ProxyInfo proxyInfo) { synchronized (mProxyLock) { <START> mVPNProxy = null; <END> if (proxyInfo == null) return; if (!TextUtils.isEmpty(proxyInfo.getHost()) && proxyInfo.getPort() != 0) { mVPNProxy = proxyInfo; } } }</code><technical_language>do need clear time? In initialization case, rely null a default</technical_language>

Target:
public void setVpnProxy(@Nullable ProxyInfo proxyInfo) { synchronized (mProxyLock) { if (proxyInfo == null) { mVPNProxy = null; return; } if (!TextUtils.isEmpty(proxyInfo.getHost()) && proxyInfo.getPort() != 0) { mVPNProxy = proxyInfo; } } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); toolbar = (Toolbar) findViewById(R.id.toolbar); <START> setSupportActionBar(toolbar); <END> completePlayerSetup(asked); toolbar.bringToFront(); }</code><technical_language>check toolbar is null</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); toolbar = (Toolbar) findViewById(R.id.toolbar); completePlayerSetup(asked); if (toolbar != null) { setSupportActionBar(toolbar); toolbar.bringToFront(); } }
Source:
<code>public AggregateReduceFunctionsRule(RelOptRuleOperand operand, RelBuilderFactory relBuilderFactory) { super(operand, relBuilderFactory, null); <START> this.functionsToReduce = new HashSet<>(); <END> addDefaultSetOfFunctionsToReduce(); }</code><technical_language>EnumSet instead of HashSet</technical_language>

Target:
public AggregateReduceFunctionsRule(RelOptRuleOperand operand, RelBuilderFactory relBuilderFactory) { super(operand, relBuilderFactory, null); functionsToReduce = EnumSet.noneOf(SqlKind.class); addDefaultSetOfFunctionsToReduce(); }
Source:
<code>public Response transferApplicationOwnership( @Valid @NotNull TransferOwnership transferOwnership) { List<RoleEntity> newRoles = new ArrayList<>(); Optional<RoleEntity> optNewPORole = roleService.findByScopeAndName(RoleScope.APPLICATION, transferOwnership.getPoRole()); if (optNewPORole.isPresent()) { newRoles.add(optNewPORole.get()); } else { } applicationService.findById(application); membershipService.transferApplicationOwnership(application, new MembershipService.MembershipMember( transferOwnership.getId(), transferOwnership.getReference(), MembershipMemberType.USER), newRoles); <START> return Response.noContent().build(); <END> }</code><technical_language>right. a breaking change some users, API UI, affected this kind of changes. Please revert</technical_language>

Target:
public Response transferApplicationOwnership( @Valid @NotNull TransferOwnership transferOwnership) { List<RoleEntity> newRoles = new ArrayList<>(); Optional<RoleEntity> optNewPORole = roleService.findByScopeAndName(RoleScope.APPLICATION, transferOwnership.getPoRole()); if (optNewPORole.isPresent()) { newRoles.add(optNewPORole.get()); } else { } applicationService.findById(application); membershipService.transferApplicationOwnership(application, new MembershipService.MembershipMember( transferOwnership.getId(), transferOwnership.getReference(), MembershipMemberType.USER), newRoles); return Response.ok().build(); }
Source:
<code>private static void generatePrepSection(StringBuilder buffer) { buffer.append("%prep\n"); <START> buffer.append("%setup -q -n %{name}-%{version} #You may need to update this according to your Source0\n\n\n"); <END> }</code><technical_language>"%setup -q -n %{name}-%{version}" is "%setup -q"</technical_language>

Target:
private static void generatePrepSection(StringBuilder buffer) { buffer.append("%prep\n"); buffer.append("%setup -q #You may need to update this according to your Source0\n\n\n"); }
Source:
<code>private static boolean isMultilineComment(StringLiteral stringLiteral) { Tree parent = stringLiteral.parent(); StringElement firstElement = stringLiteral.stringElements().get(0); <START> return (firstElement.value().endsWith("'''") || firstElement.value().endsWith("\"\"\"")) && parent.is(Tree.Kind.EXPRESSION_STMT); <END> }</code><technical_language>this part of API of StringElement</technical_language>

Target:
private static boolean isMultilineComment(StringLiteral stringLiteral) { Tree parent = stringLiteral.parent(); StringElement firstElement = stringLiteral.stringElements().get(0); return firstElement.isTripleQuoted() && parent.is(Tree.Kind.EXPRESSION_STMT); }
Source:
<code>private Number[] getAttributeNumericValues(String name) { VariableAttributeOverride attributeOverride = findAttribute(name); <START> return attributeOverride == null ? null : attributeOverride.getAttributeNumericValues(); <END> }</code><technical_language>need cater for null type well</technical_language>

Target:
private Number[] getAttributeNumericValues(String name) { VariableAttributeOverride attributeOverride = findAttribute(name); if (attributeOverride == null) return null; else if (attributeOverride.getType() == null) return attributeOverride.getAttributeNumericValues(type); else return attributeOverride.getAttributeNumericValues(); }
Source:
<code>static ThriftDDL parseThriftDDL(String ddl) { <START> if (Strings.isNullOrEmpty(ddl)) { <END> return null; } String[] parts = ddl.trim().split("\\s+"); Preconditions.checkArgument(parts.length >= 5, "Invalid thrift DDL " + ddl); Preconditions.checkArgument(THRIFT_STRUCT.equals(parts[0]), "ThriftDDL should start with " + THRIFT_STRUCT); ThriftDDL thriftDDL = new ThriftDDL(); thriftDDL.setTableName(parts[1]); Preconditions.checkArgument(START_STRUCT.equals(parts[2]), "Invalid thrift DDL " + ddl); Preconditions.checkArgument(parts[parts.length - 1].endsWith(END_STRUCT), "Invalid thrift DDL " + ddl); parts[parts.length - 1] = parts[parts.length - 1].substring(0, parts[parts.length - 1].length() - 1); List<ThriftField> fields = new ArrayList<>(); for (int i = 3; i < parts.length - 1; i += 2) { ThriftField thriftField = new ThriftField(); thriftField.setType(parts[i]); if (parts[i + 1].endsWith(FIELD_SEPARATOR)) { parts[i + 1] = parts[i + 1].substring(0, parts[i + 1].length() - 1); } thriftField.setName(parts[i + 1]); fields.add(thriftField); } thriftDDL.setFields(fields); return thriftDDL; }</code><technical_language>static import</technical_language>

Target:
private static ThriftDDL parseThriftDDL(String ddl) { if (isNullOrEmpty(ddl)) { return null; } String[] parts = ddl.trim().split("\\s+"); checkArgument(parts.length >= 5, "Invalid thrift DDL " + ddl); checkArgument(THRIFT_STRUCT.equals(parts[0]), "ThriftDDL should start with " + THRIFT_STRUCT); ThriftDDL thriftDDL = new ThriftDDL(); thriftDDL.setTableName(parts[1]); checkArgument(START_STRUCT.equals(parts[2]), "Invalid thrift DDL " + ddl); checkArgument(parts[parts.length - 1].endsWith(END_STRUCT), "Invalid thrift DDL " + ddl); parts[parts.length - 1] = parts[parts.length - 1].substring(0, parts[parts.length - 1].length() - 1); List<ThriftField> fields = new ArrayList<>(); for (int i = 3; i < parts.length - 1; i += 2) { ThriftField thriftField = new ThriftField(); thriftField.setType(parts[i]); if (parts[i + 1].endsWith(FIELD_SEPARATOR)) { parts[i + 1] = parts[i + 1].substring(0, parts[i + 1].length() - 1); } thriftField.setName(parts[i + 1]); fields.add(thriftField); } thriftDDL.setFields(fields); return thriftDDL; }