auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void truncate() throws IOException, InterruptedException, RuntimeException { String token = this.getToken(); openshiftClient = new OpenshiftClientWrapper(this.namespace, this.KUBERNETES_MASTER_URL, token); Pod[] cassandraPods = openshiftClient.getPodsWithPrefix(this.cassandraPodPrefix); ArrayList<String> cassandraHosts = new ArrayList<>(); Arrays.stream(cassandraPods).forEach((pod) -> { cassandraHosts.add(pod.getIP()); }); if (cassandraPods.length > 0 || this.forceTruncation) { if (openshiftClient.hasLargePartition(this.partitionThreshold)) { IndexTruncator truncator = new IndexTruncator(cassandraHosts, this.keyspace, this.useSSL); truncator.setCassandraConnectionMaxDelay(cassandraConnectionMaxDelay); truncator.setCassandraConnectionMaxRetries(cassandraConnectionMaxRetries); int metricsReplicas = openshiftClient.getReplicationControllerScale(this.metricsRC); int heapsterReplicas = openshiftClient.getReplicationControllerScale(this.heapsterRC); openshiftClient.scaleReplicaitonController(this.heapsterRC, 0); openshiftClient.scaleReplicaitonController(this.metricsRC, 0); truncator.execute(); openshiftClient.scaleReplicaitonController(this.heapsterRC, heapsterReplicas); openshiftClient.scaleReplicaitonController(this.metricsRC, metricsReplicas); } else { log.info("Truncation was not necessary, skipping."); } } else { throw new RuntimeException("No cassandra pods available, Is Hawkular Metrics running?"); } }

Target:
public void truncate() throws IOException, InterruptedException, RuntimeException { String token = this.getToken(); openshiftClient = new OpenshiftClientWrapper(this.namespace, this.KUBERNETES_MASTER_URL, token); Pod[] cassandraPods = openshiftClient.getPodsWithPrefix(this.cassandraPodPrefix); ArrayList<String> cassandraHosts = new ArrayList<>(); Arrays.stream(cassandraPods).forEach((pod) -> { cassandraHosts.add(pod.getIP()); }); int replicas; if (cassandraPods.length > 0) { if (openshiftClient.hasLargePartition(this.partitionThreshold, this.keyspace, this.cassandraPodPrefix) || this.forceTruncation) { IndexTruncator truncator = new IndexTruncator(cassandraHosts, this.keyspace, this.useSSL); truncator.setCassandraConnectionMaxDelay(cassandraConnectionMaxDelay); truncator.setCassandraConnectionMaxRetries(cassandraConnectionMaxRetries); replicas = openshiftClient.getReplicationControllerScale(this.metricsRC); if (replicas != 0) { metricsReplicas = replicas; } replicas = openshiftClient.getReplicationControllerScale(this.heapsterRC); if (replicas != 0) { heapsterReplicas = replicas; } openshiftClient.scaleReplicaitonController(this.heapsterRC, 0); openshiftClient.scaleReplicaitonController(this.metricsRC, 0); truncator.execute(); } else { log.info("Truncation was not necessary, skipping."); } } else { throw new RuntimeException("No cassandra pods available, Is Hawkular Metrics running?"); } }
Source:
public ShiftableTextArea() { super(); new KeyboardNavigationHandler(this) { @Override public void onEnter(NativeEvent evt) { super.onEnter(evt); int cursorPos = getCursorPos(); setText(new StringBuilder(getText()).insert(cursorPos, '\n').toString()); setCursorPos(cursorPos + 1); } }; }

Target:
public ShiftableTextArea() { super(); initializeEnterKeyHandler(); }
Source:
public void setBaseOptions(Options options) { setPriorityOptions(options); setNameOptions(options); setIteratorTypeOptions(options); }

Target:
protected void setBaseOptions(Options options) { setPriorityOptions(options); setNameOptions(options); setIteratorTypeOptions(options); }
Source:
public Object last(List<Object> list) { if (list.size() > 0) { return list.get(list.size() - 1); } return null; }

Target:
public Object last(List<Object> list) { ListIterator<Object> it = list.listIterator(list.size()); if (it.hasPrevious()) { return it.previous(); } return null; }
Source:
public <R extends Service> void startService(ServiceBinding<R> serviceBinding) { if ( StartStoppable.class.isInstance( serviceBinding.getService() ) ) { ( (StartStoppable) serviceBinding.getService() ).start( configuration, sessionFactory ); } else { super.startService( serviceBinding ); } }

Target:
public <R extends Service> void startService(ServiceBinding<R> serviceBinding) { super.startService( serviceBinding ); if ( StartStoppable.class.isInstance( serviceBinding.getService() ) ) { ( (StartStoppable) serviceBinding.getService() ).start( configuration, sessionFactory ); } }
Source:
private Set<QualifierKind> findAllTheSupers( @UnderInitialization DefaultQualifierKindHierarchy this, @KeyFor("#2") QualifierKind qualifierKind, Map<DefaultQualifierKind, Set<DefaultQualifierKind>> directSuperMap) { Queue<DefaultQualifierKind> queue = new ArrayDeque<>(directSuperMap.get(qualifierKind)); Set<QualifierKind> allSupers = new TreeSet<>(directSuperMap.get(qualifierKind)); Set<DefaultQualifierKind> visited = new HashSet<>(); while (!queue.isEmpty()) { DefaultQualifierKind superQualKind = queue.remove(); if (superQualKind == qualifierKind) { throw new TypeSystemError("Cycle in hierarchy: %s", qualifierKind); } if (visited.contains(superQualKind)) { continue; } visited.add(superQualKind); if (superQualKind.isPoly()) { continue; } if (directSuperMap.containsKey(superQualKind)) { Set<DefaultQualifierKind> superSuperQuals = directSuperMap.get(superQualKind); queue.addAll(superSuperQuals); allSupers.addAll(superSuperQuals); } else { throw new TypeSystemError( "Found a super qualifier kind not a key in the directSuperMap. Found: %s", superQualKind); } } return allSupers; }

