auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected Operand parseOperand() throws CommandLineException { skipWhitespaces(); if(pos == input.length()) { return null; } if(input.charAt(pos) == '(') { int depthCount = 0; int endIndex = pos; while(++endIndex < input.length()) { if(input.charAt(endIndex) == '(') { ++depthCount; } else if(input.charAt(endIndex) == ')') { if(depthCount == 0) { final Operation expr = parseExpression(input.substring(pos + 1, endIndex)); skipWhitespaces(); return expr; } else { --depthCount; } } else if (input.charAt(endIndex) == '"') { <START> endIndex = input.indexOf('"', endIndex + 1); <END> if (endIndex == -1) { throw new IllegalStateException(String.format("Unclosed parentheses starting at %d in '%s'", endIndex, input)); } } } throw new IllegalStateException("Failed to locate closing ')' for '(' at " + pos + " in '" + input + "'"); } final int start = pos; int end = pos; ComparisonOperation comparison = null; while(true) { if(pos == input.length()) { break; } final char ch = input.charAt(pos); if(Character.isWhitespace(ch)) { skipWhitespaces(); comparison = tryComparison(); break; } if(ch == '&' || ch == '|') { break; } comparison = tryComparison(); if(comparison != null) { break; } ++pos; ++end; } final String op = input.substring(start, end); Operand operand; if(comparison != null) { comparison.addOperand(new ModelNodePathOperand(op)); operand = comparison; comparison.addOperand(parseOperand()); } else { operand = new StringValueOperand(op); } return operand; }</code><technical_language>leave approval @aloubyansky @Gonthim if escaped quotes, \", allowed in strings this work</technical_language>

Target:
protected Operand parseOperand() throws CommandLineException { skipWhitespaces(); if(pos == input.length()) { return null; } if(input.charAt(pos) == '(') { int depthCount = 0; int endIndex = pos; while(++endIndex < input.length()) { if(input.charAt(endIndex) == '(') { ++depthCount; } else if(input.charAt(endIndex) == ')') { if(depthCount == 0) { final Operation expr = parseExpression(input.substring(pos + 1, endIndex)); skipWhitespaces(); return expr; } else { --depthCount; } } else if (input.charAt(endIndex) == '"') { endIndex = traverseStringInQuotes(endIndex); } } throw new IllegalStateException("Failed to locate closing ')' for '(' at " + pos + " in '" + input + "'"); } final int start = pos; int end = pos; ComparisonOperation comparison = null; while(true) { if(pos == input.length()) { break; } final char ch = input.charAt(pos); if(Character.isWhitespace(ch)) { skipWhitespaces(); comparison = tryComparison(); break; } if(ch == '&' || ch == '|') { break; } comparison = tryComparison(); if(comparison != null) { break; } ++pos; ++end; } final String op = input.substring(start, end); Operand operand; if(comparison != null) { comparison.addOperand(new ModelNodePathOperand(op)); operand = comparison; comparison.addOperand(parseOperand()); } else { operand = new StringValueOperand(op); } return operand; }
Source:
<code><START> protected void init() { <END> spark1Condition = new MultiComponentCondition( new BasicExpression(SparkBatchConstant.SPARK_LOCAL_MODE_PARAMETER, EqualityOperator.EQ, "false"), BooleanOperator.AND, new BasicExpression("SUPPORTED_SPARK_VERSION", EqualityOperator.EQ, ESparkVersion.SPARK_1_6.getSparkVersion())); spark2Condition = new MultiComponentCondition( new BasicExpression(SparkBatchConstant.SPARK_LOCAL_MODE_PARAMETER, EqualityOperator.EQ, "false"), BooleanOperator.AND, new MultiComponentCondition( new BasicExpression("SUPPORTED_SPARK_VERSION", EqualityOperator.EQ, ESparkVersion.SPARK_2_2.getSparkVersion()), BooleanOperator.OR, new BasicExpression("SUPPORTED_SPARK_VERSION", EqualityOperator.EQ, ESparkVersion.SPARK_2_4.getSparkVersion()) )); }</code><technical_language>spark 2.4 is supported for CDP</technical_language>

Target:
protected void init() { spark2Condition = new MultiComponentCondition( new BasicExpression(SparkBatchConstant.SPARK_LOCAL_MODE_PARAMETER, EqualityOperator.EQ, "false"), BooleanOperator.AND, new BasicExpression("SUPPORTED_SPARK_VERSION", EqualityOperator.EQ, ESparkVersion.SPARK_2_4.getSparkVersion())); }
Source:
<code>public ProfileEntry(final int id, final DateTime time, final double value) { this.id = id; this.time = time; <START> final DecimalFormat df = new DecimalFormat("#.#####"); <END> df.setRoundingMode(RoundingMode.HALF_UP); this.value = Double.parseDouble(df.format(value)); }</code><technical_language>Create separate private method correct precision</technical_language>

Target:
public ProfileEntry(final int id, final DateTime time, final double value) { this.id = id; this.time = time; this.value = this.roundValue(value); }
Source:
<code>public void setup() throws Exception { <START> profileInstances = spy(new ManagedInstanceStub<Profile>(profile1, profile2)); <END> tested = new ClientProfileManager(definitionUtils, profileInstances); }</code><technical_language>Explicit type argument Profile replaced <></technical_language>

Target:
public void setup() { profileInstances = spy(new ManagedInstanceStub<>(profile1, profile2)); tested = new ClientProfileManager(definitionUtils, profileInstances); }
Source:
<code>private static Supplier<QosIoExceptionHandler> createQosHandler(ClientConfiguration config) { <START> return () -> new AsyncQosIoExceptionHandler(scheduledExecutorService, Executors.newSingleThreadExecutor(), <END> new ExponentialBackoff(config.maxNumRetries(), config.backoffSlotSize(), new Random())); }</code><technical_language>this a executor</technical_language>

