auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void collectEntityAndStatement(AbstractTripleStore database, int keyArity, IV ontolexLexicalForm, IV ontolexSense, String statementPrefix, IV entity, Collection<IV<?, ?>> subjStatements, Collection<IV<?, ?>> subjEntity) { subjEntity.add(entity); Collection<IV<?, ?>> allReferenced = new HashSet<>(); collectReferenced(database, keyArity, statementPrefix, entity, allReferenced); if (ontolexLexicalForm != null) { IChunkedOrderedIterator<ISPO> itr = prepareAccessPath(database, keyArity, new Constant<IV>(entity), new Constant<IV>(ontolexLexicalForm), Var.var("o"), null, keyArity == 3 ? SPOKeyOrder.SPO : SPOKeyOrder.SPOC); while (itr.hasNext()) { IV subId = itr.next().o(); subjEntity.add(subId); collectReferenced(database, keyArity, statementPrefix, subId, allReferenced); } } if (ontolexSense != null) { IChunkedOrderedIterator<ISPO> itr = prepareAccessPath(database, keyArity, new Constant<IV>(entity), new Constant<IV>(ontolexSense), Var.var("o"), null, keyArity == 3 ? SPOKeyOrder.SPO : SPOKeyOrder.SPOC); while (itr.hasNext()) { IV subId = itr.next().o(); subjEntity.add(subId); collectReferenced(database, keyArity, statementPrefix, subId, allReferenced); } } final Map<IV<?, ?>, BigdataValue> terms = database.getLexiconRelation().getTerms(allReferenced, 4000 , 4000 ); for (BigdataValue subj: terms.values()) { if (subj.stringValue().startsWith(statementPrefix)) { subjStatements.add(subj.getIV()); } } }

Target:
private void collectEntityAndStatement(AbstractTripleStore database, int keyArity, IV ontolexLexicalForm, IV ontolexSense, String statementPrefix, IV entity, Collection<IV<?, ?>> subjStatements, Collection<IV<?, ?>> subjEntity) { subjEntity.add(entity); Collection<IV<?, ?>> allReferenced = new HashSet<>(); collectReferenced(database, keyArity, entity, allReferenced); collectSubjects(database, keyArity, entity, ontolexLexicalForm, subjEntity, allReferenced); collectSubjects(database, keyArity, entity, ontolexSense, subjEntity, allReferenced); final Map<IV<?, ?>, BigdataValue> terms = database.getLexiconRelation().getTerms(allReferenced, 4000 , 4000 ); for (BigdataValue subj: terms.values()) { if (subj.stringValue().startsWith(statementPrefix)) { subjStatements.add(subj.getIV()); } } }
Source:
public void process(SuroInput input, MessageContainer msg) throws Exception { if (Strings.isNullOrEmpty(msg.getRoutingKey())) { DynamicCounter.increment( MonitorConfig.builder(TagKey.DROPPED_COUNT).withTag("reason", "emptyRoutingKey").build()); return; } DynamicCounter.increment( MonitorConfig .builder(TagKey.RECV_COUNT) .withTag("routingKey", msg.getRoutingKey()) .build()); RoutingMap.RoutingInfo info = routingMap.getRoutingInfo(msg.getRoutingKey()); if (info == null) { Sink defaultSink = sinkManager.getSink("default"); input.setPause(defaultSink.checkPause()); defaultSink.writeTo(msg); } else if (info.doFilter(msg)) { List<Route> routes = info.getWhere(); for (Route route : routes) { if (route.doFilter(msg)) { Sink sink = sinkManager.getSink(route.getSink()); input.setPause(sink.checkPause()); if (!Strings.isNullOrEmpty(route.getAlias())) { sink.writeTo( new DefaultMessageContainer( new Message(route.getAlias(), msg.getMessage().getPayload()), jsonMapper)); } else { sink.writeTo(msg); } DynamicCounter.increment( MonitorConfig .builder(TagKey.PROCESSED_COUNT) .withTag("routingKey", msg.getRoutingKey()) .withTag("sinkId", route.getSink()) .build()); } } } }

Target:
public void process(SuroInput input, MessageContainer msg) throws Exception { if (Strings.isNullOrEmpty(msg.getRoutingKey())) { DynamicCounter.increment( MonitorConfig.builder(TagKey.DROPPED_COUNT).withTag("reason", "emptyRoutingKey").build()); return; } DynamicCounter.increment( MonitorConfig .builder(TagKey.RECV_COUNT) .withTag("routingKey", msg.getRoutingKey()) .build()); RoutingMap.RoutingInfo info = routingMap.getRoutingInfo(msg.getRoutingKey()); if (info == null) { Sink defaultSink = sinkManager.getSink("default"); input.setPause(defaultSink.checkPause()); defaultSink.writeTo(msg); } else if (info.doFilter(msg)) { List<Route> routes = info.getWhere(); for (Route route : routes) { if (route.doFilter(msg)) { Sink sink = sinkManager.getSink(route.getSink()); input.setPause(sink.checkPause()); if (!Strings.isNullOrEmpty(route.getAlias())) { sink.writeTo( new DefaultMessageContainer( new Message(route.getAlias(), msg.getMessage().getPayload()), jsonMapper)); } else { sink.writeTo(msg); } DynamicCounter.increment( MonitorConfig .builder(TagKey.ATTEMPTED_COUNT) .withTag("routingKey", msg.getRoutingKey()) .withTag("sinkId", route.getSink()) .build()); } } } }
Source:
public Poll addNthAnswer(String answer, int number) { wait.forElementClickable(answersInputsList.get(number)); answersInputsList.get(number).sendKeys(answer); return this; }

Target:
public Poll addNthAnswer(String answer, int number) { try { wait.forElementClickable(answersInputsList.get(number)); answersInputsList.get(number).sendKeys(answer); } catch (Exception e) { PageObjectLogging.log("Could not add nth answer", e, false); } return this; }
Source:
public Req understand(final Comment.Smart comment, final URI home) throws IOException { final Issue issue = comment.issue(); Logger.info( this, "release request found in %s#%d, comment #%d", issue.repo().coordinates(), issue.number(), comment.number() ); final Req req; final Matcher matcher = Pattern.compile(".*release.*`(.+)`.*") .matcher(comment.body()); if (matcher.matches()) { final String name = matcher.group(1); final ReleaseTag release = new ReleaseTag(issue.repo(), name); if (release.allowed()) { new Answer(comment).post( true, String.format( QnRelease.PHRASES.getString("QnRelease.start"), home.toASCIIString() ) ); req = new Req.Simple( "release", new ImmutableMap.Builder<String, String>() .put("head_branch", "master") .put( "head", String.format( "git@github.com:%s.git", comment.issue().repo().coordinates() ) ).build() ); } else { new Answer(comment).post( false, String.format( QnRelease.PHRASES.getString("QnRelease.invalid-tag"), name, release.reference() ) ); req = Req.EMPTY; } } else { new Answer(comment).post( false, QnRelease.PHRASES.getString("QnRelease.missing-tag") ); req = Req.EMPTY; } return req; }