Target:
private Set<QualifierKind> findAllTheSupers( @UnderInitialization DefaultQualifierKindHierarchy this, @KeyFor("#2") QualifierKind qualifierKind, Map<DefaultQualifierKind, Set<DefaultQualifierKind>> directSuperMap) { Set<QualifierKind> allSupers = new TreeSet<>(directSuperMap.get(qualifierKind)); Queue<DefaultQualifierKind> toVisit = new ArrayDeque<>(directSuperMap.get(qualifierKind)); Set<DefaultQualifierKind> visited = new HashSet<>(); while (!toVisit.isEmpty()) { DefaultQualifierKind superQualKind = toVisit.remove(); if (superQualKind == qualifierKind) { throw new TypeSystemError("Cycle in hierarchy: %s", qualifierKind); } if (!visited.add(superQualKind) || superQualKind.isPoly()) { continue; } Set<DefaultQualifierKind> superSuperQuals = directSuperMap.get(superQualKind); if (superSuperQuals == null) { throw new TypeSystemError(superQualKind + " is not a key in the directSuperMap"); } toVisit.addAll(superSuperQuals); allSupers.addAll(superSuperQuals); } return allSupers; }
Source:
private String exportHTML(XWikiContext context) throws XWikiException, IOException { XWikiRequest request = context.getRequest(); String description = request.get("description"); String name = request.get("name"); if (StringUtils.isBlank(name)) { name = context.getDoc().getFullName(); } String[] checkedPages = request.getParameterValues("pages"); String[] uncheckedPages = null; String checkedPagesRequestValue = request.get("checked-pages"); String uncheckedPagesRequestValue = request.get("unchecked-pages"); String otherPagesRequestValue = request.get("other-pages"); boolean otherPages = false; if (!StringUtils.isEmpty(otherPagesRequestValue)) { otherPages = Boolean.valueOf(otherPagesRequestValue); } if (!StringUtils.isEmpty(uncheckedPagesRequestValue)) { uncheckedPages = uncheckedPagesRequestValue.split("&"); } if (!StringUtils.isEmpty(checkedPagesRequestValue)) { checkedPages = checkedPagesRequestValue.split("&"); } Collection<DocumentReference> pageList = resolvePagesToExport(otherPages, checkedPages, uncheckedPages, context); if (pageList.isEmpty()) { return null; } HtmlPackager packager = new HtmlPackager(); if (name != null && name.trim().length() > 0) { packager.setName(name); } if (description != null) { packager.setDescription(description); } packager.addPageReferences(pageList); packager.export(context); return null; }

Target:
private String exportHTML(XWikiContext context) throws XWikiException, IOException { ExportArguments exportArguments = new ExportArguments(context); Collection<DocumentReference> pageList = resolvePages(exportArguments, context); if (pageList.isEmpty()) { return null; } HtmlPackager packager = new HtmlPackager(); if (exportArguments.name != null && exportArguments.name.trim().length() > 0) { packager.setName(exportArguments.name); } if (exportArguments.description != null) { packager.setDescription(exportArguments.description); } packager.addPageReferences(pageList); packager.export(context); return null; }
Source:
public EmailProducerBuilder setToRecipient(String recipient) { List<String> recipients = new ArrayList<String>(); recipients.add(recipient); return this.setToRecipients(recipients); }

Target:
public EmailProducerBuilder setToRecipient(String recipient) { return this.setToRecipients(Arrays.asList(recipient)); }
Source:
public void testSqlTimeType(){ DateConverter converter = new DateConverter(); Map<String, Object> context = new HashMap<>(); context.put(ActionContext.LOCALE, new Locale("es_MX", "MX")); Object value = converter.convertValue(context, null, null, null, TIME_00_59_10, Time.class); assertEquals(Time.valueOf(TIME_00_59_10), value); }

Target:
public void testSqlTimeType() { DateConverter converter = new DateConverter(); Map<String, Object> context = new HashMap<>(); context.put(ActionContext.LOCALE, new Locale("es_MX", "MX")); Object value = converter.convertValue(context, null, null, null, TIME_01_59_10, Time.class); assertEquals("01:59:10", value.toString()); }
Source:
protected void copyFile() throws CVSException { IWorkspaceRoot root =ResourcesPlugin.getWorkspace().getRoot(); String filePath = this.file.getPath(); IFile finalFile = root.getFileForLocation(new Path(filePath)); if(finalFile == null) { throw new CVSException("File '" + filePath + "' can not be found."); } InputStream fileInputStream = null; try { fileInputStream = new BufferedInputStream(new FileInputStream(tempFile)); if(!finalFile.exists()) { finalFile.create(fileInputStream, IResource.FORCE , null); } else { finalFile.setContents(fileInputStream, IResource.FORCE, null); } } catch (FileNotFoundException e) { throw CVSException.wrapException(e); } catch (CoreException e) { throw CVSException.wrapException(e); } finally{ if (fileInputStream != null) { try { fileInputStream.close(); } catch (IOException e) { } finally { if (tempFile != null) tempFile.delete(); } } } }

Target:
protected void copyFile() throws CVSException { IWorkspaceRoot root =ResourcesPlugin.getWorkspace().getRoot(); String filePath = this.file.getPath(); IFile finalFile = root.getFileForLocation(new Path(filePath)); if(finalFile == null) { throw new CVSException("File '" + filePath + "' can not be found in workspace."); } InputStream fileInputStream = null; try { fileInputStream = new BufferedInputStream(new FileInputStream(tempFile)); if(!finalFile.exists()) { finalFile.create(fileInputStream, IResource.FORCE , null); } else { finalFile.setContents(fileInputStream, IResource.FORCE, null); } } catch (FileNotFoundException e) { throw CVSException.wrapException(e); } catch (CoreException e) { throw CVSException.wrapException(e); } finally{ if (fileInputStream != null) { try { fileInputStream.close(); } catch (IOException e) { } finally { if (tempFile != null) tempFile.delete(); } } } }
Source:
SqliteConnectionManager(long poolSize, long poolReaperIntervalMs) { Utils.info(LOGGER, "Initiating connection poll: [poolSize='%d', poolReaperIntervalMs='%d'].", poolSize, poolReaperIntervalMs); try { Class.forName("org.sqlite.JDBC"); } catch (Exception exception) { throw Utils.exception(exception, "Error initiating sqlite driver."); } double poolSizeThreshold = poolSize * 0.9; double connectionsToRemove = poolSize * 0.1; new Thread(() -> { Utils.updateLogId("connection-reaper"); while (!stopPoolReaper) { Utils.debug(LOGGER, "Current pool size is '%d' and threshold is '%f'.", pool.size(), poolSizeThreshold); if (pool.size() > poolSizeThreshold) { Utils.info(LOGGER, "Reaping connections, current pool size %d.", pool.size()); List<PooledConnection> pooledConnections = new ArrayList<>(pool.values()); Collections.sort(pooledConnections); for (int i = 0; i < connectionsToRemove && i < pooledConnections.size(); i++) { pooledConnections.get(i).reapConnection(); } } try { Thread.sleep(poolReaperIntervalMs); } catch (Exception exception) { Thread.currentThread().interrupt(); Utils.warn(LOGGER, "Pool reaper interrupted."); } } Utils.warn(LOGGER, "Pool reaper stop."); }).start(); }