Target:
private static Supplier<QosIoExceptionHandler> createQosHandler(ClientConfiguration config) { return () -> new AsyncQosIoExceptionHandler(scheduledExecutorService, executorService, new ExponentialBackoff(config.maxNumRetries(), config.backoffSlotSize(), new Random())); }
Source:
<code>private BooleanProperty torNetworkNodeShutDown() { final BooleanProperty done = new SimpleBooleanProperty(); if (executorService != null) { executorService.submit(() -> { Utilities.setThreadName("torNetworkNodeShutDown"); long ts = System.currentTimeMillis(); log.debug("Shutdown torNetworkNode"); try { <START> if (tor == null) tor = Tor.getDefault(); <END> if (tor != null) tor.shutdown(); log.debug("Shutdown torNetworkNode done after " + (System.currentTimeMillis() - ts) + " ms."); } catch (Throwable e) { log.error("Shutdown torNetworkNode failed with exception: " + e.getMessage()); e.printStackTrace(); } finally { UserThread.execute(() -> done.set(true)); } }); } else { done.set(true); } return done; }</code><technical_language>NIT: I decided some point conditionals line anymore</technical_language>

Target:
private BooleanProperty torNetworkNodeShutDown() { final BooleanProperty done = new SimpleBooleanProperty(); if (executorService != null) { executorService.submit(() -> { Utilities.setThreadName("torNetworkNodeShutDown"); long ts = System.currentTimeMillis(); log.debug("Shutdown torNetworkNode"); try { tor = Tor.getDefault(); if (tor != null) tor.shutdown(); log.debug("Shutdown torNetworkNode done after " + (System.currentTimeMillis() - ts) + " ms."); } catch (Throwable e) { log.error("Shutdown torNetworkNode failed with exception: " + e.getMessage()); e.printStackTrace(); } finally { UserThread.execute(() -> done.set(true)); } }); } else { done.set(true); } return done; }
Source:
<code>public synchronized void initTrace(@Nullable IResource resource, @Nullable String path, @Nullable Class<? extends ITmfEvent> type) throws TmfTraceException { if (path == null) { throw new TmfTraceException("No path has been specified."); } File f = new File(path); String absPath = f.getAbsolutePath(); if (absPath == null) { throw new TmfTraceException("No path has been specified."); } <START> super.initTrace(resource, absPath, type); <END> try { fPcapFile = new PcapFile(absPath); } catch (IOException | BadPcapFileException e) { throw new TmfTraceException(e.getMessage(), e); } }</code><technical_language>do in super.initTrace()? way, wil solved for trace types, pcap</technical_language>

Target:
public synchronized void initTrace(@Nullable IResource resource, @Nullable String path, @Nullable Class<? extends ITmfEvent> type) throws TmfTraceException { super.initTrace(resource, path, type); if (path == null) { throw new TmfTraceException("No path has been specified."); } try { fPcapFile = new PcapFile(path); } catch (IOException | BadPcapFileException e) { throw new TmfTraceException(e.getMessage(), e); } }
Source:
<code>protected String execute(Jedis client, String[] tokens) { <START> String result = client.geoadd(tokens[1], Double.valueOf(tokens[2]), <END> Double.valueOf(tokens[3]), tokens[4]) + ""; return result; }</code><technical_language>prefer wrapping String.valueOf() call toString() if same, this is simpler OK me</technical_language>

Target:
protected String execute(Jedis client, String[] tokens) { String result = client.geoadd(tokens[1], Double.valueOf(tokens[2]), Double.valueOf(tokens[3]), tokens[4]).toString(); return result; }
Source:
<code>public void write() throws StoreException, IOException { logger.info("writing index to disk for {}", indexFile.getPath()); File temp = new File(indexFile.getAbsolutePath() + ".tmp"); FileOutputStream fileStream = new FileOutputStream(temp); CrcOutputStream crc = new CrcOutputStream(fileStream); DataOutputStream writer = new DataOutputStream(crc); synchronized(lock) { try { long fileEndPointer = logEndOffset.get(); log.flush(); writer.writeShort(BlobPersistantIndex.version); for (Map.Entry<StoreKey, BlobIndexValue> entry : index.entrySet()) { writer.write(entry.getKey().toBytes()); writer.write(entry.getValue().getBytes().array()); } writer.writeLong(fileEndPointer); long crcValue = crc.getValue(); writer.writeLong(crcValue); fileStream.getChannel().force(true); <START> temp.renameTo(indexFile); <END> } catch (IOException e) { logger.error("IO error while persisting index to disk {}", indexFile.getAbsoluteFile()); throw new StoreException("IO error while persisting index to disk " + indexFile.getAbsolutePath(), e, StoreErrorCodes.IOError); } finally { writer.close(); } } logger.info("Completed writing index to file"); }</code><technical_language>check return code? renameTo return false (under situations, I sure). Java File IO is fragile enough worth checking return code throwing falsely index is persisted is not</technical_language>

Target:
public void write() throws StoreException, IOException { logger.info("writing index to disk for {}", indexFile.getPath()); DataOutputStream writer = null; synchronized(lock) { try { File temp = new File(indexFile.getAbsolutePath() + ".tmp"); FileOutputStream fileStream = new FileOutputStream(temp); CrcOutputStream crc = new CrcOutputStream(fileStream); writer = new DataOutputStream(crc); long fileEndPointer = logEndOffset.get(); log.flush(); writer.writeShort(BlobIndex.version); for (Map.Entry<StoreKey, BlobIndexValue> entry : index.entrySet()) { writer.write(entry.getKey().toBytes()); writer.write(entry.getValue().getBytes().array()); } writer.writeLong(fileEndPointer); long crcValue = crc.getValue(); writer.writeLong(crcValue); fileStream.getChannel().force(true); temp.renameTo(indexFile); } catch (IOException e) { logger.error("IO error while persisting index to disk {}", indexFile.getAbsoluteFile()); throw new StoreException("IO error while persisting index to disk " + indexFile.getAbsolutePath(), e, StoreErrorCodes.IOError); } finally { if (writer != null) writer.close(); } } logger.info("Completed writing index to file"); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dynamic_setters); ButterKnife.bind(this); currentTileSize = MaterialCalendarView.DEFAULT_TILE_SIZE_DP; currentTileWidth = MaterialCalendarView.DEFAULT_TILE_SIZE_DP; currentTileHeight = MaterialCalendarView.DEFAULT_TILE_SIZE_DP; widget.setOnTitleClickListener(new View.OnClickListener() { @Override public void onClick(final View view) { <START> Toast.makeText(DynamicSettersActivity.this, "Today is the day", Toast.LENGTH_SHORT) <END> .show(); } }); }</code><technical_language>string resources? matter</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dynamic_setters); ButterKnife.bind(this); currentTileSize = MaterialCalendarView.DEFAULT_TILE_SIZE_DP; currentTileWidth = MaterialCalendarView.DEFAULT_TILE_SIZE_DP; currentTileHeight = MaterialCalendarView.DEFAULT_TILE_SIZE_DP; widget.setOnTitleClickListener(new View.OnClickListener() { @Override public void onClick(final View view) { Toast.makeText(DynamicSettersActivity.this, R.string.today, Toast.LENGTH_SHORT) .show(); } }); }
Source:
<code>public void testIsProcessAlive() throws Exception { String randomUser = RandomStringUtils.randomAlphanumeric(12); Collection<Long> pids = getRunningProcessIds(); Assert.isNonEmpty(pids); for (long pid: pids) { boolean status = Container.isProcessAlive(pid, randomUser); <START> org.junit.Assert.assertFalse("Random user " + randomUser + " is not expected to own any process", status); <END> } boolean status = false; String currentUser = System.getProperty("user.name"); for (long pid: pids) { if (Container.isProcessAlive(pid, currentUser)) { status = true; break; } } org.junit.Assert.assertTrue("Expecting user " + currentUser + " to own at least one process", status); }</code><technical_language>import org.junit.Assert this line cleaner</technical_language>