Target:
public Req understand(final Comment.Smart comment, final URI home) throws IOException { final Issue issue = comment.issue(); Logger.info( this, "release request found in %s#%d, comment #%d", issue.repo().coordinates(), issue.number(), comment.number() ); final Req req; final Matcher matcher = QnRelease.QUESTION_PATTERN .matcher(comment.body()); if (matcher.find()) { final String name = matcher.group(1); final ReleaseTag release = new ReleaseTag(issue.repo(), name); if (release.allowed()) { req = QnRelease.affirmative(comment, home); } else { new Answer(comment).post( false, String.format( QnRelease.PHRASES.getString("QnRelease.invalid-tag"), name, release.reference() ) ); req = Req.EMPTY; } } else { req = QnRelease.affirmative(comment, home); } return req; }
Source:
public boolean checkMuteTimeout(final long currentTime) { if (getMuteTimeout() > 0 && getMuteTimeout() < currentTime && isMuted()) { final MuteStatusChangeEvent event = new MuteStatusChangeEvent(this, null, false); ess.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { setMuteTimeout(0); sendMessage(tl("canTalkAgain")); setMuted(false); setMuteReason (""); return true; } } return false; }

Target:
public boolean checkMuteTimeout(final long currentTime) { if (getMuteTimeout() > 0 && getMuteTimeout() < currentTime && isMuted()) { final MuteStatusChangeEvent event = new MuteStatusChangeEvent(this, null, false); ess.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { setMuteTimeout(0); sendMessage(tl("canTalkAgain")); setMuted(false); setMuteReason(null); return true; } } return false; }
Source:
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) { String currentDomain = request.getHeader("Host"); Document siteMapDocument = this.siteMapGenerators.get(currentDomain).getSiteMap(request.getResourceResolver()); printSiteMap(siteMapDocument, response); }

Target:
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) { String currentDomain = request.getHeader("Host"); Document siteMapDocument = this.siteMapGenerators.get(currentDomain).getSiteMap(anonymousResolver); printSiteMap(siteMapDocument, response); }
Source:
public boolean write() throws IOException { Send send = networkSend.getPayload(); if (send == null) { throw new IllegalStateException("Registered for write interest but no response attached to key."); } long startTimeMs = SystemTime.getInstance().milliseconds(); long written = send.writeTo(socketChannel); long writeTimeMs = SystemTime.getInstance().milliseconds() - startTimeMs; logger.trace("Bytes written to using key Time: {}", written, socketChannel.socket().getRemoteSocketAddress(), getConnectionId(), writeTimeMs); if (written > 0) { metrics.plaintextSendTimePerKB.update(writeTimeMs * 1024 / written); } return send.isSendComplete(); }

Target:
public boolean write() throws IOException { Send send = networkSend.getPayload(); if (send == null) { throw new IllegalStateException("Registered for write interest but no response attached to key."); } long startTimeMs = SystemTime.getInstance().milliseconds(); long bytesWritten = send.writeTo(socketChannel); long writeTimeMs = SystemTime.getInstance().milliseconds() - startTimeMs; logger.trace("Bytes written to using key Time: {}", bytesWritten, socketChannel.socket().getRemoteSocketAddress(), getConnectionId(), writeTimeMs); if (bytesWritten > 0) { metrics.plaintextSendTimePerKB.update(writeTimeMs * 1024 / bytesWritten); } return send.isSendComplete(); }
Source:
public void init() { super.init(); this.options = new FrontEndScannerOptions(); this.api = new FrontEndScannerAPI(this); this.api.addApiOptions(options); this.proxyListener = new FrontEndScannerProxyListener(api, options, LOGGER); this.extensionScript = Control.getSingleton().getExtensionLoader().getExtension(ExtensionScript.class); }

Target:
public void init() { super.init(); this.options = new FrontEndScannerOptions(); this.api = new FrontEndScannerAPI(this); this.api.addApiOptions(options); this.proxyListener = new FrontEndScannerProxyListener(api, options); this.extensionScript = Control.getSingleton().getExtensionLoader().getExtension(ExtensionScript.class); }
Source:
protected List<Worker<? extends BenchmarkModule>> makeWorkersImpl(boolean verbose) throws IOException { LOG.info(String.format("Initializing %d %s", workConf.getTerminals(), WikipediaWorker.class.getSimpleName())); List<Worker<? extends BenchmarkModule>> workers = new ArrayList<Worker<? extends BenchmarkModule>>(); for (int i = 0; i < workConf.getTerminals(); ++i) { WikipediaWorker worker = new WikipediaWorker(this, i); workers.add(worker); } return workers; }

Target:
protected List<Worker<? extends BenchmarkModule>> makeWorkersImpl(boolean verbose) throws IOException { LOG.debug(String.format("Initializing %d %s", this.workConf.getTerminals(), WikipediaWorker.class.getSimpleName())); List<Worker<? extends BenchmarkModule>> workers = new ArrayList<Worker<? extends BenchmarkModule>>(); for (int i = 0; i < this.workConf.getTerminals(); ++i) { WikipediaWorker worker = new WikipediaWorker(this, i); workers.add(worker); } return workers; }
Source:
public void setUp() throws Exception { System.setProperty("org.apache.logging.log4j.simplelog.StatusLogger.level", "INFO"); MockLogAppender.setupLogging(); TemporaryDatabasePostgreSQL temp = new TemporaryDatabasePostgreSQL(); }

Target:
public void setUp() throws Exception { System.setProperty("org.apache.logging.log4j.simplelog.StatusLogger.level", "INFO"); MockLogAppender.setupLogging(); }
Source:
public static GAV parse(String line) { int currentIndex = 0; int colonIndex = -1; colonIndex = nextColonIndex(line, currentIndex); if (colonIndex < 0) { throw new IllegalArgumentException("Invalid line: '" + line + "'"); } String groupId = substring(line, currentIndex, colonIndex); currentIndex = colonIndex + 1; colonIndex = nextColonIndex(line, currentIndex); if (colonIndex < 0) { throw new IllegalArgumentException("Invalid line: '" + line + "'"); } String artifactId = substring(line, currentIndex, colonIndex); currentIndex = colonIndex + 1; String version = substring(line, currentIndex, line.length()); return new GAV(groupId, artifactId, version); }