Target:
SqliteConnectionManager(long poolSize, long poolReaperIntervalMs) { if (LOGGER.isInfoEnabled()) { LOGGER.info(String.format("Initiating connection poll: [poolSize='%d', poolReaperIntervalMs='%d'].", poolSize, poolReaperIntervalMs)); } try { Class.forName("org.sqlite.JDBC"); } catch (Exception exception) { throw Utils.exception(exception, "Error initiating sqlite driver."); } double poolSizeThreshold = poolSize * 0.9; double connectionsToRemove = poolSize * 0.1; new Thread(() -> { while (!stopPoolReaper) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(String.format("Current pool size is '%d' and threshold is '%f'.", pool.size(), poolSizeThreshold)); } if (pool.size() > poolSizeThreshold) { if (LOGGER.isInfoEnabled()) { LOGGER.info(String.format("Reaping connections, current pool size %d.", pool.size())); } List<PooledConnection> pooledConnections = new ArrayList<>(pool.values()); Collections.sort(pooledConnections); for (int i = 0; i < connectionsToRemove && i < pooledConnections.size(); i++) { pooledConnections.get(i).reapConnection(); } } try { Thread.sleep(poolReaperIntervalMs); } catch (Exception exception) { Thread.currentThread().interrupt(); if (LOGGER.isWarnEnabled()) { LOGGER.warn("Pool reaper interrupted."); } } } if (LOGGER.isWarnEnabled()) { LOGGER.warn("Pool reaper stop."); } }).start(); }
Source:
private void assertAPIVersionIsAbove(String minimumVersion) throws DockerException, InterruptedException { final String apiVersion = version().apiVersion(); final int versionComparison = compareVersion(apiVersion, minimumVersion); if (versionComparison > 0) { throw new UnsupportedApiVersionException(apiVersion); } }

Target:
private void assertAPIVersionIsAbove(String minimumVersion) throws DockerException, InterruptedException { final String apiVersion = version().apiVersion(); final int versionComparison = compareVersion(apiVersion, minimumVersion); if (versionComparison < 0) { throw new UnsupportedApiVersionException(apiVersion); } }
Source:
protected Map<String, Object> getIcon(DocumentReference userReference) { Map<String, Object> icon = new HashMap<>(); XWikiContext xcontext = this.xcontextProvider.get(); try { XWikiDocument userProfileDocument = xcontext.getWiki().getDocument(userReference, xcontext); String avatar = userProfileDocument.getStringValue("avatar"); XWikiAttachment avatarAttachment = userProfileDocument.getAttachment(avatar); if (avatarAttachment != null && avatarAttachment.isImage(xcontext)) { icon.put(META_DATA_ICON, xcontext.getWiki().getURL(avatarAttachment.getReference(), "download", "width=30&height=30&keepAspectRatio=true", null, xcontext)); } } catch (XWikiException e) { this.logger.warn( "Failed to read the avatar of user [{}]. Root cause is [{}]. Using the default avatar instead.", userReference.getName(), ExceptionUtils.getRootCauseMessage(e)); } if (!icon.containsKey(META_DATA_ICON)) { icon.put(META_DATA_ICON, xcontext.getWiki().getSkinFile("icons/xwiki/noavatar.png", true, xcontext)); } return icon; }

Target:
protected Map<String, Object> getIcon(DocumentReference userReference) { Map<String, Object> icon = new HashMap<>(); XWikiContext xcontext = this.xcontextProvider.get(); try { XWikiDocument userProfileDocument = xcontext.getWiki().getDocument(userReference, xcontext); String avatar = userProfileDocument.getStringValue("avatar"); XWikiAttachment avatarAttachment = userProfileDocument.getAttachment(avatar); if (avatarAttachment != null && avatarAttachment.isImage(xcontext)) { icon.put(IconManager.META_DATA_URL, xcontext.getWiki().getURL(avatarAttachment.getReference(), "download", "width=30&height=30&keepAspectRatio=true", null, xcontext)); icon.put(IconManager.META_DATA_ICON_SET_TYPE, IconType.IMAGE.name()); } } catch (XWikiException e) { this.logger.warn( "Failed to read the avatar of user [{}]. Root cause is [{}]. Using the default avatar instead.", userReference.getName(), ExceptionUtils.getRootCauseMessage(e)); } if (!icon.containsKey(IconManager.META_DATA_URL)) { try { icon = this.iconManager.getMetaData(DEFAULT_ICON_NAME); } catch (IconException e) { this.logger.warn("Error getting the icon [{}]. Root cause is [{}].", DEFAULT_ICON_NAME, ExceptionUtils.getRootCause(e)); } } return icon; }
Source:
public List<LockWithClient> getLocks() { return ImmutableList.copyOf(Iterables.transform(lockHolders.entrySet(), TO_LOCK_WITH_CLIENT_FUNCTION)); }

Target:
public List<LockWithClient> getLocks() { return lockHolders.entrySet() .stream() .map(input -> ImmutableLockWithClient.builder() .lockDescriptor(input.getKey()) .lockClient(input.getValue()) .build()) .collect(Collectors.toList()); }
Source:
private void testNoEntryMergePolicyConfigured() { Exceptions.expectException(CacheException.class, () -> ConflictManagerFactory.get(getCache(0)).resolveConflicts()); }