Target:
public void testIsProcessAlive() throws Exception { String randomUser = RandomStringUtils.randomAlphanumeric(12); Collection<Long> pids = getRunningProcessIds(); assertFalse(pids.isEmpty()); for (long pid: pids) { boolean status = Container.isProcessAlive(pid, randomUser); assertFalse("Random user " + randomUser + " is not expected to own any process", status); } boolean status = false; String currentUser = System.getProperty("user.name"); for (long pid: pids) { if (Container.isProcessAlive(pid, currentUser)) { status = true; break; } } assertTrue("Expecting user " + currentUser + " to own at least one process", status); }
Source:
<code>public void testConnectionTypeHasCorrectIsClientOriented() throws Exception { final boolean result = connType.isClientOriented(); <START> assertTrue(result == expected); <END> }</code><technical_language>change this assertEquals(expected, result)</technical_language>

Target:
public void testConnectionTypeHasCorrectIsClientOriented() throws Exception { final boolean result = connType.isClientOriented(); assertEquals(result, expected); }
Source:
<code>protected AbstractS3ATokenIdentifier( final Text kind, final URI uri, final Text owner, final Text renewer, final String origin, final EncryptionSecrets encryptionSecrets) { <START> this(kind, owner, renewer, new Text(), uri); <END> this.origin = requireNonNull(origin); this.encryptionSecrets = requireNonNull(encryptionSecrets); }</code><technical_language>renewer null. add a new Text() if a null in</technical_language>

Target:
protected AbstractS3ATokenIdentifier( final Text kind, final URI uri, final Text owner, final Text renewer, final String origin, final EncryptionSecrets encryptionSecrets) { this(kind, owner, (renewer != null ? renewer : new Text()), new Text(), uri); this.origin = requireNonNull(origin); this.encryptionSecrets = requireNonNull(encryptionSecrets); }
Source:
<code>private void raiseViolationOnDuplicateLandmarkRole(List<TagNode> nodes) { <START> Map<String, List<TagNode>> matched = nodes.stream().collect(Collectors.groupingBy(node -> node.getAttribute("role"))); <END> for (List<TagNode> matches : matched.values()) { raiseViolationOnSize(matches); } }</code><technical_language>Grouping of role attribute case insentitive. Currently, if is element role="Banner another role="banner", grouped</technical_language>

Target:
private void raiseViolationOnDuplicateLandmarkRole(List<TagNode> nodes) { Map<String, List<TagNode>> matched = nodes.stream().collect(Collectors.groupingBy(node -> node.getAttribute("ROLE").toUpperCase(Locale.ROOT))); for (List<TagNode> matches : matched.values()) { List<TagNode> labeless = matches.stream().filter(match -> !hasAriaLabel(match)).collect(Collectors.toList()); if (labeless.size() > 1 || matches.size() > 1) { for (TagNode node : labeless) { createViolation(node.getStartLinePosition(), "Add an \"aria-label\" or \"aria-labbelledby\" attribute to this element."); } } } }
Source:
<code>public void getUserAuthenticated() throws IOException { service = new GmailServiceMaker(username).makeGmailService(); int retryLimit = 5; while (retryLimit > 0) { try { retryLimit--; <START> service.users().messages().list(username).setMaxResults(1L).execute(); <END> break; } catch (HttpResponseException e) { if (e.getStatusCode() == HttpStatusCodes.STATUS_CODE_FORBIDDEN || e.getStatusCode() == HttpStatusCodes.STATUS_CODE_UNAUTHORIZED || e.getStatusCode() == HttpStatusCodes.STATUS_CODE_BAD_REQUEST) { System.out.println(e.getMessage()); service = new GmailServiceMaker(username, true).makeGmailService(); } else { throw new IOException(e); } } } }</code><technical_language>able getListOfUnreadEmailFromSender</technical_language>

Target:
public void getUserAuthenticated() throws IOException { service = new GmailServiceMaker(username).makeGmailService(); int retryLimit = 5; while (retryLimit > 0) { try { retryLimit--; getListOfUnreadEmailFromSender(1L, ""); break; } catch (HttpResponseException e) { if (e.getStatusCode() == HttpStatusCodes.STATUS_CODE_FORBIDDEN || e.getStatusCode() == HttpStatusCodes.STATUS_CODE_UNAUTHORIZED || e.getStatusCode() == HttpStatusCodes.STATUS_CODE_BAD_REQUEST) { System.out.println(e.getMessage()); service = new GmailServiceMaker(username, true).makeGmailService(); } else { throw new IOException(e); } } } }
Source:
<code>public void isActionFailed_GUIDAccessDeniedVerifiesTrueKey() { pushResponse.response.accumulate("guid_access_denied", true); <START> Assert.assertTrue(pushResponse.isActionFailed_GUIDAccessDenied()); <END> }</code><technical_language>A test check other state. Set key false, check response is false</technical_language>