Target:
public static GAV parse(String line) throws IllegalArgumentException { int currentIndex = 0; int colonIndex = -1; colonIndex = nextColonIndex(line, currentIndex); String groupId = substring(line, currentIndex, colonIndex); currentIndex = colonIndex + 1; colonIndex = nextColonIndex(line, currentIndex); String artifactId = substring(line, currentIndex, colonIndex); currentIndex = colonIndex + 1; String version = substring(line, currentIndex, line.length()); return new GAV(groupId, artifactId, version); }
Source:
public Response preview(Action action) { action.setAsync(false); TryBackToAllSnapshotsOfVmParameters tryBackParams = new TryBackToAllSnapshotsOfVmParameters(parentId, guid); Response response = doAction(VdcActionType.TryBackToAllSnapshotsOfVm, tryBackParams, action, PollingType.JOB); return response; }

Target:
public Response preview(Action action) { TryBackToAllSnapshotsOfVmParameters tryBackParams = new TryBackToAllSnapshotsOfVmParameters(parentId, guid); Response response = doAction(VdcActionType.TryBackToAllSnapshotsOfVm, tryBackParams, action); return response; }
Source:
private boolean validateStoragePropertiesUpdate() { if (!checkStorageDomainStatusNotEqual(StorageDomainStatus.Locked) || !validateStorageNameUpdate()) { return false; } List<String> props = ObjectIdentityChecker.GetChangedFields(oldDomain, getStorageDomain() .getStorageStaticData()); if (props.isEmpty()) { return true; } props.remove("storageName"); props.remove("description"); props.remove("comment"); if (!props.isEmpty()) { log.warn("There was an attempt to update the following fields although they are not allowed to be updated: {}", StringUtils.join(props, ",")); return failCanDoAction(VdcBllMessages.ERROR_CANNOT_CHANGE_STORAGE_DOMAIN_FIELDS); } return true; }

Target:
private boolean validateStoragePropertiesUpdate() { if (!checkStorageDomainStatusNotEqual(StorageDomainStatus.Locked) || !validateStorageNameUpdate()) { return false; } List<String> props = ObjectIdentityChecker.GetChangedFields(oldDomain, getStorageDomain() .getStorageStaticData()); props.remove("storageName"); props.remove("description"); props.remove("comment"); if (!props.isEmpty()) { log.warn("There was an attempt to update the following fields although they are not allowed to be updated: {}", StringUtils.join(props, ",")); return failCanDoAction(VdcBllMessages.ERROR_CANNOT_CHANGE_STORAGE_DOMAIN_FIELDS); } return true; }
Source:
private String getSubmissionFormTableHeaderFragmentHtml(String questionNumberString, String responseNumberString) { StringBuilder tableHeaderFragmentHtml = new StringBuilder(); String tableHeaderFragmentTemplate = FeedbackQuestionFormTemplates.RUBRIC_SUBMISSION_FORM_HEADER_FRAGMENT; for(int i = 0; i < numOfRubricChoices; i++) { String tableHeaderCell = FeedbackQuestionFormTemplates.populateTemplate(tableHeaderFragmentTemplate, "${qnIndex}", questionNumberString, "${respIndex}", responseNumberString, "${col}", Integer.toString(i), "${rubricChoiceValue}", (rubricChoices.get(i) + " (" + (numOfRubricChoices-i) + ")")); tableHeaderFragmentHtml.append(tableHeaderCell + Const.EOL); } return tableHeaderFragmentHtml.toString(); }

Target:
private String getSubmissionFormTableHeaderFragmentHtml(String questionNumberString, String responseNumberString) { StringBuilder tableHeaderFragmentHtml = new StringBuilder(); String tableHeaderFragmentTemplate = FeedbackQuestionFormTemplates.RUBRIC_SUBMISSION_FORM_HEADER_FRAGMENT; for (int i = 0; i < numOfRubricChoices; i++) { String tableHeaderCell = FeedbackQuestionFormTemplates.populateTemplate(tableHeaderFragmentTemplate, "${qnIndex}", questionNumberString, "${respIndex}", responseNumberString, "${col}", Integer.toString(i), "${rubricChoiceValue}", Sanitizer.sanitizeForHtml(rubricChoices.get(i)) + " (" + (numOfRubricChoices - i) + ")"); tableHeaderFragmentHtml.append(tableHeaderCell + Const.EOL); } return tableHeaderFragmentHtml.toString(); }
Source:
public void addAllReviewers(ChangeAttribute a, Change change) throws OrmException { ResultSet<PatchSetApproval> approvals = db.get().patchSetApprovals().byChange(change.getId()); a.allReviewers = Lists.newArrayList(); Set<Account.Id> accountIdlist = new HashSet<Account.Id>(); for (PatchSetApproval psa : approvals) { Account.Id accountId = psa.getAccountId(); if (!accountIdlist.contains(accountId)) { accountIdlist.add(accountId); a.allReviewers.add(asAccountAttribute(psa.getAccountId())); } } if (a.allReviewers.isEmpty()) { a.allReviewers = null; } }

Target:
public void addAllReviewers(ChangeAttribute a, Change change) throws OrmException { List<PatchSetApproval> approvals = db.get().patchSetApprovals().byChange(change.getId()).toList(); if (approvals.isEmpty()) { return; } a.allReviewers = Lists.newArrayList(); Set<Account.Id> accountIdlist = Sets.newHashSet(); for (PatchSetApproval psa : approvals) { Account.Id accountId = psa.getAccountId(); if (!accountIdlist.contains(accountId)) { accountIdlist.add(accountId); a.allReviewers.add(asAccountAttribute(psa.getAccountId())); } } }
Source:
public ZestRequest deepCopy () { ZestRequest zr = new ZestRequest(this.getIndex()); zr.setUrl(this.url); zr.setUrlToken(this.urlToken); zr.setData(this.data); zr.setMethod(this.method); zr.setHeaders(this.headers); zr.setFollowRedirects(this.followRedirects); if (this.getResponse()!= null) { zr.setResponse(this.getResponse().deepCopy()); } for (ZestAssertion zt : this.getAssertions()) { zr.addAssertion((ZestAssertion)zt.deepCopy()); } for (ZestCookie cookie : this.cookies) { zr.addCookie(new ZestCookie(cookie.getDomain(), cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getExpiryDate(), cookie.getSecure())); } zr.setEnabled(this.isEnabled()); return zr; }