Target:
public void testNoEntryMergePolicyConfigured() { Exceptions.expectException(CacheException.class, () -> ConflictManagerFactory.get(getCache(0)).resolveConflicts()); }
Source:
public static void main(String[] args) { System.out.println("Running the interpreter."); if(args.length != 1) { System.err.println("usage: wyvern <filename>"); System.exit(1); } String filename = args[0]; Path filepath = Paths.get(filename); if(!Files.isReadable(filepath)) { System.err.println("Cannot read file " + filename); System.exit(-1); } String source = TestUtil.readFile(filepath.toAbsolutePath().toString()); try { ExpressionAST ast = (ExpressionAST) TestUtil.getNewAST(source); Expression program = ast.generateIL(GenContext.empty()); TypeContext ctx = TypeContext.empty(); program.typeCheck(ctx); Value v = program.interpret(EvalContext.empty()); System.out.println(v.toString()); } catch(ParseException e) { System.err.println("Failed to parse file."); e.printStackTrace(); } }

Target:
public static void main(String[] args) { if(args.length != 1) { System.err.println("usage: wyvern <filename>"); System.exit(1); } String filename = args[0]; Path filepath = Paths.get(filename); if(!Files.isReadable(filepath)) { System.err.println("Cannot read file " + filename); System.exit(1); } String source = TestUtil.readFile(filepath.toAbsolutePath().toString()); try { ExpressionAST ast = (ExpressionAST) TestUtil.getNewAST(source); Expression program = ast.generateIL(GenContext.empty()); TypeContext ctx = TypeContext.empty(); program.typeCheck(ctx); Value v = program.interpret(EvalContext.empty()); System.out.println(v.toString()); } catch(ParseException e) { System.err.println(e.toString()); } catch(ToolError e) { System.err.println(e.getTypecheckingErrorMessage().toString()); } }
Source:
public static String[] getBootClassPathJars() { String classpath = null; String javaVersion = System.getProperty("java.specification.version"); if (javaVersion.equals("9") || javaVersion.equals("10") || javaVersion.equals("11")) { try { classpath = String.join( File.pathSeparator, Files.list(Paths.get(System.getenv("JAVA_HOME"), "jmods")) .map(x -> x.toString()) .collect(Collectors.toList())); } catch (IOException e) { } } else { classpath = System.getProperty("sun.boot.class.path"); } if (classpath == null) { throw new IllegalStateException("could not find boot classpath"); } String[] jars = classpath.split(File.pathSeparator); ArrayList<String> result = new ArrayList<>(); for (String jar : jars) { if ((jar.endsWith(".jar") || jar.endsWith(".jmod")) && (new File(jar)).exists()) { result.add(jar); } } return result.toArray(new String[0]); }

Target:
public static String[] getBootClassPathJars() { String classpath = null; String javaVersion = System.getProperty("java.specification.version"); if (javaVersion.equals("9") || javaVersion.equals("10") || javaVersion.equals("11")) { try { classpath = String.join( File.pathSeparator, Files.list(Paths.get(System.getenv("JAVA_HOME"), "jmods")) .map(Path::toString) .collect(Collectors.toList())); } catch (IOException e) { throw new IllegalStateException(e); } } else { classpath = System.getProperty("sun.boot.class.path"); } if (classpath == null) { throw new IllegalStateException("could not find boot classpath"); } String[] jars = classpath.split(File.pathSeparator); ArrayList<String> result = new ArrayList<>(); for (String jar : jars) { if ((jar.endsWith(".jar") || jar.endsWith(".jmod")) && (new File(jar)).exists()) { result.add(jar); } } return result.toArray(new String[0]); }
Source:
private boolean checkVdsGroupMatchQuota(QuotaConsumptionParametersWrapper parameters, QuotaConsumptionParameter param) { Quota quota = param.getQuota(); if (param instanceof QuotaVdsConsumptionParameter) { QuotaVdsConsumptionParameter paramVds = (QuotaVdsConsumptionParameter) param; if (paramVds.getVdsGroupId() == null) { parameters.getCanDoActionMessages().add(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID.toString()); log.errorFormat("Quota Vds parameters from command: {0} are missing vds group id", parameters.getAuditLogable().getClass().getName()); return false; } boolean vdsGroupInQuota = false; if(quota.getGlobalQuotaVdsGroup() != null) { vdsGroupInQuota = quota.getGlobalQuotaVdsGroup().getQuotaVdsGroupId().equals(paramVds.getVdsGroupId()); } else { for (QuotaVdsGroup vdsGroup : quota.getQuotaVdsGroups()) { if (vdsGroup.getVdsGroupId().equals(paramVds.getVdsGroupId())) { vdsGroupInQuota = true; break; } } } if (!vdsGroupInQuota) { parameters.getCanDoActionMessages().add(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID.toString()); log.errorFormat("Quota Vds parameters from command: {0}. Vds group does not match quota", parameters.getAuditLogable().getClass().getName()); return false; } } return true; }

Target:
private boolean checkVdsGroupMatchQuota(QuotaConsumptionParametersWrapper parameters, QuotaConsumptionParameter param) { Quota quota = param.getQuota(); QuotaVdsConsumptionParameter paramVds = (QuotaVdsConsumptionParameter) param; if (paramVds.getVdsGroupId() == null) { parameters.getCanDoActionMessages().add(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID.toString()); log.errorFormat("Quota Vds parameters from command: {0} are missing vds group id", parameters.getAuditLogable().getClass().getName()); return false; } boolean vdsGroupInQuota = false; if(quota.getGlobalQuotaVdsGroup() != null) { vdsGroupInQuota = quota.getGlobalQuotaVdsGroup().getVdsGroupId().equals(paramVds.getVdsGroupId()); } else { for (QuotaVdsGroup vdsGroup : quota.getQuotaVdsGroups()) { if (vdsGroup.getVdsGroupId().equals(paramVds.getVdsGroupId())) { vdsGroupInQuota = true; break; } } } if (!vdsGroupInQuota) { parameters.getCanDoActionMessages().add(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID.toString()); log.errorFormat("Quota Vds parameters from command: {0}. Vds group does not match quota", parameters.getAuditLogable().getClass().getName()); return false; } return true; }
Source:
public PrimitiveLongIterator query( IndexQuery... predicates ) throws IndexNotApplicableKernelException { if ( predicates.length != 1 ) { throw new UnsupportedOperationException(); } ensureOpenSeekerClosed(); IndexQuery predicate = predicates[0]; switch ( predicate.type() ) { case exists: treeKeyFrom.initAsLowest(); treeKeyTo.initAsHighest(); return startSeekForInitializedRange(); case exact: ExactPredicate exactPredicate = (ExactPredicate) predicate; Object[] values = new Object[] {exactPredicate.value()}; treeKeyFrom.from( Long.MIN_VALUE, values ); treeKeyTo.from( Long.MAX_VALUE, values ); return startSeekForInitializedRange(); case rangeNumeric: NumberRangePredicate rangePredicate = (NumberRangePredicate) predicate; treeKeyFrom.from( rangePredicate.fromInclusive() ? Long.MIN_VALUE : Long.MAX_VALUE, new Object[] {rangePredicate.from()} ); treeKeyFrom.entityIdIsSpecialTieBreaker = true; treeKeyTo.from( rangePredicate.toInclusive() ? Long.MAX_VALUE : Long.MIN_VALUE, new Object[] {rangePredicate.to()} ); treeKeyTo.entityIdIsSpecialTieBreaker = true; return startSeekForInitializedRange(); default: throw new IllegalArgumentException( "IndexQuery of type " + predicate.type() + " is not supported." ); } }