Target:
public void isActionFailed_GUIDAccessDeniedVerifiesTrueKey() { pushResponse.response.accumulate("guid_access_denied", true); Assert.assertTrue(pushResponse.isActionFailed_GUIDAccessDenied()); pushResponse.response.clear(); pushResponse.response.accumulate("guid_access_denied", false); Assert.assertFalse(pushResponse.isActionFailed_GUIDAccessDenied()); }
Source:
<code>public ContextHolder(T context, Class<T> type, Set<Annotation> qualifiers) { this.context = context; this.type = type; <START> this.qualifiers = asSet(DefaultLiteral.INSTANCE, AnyLiteral.INSTANCE); <END> this.qualifiers.addAll(qualifiers); }</code><technical_language>This is unnecessary. set of qualifiers is expected elements. org.jboss.weld.bootstrap.WeldStartup.createContexts(ServiceRegistry) other places this constructor is used</technical_language>

Target:
public ContextHolder(T context, Class<T> type, Set<Annotation> qualifiers) { this.context = context; this.type = type; this.qualifiers = qualifiers; }
Source:
<code>private void notifyRemove(Collection<IProjectAdapter> adapters) { synchronized (listeners) { try { for (IProjectAdapter a : adapters) { <START> listeners.forEach(l->l.handleRemoveFromCache(this, a)); <END> } }catch(Exception e) { Trace.error("Exception while trying to notify cache listener", e); } } }</code><technical_language>@jcantrill Cache listeners notified of removed IProjectAdapter removed 'cache' map. is fine. However, DeploymentResourceMapper is a listener ConnectionsRegistry, handled garbage collector maps built. I suggest public void IProjectAdapter.dispose() { mapper.dispose(); } public void DeploymentResourceMapper.dispose() { ConnectionsRegistrySingleton.getInstance().removeListener(connectionListener); cache.dispose(); //clean maps for faster memory cleaning. } public void ObservableResourceCache.dispose() { //clean maps collections for faster memory cleaning. }</technical_language>

Target:
private void notifyRemove(Collection<IProjectAdapter> adapters) { synchronized (listeners) { try { for (IProjectAdapter a : adapters) { listeners.forEach(l->l.handleRemoveFromCache(this, a)); a.dispose(); } }catch(Exception e) { Trace.error("Exception while trying to notify cache listener", e); } } }
Source:
<code>protected void createCommentEditor(final int suggestRow, final int column, final int line, final short file) { <START> createCommentEditor(suggestRow, column, line, file, ""); <END> }</code><technical_language>existing rows null "" for parentUuid</technical_language>

Target:
protected void createCommentEditor(final int suggestRow, final int column, final int line, final short file) { createCommentEditor(suggestRow, column, line, file, null ); }
Source:
<code>private WindowDefinition getWindowDefinition(Optional<Window> maybeWindow, ExpressionAnalysisContext context) { if (!maybeWindow.isPresent()) { return null; } Window window = maybeWindow.get(); List<Symbol> partitionSymbols = new ArrayList<>(window.getPartitions().size()); for (Expression partition : window.getPartitions()) { Symbol symbol = convert(partition, context); SemanticSortValidator.validate(symbol, "PARTITION BY"); partitionSymbols.add(symbol); } OrderBy orderBy = OrderyByAnalyzer.analyzeSortItems(window.getOrderBy(), sortKey -> { Symbol symbol = convert(sortKey, context); SemanticSortValidator.validate(symbol); return symbol; }); WindowFrameDefinition windowFrameDefinition = WindowDefinition.UNBOUNDED_PRECEDING_CURRENT_ROW; if (window.getWindowFrame().isPresent()) { WindowFrame windowFrame = window.getWindowFrame().get(); FrameBound start = windowFrame.getStart(); <START> if (start.equals(UNBOUNDED_FOLLOWING)) { <END> throw new IllegalArgumentException("Window frame start cannot be UNBOUNDED FOLLOWING"); } FrameBoundDefinition startBound = convertToAnalyzedFrameBound(context, start); FrameBoundDefinition endBound = new FrameBoundDefinition(FrameBound.Type.CURRENT_ROW); if (windowFrame.getEnd().isPresent()) { FrameBound end = windowFrame.getEnd().get(); if (end.equals(UNBOUNDED_PRECEDING)) { throw new IllegalArgumentException("Window frame end cannot be UNBOUNDED PRECEDING"); } endBound = convertToAnalyzedFrameBound(context, end); } windowFrameDefinition = new WindowFrameDefinition(windowFrame.getType(), startBound, endBound); } return new WindowDefinition(partitionSymbols, orderBy, windowFrameDefinition); }</code><technical_language>Do need checks in WindowAgg operator? If this code handle other definitions I limitation is closer components handle other definitions</technical_language>

Target:
private WindowDefinition getWindowDefinition(Optional<Window> maybeWindow, ExpressionAnalysisContext context) { if (!maybeWindow.isPresent()) { return null; } Window window = maybeWindow.get(); List<Symbol> partitionSymbols = new ArrayList<>(window.getPartitions().size()); for (Expression partition : window.getPartitions()) { Symbol symbol = convert(partition, context); SemanticSortValidator.validate(symbol, "PARTITION BY"); partitionSymbols.add(symbol); } OrderBy orderBy = OrderyByAnalyzer.analyzeSortItems(window.getOrderBy(), sortKey -> { Symbol symbol = convert(sortKey, context); SemanticSortValidator.validate(symbol); return symbol; }); WindowFrameDefinition windowFrameDefinition = WindowDefinition.UNBOUNDED_PRECEDING_CURRENT_ROW; if (window.getWindowFrame().isPresent()) { WindowFrame windowFrame = window.getWindowFrame().get(); FrameBound start = windowFrame.getStart(); FrameBoundDefinition startBound = convertToAnalyzedFrameBound(context, start); FrameBoundDefinition endBound = windowFrame.getEnd() .map(end -> convertToAnalyzedFrameBound(context, end)) .orElse(new FrameBoundDefinition(FrameBound.Type.CURRENT_ROW)); windowFrameDefinition = new WindowFrameDefinition(windowFrame.getType(), startBound, endBound); } return new WindowDefinition(partitionSymbols, orderBy, windowFrameDefinition); }
Source:
<code>public Timeline createTimeline(final Timeline timeline) { try { jdbcTemplate.update( "INSERT INTO zn_data.timeline(" + " tl_id, et_name, tl_order, st_id, tl_topic, " + " tl_created_at, tl_switched_at, tl_cleanup_at, tl_latest_position) " + " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?::jsonb)", <START> timeline.getId(), <END> timeline.getEventType(), timeline.getOrder(), timeline.getStorage().getId(), timeline.getTopic(), timeline.getCreatedAt(), timeline.getSwitchedAt(), timeline.getCleanupAt(), timeline.getLatestPosition() == null ? null : jsonMapper.writer().writeValueAsString(timeline.getLatestPosition())); return timeline; } catch (final JsonProcessingException ex) { throw new IllegalArgumentException("Can not serialize latest position to json", ex); } }</code><technical_language>happen if id is null</technical_language>

Target:
public Timeline createTimeline(final Timeline timeline) { if (null == timeline.getId()) { throw new IllegalArgumentException("Timeline id can not be null on create (" + timeline + ")"); } try { jdbcTemplate.update( "INSERT INTO zn_data.timeline(" + " tl_id, et_name, tl_order, st_id, tl_topic, " + " tl_created_at, tl_switched_at, tl_cleanup_at, tl_latest_position) " + " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?::jsonb)", timeline.getId(), timeline.getEventType(), timeline.getOrder(), timeline.getStorage().getId(), timeline.getTopic(), timeline.getCreatedAt(), timeline.getSwitchedAt(), timeline.getCleanupAt(), timeline.getLatestPosition() == null ? null : jsonMapper.writer().writeValueAsString(timeline.getLatestPosition())); return timeline; } catch (final JsonProcessingException ex) { throw new IllegalArgumentException("Can not serialize latest position to json", ex); } }
Source:
<code>public Iterable<E> getSubgraphContaining(E element) { <START> final Node<E> node = nodes.get(element); <END> if (node != null) { return new SubgraphBuilder<E>(node).build(); } return Collections.emptyList(); }</code><technical_language>this is thread safe, nodes modified while building subgraph. I suggest Lock for reading writing instead of synchronized blocks</technical_language>

Target:
public Iterable<E> getSubgraphContaining(E element) { synchronized(nodes) { final Node<E> node = nodes.get(element); if (node != null) { return new SubgraphBuilder<E>(node).build(); } return Collections.emptyList(); } }
Source:
<code>private void addFolderContentsToZip(String srcFolder, ZipOutputStream zip) { File folder = new File(srcFolder); String[] fileList = folder.list(); try { if (fileList != null) { int i = 0; while (true) { if (fileList.length == i) break; if (new File(folder, fileList[i]).isDirectory()) { zip.putNextEntry(new ZipEntry(fileList[i] + File.separator)); zip.closeEntry(); } addToZip("", srcFolder + File.separator + fileList[i], zip); i++; } } <START> } catch (Exception ex) { <END> getLog().error("Error occurred while creating CAR file. " + ex); } }</code><technical_language>catch specific exception</technical_language>

Target:
private void addFolderContentsToZip(String srcFolder, ZipOutputStream zip) throws ArchiveException { File folder = new File(srcFolder); String[] fileList = folder.list(); if (fileList == null) { return; } try { int i = 0; while (true) { if (fileList.length == i) break; if (new File(folder, fileList[i]).isDirectory()) { zip.putNextEntry(new ZipEntry(fileList[i] + File.separator)); zip.closeEntry(); } addToZip(Constants.EMPTY_STRING, srcFolder + File.separator + fileList[i], zip); i++; } } catch (IOException ex) { throw new ArchiveException(Constants.ARCHIVE_EXCEPTION_MSG, ex); } }
Source:
<code>public void fileMappedWithDeleteOnCloseShouldNotFlushDirtyPagesOnClose() throws Exception { AtomicInteger flushCounter = new AtomicInteger(); PageSwapperFactory swapperFactory = flushCountingPageSwapperFactory( flushCounter ); swapperFactory.open( fs, Configuration.EMPTY ); try ( PageCache cache = createPageCache( swapperFactory, maxPages, PageCacheTracer.NULL, PageCursorTracerSupplier.NULL, EmptyVersionContextSupplier.EMPTY ) ) { File file = file( "a" ); <START> try ( PagedFile pf = cache.map( file, filePageSize, DELETE_ON_CLOSE ); WritableByteChannel channel = pf.openWritableByteChannel() ) <END> { generateFileWithRecords( channel, recordCount, recordSize ); } } assertThat( flushCounter.get(), lessThan( recordCount / recordsPerFilePage ) ); }</code><technical_language>move file creation merge try clauses get rid of nested blocks</technical_language>

Target:
public void fileMappedWithDeleteOnCloseShouldNotFlushDirtyPagesOnClose() throws Exception { AtomicInteger flushCounter = new AtomicInteger(); PageSwapperFactory swapperFactory = flushCountingPageSwapperFactory( flushCounter ); swapperFactory.open( fs, Configuration.EMPTY ); File file = file( "a" ); try ( PageCache cache = createPageCache( swapperFactory, maxPages, PageCacheTracer.NULL, PageCursorTracerSupplier.NULL, EmptyVersionContextSupplier.EMPTY ); PagedFile pf = cache.map( file, filePageSize, DELETE_ON_CLOSE ); WritableByteChannel channel = pf.openWritableByteChannel() ) { generateFileWithRecords( channel, recordCount, recordSize ); } assertThat( flushCounter.get(), lessThan( recordCount / recordsPerFilePage ) ); }
Source:
<code>public <T> List<T> getList(String key, Class<T> type) { for (Config child : children) { if (child.containsKey(key)) { return child.getList(key, type); } } <START> return null; <END> }</code><technical_language>call notFound</technical_language>

Target:
public <T> List<T> getList(String key, Class<T> type) { for (Config child : children) { if (child.containsKey(key)) { return child.getList(key, type); } } return notFound(key); }
Source:
<code>public static MultiPlaceEvent onPlayerMultiBlockPlace(EntityPlayer player, List<BlockSnapshot> blockSnapshots, EnumFacing direction) <START> { <END> BlockSnapshot snap = blockSnapshots.get(0); IBlockState placedAgainst = snap.getWorld().getBlockState(snap.getPos().offset(direction.getOpposite())); MultiPlaceEvent event = new MultiPlaceEvent(blockSnapshots, placedAgainst, player); MinecraftForge.EVENT_BUS.post(event); return event; }</code><technical_language>Dont duplicate code, bounce new argument null, this more obvious remove deleting deprecated functions. illustrates parameter null</technical_language>

Target:
public static MultiPlaceEvent onPlayerMultiBlockPlace(EntityPlayer player, List<BlockSnapshot> blockSnapshots, EnumFacing direction) { return onPlayerMultiBlockPlace(player, blockSnapshots, direction, null); }
Source:
<code>public void testSerialize() { Set<Property> props = new HashSet<Property>(); Property prop1 = new Property(); prop1.setName("testProp1"); prop1.setValue("testValue1"); prop1.setType(PropertyType.Text); props.add(prop1); Property prop2 = new Property(); prop2.setName("testProp2"); prop2.setValue("testValue2"); prop2.setType(PropertyType.Number); props.add(prop2); SourceInfo si = new SourceInfo(); si.setId("testId"); si.setDuration(500); si.setFragmentId("fragId"); si.setHostAddress("hostAddr"); si.setHostName("hostName"); si.setMultipleConsumers(true); si.setEndpoint(new EndpointRef("sourceUri", "sourceOp", false)); si.setProperties(props); <START> si.setTimestamp(TimeUnit.NANOSECONDS.toMicros(System.nanoTime())); <END> SourceInfo result = null; try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(si); oos.flush(); oos.close(); baos.close(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); ObjectInputStream ois = new ObjectInputStream(bais); result = (SourceInfo) ois.readObject(); bais.close(); ois.close(); } catch (Exception e) { e.printStackTrace(); fail("Failed to serialize: " + e); } assertNotNull(result); assertEquals(result, si); }</code><technical_language>original code currentTimeMillis, converted micros</technical_language>