Target:
public ZestRequest deepCopy () { ZestRequest zr = new ZestRequest(this.getIndex()); zr.setUrl(this.url); zr.setUrlToken(this.urlToken); zr.setData(this.data); zr.setMethod(this.method); zr.setHeaders(this.headers); zr.setFollowRedirects(this.followRedirects); if (this.getResponse()!= null) { zr.setResponse(this.getResponse().deepCopy()); } for (ZestAssertion zt : this.getAssertions()) { zr.addAssertion((ZestAssertion)zt.deepCopy()); } for (ZestCookie cookie : this.cookies) { zr.addCookie(new ZestCookie(cookie.getDomain(), cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getExpiryDate(), cookie.isSecure())); } zr.setEnabled(this.isEnabled()); return zr; }
Source:
private void setAuthenticatedUser(Api api) { QueryReturnValue returnValue = runQuery(QueryType.GetUserBySessionId, new QueryParametersBase()); DbUser authenticatedUser = (DbUser)returnValue.getReturnValue(); User user = new User(); user.setId(authenticatedUser.getId().toString()); LinkHelper.addLinks(user); api.setAuthenticatedUser(user); }

Target:
private void setAuthenticatedUser(Api api) { QueryReturnValue returnValue = runQuery(QueryType.GetUserBySessionId, new QueryParametersBase()); DbUser authenticatedUser = (DbUser)returnValue.getReturnValue(); User user = new User(); user.setId(authenticatedUser.getId().toString()); LinkHelper.addLinks(user); api.setAuthenticatedUser(user); api.setEffectiveUser(user); }
Source:
public DemoWorkflow() { super(DEMO_WORKFLOW_TYPE, State.begin, State.error, new WorkflowSettings.Builder().setWakeupParentWhenFinished(true).build()); setDescription("Simple demo workflow: start -> process -> end"); permit(State.begin, State.process); permit(State.process, State.done); }

Target:
public DemoWorkflow() { super(DEMO_WORKFLOW_TYPE, State.begin, State.error); setDescription("Simple demo workflow: start -> process -> end"); permit(State.begin, State.process); permit(State.process, State.done); }
Source:
public void setConflictValue(boolean missingHook, boolean statusConflict, boolean contentConflict) { this.conflictStatus = 0; if (missingHook) { this.conflictStatus = this.conflictStatus | MISSING_HOOK.getValue(); } if (statusConflict) { this.conflictStatus = this.conflictStatus | STATUS_CONFLICT.getValue(); } if (contentConflict) { this.conflictStatus = this.conflictStatus | CONTENT_CONFLICT.getValue(); } }

Target:
public void setConflictValue(boolean missingHook, boolean statusConflict, boolean contentConflict) { conflictStatus = 0; if (missingHook) { conflictStatus = conflictStatus | MISSING_HOOK.getValue(); } if (statusConflict) { conflictStatus = conflictStatus | STATUS_CONFLICT.getValue(); } if (contentConflict) { conflictStatus = conflictStatus | CONTENT_CONFLICT.getValue(); } }
Source:
private static String[] split(String commandLine) { final List<String> list = new ArrayList<String>(); boolean inquote = false; boolean inDblQuote = false; StringBuilder r = new StringBuilder(); for (int ip = 0; ip < commandLine.length();) { final char b = commandLine.charAt(ip++); switch (b) { case '\t': case ' ': if (inquote || inDblQuote) r.append(b); else if (r.length() > 0) { list.add(r.toString()); r = new StringBuilder(); } continue; case '\"': if (inquote) r.append(b); else inDblQuote = !inDblQuote; continue; case '\'': if (inDblQuote) r.append(b); else inquote = !inquote; continue; case '\\': if (inquote || ip == commandLine.length()) r.append(b); else r.append(commandLine.charAt(ip++)); continue; default: r.append(b); continue; } } if (r.length() > 0) { list.add(r.toString()); } return list.toArray(new String[list.size()]); }

Target:
private static String[] split(String commandLine) { final List<String> list = new ArrayList<String>(); boolean inquote = false; boolean inDblQuote = false; StringBuilder r = new StringBuilder(); for (int ip = 0; ip < commandLine.length();) { final char b = commandLine.charAt(ip++); switch (b) { case '\t': case ' ': if (inquote || inDblQuote) r.append(b); else if (r.length() > 0) { list.add(r.toString()); r = new StringBuilder(); } continue; case '\"': if (inquote) r.append(b); else inDblQuote = !inDblQuote; continue; case '\'': if (inDblQuote) r.append(b); else inquote = !inquote; continue; case '\\': if (inquote || ip == commandLine.length()) r.append(b); else r.append(commandLine.charAt(ip++)); continue; default: r.append(b); continue; } } if (r.length() > 0) list.add(r.toString()); return list.toArray(new String[list.size()]); }
Source:
private byte[] bytesFromByteBuffer(PhoenixArray array, ByteBuffer buffer, int noOfElements, Integer byteSize, int capacity) { int temp = noOfElements; if (buffer == null) return null; ByteBufferUtils.writeVLong(buffer, noOfElements); if (byteSize == null) { int fillerForOffsetByteArray = buffer.position(); buffer.position(fillerForOffsetByteArray + Bytes.SIZEOF_INT); ByteBuffer offsetArray = ByteBuffer.allocate(capacity); if(noOfElements < 0){ noOfElements = -noOfElements; } for (int i = 0; i < noOfElements; i++) { if (temp < 0) { offsetArray.putInt(buffer.position()); } else { offsetArray.putShort((short)buffer.position()); } byte[] bytes = array.toBytes(i); buffer.put(bytes); } int offsetArrayPosition = buffer.position(); buffer.put(offsetArray.array()); buffer.position(fillerForOffsetByteArray); buffer.putInt(offsetArrayPosition); } else { for (int i = 0; i < noOfElements; i++) { byte[] bytes = array.toBytes(i); buffer.put(bytes); } } return buffer.array(); }

Target:
private byte[] bytesFromByteBuffer(PhoenixArray array, ByteBuffer buffer, int noOfElements, Integer byteSize, int capacity) { int temp = noOfElements; if (buffer == null) return null; ByteBufferUtils.writeVLong(buffer, noOfElements); if (byteSize == null) { int fillerForOffsetByteArray = buffer.position(); buffer.position(fillerForOffsetByteArray + Bytes.SIZEOF_INT); ByteBuffer offsetArray = ByteBuffer.allocate(capacity); if(noOfElements < 0){ noOfElements = -noOfElements; } for (int i = 0; i < noOfElements; i++) { if (temp < 0) { offsetArray.putInt(buffer.position()); } else { offsetArray.putShort((short)(buffer.position() - Short.MAX_VALUE)); } byte[] bytes = array.toBytes(i); buffer.put(bytes); } int offsetArrayPosition = buffer.position(); buffer.put(offsetArray.array()); buffer.position(fillerForOffsetByteArray); buffer.putInt(offsetArrayPosition); } else { for (int i = 0; i < noOfElements; i++) { byte[] bytes = array.toBytes(i); buffer.put(bytes); } } return buffer.array(); }
Source:
public GlowPlayerProfile createProfile(String name) { checkNotNull(name); return createProfile(null, name); }