Target:
public PrimitiveLongIterator query( IndexQuery... predicates ) throws IndexNotApplicableKernelException { if ( predicates.length != 1 ) { throw new UnsupportedOperationException(); } IndexQuery predicate = predicates[0]; switch ( predicate.type() ) { case exists: treeKeyFrom.initAsLowest(); treeKeyTo.initAsHighest(); return startSeekForInitializedRange(); case exact: ExactPredicate exactPredicate = (ExactPredicate) predicate; Value[] values = new Value[] {exactPredicate.value()}; treeKeyFrom.from( Long.MIN_VALUE, values ); treeKeyTo.from( Long.MAX_VALUE, values ); return startSeekForInitializedRange(); case rangeNumeric: NumberRangePredicate rangePredicate = (NumberRangePredicate) predicate; treeKeyFrom.from( rangePredicate.fromInclusive() ? Long.MIN_VALUE : Long.MAX_VALUE, new Value[] {Values.of( rangePredicate.from() )} ); treeKeyFrom.entityIdIsSpecialTieBreaker = true; treeKeyTo.from( rangePredicate.toInclusive() ? Long.MAX_VALUE : Long.MIN_VALUE, new Value[] {Values.of( rangePredicate.to() )} ); treeKeyTo.entityIdIsSpecialTieBreaker = true; return startSeekForInitializedRange(); default: throw new IllegalArgumentException( "IndexQuery of type " + predicate.type() + " is not supported." ); } }
Source:
public Optional<MovementSpeedData> build(DataView container) throws InvalidDataException { double walkSpeed = getData(container, Keys.WALKING_SPEED); double flySpeed = getData(container, Keys.FLYING_SPEED); MovementSpeedData movementSpeedData = new SpongeMovementSpeedData(walkSpeed, flySpeed); return Optional.of(movementSpeedData); }

Target:
public Optional<MovementSpeedData> build(DataView container) throws InvalidDataException { if (container.contains(Keys.WALKING_SPEED.getQuery()) && container.contains(Keys.FLYING_SPEED.getQuery())) { double walkSpeed = getData(container, Keys.WALKING_SPEED); double flySpeed = getData(container, Keys.FLYING_SPEED); MovementSpeedData movementSpeedData = new SpongeMovementSpeedData(walkSpeed, flySpeed); return Optional.of(movementSpeedData); } return Optional.empty(); }
Source:
protected View getWelcomeView() { return new MultiBranchProjectEmptyView(this); }

Target:
protected View getWelcomeView() { return new OrganizationFolderEmptyView(this); }
Source:
public void visitJsonResultForm(Query query) { out.print("JSON {"); List<String> terms = new ArrayList<>(); for (Map.Entry<String, Object> entry : query.jsonMapping.entrySet()) { terms.add(String.format("\"%s\" : %s ", entry.getKey(), entry.getValue())); } out.print(String.join(",", terms)); out.print(" }"); out.newline(); }

Target:
public void visitJsonResultForm(Query query) { out.println("JSON {"); out.incIndent(BLOCK_INDENT); out.incIndent(BLOCK_INDENT); boolean first = true; for (Map.Entry<String, Node> entry : query.getJsonMapping().entrySet()) { String field = entry.getKey(); Node value = entry.getValue(); if ( ! first ) out.println(" ,"); first = false; out.print('"'); out.print(field); out.print('"'); out.print(" : "); out.pad(15); out.print(FmtUtils.stringForNode(value, prologue)); } out.decIndent(BLOCK_INDENT); out.decIndent(BLOCK_INDENT); out.print(" }"); out.newline(); }
Source:
private void checkSetClazz(PortContext context) { if (clazz != null) { clazz = context.getValue(Context.PortContext.TUPLE_CLASS); } else if (clazz != context.getValue(Context.PortContext.TUPLE_CLASS)) { logger.error("Input/Output ports must have same schema class. != {}", clazz, context.getValue(Context.PortContext.TUPLE_CLASS)); } }

Target:
private void checkSetClazz(PortContext context) { if (clazz == null) { clazz = context.getValue(Context.PortContext.TUPLE_CLASS); } else if (clazz != context.getValue(Context.PortContext.TUPLE_CLASS)) { logger.error("Input/Output ports must have same schema class. != {}", clazz, context.getValue(Context.PortContext.TUPLE_CLASS)); } }
Source:
private PlaylistTab() { this.playlistName = "<no-name>"; this.playlistId = -1; this.playlistType = LocalItemType.PLAYLIST_LOCAL_ITEM; this.playlistServiceId = -1; this.playlistUrl = "<no-url>"; }

Target:
private PlaylistTab() { this(-1, "<no-name>"); }
Source:
static ImmutableSet.Builder<Type> omitIllegalBeanTypes(Set<Type> types, EnhancedAnnotated<?, ?> annotated) { ImmutableSet.Builder<Type> builder = ImmutableSet.builder(); for (Type type : types) { if (isIllegalBeanType(type)) { MetadataLogger.LOG.illegalBeanTypeIgnored(type, annotated); } else { builder.add(type); } } return builder; }

Target:
static ImmutableSet.Builder<Type> omitIllegalBeanTypes(Set<Type> types, EnhancedAnnotated<?, ?> annotated) { ImmutableSet.Builder<Type> builder = ImmutableSet.builder(); for (Type type : types) { if (Types.isIllegalBeanType(type)) { MetadataLogger.LOG.illegalBeanTypeIgnored(type, annotated); } else { builder.add(type); } } return builder; }
Source:
private static StepVideo parseVideo(JSONObject jVideo) throws JSONException { StepVideo video = new StepVideo(); try { JSONArray jEncodings = jVideo.getJSONArray("encoding"); for (int i = 0; i < jEncodings.length(); i++) { video.addEncoding(parseVideoEncoding(jEncodings.getJSONObject(i))); } } catch (JSONException e) { e.printStackTrace(); } video.setThumbnail(parseVideoThumbnail(jVideo.getJSONObject("thumbnail"))); return video; }