Target:
public void testSerialize() { Set<Property> props = new HashSet<Property>(); Property prop1 = new Property(); prop1.setName("testProp1"); prop1.setValue("testValue1"); prop1.setType(PropertyType.Text); props.add(prop1); Property prop2 = new Property(); prop2.setName("testProp2"); prop2.setValue("testValue2"); prop2.setType(PropertyType.Number); props.add(prop2); SourceInfo si = new SourceInfo(); si.setId("testId"); si.setDuration(500); si.setFragmentId("fragId"); si.setHostAddress("hostAddr"); si.setHostName("hostName"); si.setMultipleConsumers(true); si.setEndpoint(new EndpointRef("sourceUri", "sourceOp", false)); si.setProperties(props); si.setTimestamp(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis())); SourceInfo result = null; try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(si); oos.flush(); oos.close(); baos.close(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); ObjectInputStream ois = new ObjectInputStream(bais); result = (SourceInfo) ois.readObject(); bais.close(); ois.close(); } catch (Exception e) { e.printStackTrace(); fail("Failed to serialize: " + e); } assertNotNull(result); assertEquals(result, si); }
Source:
<code>public Path decryptAsFile(String filePathOrEncrypted) { Path decryptedFile = getCachedSecretFile(filePathOrEncrypted); if (decryptedFile != null) { return decryptedFile; } String decryptedContents = decrypt(filePathOrEncrypted); <START> if (decryptedContents.equals(filePathOrEncrypted)) { <END> return Paths.get(filePathOrEncrypted); } decryptedFile = decryptedFilePath("tmp", decryptedContents); cacheSecretFile(filePathOrEncrypted, decryptedFile); return decryptedFile; }</code><technical_language>This throw NPE if decryptedContents is null - wrap in StringUtils.equals()</technical_language>