Target:
public GlowPlayerProfile createProfile(String name) { checkNotNull(name); UUID id = ProfileCache.getUuid(name).join(); if (id == null) { throw new IllegalArgumentException("Could not fetch UUID for username: " + name); } return createProfile(id, name); }
Source:
public GameInfoBean getByUid(int uid) { GameInfoBean gameInfoBean = null; try { gameInfoBean = uidToGameInfoBean.get(uid); }catch(NullPointerException e){ logger.error("Can't find in gameInfoBean map",uid); } return gameInfoBean; }

Target:
public GameInfoBean getByUid(int uid) { GameInfoBean gameInfoBean = uidToGameInfoBean.get(uid); if (gameInfoBean == null) { logger.warn("Can't find in gameInfoBean map", uid); } return gameInfoBean; }
Source:
public final void trigger(NodeInstance from, String type) { boolean hidden = false; if (getNode().getMetaData().get("hidden") != null) { hidden = true; } if (from != null) { this.metaData.put("IncomingConnection", from.getNode().getMetaData().get("UniqueId")); } if (dynamicParameters != null) { for (Entry<String, Object> entry : dynamicParameters.entrySet()) { setVariable(entry.getKey(), entry.getValue()); } } configureSla(); InternalKnowledgeRuntime kruntime = getProcessInstance().getKnowledgeRuntime(); if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireBeforeNodeTriggered(this, kruntime); } try { getExecutionErrorHandler().processing(this); internalTrigger(from, type); } catch (WorkflowRuntimeException e) { throw e; } catch (Exception e) { throw new WorkflowRuntimeException(this, getProcessInstance(), e); } if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireAfterNodeTriggered(this, kruntime); } }

Target:
public final void trigger(NodeInstance from, String type) { boolean hidden = false; if (getNode().getMetaData().get("hidden") != null) { hidden = true; } if (from != null) { this.metaData.put("IncomingConnection", from.getNode().getMetaData().get(UNIQUE_ID)); } if (dynamicParameters != null) { for (Entry<String, Object> entry : dynamicParameters.entrySet()) { setVariable(entry.getKey(), entry.getValue()); } } configureSla(); InternalKnowledgeRuntime kruntime = getProcessInstance().getKnowledgeRuntime(); if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireBeforeNodeTriggered(this, kruntime); } try { getExecutionErrorHandler().processing(this); internalTrigger(from, type); } catch (WorkflowRuntimeException e) { throw e; } catch (Exception e) { throw new WorkflowRuntimeException(this, getProcessInstance(), e); } if (!hidden) { ((InternalProcessRuntime) kruntime.getProcessRuntime()) .getProcessEventSupport().fireAfterNodeTriggered(this, kruntime); } }
Source:
private static VdsDao getVdsDao() { return DbFacade.getInstance().getVdsDao(); }

Target:
private static VdsDao getVdsDao() { return Injector.get(VdsDao.class); }
Source:
private void printHelp(String command, CommandSpec commandSpec, PrintStream os) { if (consolePresent) { os.print(COLOR_CODE); os.print(command); os.print("\033[0m"); } else { os.print(command); } if (commandSpec instanceof OptionsCommandSpec) { OptionsCommandSpec ocs = (OptionsCommandSpec)commandSpec; if (ocs.options != null) { os.print(" [options]"); } } if (commandSpec.requiredArgs != null) { for (Arg arg : commandSpec.requiredArgs) { if (consolePresent) { os.print(" \033[3m" + arg + "\033[0m"); } else { os.print(" <" + arg + ">"); } } } if (commandSpec.optionalArgs != null) { for (Arg arg : commandSpec.optionalArgs) { if (consolePresent) { os.print(" [\033[3m" + arg + "\033[0m"); } else { os.print(" [<" + arg + ">"); } if (arg instanceof VarArg) { os.print(" ..."); } os.print("]"); } } os.println("\n\t" + commandSpec.description); if (commandSpec instanceof OptionsCommandSpec) { OptionsCommandSpec ocs = (OptionsCommandSpec)commandSpec; if (ocs.options != null) { os.println("\tOptions:"); HelpFormatter formatter = new HelpFormatter(); PrintWriter pw = new PrintWriter(os); formatter.printOptions(pw, 80, ocs.options, 12, 4); pw.flush(); } } }

Target:
private void printHelp(String command, CommandSpec commandSpec, PrintStream os) { if (consolePresent) { os.print(getHighlightColor()); os.print(command); os.print(COLOR_RESET); } else { os.print(command); } if (commandSpec instanceof OptionsCommandSpec) { OptionsCommandSpec ocs = (OptionsCommandSpec)commandSpec; if (ocs.options != null) { os.print(" [options]"); } } if (commandSpec.requiredArgs != null) { for (Arg arg : commandSpec.requiredArgs) { if (consolePresent) { os.print(" " + ITALICS + arg + COLOR_RESET); } else { os.print(" <" + arg + ">"); } } } if (commandSpec.optionalArgs != null) { for (Arg arg : commandSpec.optionalArgs) { if (consolePresent) { os.print(" [" + ITALICS + arg + COLOR_RESET); } else { os.print(" [<" + arg + ">"); } if (arg instanceof VarArg) { os.print(" ..."); } os.print("]"); } } os.println("\n\t" + commandSpec.description); if (commandSpec instanceof OptionsCommandSpec) { OptionsCommandSpec ocs = (OptionsCommandSpec)commandSpec; if (ocs.options != null) { os.println("\tOptions:"); HelpFormatter formatter = new HelpFormatter(); PrintWriter pw = new PrintWriter(os); formatter.printOptions(pw, 80, ocs.options, 12, 4); pw.flush(); } } }
Source:
private void onAssignmentAdded(SubscriptionAssignment assignment) { assignments.add(assignment); if (consumerNodeId.equals(assignment.getConsumerNodeId())) { callbacks.forEach(callback -> callback.onSubscriptionAssigned(assignment.getSubscriptionName()) ); } }

Target:
private void onAssignmentAdded(SubscriptionAssignment assignment) { try { if (assignments.add(assignment) && consumerNodeId.equals(assignment.getConsumerNodeId())) { callbacks.forEach(callback -> callback.onSubscriptionAssigned(assignment.getSubscriptionName())); } } catch (Exception e) { logger.error("Exception while adding assignment {}", assignment, e); } }
Source:
public String getId() { return "com.fsck.k9"; }

Target:
public String getId() { return "fallback-photo"; }
Source:
protected abstract DatastreamProducerRecord translate(ConsumerRecord<?, ?> fromKafka, Instant readTime) throws Exception; protected void translateAndSendBatch(ConsumerRecords<?, ?> records, Instant readTime) throws Exception { for (TopicPartition topicPartition : records.partitions()) { for (ConsumerRecord<?, ?> record : records.records(topicPartition)) { try { sendMessage(record, readTime); } catch (RuntimeException e) { _consumerMetrics.updateErrorRate(1); seekToLastCheckpoint(Collections.singleton(topicPartition)); if (_pausePartitionOnSendFailure) { _logger.warn("Got exception while sending record {}, adding topic partition to auto-pause set", record, topicPartition); _autoPausedSourcePartitions.add(topicPartition); _taskUpdates.add(DatastreamConstants.UpdateType.PAUSE_RESUME_PARTITIONS); } break; } } } }