Target:
private static StepVideo parseVideo(JSONObject jVideo) throws JSONException { StepVideo video = new StepVideo(); try { JSONArray jEncodings = jVideo.getJSONArray("encoding"); for (int i = 0; i < jEncodings.length(); i++) { video.addEncoding(parseVideoEncoding(jEncodings.getJSONObject(i))); } } catch (JSONException e) { e.printStackTrace(); Log.e("JSONHelper parseVideo", "Error parsing video API response"); } video.setThumbnail(parseVideoThumbnail(jVideo.getJSONObject("thumbnail"))); return video; }
Source:
static void asyncDml(DatabaseClient client) throws InterruptedException, ExecutionException, TimeoutException { ExecutorService executor = Executors.newSingleThreadExecutor(); ApiFuture<Long> rowCount = client .runAsync() .runAsync( new AsyncWork<Long>() { @Override public ApiFuture<Long> doWorkAsync(TransactionContext txn) { String sql = "INSERT INTO Singers (SingerId, FirstName, LastName) VALUES " + "(12, 'Melissa', 'Garcia'), " + "(13, 'Russell', 'Morales'), " + "(14, 'Jacqueline', 'Long'), " + "(15, 'Dylan', 'Shaw')"; return txn.executeUpdateAsync(Statement.of(sql)); } }, executor); System.out.printf("%d records inserted.%n", rowCount.get()); executor.shutdown(); }

Target:
static void asyncDml(DatabaseClient client) throws InterruptedException, ExecutionException, TimeoutException { ExecutorService executor = Executors.newSingleThreadExecutor(); AsyncRunner runner = client.runAsync(); ApiFuture<Long> rowCount = runner.runAsync( new AsyncWork<Long>() { @Override public ApiFuture<Long> doWorkAsync(TransactionContext txn) { String sql = "INSERT INTO Singers (SingerId, FirstName, LastName) VALUES " + "(12, 'Melissa', 'Garcia'), " + "(13, 'Russell', 'Morales'), " + "(14, 'Jacqueline', 'Long'), " + "(15, 'Dylan', 'Shaw')"; return txn.executeUpdateAsync(Statement.of(sql)); } }, executor); System.out.printf("%d records inserted.%n", rowCount.get()); executor.shutdown(); }
Source:
public OrcUpdatablePageSource( Optional<ShardRewriter> shardRewriter, OrcBatchRecordReader recordReader, OrcPageSource parentPageSource) { this.rowsToDelete = new BitSet(toIntExact(recordReader.getFileRowCount())); this.shardRewriter = requireNonNull(shardRewriter, "shardRewriter is null"); this.parentPageSource = requireNonNull(parentPageSource, "parentPageSource is null"); }

Target:
public OrcUpdatablePageSource( Optional<ShardRewriter> shardRewriter, OrcBatchRecordReader recordReader, OrcPageSource parentPageSource) { this.shardRewriter = requireNonNull(shardRewriter, "shardRewriter is null"); requireNonNull(recordReader, "recordReader is null"); this.parentPageSource = requireNonNull(parentPageSource, "parentPageSource is null"); this.rowsToDelete = new BitSet(toIntExact(recordReader.getFileRowCount())); }
Source:
private void onSendCallback(DatastreamRecordMetadata metadata, Exception exception, SendCallback sendCallback, DatastreamTask task, DatastreamProducerRecord record) { SendFailedException sendFailedException = null; if (exception != null) { sendFailedException = new SendFailedException(_safeCheckpoints); if (_onUnrecoverableError != null) { _onUnrecoverableError.accept(this); } } else { synchronized (_latency) { _latency = System.currentTimeMillis() - record.getEventsTimestamp(); if (_latency <= _availabilityThresholdSlaMs) { EVENTS_PRODUCED_WITHIN_SLA.inc(); } else { _dynamicMetricsManager.createOrUpdateCounter(this.getClass(), metadata.getTopic(), EVENTS_PRODUCED_OUTSIDE_SLA, 1); _logger.warn( String.format("Event latency of %d for source %s, topic %s, partition %d exceeded SLA of %d millseconds", _latency, task.getDatastreamSource().getConnectionString(), metadata.getTopic(), metadata.getPartition(), _availabilityThresholdSlaMs)); } TOTAL_EVENTS_PRODUCED.inc(); } try { _checkpointRWLock.readLock().lock(); if (!_safeCheckpoints.containsKey(task)) { _logger.warn(String.format("Event of unknown task is being acknowledged: task=%s, record=%s", task, record)); } else { _safeCheckpoints.get(task).put(metadata.getPartition(), record.getCheckpoint()); _pendingCheckpoints.set(true); } } finally { _checkpointRWLock.readLock().unlock(); } } if (sendCallback != null) { sendCallback.onCompletion(metadata, sendFailedException); } if (exception != null) { shutdown(); } }