Target:
public Path decryptAsFile(String filePathOrEncrypted) { Path decryptedFile = getCachedSecretFile(filePathOrEncrypted); if (decryptedFile != null) { return decryptedFile; } String decryptedContents = decrypt(filePathOrEncrypted); if (StringUtils.equals(decryptedContents, filePathOrEncrypted)) { return Paths.get(filePathOrEncrypted); } decryptedFile = decryptedFilePath("tmp", decryptedContents); cacheSecretFile(filePathOrEncrypted, decryptedFile); return decryptedFile; }
Source:
<code>private Metadata createMetadata(String tableName) { Metadata metadata = new Metadata(); BigtableInstanceName instanceName = this.bigtableOptions.getInstanceName(); if (instanceName != null) { String projectId = this.bigtableOptions.getProjectId(); String instanceId = this.bigtableOptions.getInstanceId(); String tableId = instanceName.toTableId(tableName); <START> metadata.put(GRPC_PARAMS_KEY, String.format("[project_id=%s,instance_id=m%s,table_id=%s]", <END> projectId, instanceId, tableId)); } return metadata; }</code><technical_language>Is "m" in "m%s" a typo</technical_language>

Target:
private Metadata createMetadata(String tableName) { Metadata metadata = new Metadata(); if (tableName != null) { metadata.put(GRPC_RESOURCE_PREFIX_KEY, tableName); } return metadata; }
Source:
<code>public void testSweeperFailsHalfwayThroughOnDeleteTable() throws InterruptedException { createTable(SweepStrategy.CONSERVATIVE); putIntoDefaultColumn("foo", "bar", 50); putIntoDefaultColumn("foo2", "bang", 75); putIntoDefaultColumn("foo3", "baz", 100); putIntoDefaultColumn("foo4", "buzz", 125); byte[] nextStartRow = partialSweep(150).getNextStartRow().get(); kvs.dropTable(TABLE_NAME); SweepResults results = sweepRunner.run( TABLE_NAME, ImmutableSweepBatchConfig.builder() .deleteBatchSize(DEFAULT_BATCH_SIZE) .candidateBatchSize(DEFAULT_BATCH_SIZE) .maxCellTsPairsToExamine(DEFAULT_BATCH_SIZE) .build(), nextStartRow); <START> Thread.sleep(1); <END> assertEquals(SweepResults.createEmptySweepResult(Optional.empty()), results); }</code><technical_language>left debugging. remove</technical_language>

Target:
public void testSweeperFailsHalfwayThroughOnDeleteTable() { createTable(SweepStrategy.CONSERVATIVE); putIntoDefaultColumn("foo", "bar", 50); putIntoDefaultColumn("foo2", "bang", 75); putIntoDefaultColumn("foo3", "baz", 100); putIntoDefaultColumn("foo4", "buzz", 125); byte[] nextStartRow = partialSweep(150).getNextStartRow().get(); kvs.dropTable(TABLE_NAME); SweepResults results = sweepRunner.run( TABLE_NAME, ImmutableSweepBatchConfig.builder() .deleteBatchSize(DEFAULT_BATCH_SIZE) .candidateBatchSize(DEFAULT_BATCH_SIZE) .maxCellTsPairsToExamine(DEFAULT_BATCH_SIZE) .build(), nextStartRow); assertEquals(SweepResults.createEmptySweepResult(Optional.empty()), results); }
Source:
<code>public Object clone() throws CloneNotSupportedException { super.clone(); CommandContext ctx = new CommandContext(); ctx.setFromContext(this); <START> return this.duplicate(); <END> }</code><technical_language>clone duplicate... duplicate alias of clone. hmmm... created infinite loop? clone->duplicate->clone? this entire logic is incorrect... be, line: CommandContext cloned = (CommandContext)super.clone(); cloned.setFromContext(this); return cloned;</technical_language>