Target:
protected abstract DatastreamProducerRecord translate(ConsumerRecord<?, ?> fromKafka, Instant readTime) throws Exception; protected void translateAndSendBatch(ConsumerRecords<?, ?> records, Instant readTime) throws Exception { boolean shouldAddPausePartitionsTask = false; for (TopicPartition topicPartition : records.partitions()) { for (ConsumerRecord<?, ?> record : records.records(topicPartition)) { try { sendMessage(record, readTime); } catch (RuntimeException e) { _consumerMetrics.updateErrorRate(1); seekToLastCheckpoint(Collections.singleton(topicPartition)); if (_pausePartitionOnError) { _logger.warn("Got exception while sending record {}, adding topic partition to auto-pause set", record, topicPartition); _autoPausedSourcePartitions.add(topicPartition); shouldAddPausePartitionsTask = true; } break; } } } if (shouldAddPausePartitionsTask) { _taskUpdates.add(DatastreamConstants.UpdateType.PAUSE_RESUME_PARTITIONS); } }
Source:
public void setData(List<ImportKeysListEntry> data) { this.mData = data; this.mKeyStates = new KeyState[data.size()]; for (int i = 0; i < mKeyStates.length; i++) { mKeyStates[i] = new KeyState(); } if (mData.size() == 1) getKey(mData.get(0), true); notifyDataSetChanged(); }

Target:
public void setData(List<ImportKeysListEntry> data) { mData = data; mKeyStates = new KeyState[data.size()]; for (int i = 0; i < mKeyStates.length; i++) { mKeyStates[i] = new KeyState(); ImportKeysListEntry entry = mData.get(i); long keyId = KeyFormattingUtils.convertKeyIdHexToKeyId(entry.getKeyIdHex()); try { KeyRing keyRing; if (entry.isSecretKey()) { keyRing = mProviderHelper.getCanonicalizedSecretKeyRing(keyId); } else { keyRing = mProviderHelper.getCachedPublicKeyRing(keyId); } mKeyStates[i].mAlreadyPresent = true; mKeyStates[i].mVerified = keyRing.getVerified() > 0; } catch (ProviderHelper.NotFoundException | PgpKeyNotFoundException ignored) { } } if (mData.size() == 1) { mCurrent = 0; getKey(mData.get(0), true); } notifyDataSetChanged(); }
Source:
public static void toJSON(OutputWriter writer, ArtifactStores stores) { writer.addLinks( outputLinkWriter -> outputLinkWriter.addLink("self", Routes.ArtifactStoreConfig.BASE)) .addChild("_embedded", embeddedWriter -> embeddedWriter.addChildList("artifact_stores", artifactStoresWriter -> stores.forEach( store -> artifactStoresWriter.addChild( artifactStoreWriter -> ArtifactStoreRepresenter.toJSON(artifactStoreWriter, store))))); }

Target:
public static void toJSON(OutputWriter writer, ArtifactStores stores) { writer.addLinks( outputLinkWriter -> outputLinkWriter .addLink("self", Routes.ArtifactStoreConfig.BASE) .addAbsoluteLink("doc", Routes.ArtifactStoreConfig.DOC) .addLink("find", Routes.ArtifactStoreConfig.find())) .addChild("_embedded", embeddedWriter -> embeddedWriter.addChildList("artifact_stores", artifactStoresWriter -> stores.forEach( store -> artifactStoresWriter.addChild( artifactStoreWriter -> ArtifactStoreRepresenter.toJSON(artifactStoreWriter, store))))); }
Source:
public void setHtmlTemplate(FreemarkerTemplate htmlTemplate) { if (this.getUseFreemarkerTemplate()) { set(LANDING_PAGE_HTML_TEMPLATE, htmlTemplate); } }

Target:
public void setHtmlTemplate(FreemarkerTemplate htmlTemplate) { set(LANDING_PAGE_HTML_TEMPLATE, htmlTemplate); }
Source:
public Schema getSchema(FormatContext context) { if (conf.containsMacro("schema")) { return super.getSchema(context); } if (!Strings.isNullOrEmpty(conf.schema)) { return super.getSchema(context); } String filePath = conf.getProperties().getProperties().getOrDefault("path", null); if (filePath == null) { return super.getSchema(context); } try { Job job = JobUtils.createInstance(); Configuration hconf = job.getConfiguration(); Path file = conf.getFilePathForSchemaGeneration(filePath, NAME, hconf); DatumReader<GenericRecord> dataReader = new GenericDatumReader<GenericRecord>(); SeekableInput seekableInput = new FsInput(file, hconf); FileReader<GenericRecord> dataFileReader = DataFileReader .openReader(seekableInput, dataReader); GenericRecord firstRecord; if (!dataFileReader.hasNext()) { return null; } firstRecord = dataFileReader.next(); return new AvroToStructuredTransformer().convertSchema(firstRecord.getSchema()); } catch (IOException e) { context.getFailureCollector().addFailure("Schema parse error", e.getMessage()); } return super.getSchema(context); }

Target:
public Schema getSchema(FormatContext context) { if (conf.containsMacro("schema")) { return super.getSchema(context); } if (!Strings.isNullOrEmpty(conf.schema)) { return super.getSchema(context); } String filePath = conf.getProperties().getProperties().getOrDefault("path", null); if (filePath == null) { return super.getSchema(context); } try { return getDefaultSchema(context); } catch (IOException e) { throw new IllegalArgumentException("Invalid schema: " + e.getMessage(), e); } }
Source:
private void requestReadMoreItems(final LayoutInflater layoutInflater, final PageTitle myTitle) { if (myTitle == null || TextUtils.isEmpty(myTitle.getPrefixedText())) { hideReadMore(); layoutContent(); return; } new SuggestionsTask(app.getAPIForSite(myTitle.getSite()), myTitle.getSite(), myTitle.getPrefixedText()) { @Override public void onFinish(SearchResults results) { readMoreItems = results; if (!readMoreItems.getPageTitles().isEmpty()) { setupReadMoreSection(layoutInflater, readMoreItems); readMoreContainer.setVisibility(View.VISIBLE); } else { readMoreContainer.setVisibility(View.GONE); } layoutContent(); } @Override public void onCatch(Throwable caught) { Log.w(TAG, "Error while fetching Read More titles.", caught); layoutContent(); } }.execute(); }