Target:
private void onSendCallback(DatastreamRecordMetadata metadata, Exception exception, SendCallback sendCallback, DatastreamTask task, DatastreamProducerRecord record) { SendFailedException sendFailedException = null; if (exception != null) { sendFailedException = new SendFailedException(_safeCheckpoints); if (_onUnrecoverableError != null) { _onUnrecoverableError.accept(this); } } else { synchronized (_sourceToDestinationLatencyMs) { _sourceToDestinationLatencyMs = System.currentTimeMillis() - record.getEventsTimestamp(); if (_sourceToDestinationLatencyMs <= _availabilityThresholdSlaMs) { EVENTS_PRODUCED_WITHIN_SLA.inc(); } else { _dynamicMetricsManager.createOrUpdateCounter(this.getClass(), metadata.getTopic(), EVENTS_PRODUCED_OUTSIDE_SLA, 1); _logger.warn( String.format("Event latency of %d for source %s, topic %s, partition %d exceeded SLA of %d millseconds", _sourceToDestinationLatencyMs, task.getDatastreamSource().getConnectionString(), metadata.getTopic(), metadata.getPartition(), _availabilityThresholdSlaMs)); } TOTAL_EVENTS_PRODUCED.inc(); } try { _checkpointRWLock.readLock().lock(); if (!_safeCheckpoints.containsKey(task)) { _logger.warn(String.format("Event of unknown task is being acknowledged: task=%s, record=%s", task, record)); } else { _safeCheckpoints.get(task).put(metadata.getPartition(), record.getCheckpoint()); _pendingCheckpoints.set(true); } } finally { _checkpointRWLock.readLock().unlock(); } } if (sendCallback != null) { sendCallback.onCompletion(metadata, sendFailedException); } if (exception != null) { shutdown(); } }
Source:
public VdTree parse(InputStream is, StringBuilder vdErrorLog) { try { final VdTree tree = new VdTree(); SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); XMLReader xr = sp.getXMLReader(); xr.setContentHandler(new ContentHandler() { String space = " "; @Override public void setDocumentLocator(Locator locator) { } @Override public void startDocument() throws SAXException { } @Override public void endDocument() throws SAXException { } @Override public void startPrefixMapping(String s, String s2) throws SAXException { } @Override public void endPrefixMapping(String s) throws SAXException { } @Override public void startElement(String s, String s2, String s3, Attributes attributes) throws SAXException { String name = s3; if (tagSwitch.containsKey(name)) { tagSwitch.get(name).parse(tree, attributes); } space += " "; } @Override public void endElement(String s, String s2, String s3) throws SAXException { space = space.substring(1); } @Override public void characters(char[] chars, int i, int i2) throws SAXException { } @Override public void ignorableWhitespace(char[] chars, int i, int i2) throws SAXException { } @Override public void processingInstruction(String s, String s2) throws SAXException { } @Override public void skippedEntity(String s) throws SAXException { } }); xr.parse(new InputSource(is)); tree.parseFinish(); return tree; } catch (Exception e) { vdErrorLog.append("Exception in parsing XML file " + e.getMessage()); return null; } }

Target:
public VdTree parse(InputStream is, StringBuilder vdErrorLog) { try { final VdTree tree = new VdTree(); SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); XMLReader xr = sp.getXMLReader(); xr.setContentHandler(new ContentHandler() { String space = " "; @Override public void setDocumentLocator(Locator locator) { } @Override public void startDocument() throws SAXException { } @Override public void endDocument() throws SAXException { } @Override public void startPrefixMapping(String s, String s2) throws SAXException { } @Override public void endPrefixMapping(String s) throws SAXException { } @Override public void startElement(String s, String s2, String s3, Attributes attributes) throws SAXException { String name = s3; if (tagSwitch.containsKey(name)) { tagSwitch.get(name).parse(tree, attributes); } space += " "; } @Override public void endElement(String s, String s2, String s3) throws SAXException { space = space.substring(1); } @Override public void characters(char[] chars, int i, int i2) throws SAXException { } @Override public void ignorableWhitespace(char[] chars, int i, int i2) throws SAXException { } @Override public void processingInstruction(String s, String s2) throws SAXException { } @Override public void skippedEntity(String s) throws SAXException { } }); xr.parse(new InputSource(is)); tree.parseFinish(); return tree; } catch (Exception e) { vdErrorLog.append("Exception while parsing XML file:\n" + e.getMessage()); return null; } }
Source:
public Object methodInvoke(Method method, Object instance, Object... convertedArgs) throws Throwable { try { return method.invoke(instance, convertedArgs); } catch (InvocationTargetException e) { if (e.getCause() != null) { throw e.getCause(); } else { throw e.getTargetException(); } } catch (IllegalArgumentException e) { throw new RuntimeException("Bad call of: " + method.getDeclaringClass().getName() + "." + method.getName() + ". On instance of: " + ((instance == null) ? "null" : instance.getClass().getName()), e); } }

Target:
public Object methodInvoke(Method method, Object instance, Object... convertedArgs) throws Throwable { try { return method.invoke(instance, convertedArgs); } catch (InvocationTargetException e) { if (e.getCause() != null) { throw e.getCause(); } else { throw e.getTargetException(); } } catch (IllegalArgumentException e) { throw new RuntimeException("Bad call of: " + method.getDeclaringClass().getName() + "." + method.getName() + "." + ((instance == null) ? "" : " On instance of: " + instance.getClass().getName()), e); } catch (Exception e){ String methodName = MethodExecutionResult.methodToString(method); throw new RuntimeException("Exception when invoking: " + method.getDeclaringClass().getName() + "." + methodName + "." + ((instance == null) ? "" : " On instance of: " + instance.getClass().getName()), e); } }
Source:
public Server gRpcServer( @Value("${grpc.server.port:0}") final int port, final Set<BindableService> services, final List<ServerInterceptor> serverInterceptors ) { final NettyServerBuilder builder = NettyServerBuilder.forPort( port == RANDOM_PORT ? SocketUtils.findAvailableTcpPort() : port ); services .stream() .map(BindableService::bindService) .map(serviceDefinition -> ServerInterceptors.intercept(serviceDefinition, serverInterceptors)) .forEach(builder::addService); return builder.build(); }

Target:
public Server gRpcServer( @Value("${grpc.server.port:0}") final int port, final Set<BindableService> services, final List<ServerInterceptor> serverInterceptors ) { final NettyServerBuilder builder = NettyServerBuilder.forPort(port); services .stream() .map(BindableService::bindService) .map(serviceDefinition -> ServerInterceptors.intercept(serviceDefinition, serverInterceptors)) .forEach(builder::addService); return builder.build(); }
Source:
public boolean hasSpaceForSnapthosts(VM vm) { Map<storage_domains, Integer> map = mapStorageDomainsToNumOfDisks(vm); Integer minSnapshotSize = Config.<Integer> GetValue(ConfigValues.InitStorageSparseSizeInGB); for (storage_domains domain : map.keySet()) { if (!StorageDomainSpaceChecker.hasSpaceForRequest(domain, minSnapshotSize * map.get(domain))) { log.error("not enough space to create snapshot on domain " + domain.getId()); return false; } } return true; }