Target:
public Object clone() { return new CommandContext(this); }
Source:
<code>public ChainedTokenCredential build() { <START> return new ChainedTokenCredential(credentials); <END> }</code><technical_language>consider making a copy of credentials here, get modified if user continues user builder modify credentials</technical_language>

Target:
public ChainedTokenCredential build() { return new ChainedTokenCredential(new ArrayDeque<>(credentials)); }
Source:
<code><START> private boolean hasEnoughBytes(ByteBuf in) { <END> if(in.readableBytes() >= this.requiredBytes) { return true; } return false; }</code><technical_language>shorthand java private boolean hasEnoughBytes(ByteBuf in) { in.readableBytes() >= this.requiredBytes }</technical_language>

Target:
private boolean hasEnoughBytes(ByteBuf in) { return in.readableBytes() >= requiredBytes; }
Source:
<code>public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { getInputStream().available(); } catch (Exception e) { disconnect(); synchronized (this) { this.notify(); } break; } try { <START> if (getInputStream().available() > 0) { <END> synchronized (this) { this.notify(); } } } catch (Exception e) { e.printStackTrace(); } break; } }</code><technical_language>This tested in Linux, some machines report 0 data avilable data</technical_language>

Target:
public void serialEvent(SerialPortEvent event) { switch (event.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: try { getInputStream().available(); } catch (Exception e) { close(); synchronized (this) { this.notify(); } break; } try { if (getInputStream().available() > 0) { synchronized (this) { this.notify(); } } } catch (Exception e) { e.printStackTrace(); } break; } }
Source:
<code>private static boolean isInsecureAlgorithm(String algorithmName) { Matcher matcher = ALGORITHM_PATTERN.matcher(algorithmName); <START> if (matcher.find()) { <END> String algorithm = matcher.group(1); String mode = matcher.group(2); String padding = matcher.group(3); if (mode.equals("ECB")) { return true; } else if (mode.equals("CBC")) { return padding.equals("PKCS5Padding") || padding.equals("PKCS7Padding"); } if (algorithm.equals("RSA")) { return !(padding.equals("OAEPWITHSHA-256ANDMGF1PADDING") || padding.equals("OAEPWithSHA-1AndMGF1Padding")); } return false; } return true; }</code><technical_language>usage of find() here. If searching for entire string, I recommend matches() instead. I test case justify finding for subsequences everything</technical_language>

Target:
private static boolean isInsecureAlgorithm(String algorithmName) { Matcher matcher = ALGORITHM_PATTERN.matcher(algorithmName); if (matcher.matches()) { String algorithm = matcher.group(1); String mode = matcher.group(2); String padding = matcher.group(3); if ("ECB".equals(mode)) { return true; } else if ("CBC".equals(mode)) { return "PKCS5Padding".equals(padding) || "PKCS7Padding".equals(padding); } if ("RSA".equals(algorithm)) { return !("OAEPWITHSHA-256ANDMGF1PADDING".equals(padding) || "OAEPWithSHA-1AndMGF1Padding".equals(padding)); } return false; } return true; }
Source:
<code>public void buildOrgUnitProgramRelation(OrganisationUnitExtended sdkOrganisationUnitExtended) { OrgUnitDB appOrgUnit = sdkOrganisationUnitExtended.getAppOrgUnit(); Log.d(TAG, "buildOrgUnitProgramRelation " + appOrgUnit.getName()); for (ProgramExtended sdkProgramExtended : ProgramExtended.getExtendedList( SdkQueries.getProgramsForOrganisationUnit(appOrgUnit.getUid(), ProgramType.WITHOUT_REGISTRATION))) { if(sdkProgramExtended.isValidProgram()) { sdkProgramExtended.setAppProgram( programMapObjects.get(sdkProgramExtended.getUid())); addOrgUnitProgramRelation(sdkOrganisationUnitExtended, sdkProgramExtended); <START> } <END> } }</code><technical_language>loop programs, valid programs. I change getProgramsForOrganisationUnit adding optional parameter (function overloading) determine program type</technical_language>

Target:
public void buildOrgUnitProgramRelation(OrganisationUnitExtended sdkOrganisationUnitExtended) { OrgUnitDB appOrgUnit = sdkOrganisationUnitExtended.getAppOrgUnit(); Log.d(TAG, "buildOrgUnitProgramRelation " + appOrgUnit.getName()); for (ProgramExtended sdkProgramExtended : ProgramExtended.getExtendedList( SdkQueries.getProgramsForOrganisationUnit(appOrgUnit.getUid(), PreferencesState.getInstance().getContext().getString(R.string.pull_program_code, ProgramType.WITHOUT_REGISTRATION), ProgramType.WITHOUT_REGISTRATION))) { sdkProgramExtended.setAppProgram( programMapObjects.get(sdkProgramExtended.getUid())); addOrgUnitProgramRelation(sdkOrganisationUnitExtended, sdkProgramExtended); } }
Source:
<code>private static StageExecutionPlan createPlan(ConnectorSplitSource splitSource) { Symbol symbol = new Symbol("column"); PlanNodeId tableScanNodeId = new PlanNodeId("plan_id"); TableScanNode tableScan = new TableScanNode( tableScanNodeId, new TableHandle(CONNECTOR_ID, new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), Optional.empty(), TupleDomain.all(), null); RemoteSourceNode remote = new RemoteSourceNode(new PlanNodeId("remote_id"), new PlanFragmentId("plan_fragment_id"), ImmutableList.of()); PlanFragment testFragment = new PlanFragment( new PlanFragmentId("plan_id"), new JoinNode(new PlanNodeId("join_id"), INNER, tableScan, remote, ImmutableList.of(), ImmutableList.<Symbol>builder() .addAll(tableScan.getOutputSymbols()) .addAll(remote.getOutputSymbols()) .build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.of(JoinNode.DistributionType.PARTITIONED)), ImmutableMap.of(symbol, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(tableScanNodeId), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(symbol))); return new StageExecutionPlan( testFragment, <START> ImmutableMap.of(tableScanNodeId, new ConnectorAwareSplitSource(CONNECTOR_ID, TestingTransactionHandle.create(), splitSource, SplitSchedulingStrategy.ALL_AT_ONCE)), <END> ImmutableList.of()); }</code><technical_language>static import</technical_language>