Target:
private void requestReadMoreItems(final LayoutInflater layoutInflater, final PageTitle myTitle) { if (myTitle == null || TextUtils.isEmpty(myTitle.getPrefixedText())) { hideReadMore(); layoutContent(); return; } new SuggestionsTask(app.getAPIForSite(myTitle.getSite()), myTitle.getSite(), myTitle.getPrefixedText()) { @Override public void onFinish(SearchResults results) { readMoreItems = results; if (!readMoreItems.getPageTitles().isEmpty()) { setupReadMoreSection(layoutInflater, readMoreItems); showReadMore(); } else { hideReadMore(); } layoutContent(); } @Override public void onCatch(Throwable caught) { Log.w(TAG, "Error while fetching Read More titles.", caught); layoutContent(); } }.execute(); }
Source:
private static void testStateSystemExplorer() { SWTWorkbenchBot bot = new SWTWorkbenchBot(); List<String> expectedAnalyses = new ArrayList<>(); expectedAnalyses.addAll(EXPECTED_ANALYSES); expectedAnalyses.sort(null); SWTBotUtils.openView(TmfStateSystemExplorer.ID); SWTBotView sseBot = bot.viewByTitle("State System Explorer"); sseBot.show(); SWTBotTree tree = sseBot.bot().tree(); bot.waitUntil(new TreeIsPopulatedCondition(tree)); tree.getAllItems()[0].expand(); List<String> actual = sseBot.bot().tree().getAllItems()[0].getNodes(); actual.sort(null); assertTrue("State systems are not what expected : " + EXPECTED_ANALYSES + " instead " + actual, actual.containsAll(EXPECTED_ANALYSES)); sseBot.close(); SWTBotUtils.openView(TmfStateSystemExplorer.ID); sseBot = bot.viewByTitle("State System Explorer"); sseBot.show(); tree = sseBot.bot().tree(); bot.waitUntil(new TreeIsPopulatedCondition(tree)); tree.getAllItems()[0].expand(); actual.clear(); actual.addAll(sseBot.bot().tree().getAllItems()[0].getNodes()); actual.sort(String.CASE_INSENSITIVE_ORDER); assertTrue("State systems are not what expected : " + EXPECTED_ANALYSES + " instead " + actual, actual.containsAll(EXPECTED_ANALYSES)); }

Target:
private static void testStateSystemExplorer() { SWTWorkbenchBot bot = new SWTWorkbenchBot(); List<String> expectedAnalyses = new ArrayList<>(); expectedAnalyses.addAll(EXPECTED_ANALYSES); expectedAnalyses.sort(null); SWTBotUtils.openView(TmfStateSystemExplorer.ID); SWTBotView sseBot = bot.viewByTitle("State System Explorer"); sseBot.show(); SWTBotTree tree = sseBot.bot().tree(); bot.waitWhile(treeHasRows(tree, 0)); tree.getAllItems()[0].expand(); List<String> actual = sseBot.bot().tree().getAllItems()[0].getNodes(); assertTrue("State systems are not what expected : " + EXPECTED_ANALYSES + " instead " + actual, actual.containsAll(EXPECTED_ANALYSES)); sseBot.close(); SWTBotUtils.openView(TmfStateSystemExplorer.ID); sseBot = bot.viewByTitle("State System Explorer"); sseBot.show(); tree = sseBot.bot().tree(); bot.waitWhile(treeHasRows(tree, 0)); tree.getAllItems()[0].expand(); actual.clear(); actual.addAll(sseBot.bot().tree().getAllItems()[0].getNodes()); assertTrue("State systems are not what expected : " + EXPECTED_ANALYSES + " instead " + actual, actual.containsAll(EXPECTED_ANALYSES)); }
Source:
void shutdownProducer() { Producer<K, V> producer; try { _producerLock.lock(); if (_kafkaProducer == null || closeInProgress) { return; } producer = _kafkaProducer; closeInProgress = true; _kafkaProducer = null; _producerCloseExecutorService.submit(() -> { _log.info("KafkaProducerWrapper: Closing the Kafka Producer"); try { producer.close(CLOSE_TIMEOUT_MS, TimeUnit.MILLISECONDS); NUM_PRODUCERS.decrementAndGet(); _log.info("KafkaProducerWrapper: Kafka Producer is closed"); } finally { try { _producerLock.lock(); closeInProgress = false; _waitOnNoProducerClose.signalAll(); } finally { _producerLock.unlock(); } } }); } finally { _producerLock.unlock(); } }

Target:
void shutdownProducer() { Producer<K, V> producer; try { _producerLock.lock(); if (_kafkaProducer == null || _closeInProgress) { return; } producer = _kafkaProducer; _closeInProgress = true; _kafkaProducer = null; _producerCloseExecutorService.submit(() -> { _log.info("KafkaProducerWrapper: Closing the Kafka Producer"); try { producer.close(CLOSE_TIMEOUT_MS, TimeUnit.MILLISECONDS); NUM_PRODUCERS.decrementAndGet(); _log.info("KafkaProducerWrapper: Kafka Producer is closed"); } finally { markProducerCloseComplete(); } }); } finally { _producerLock.unlock(); } }
Source:
private void sendIPDataImpl(Inet4Address ipAddress, int destPort, IPProtocol protocol, boolean closeSocket, byte[] data) throws TimeoutException, XBeeException { if (ipAddress == null) throw new NullPointerException("IP address cannot be null"); if (data == null) throw new NullPointerException("Data cannot be null"); if (destPort < 0 || destPort > 65535) throw new IllegalArgumentException("Destination port must be between 0 and 65535."); if (isRemote()) throw new OperationNotSupportedException("Cannot send IP data from a remote device."); int sourcePort = this.sourcePort; if (protocol != IPProtocol.UDP) sourcePort = 0; logger.debug(toString() + "Sending IP data to {}:{} >> {}.", ipAddress, destPort, HexUtils.prettyHexString(data)); XBeePacket xbeePacket = new TXIPv4Packet(getNextFrameID(), ipAddress, destPort, sourcePort, protocol, closeSocket ? TXIPv4Packet.OPTIONS_CLOSE_SOCKET: TXIPv4Packet.OPTIONS_LEAVE_SOCKET_OPEN, data); sendAndCheckXBeePacket(xbeePacket, false); }