Target:
public boolean hasSpaceForSnapthosts(VM vm) { Integer minSnapshotSize = Config.<Integer> GetValue(ConfigValues.InitStorageSparseSizeInGB); for (Entry<storage_domains, Integer> e : mapStorageDomainsToNumOfDisks(vm).entrySet()) { if (!StorageDomainSpaceChecker.hasSpaceForRequest(e.getKey(), minSnapshotSize * e.getValue())) { log.error("not enough space to create snapshot on domain " + e.getKey().getId()); return false; } } return true; }
Source:
public Change insert() throws OrmException, IOException { ReviewDb db = dbProvider.get(); db.changes().beginTransaction(change.getId()); try { ChangeUtil.insertAncestors(db, patchSet.getId(), commit); db.patchSets().insert(Collections.singleton(patchSet)); db.changes().insert(Collections.singleton(change)); ChangeUtil.updateTrackingIds(db, change, trackingFooters, commit.getFooterLines()); LabelTypes labelTypes = refControl.getProjectControl().getLabelTypes(); approvalsUtil.addReviewers(db, labelTypes, change, patchSet, patchSetInfo, reviewers, Collections.<Account.Id> emptySet()); db.commit(); } finally { db.rollback(); } if (changeMessage != null) { db.changeMessages().insert(Collections.singleton(changeMessage)); } final CheckedFuture<Boolean, IOException> mergeableFuture = mergeabilityChecker.updateAsync(change); mergeableFuture.addListener(new Runnable() { @Override public void run() { try { if (!mergeableFuture.checkedGet()) { indexer.index(change); } } catch (IOException e) { log.error("Failed to update mergeable flag for change " + change.getChangeId(), e); throw new RuntimeException(e); } } }, MoreExecutors.sameThreadExecutor()); gitRefUpdated.fire(change.getProject(), patchSet.getRefName(), ObjectId.zeroId(), commit); if (runHooks) { hooks.doPatchsetCreatedHook(change, patchSet, db); } if (sendMail) { try { CreateChangeSender cm = createChangeSenderFactory.create(change); cm.setFrom(change.getOwner()); cm.setPatchSet(patchSet, patchSetInfo); cm.addReviewers(reviewers); cm.addExtraCC(extraCC); cm.send(); } catch (Exception err) { log.error("Cannot send email for new change " + change.getId(), err); } } try { mergeableFuture.checkedGet(); } catch (IOException e) { indexer.index(change); throw e; } return change; }

Target:
public Change insert() throws OrmException, IOException { ReviewDb db = dbProvider.get(); db.changes().beginTransaction(change.getId()); try { ChangeUtil.insertAncestors(db, patchSet.getId(), commit); db.patchSets().insert(Collections.singleton(patchSet)); db.changes().insert(Collections.singleton(change)); ChangeUtil.updateTrackingIds(db, change, trackingFooters, commit.getFooterLines()); LabelTypes labelTypes = refControl.getProjectControl().getLabelTypes(); approvalsUtil.addReviewers(db, labelTypes, change, patchSet, patchSetInfo, reviewers, Collections.<Account.Id> emptySet()); db.commit(); } finally { db.rollback(); } if (changeMessage != null) { db.changeMessages().insert(Collections.singleton(changeMessage)); } CheckedFuture<?, IOException> f = mergeabilityChecker.updateAndIndexAsync(change); gitRefUpdated.fire(change.getProject(), patchSet.getRefName(), ObjectId.zeroId(), commit); if (runHooks) { hooks.doPatchsetCreatedHook(change, patchSet, db); } if (sendMail) { try { CreateChangeSender cm = createChangeSenderFactory.create(change); cm.setFrom(change.getOwner()); cm.setPatchSet(patchSet, patchSetInfo); cm.addReviewers(reviewers); cm.addExtraCC(extraCC); cm.send(); } catch (Exception err) { log.error("Cannot send email for new change " + change.getId(), err); } } f.checkedGet(); return change; }
Source:
@Override public Future<RecordMetadata> send(ProducerRecord<K, V> record, @Nullable Callback callback) { TraceContextOrSamplingFlags traceContextOrSamplingFlags = extractor.extract(record.headers()); final Span span; if (traceContextOrSamplingFlags != null) { span = tracing.tracer().nextSpan(traceContextOrSamplingFlags); } else { span = tracing.tracer().nextSpan(); } tracing.propagation().keys().forEach(key -> record.headers().remove(key)); injector.inject(span.context(), record.headers()); if (!span.isNoop()) { if (record.key() instanceof String && !"".equals(record.key())) { span.tag(KafkaTags.KAFKA_KEY_TAG, record.key().toString()); } if (remoteServiceName != null) { span.remoteServiceName(remoteServiceName); } span.tag(KafkaTags.KAFKA_TOPIC_TAG, record.topic()).name("send").kind(Kind.PRODUCER).start(); } try (Tracer.SpanInScope ws = tracing.tracer().withSpanInScope(span)) { return delegate.send(record, new TracingCallback(span, callback)); } catch (RuntimeException | Error e) { span.error(e).finish(); throw e; } }

Target:
@Override public Future<RecordMetadata> send(ProducerRecord<K, V> record, @Nullable Callback callback) { final Span span; final TraceContext maybeParent = tracing.currentTraceContext().get(); if (maybeParent == null && record.headers().toArray().length > 0) { TraceContextOrSamplingFlags traceContextOrSamplingFlags = extractor.extract(record.headers()); span = tracing.tracer().nextSpan(traceContextOrSamplingFlags); } else { span = tracing.tracer().nextSpan(); } tracing.propagation().keys().forEach(key -> record.headers().remove(key)); injector.inject(span.context(), record.headers()); if (!span.isNoop()) { if (record.key() instanceof String && !"".equals(record.key())) { span.tag(KafkaTags.KAFKA_KEY_TAG, record.key().toString()); } if (remoteServiceName != null) span.remoteServiceName(remoteServiceName); span.tag(KafkaTags.KAFKA_TOPIC_TAG, record.topic()).name("send").kind(Kind.PRODUCER).start(); } try (Tracer.SpanInScope ws = tracing.tracer().withSpanInScope(span)) { return delegate.send(record, new TracingCallback(span, callback)); } catch (RuntimeException | Error e) { span.error(e).finish(); throw e; } }
Source:
public CookieBuilder withCustomValue( String name, String value ) { this.custom = StringUtils.isNoneBlank( name, value ) ? name + "=" + value : null; return this; }

Target:
public CookieBuilder withCustomValue( String name, String value ) { if( StringUtils.isNoneBlank( name, value ) ) { this.customs.add( name + "=" + value ); } return this; }