Target:
private static StageExecutionPlan createPlan(ConnectorSplitSource splitSource) { Symbol symbol = new Symbol("column"); PlanNodeId tableScanNodeId = new PlanNodeId("plan_id"); TableScanNode tableScan = new TableScanNode( tableScanNodeId, new TableHandle(CONNECTOR_ID, new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), Optional.empty(), TupleDomain.all(), null); RemoteSourceNode remote = new RemoteSourceNode(new PlanNodeId("remote_id"), new PlanFragmentId("plan_fragment_id"), ImmutableList.of()); PlanFragment testFragment = new PlanFragment( new PlanFragmentId("plan_id"), new JoinNode(new PlanNodeId("join_id"), INNER, tableScan, remote, ImmutableList.of(), ImmutableList.<Symbol>builder() .addAll(tableScan.getOutputSymbols()) .addAll(remote.getOutputSymbols()) .build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.of(JoinNode.DistributionType.PARTITIONED)), ImmutableMap.of(symbol, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(tableScanNodeId), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(symbol)), UNGROUPED_EXECUTION); return new StageExecutionPlan( testFragment, ImmutableMap.of(tableScanNodeId, new ConnectorAwareSplitSource(CONNECTOR_ID, TestingTransactionHandle.create(), splitSource, UNGROUPED_SCHEDULING)), ImmutableList.of()); }
Source:
<code>Set<Status> syncableStates() { return EnumSet.of( Status.AVAILABLE, Status.UPDATE_FAILED, Status.ENABLE_SECURITY_FAILED, Status.START_FAILED, Status.STOPPED, Status.STOP_FAILED, Status.AMBIGUOUS, <START> Status.BACKUP_FINISHED, Status.RESTORE_FINISHED <END> ); }</code><technical_language>I pr final setting for this, 2 FAILED statuses also. cc @hreeve-cloudera</technical_language>

Target:
Set<Status> syncableStates() { return EnumSet.of( Status.AVAILABLE, Status.UPDATE_FAILED, Status.ENABLE_SECURITY_FAILED, Status.START_FAILED, Status.STOPPED, Status.STOP_FAILED, Status.AMBIGUOUS, Status.RESTORE_FAILED, Status.BACKUP_FAILED, Status.BACKUP_FINISHED, Status.RESTORE_FINISHED ); }
Source:
<code>GdkColor getContextBackground () { long fontHandle = fontHandle (); long context = OS.gtk_widget_get_style_context (fontHandle); <START> long styleState = OS.gtk_widget_get_state_flags(handle); <END> GdkRGBA rgba = new GdkRGBA (); OS.gtk_style_context_get_background_color (context, (int)styleState, rgba); if (rgba.alpha == 0) { return display.COLOR_WIDGET_BACKGROUND; } GdkColor color = new GdkColor (); color.red = (short)(rgba.red * 0xFFFF); color.green = (short)(rgba.green * 0xFFFF); color.blue = (short)(rgba.blue * 0xFFFF); return color; }</code><technical_language>this shoudl int changed function return int</technical_language>

Target:
GdkColor getContextBackground () { long fontHandle = fontHandle (); long context = OS.gtk_widget_get_style_context (fontHandle); int styleState = OS.gtk_widget_get_state_flags(handle); GdkRGBA rgba = new GdkRGBA (); OS.gtk_style_context_get_background_color (context, styleState, rgba); if (rgba.alpha == 0) { return display.COLOR_WIDGET_BACKGROUND; } GdkColor color = new GdkColor (); color.red = (short)(rgba.red * 0xFFFF); color.green = (short)(rgba.green * 0xFFFF); color.blue = (short)(rgba.blue * 0xFFFF); return color; }
Source:
<code>private Answer executeRequest(SyncDomainCommand cmd) { try { isNuageVspManagerLoaded(); boolean success = _nuageVspManagerClient.syncDomainWithNuageVsp(cmd.getDomainUuid(), cmd.getDomainName(), cmd.getDomainPath(), cmd.isToAdd(), cmd.isToRemove()); return new SyncDomainAnswer(success); <START> } catch (Exception e) { <END> return new SyncDomainAnswer(false); } }</code><technical_language>Log exception error</technical_language>

Target:
private Answer executeRequest(SyncDomainCommand cmd) { try { isNuageVspManagerLoaded(); boolean success = _nuageVspManagerClient.syncDomainWithNuageVsp(cmd.getDomainUuid(), cmd.getDomainName(), cmd.getDomainPath(), cmd.isToAdd(), cmd.isToRemove()); return new SyncDomainAnswer(success); } catch (ExecutionException | ConfigurationException e) { s_logger.error("Failure during " + cmd + " on Nuage VSD " + _hostName, e); return new SyncDomainAnswer(false); } }
Source:
<code>public FlexmarkParser() { MutableDataSet options = new MutableDataSet(); options.set(Parser.EXTENSIONS, Arrays.asList(StrikethroughExtension.create(), TablesExtension.create(), <START> GitLabExtension.create(), <END> UMLExtension.create(), AutolinkExtension.create(), WikiLinkExtension.create(), TypographicExtension.create())); options.set(HtmlRenderer.SOFT_BREAK, "<br />\n"); parser = Parser.builder(options).build(); renderer = HtmlRenderer.builder(options).build(); }</code><technical_language>gitlab extension needed here</technical_language>

Target:
public FlexmarkParser() { MutableDataSet options = new MutableDataSet(); options.set(Parser.EXTENSIONS, Arrays.asList(StrikethroughExtension.create(), TablesExtension.create(), UMLExtension.create(), AutolinkExtension.create(), WikiLinkExtension.create(), TypographicExtension.create())); options.set(HtmlRenderer.SOFT_BREAK, "<br />\n"); parser = Parser.builder(options).build(); renderer = HtmlRenderer.builder(options).build(); }