Target:
private void sendIPDataImpl(Inet4Address ipAddress, int destPort, IPProtocol protocol, boolean closeSocket, byte[] data) throws TimeoutException, XBeeException { if (ipAddress == null) throw new NullPointerException("IP address cannot be null"); if (protocol == null) throw new NullPointerException("Protocol cannot be null"); if (data == null) throw new NullPointerException("Data cannot be null"); if (destPort < 0 || destPort > 65535) throw new IllegalArgumentException("Destination port must be between 0 and 65535."); if (isRemote()) throw new OperationNotSupportedException("Cannot send IP data from a remote device."); int sourcePort = this.sourcePort; if (protocol != IPProtocol.UDP) sourcePort = 0; logger.debug(toString() + "Sending IP data to {}:{} >> {}.", ipAddress, destPort, HexUtils.prettyHexString(data)); XBeePacket xbeePacket = new TXIPv4Packet(getNextFrameID(), ipAddress, destPort, sourcePort, protocol, closeSocket ? TXIPv4Packet.OPTIONS_CLOSE_SOCKET: TXIPv4Packet.OPTIONS_LEAVE_SOCKET_OPEN, data); sendAndCheckXBeePacket(xbeePacket, false); }
Source:
@Override public void visit(SchemaIndexCacheVisitorClosure clo) throws IgniteCheckedException { assert clo != null; List<GridDhtLocalPartition> parts = cctx.topology().localPartitions(); if (parts.isEmpty()) return; partsCnt.set(parts.size()); GridCompoundFuture<SchemaIndexCacheStat, SchemaIndexCacheStat> fut = null; if (parallelism > 1) { fut = new GridCompoundFuture<>(new SchemaIndexCacheStatFutureReducer()); for (int i = 1; i < parallelism; i++) fut.add(processPartitionsAsync(parts, clo, i)); fut.markInitialized(); } final SchemaIndexCacheStat stat; try { stat = processPartitions(parts, clo, 0); } catch (Throwable e) { U.error(log, "Error during parallel index create/rebuild.", e); stop = true; resetPartitionsCount(); throw e; } if (fut != null && stat != null) { final SchemaIndexCacheStat st = fut.get(); stat.scanned += st.scanned; stat.types.putAll(st.types); } printIndexStats(stat); }

Target:
@Override public void visit(SchemaIndexCacheVisitorClosure clo) { assert nonNull(clo); List<GridDhtLocalPartition> locParts = cctx.topology().localPartitions(); if (locParts.isEmpty()) { buildIdxFut.onDone(); return; } cctx.group().metrics().addIndexBuildCountPartitionsLeft(locParts.size()); beforeExecute(); AtomicInteger partsCnt = new AtomicInteger(locParts.size()); AtomicBoolean stop = new AtomicBoolean(); GridCompoundFuture<SchemaIndexCacheStat, SchemaIndexCacheStat> buildIdxCompoundFut = new GridCompoundFuture<>(); for (GridDhtLocalPartition locPart : locParts) { GridWorkerFuture<SchemaIndexCacheStat> workerFut = new GridWorkerFuture<>(); GridWorker worker = new SchemaIndexCachePartitionWorker(cctx, locPart, stop, cancel, clo, workerFut, rowFilter, partsCnt); workerFut.setWorker(worker); buildIdxCompoundFut.add(workerFut); cctx.kernalContext().buildIndexExecutorService().execute(worker); } buildIdxCompoundFut.listen(fut -> { Throwable err = fut.error(); if (isNull(err) && collectStat && log.isInfoEnabled()) { try { GridCompoundFuture<SchemaIndexCacheStat, SchemaIndexCacheStat> compoundFut = (GridCompoundFuture<SchemaIndexCacheStat, SchemaIndexCacheStat>)fut; SchemaIndexCacheStat resStat = new SchemaIndexCacheStat(); compoundFut.futures().stream() .map(IgniteInternalFuture::result) .filter(Objects::nonNull) .forEach(resStat::accumulate); log.info(indexStatStr(resStat)); } catch (Exception e) { log.error("Error when trying to print index build/rebuild statistics [cacheName=" + cctx.cache().name() + ", grpName=" + cctx.group().name() + "]", e); } } buildIdxFut.onDone(err); }); buildIdxCompoundFut.markInitialized(); }
Source:
public TupleTypeValue(List<TypeValue> subtypes) { this.subtypes = subtypes; }

Target:
public TupleTypeValue(List<TypeValue> subtypes) { this.subtypes = ImmutableList.copyOf(subtypes); }
Source:
public boolean getDualCommitEnabled() { return Boolean.parseBoolean(getStringLastValue("kafka.dual.commit.enabled", "true")); }

Target:
public String getDualCommitEnabled() { return getString("kafka.dual.commit.enabled"); }
Source:
public OpenWireProtocolManager(OpenWireProtocolManagerFactory factory, ActiveMQServer server) { this.factory = factory; this.server = server; this.wireFactory = new OpenWireFormatFactory(); wireFactory.setCacheEnabled(false); advisoryProducerId.setConnectionId(ID_GENERATOR.generateId()); scheduledPool = server.getScheduledPool(); this.wireFormat = (OpenWireFormat) wireFactory.createWireFormat(); final ClusterManager clusterManager = this.server.getClusterManager(); ClusterConnection cc = clusterManager.getDefaultConnection(null); if (cc != null) { cc.addClusterTopologyListener(this); } if (supportAdvisory) { clusterManager.addToIgnoredAddressPrefixes(AdvisorySupport.ADVISORY_TOPIC_PREFIX); } else { clusterManager.removeFromIgnoredAddressPrefixes(AdvisorySupport.ADVISORY_TOPIC_PREFIX); } }

Target:
public OpenWireProtocolManager(OpenWireProtocolManagerFactory factory, ActiveMQServer server) { this.factory = factory; this.server = server; this.wireFactory = new OpenWireFormatFactory(); wireFactory.setCacheEnabled(false); advisoryProducerId.setConnectionId(ID_GENERATOR.generateId()); scheduledPool = server.getScheduledPool(); this.wireFormat = (OpenWireFormat) wireFactory.createWireFormat(); final ClusterManager clusterManager = this.server.getClusterManager(); ClusterConnection cc = clusterManager.getDefaultConnection(null); if (cc != null) { cc.addClusterTopologyListener(this); } if (supportAdvisory) { clusterManager.addToIgnoredAddressPrefixes(AdvisorySupport.ADVISORY_TOPIC_PREFIX); } }
Source:
public void clean() { ShellHandler.getInstance().closeAllNonWorbenchShells(); new ProjectExplorer().deleteAllProjects(); try { new WaitWhile(new JobIsRunning(), TimePeriod.LONG); new ServerAdapter(Version.OPENSHIFT3, OpenShiftResources.NODEJS_SERVICE).delete(); } catch (OpenShiftToolsException ex) { } }

Target:
public void clean() { ProjectExplorer pe = new ProjectExplorer(); pe.open(); pe.deleteAllProjects(); try { new WaitWhile(new JobIsRunning(), TimePeriod.LONG); new ServerAdapter(Version.OPENSHIFT3, OpenShiftResources.NODEJS_SERVICE).delete(); } catch (OpenShiftToolsException ex) { } }