auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private List<DetailAST> findMatchingNodesByXpathQuery(DetailAST rootAST) { final XPathEvaluator xpathEvaluator = new XPathEvaluator(Configuration.newConfiguration()); try { final RootNode rootNode = new RootNode(rootAST); <START> final XPathExpression xpathExpression = xpathEvaluator.createExpression(query); <END> final XPathDynamicContext xpathDynamicContext = xpathExpression.createDynamicContext(rootNode); final List<Item> matchingItems = xpathExpression.evaluate(xpathDynamicContext); return matchingItems.stream() .map(item -> ((AbstractNode) item).getUnderlyingNode()) .collect(Collectors.toList()); } catch (XPathException ex) { throw new IllegalStateException("Evaluation of Xpath query failed: " + query, ex); } }</code><technical_language>final XPathEvaluator xpathEvaluator = new XPathEvaluator(Configuration.newConfiguration()); final XPathExpression xpathExpression = xpathEvaluator.createExpression(query); this execution done for Checkstyle execution ? for example in "setQuery"</technical_language>

Target:
private List<DetailAST> findMatchingNodesByXpathQuery(DetailAST rootAST) { try { final RootNode rootNode = new RootNode(rootAST); final XPathDynamicContext xpathDynamicContext = xpathExpression.createDynamicContext(rootNode); final List<Item> matchingItems = xpathExpression.evaluate(xpathDynamicContext); return matchingItems.stream() .map(item -> ((AbstractNode) item).getUnderlyingNode()) .collect(Collectors.toList()); } catch (XPathException ex) { throw new IllegalStateException("Evaluation of Xpath query failed: " + query, ex); } }
Source:
<code><START> public MeetupRsvpStream(File dataFile) <END> throws Exception { Properties properties = new Properties(); properties.put("metadata.broker.list", KafkaStarterUtils.DEFAULT_KAFKA_BROKER); properties.put("serializer.class", "kafka.serializer.DefaultEncoder"); properties.put("request.required.acks", "1"); producer = StreamDataProvider.getStreamDataProducer(KafkaStarterUtils.KAFKA_PRODUCER_CLASS_NAME, properties); _dataFile = dataFile; _service = Executors.newFixedThreadPool(1); }</code><technical_language>I a live stream for a reason. evaluate if is a good idea, if so, it, opposed a dataFile. is a data-file, is other provider (not necessarily meetup)</technical_language>

Target:
public MeetupRsvpStream(File dataFile) throws Exception { this(dataFile, false); }
Source:
<code>public void setDisableCliSchedule(EntityModel<Boolean> value) { this.disableCliSchedule = value; <START> this.disableCliSchedule.setIsAvailable(value.getEntity()); <END> }</code><technical_language>this of for in init is false. I in line 442 of GlusterVolumeSnapshotListModel snapshotModel#getDisableCliSchedule#setEntity right</technical_language>

Target:
public void setDisableCliSchedule(EntityModel<Boolean> value) { this.disableCliSchedule = value; }
Source:
<code>protected void EndWithFailure() { setVm(DbFacade.getInstance().getVmDAO().getById(getVmId())); vm_pools vmPool = getVmPool(); <START> <END> setSucceeded(Backend.getInstance().endAction(VdcActionType.RunVm, getParameters().getImagesParameters().get(0), getCompensationContext()).getSucceeded()); if (!getSucceeded()) { log.warn("AttachUserToVmFromPoolAndRunCommand::EndWitFailure: EndAction of RunVm Failed"); } detachUserFromVmFromPool(); }</code><technical_language>endAction of RunVm called automatically</technical_language>

Target:
protected void EndWithFailure() { setSucceeded(Backend.getInstance().endAction(VdcActionType.RunVm, getParameters().getImagesParameters().get(0), getCompensationContext()).getSucceeded()); if (!getSucceeded()) { log.warn("AttachUserToVmFromPoolAndRunCommand::EndWitFailure: EndAction of RunVm Failed"); } detachUserFromVmFromPool(); }
Source:
<code>public TCCLObjectInputStream(InputStream in) throws IOException { super(in); <START> this.classLoader = Thread.currentThread().getContextClassLoader(); <END> }</code><technical_language>Replace this(in, null)</technical_language>

Target:
public TCCLObjectInputStream(InputStream in) throws IOException { this(in, null); }
Source:
<code>protected final StringBuilder appendOperands(StringBuilder sb) { List<String> operandDigests = new ArrayList<>(operands.size()); for (int i = 0; i < operands.size(); i++) { RexNode operand = operands.get(i); if (!(operand instanceof RexLiteral)) { operandDigests.add(operand.toString()); continue; } RexDigestIncludeType includeType = RexDigestIncludeType.OPTIONAL; if ((isA(SqlKind.AND) || isA(SqlKind.OR)) && operand.getType().getSqlTypeName() == SqlTypeName.BOOLEAN) { includeType = RexDigestIncludeType.NO_TYPE; } if (SIMPLE_BINARY_OPS.contains(getKind()) && operands.size() == 2) { RexNode otherArg = operands.get(1 - i); if ((!(otherArg instanceof RexLiteral) || ((RexLiteral) otherArg).digestIncludesType() == RexDigestIncludeType.NO_TYPE) && equalSansNullability(operand.getType(), otherArg.getType())) { <START> includeType = RexDigestIncludeType.NO_TYPE; <END> } } operandDigests.add(((RexLiteral) operand).computeDigest(includeType)); } int totalLength = (operandDigests.size() - 1) * 2; for (String s : operandDigests) { totalLength += s.length(); } sb.ensureCapacity(sb.length() + totalLength); if (SIMPLE_COMMUTATIVE_OPS.contains(op.getKind())) { operandDigests.sort(OPERAND_READABILITY_COMPARATOR); } for (int i = 0; i < operandDigests.size(); i++) { String op = operandDigests.get(i); if (i != 0) { sb.append(", "); } sb.append(op); } return sb; }</code><technical_language>operands empty</technical_language>

Target:
protected final StringBuilder appendOperands(StringBuilder sb) { if (operands.isEmpty()) { return sb; } List<String> operandDigests = new ArrayList<>(operands.size()); for (int i = 0; i < operands.size(); i++) { RexNode operand = operands.get(i); if (!(operand instanceof RexLiteral)) { operandDigests.add(operand.toString()); continue; } RexDigestIncludeType includeType = RexDigestIncludeType.OPTIONAL; if ((isA(SqlKind.AND) || isA(SqlKind.OR)) && operand.getType().getSqlTypeName() == SqlTypeName.BOOLEAN) { includeType = RexDigestIncludeType.NO_TYPE; } if (SIMPLE_BINARY_OPS.contains(getKind()) && operands.size() == 2) { RexNode otherArg = operands.get(1 - i); if ((!(otherArg instanceof RexLiteral) || ((RexLiteral) otherArg).digestIncludesType() == RexDigestIncludeType.NO_TYPE) && equalSansNullability(operand.getType(), otherArg.getType())) { includeType = RexDigestIncludeType.NO_TYPE; } } operandDigests.add(((RexLiteral) operand).computeDigest(includeType)); } int totalLength = (operandDigests.size() - 1) * 2; for (String s : operandDigests) { totalLength += s.length(); } sb.ensureCapacity(sb.length() + totalLength); sortOperandsIfNeeded(sb, operands, operandDigests); for (int i = 0; i < operandDigests.size(); i++) { String op = operandDigests.get(i); if (i != 0) { sb.append(", "); } sb.append(op); } return sb; }
Source:
<code>public void commit_txn(CommitTxnRequest rqst) throws TException { getTxnHandler().commitTxn(rqst); <START> MetaStoreListenerNotifier.notifyEvent(transactionalListeners, <END> EventType.COMMIT_TXN, new CommitTxnEvent(rqst.getTxnid(), this)); }</code><technical_language>listeners notified</technical_language>

Target:
public void commit_txn(CommitTxnRequest rqst) throws TException { getTxnHandler().commitTxn(rqst); if (listeners != null && !listeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(listeners, EventType.COMMIT_TXN, new CommitTxnEvent(rqst.getTxnid(), this)); } }
Source:
<code>private static Tree firstStatementParent(Tree node) { Tree current = node; <START> while (true) { <END> if (current instanceof StatementTree) { return current; } current = current.parent(); } }</code><technical_language>safer a current != null</technical_language>

Target:
private static Tree firstStatementParent(Tree node) { Tree current = node.parent(); while (current != null) { if (current instanceof StatementTree) { break; } current = current.parent(); } return current; }
Source:
<code>public synchronized GrillResultSetMetadata getMetadata() throws GrillException { if (grillResultMeta == null) { grillResultMeta = new GrillResultSetMetadata() { @Override public List<ColumnDescriptor> getColumns() { try{ ResultSetMetaData rsmeta = getRsMetadata(); List<ColumnDescriptor> columns = new ArrayList<ColumnDescriptor>(rsmeta.getColumnCount()); System.out.println("Column count:" + rsmeta.getColumnCount()); <START> for (int i = 1; i <= rsmeta.getColumnCount(); i++) { <END> FieldSchema col = new FieldSchema(rsmeta.getColumnName(i), TypeInfoUtils.getTypeInfoFromTypeString( getHiveTypeForSQLType(i, rsmeta)).getTypeName(), rsmeta.getColumnTypeName(i)); columns.add(new ColumnDescriptor(col, i)); } return columns; } catch (Exception e) { LOG.error("Error getting JDBC type information: " + e.getMessage(), e); return null; } } }; } return grillResultMeta; }</code><technical_language>Debug statement removed</technical_language>

Target:
public synchronized GrillResultSetMetadata getMetadata() throws GrillException { if (grillResultMeta == null) { grillResultMeta = new GrillResultSetMetadata() { @Override public List<ColumnDescriptor> getColumns() { try{ ResultSetMetaData rsmeta = getRsMetadata(); List<ColumnDescriptor> columns = new ArrayList<ColumnDescriptor>(rsmeta.getColumnCount()); for (int i = 1; i <= rsmeta.getColumnCount(); i++) { FieldSchema col = new FieldSchema(rsmeta.getColumnName(i), TypeInfoUtils.getTypeInfoFromTypeString( getHiveTypeForSQLType(i, rsmeta)).getTypeName(), rsmeta.getColumnTypeName(i)); columns.add(new ColumnDescriptor(col, i)); } return columns; } catch (Exception e) { LOG.error("Error getting JDBC type information: " + e.getMessage(), e); return null; } } }; } return grillResultMeta; }
Source:
<code>private void handleUrlClicked(final String url) { Log.d(TAG, "handleUrlClicked() url: " + url); if(TextUtils.isEmpty(url)) return; AlertDialog.Builder builder = new AlertDialog.Builder(this); @SuppressLint("InflateParams") View v = getLayoutInflater().inflate(R.layout.dialog_title_url, null); TextView tv = (TextView)v.findViewById(R.id.tv_dialog_title_url); tv.setText(url); builder.setCustomTitle(v); builder.setItems( new CharSequence[]{ getString(R.string.d_urlAction_openInBrowser), getString(R.string.d_urlAction_addToWallabag), getString(R.string.d_urlAction_copytoclipboard), getString(R.string.menuShare), }, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { switch (which) { case 0: openURL(url); break; case 1: ServiceHelper.addLink(ReadArticleActivity.this, url); break; case 2: ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); ClipData clip = ClipData.newRawUri("wallabag", Uri.parse(url)); clipboard.setPrimaryClip(clip); break; case 3: Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_TEXT, url); <START> sendIntent.setType("text/plan"); <END> startActivity(sendIntent); } } }); builder.show(); }</code><technical_language>i guess text/plain</technical_language>

Target:
private void handleUrlClicked(final String url) { Log.d(TAG, "handleUrlClicked() url: " + url); if(TextUtils.isEmpty(url)) return; AlertDialog.Builder builder = new AlertDialog.Builder(this); @SuppressLint("InflateParams") View v = getLayoutInflater().inflate(R.layout.dialog_title_url, null); TextView tv = (TextView)v.findViewById(R.id.tv_dialog_title_url); tv.setText(url); builder.setCustomTitle(v); builder.setItems( new CharSequence[]{ getString(R.string.d_urlAction_openInBrowser), getString(R.string.d_urlAction_addToWallabag), getString(R.string.d_urlAction_copyToClipboard), getString(R.string.menuShare) }, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { switch (which) { case 0: openURL(url); break; case 1: ServiceHelper.addLink(ReadArticleActivity.this, url); break; case 2: copyURLToClipboard(url); break; case 3: shareArticle(null, url); break; } } }); builder.show(); }
Source:
<code>protected void reportMethodInvocabilityError( MethodInvocationTree node, AnnotatedTypeMirror found, AnnotatedTypeMirror expected) { AnnotationMirror expectedCM = expected.getAnnotation(CalledMethods.class); if (expectedCM != null) { AnnotationMirror foundCM = found.getAnnotation(CalledMethods.class); Set<String> foundMethods = foundCM == null ? Collections.emptySet() : new HashSet<>(atypeFactory.getAccumulatedValues(foundCM)); List<String> expectedMethods = atypeFactory.getAccumulatedValues(expectedCM); StringBuilder missingMethods = new StringBuilder(); for (String expectedMethod : expectedMethods) { if (!foundMethods.contains(expectedMethod)) { missingMethods.append(expectedMethod); <START> missingMethods.append("() "); <END> } } checker.reportError(node, FINALIZER_INVOCATION_INVALID, missingMethods.toString()); } else { super.reportMethodInvocabilityError(node, found, expected); } }</code><technical_language>a trailing space end of missingMethods, a StringJoiner</technical_language>

Target:
protected void reportMethodInvocabilityError( MethodInvocationTree node, AnnotatedTypeMirror found, AnnotatedTypeMirror expected) { AnnotationMirror expectedCM = expected.getAnnotation(CalledMethods.class); if (expectedCM != null) { AnnotationMirror foundCM = found.getAnnotation(CalledMethods.class); Set<String> foundMethods = foundCM == null ? Collections.emptySet() : new HashSet<>(atypeFactory.getAccumulatedValues(foundCM)); List<String> expectedMethods = atypeFactory.getAccumulatedValues(expectedCM); StringJoiner missingMethods = new StringJoiner(" "); for (String expectedMethod : expectedMethods) { if (!foundMethods.contains(expectedMethod)) { missingMethods.add(expectedMethod + "()"); } } checker.reportError(node, "finalizer.invocation.invalid", missingMethods.toString()); } else { super.reportMethodInvocabilityError(node, found, expected); } }
Source:
<code>public void tearDown(ManagementClient managementClient, String containerId) throws Exception { Path logPath = LoggingUtil.getLogPath(managementClient, "periodic-rotating-file-handler", getHandlerName()); <START> Files.deleteIfExists(logPath); <END> Collection<String> categories = getCategories(); for (String category : categories) { if (category == null || category.length() == 0) { LOGGER.warn("Empty category name provided."); continue; } ModelNode op = org.jboss.as.controller.operations.common.Util.createRemoveOperation(PathAddress.pathAddress().append(SUBSYSTEM, "logging").append("logger", category)); applyUpdate(managementClient.getControllerClient(), op, false); } ModelNode removeTestLogOp = org.jboss.as.controller.operations.common.Util.createRemoveOperation(PathAddress.pathAddress().append(SUBSYSTEM, "logging") .append("periodic-rotating-file-handler", getHandlerName())); applyUpdate(managementClient.getControllerClient(), removeTestLogOp, false); }</code><technical_language>actual delete happen end WIndows picky files logged. remove need happen first</technical_language>

Target:
public void tearDown(ManagementClient managementClient, String containerId) throws Exception { Path logPath = LoggingUtil.getLogPath(managementClient, "file-handler", getHandlerName()); final Operations.CompositeOperationBuilder builder = Operations.CompositeOperationBuilder.create(); ModelNode removeOp; while ((removeOp = removeOps.pollFirst()) != null) { builder.addStep(removeOp); } applyUpdate(managementClient.getControllerClient(), builder.build(), false); Files.deleteIfExists(logPath); }
Source:
<code>public JavaLanguageModule() { super(NAME, null, TERSE_NAME, JavaRuleChainVisitor.class, "java"); addVersion("1.3", new JavaLanguageHandler(3), false); addVersion("1.4", new JavaLanguageHandler(4), false); addVersion("1.5", new JavaLanguageHandler(5), false); addVersion("1.6", new JavaLanguageHandler(6), false); addVersion("1.7", new JavaLanguageHandler(7), false); addVersion("1.8", new JavaLanguageHandler(8), false); addVersion("9", new JavaLanguageHandler(9), false); addVersion("10", new JavaLanguageHandler(10), false); addVersion("11", new JavaLanguageHandler(11), false); <START> addVersion("12", new JavaLanguageHandler(12), false); <END> addVersion("13", new JavaLanguageHandler(13), true); }</code><technical_language>anymore point of supporting preview features is, if drop support for minor version. 1. instability is expected, advertise preview feature support broken anytime (and display a warning) 2. support preview features 3. continue supporting preview version next major release. I I side option here. complex continue supporting Java 12 preview. Besides, advertised dropping Java 12 preview support this kind of sudden. If continue supporting preview features, sense separate language versions for preview versions, because: * Rules written for preview features apply non-preview version. For example, write a rule detect string concatenation replaced a text block - this irrelevant preview enabled. This is problem LanguageVersions supposed tackle. * a language version, determine running in preview mode *seeing* a preview feature used, making warning of option 1 unreliable</technical_language>

Target:
public JavaLanguageModule() { super(NAME, null, TERSE_NAME, JavaRuleChainVisitor.class, "java"); addVersion("1.3", new JavaLanguageHandler(3), false); addVersion("1.4", new JavaLanguageHandler(4), false); addVersion("1.5", new JavaLanguageHandler(5), false); addVersion("1.6", new JavaLanguageHandler(6), false); addVersion("1.7", new JavaLanguageHandler(7), false); addVersion("1.8", new JavaLanguageHandler(8), false); addVersion("9", new JavaLanguageHandler(9), false); addVersion("10", new JavaLanguageHandler(10), false); addVersion("11", new JavaLanguageHandler(11), false); addVersion("12", new JavaLanguageHandler(12), false); addVersion("12-preview", new JavaLanguageHandler(12, true), false); addVersion("13", new JavaLanguageHandler(13), true); addVersion("13-preview", new JavaLanguageHandler(13, true), false); }
Source:
<code>public String getMessage() { <START> return name; <END> }</code><technical_language>wrong, be: return message;</technical_language>

Target:
public String getMessage() { return message; }
Source:
<code>public long getFirstStoredEntryId() { Long firstEntry = LedgerHandle.INVALID_ENTRY_ID; for (int bookieIndex : bookieIndexes) { Long firstStoredEntryForBookie = getFirstStoredEntryId(bookieIndex); <START> if (firstStoredEntryForBookie != LedgerHandle.INVALID_ENTRY_ID) { <END> if (firstEntry == LedgerHandle.INVALID_ENTRY_ID) { firstEntry = firstStoredEntryForBookie; } else { firstEntry = Math.min(firstEntry, firstStoredEntryForBookie); } } } return firstEntry; }</code><technical_language>this lead NPE, if firstStoredEntryForBookie is null</technical_language>

Target:
public long getFirstStoredEntryId() { long firstEntry = LedgerHandle.INVALID_ENTRY_ID; for (int bookieIndex : bookieIndexes) { Long firstStoredEntryForBookie = getFirstStoredEntryId(bookieIndex); if (firstStoredEntryForBookie != LedgerHandle.INVALID_ENTRY_ID) { if (firstEntry == LedgerHandle.INVALID_ENTRY_ID) { firstEntry = firstStoredEntryForBookie; } else { firstEntry = Math.min(firstEntry, firstStoredEntryForBookie); } } } return firstEntry; }
Source:
<code>public NonNullList<ItemStack> getRemainingItems(@Nonnull CraftingInventory inv) { NonNullList<ItemStack> remaining = NonNullList.withSize(inv.getSizeInventory(), ItemStack.EMPTY); final MatchLocation offset = findMatch(inv); Preconditions.checkNotNull(offset); for(int x = 0; x < inv.getWidth(); ++x) for(int y = 0; y < inv.getHeight(); ++y) { final int invIndex = getInventoryIndex(inv, x, y); final int ingrIndex = offset.getListIndex(x, y); if(ingrIndex >= 0) { Ingredient ingr = getIngredients().get(ingrIndex); final ItemStack item = inv.getStackInSlot(invIndex); ItemStack result = ItemStack.EMPTY; if(ingr instanceof IngredientFluidStack) <START> result = ((IngredientFluidStack)ingr).getExtractedStack(item).copy(); <END> else if(item.hasContainerItem()) result = item.getContainerItem(); if(result==item) result = result.copy(); remaining.set(invIndex, result); } } return remaining; }</code><technical_language>I positive I sense copy item (or in getExtractedStack extracting), if a crafting implementer queries remaining items for a recipe side effects of container drained of getter called if automated crafter room store remaining stacks</technical_language>

Target:
public NonNullList<ItemStack> getRemainingItems(@Nonnull CraftingInventory inv) { NonNullList<ItemStack> remaining = NonNullList.withSize(inv.getSizeInventory(), ItemStack.EMPTY); final MatchLocation offset = findMatch(inv); Preconditions.checkNotNull(offset); for(int x = 0; x < inv.getWidth(); ++x) for(int y = 0; y < inv.getHeight(); ++y) { final int invIndex = getInventoryIndex(inv, x, y); final int ingrIndex = offset.getListIndex(x, y); if(ingrIndex >= 0) { Ingredient ingr = getIngredients().get(ingrIndex); final ItemStack item = inv.getStackInSlot(invIndex); ItemStack result = ItemStack.EMPTY; if(ingr instanceof IngredientFluidStack) result = ((IngredientFluidStack)ingr).getExtractedStack(item.copy()); else if(item.hasContainerItem()) result = item.getContainerItem(); if(result==item) result = result.copy(); remaining.set(invIndex, result); } } return remaining; }
Source:
<code>public void configure() throws Exception { String metacardRouteId = "metacard-" + UUID.randomUUID().toString(); from("catalog:postingest") .split(method(ResponseMetacardActionSplitter.class, "split(${body})")) .to("direct:" + metacardRouteId); from("direct:" + metacardRouteId) .setHeader(METACARD_TRANSFORMER_ID_RTE_PROP, simple(metacardTransformerId, String.class)) .setHeader( METACARD_BACKUP_INVALID_RTE_PROP, simple(String.valueOf(backupInvalidMetacards), Boolean.class)) .setHeader( METACARD_BACKUP_KEEP_DELETED_RTE_PROP, simple(String.valueOf(keepDeletedMetacards), Boolean.class)) .choice() .when(not(getShouldBackupPredicate())) .stop() .otherwise() .setHeader( TEMPLATED_STRING_HEADER_RTE_PROP, method(new MetacardTemplate(outputPathTemplate), "applyTemplate(${body})")) .to("catalog:metacardtransformer") .choice() .when( and( header(PostIngestConsumer.ACTION).isEqualTo(PostIngestConsumer.DELETE), not(getCheckDeletePredicate()))) .bean( MetacardFileStorageRoute.class, String.format( <START> "deleteFile(%s, ${in.headers.%s)", <END> getStartingDir(), TEMPLATED_STRING_HEADER_RTE_PROP)) .stop() .otherwise() .to( "file://" + getStartingDir() + "?fileName=${in.headers." + TEMPLATED_STRING_HEADER_RTE_PROP + "}"); LOGGER.trace("Starting metacard file storage route: {}", this); }</code><technical_language>I talked this, verify, I guessing .to( "file://" + getStartingDir() + "?fileName=${in.headers." + TEMPLATED_STRING_HEADER_RTE_PROP + "}&delete=true"); work</technical_language>

Target:
public void configure() throws Exception { routeIds.clear(); String metacardRouteId = "metacard-" + UUID.randomUUID().toString(); String route1Id = metacardRouteId + "1"; from("catalog:postingest") .routeId(route1Id) .split(method(ResponseMetacardActionSplitter.class, "split(${body})")) .to("direct:" + metacardRouteId); routeIds.add(route1Id); String route2Id = metacardRouteId + "2"; from("direct:" + metacardRouteId + "?block=true") .routeId(route2Id) .setHeader(METACARD_TRANSFORMER_ID_RTE_PROP, simple(metacardTransformerId, String.class)) .setHeader( METACARD_BACKUP_INVALID_RTE_PROP, simple(String.valueOf(backupInvalidMetacards), Boolean.class)) .setHeader( METACARD_BACKUP_KEEP_DELETED_RTE_PROP, simple(String.valueOf(keepDeletedMetacards), Boolean.class)) .choice() .when(not(getShouldBackupPredicate())) .stop() .otherwise() .setHeader( TEMPLATED_STRING_HEADER_RTE_PROP, method(new MetacardTemplate(outputPathTemplate), "applyTemplate(${body})")) .to("catalog:metacardtransformer") .choice() .when( and( header(PostIngestConsumer.ACTION).isEqualTo(PostIngestConsumer.DELETE), getCheckDeletePredicate())) .bean( MetacardFileStorageRoute.class, String.format( "deleteFile(%s, ${in.headers.%s})", URLEncoder.encode(getStartingDir(), StandardCharsets.UTF_8.name()), URLEncoder.encode(TEMPLATED_STRING_HEADER_RTE_PROP, StandardCharsets.UTF_8.name()))) .stop() .otherwise() .to( "file://" + getStartingDir() + "?fileName=${in.headers." + TEMPLATED_STRING_HEADER_RTE_PROP + "}"); routeIds.add(route2Id); LOGGER.trace("Starting metacard file storage route: {}", this); }
Source:
<code>public void attemptsExperimentAgainAfterEnoughTimeHasElapsed() { <START> enableExperiment(); <END> throwOnFirstExperiment(); assertThatThrownBy(experimentSupplier::getAsInt).isEqualTo(RUNTIME_EXCEPTION); assertThat(experimentSupplier.getAsInt()).isEqualTo(FALLBACK_INT); when(clock.instant()).thenReturn(Instant.ofEpochSecond(1_000)); assertThat(experimentSupplier.getAsInt()).isEqualTo(EXPERIMENTAL_INT); }</code><technical_language>if time elapsed, explicit start time is</technical_language>

Target:
public void attemptsExperimentAgainAfterEnoughTimeHasElapsed() { enableExperiment(); setTimeTo(Instant.ofEpochSecond(0)); throwOnExperiment(); assertThatThrownBy(proxyInstance::getAsInt).isEqualTo(RUNTIME_EXCEPTION); assertThat(proxyInstance.getAsInt()).isEqualTo(FALLBACK_RESULT); returnValueOnExperiment(); setTimeTo(Instant.ofEpochSecond(ExperimentRunningProxy.REFRESH_INTERVAL.getSeconds() - 1)); assertThat(proxyInstance.getAsInt()).isEqualTo(FALLBACK_RESULT); setTimeTo(Instant.ofEpochSecond(ExperimentRunningProxy.REFRESH_INTERVAL.getSeconds() + 1)); assertThat(proxyInstance.getAsInt()).isEqualTo(EXPERIMENTAL_RESULT); }
Source:
<code>protected abstract TaskResult runTask(@NotNull TaskContext context) throws TaskException; protected abstract void initTask(@NotNull TaskContext context) throws TaskException; public TaskResult execute(@NotNull TaskContext context) throws TaskException { String buildInfoFromContext = ""; if (shouldRemoveBuildInfoFromContext()) { buildInfoFromContext = TaskUtils.getAndDeleteAggregatedBuildInfo(context); } initTask(context); ServerConfig server = getUsageServerConfig(); if (server != null) { reportUsage(server, getTaskUsageName(), getLog()); } TaskResult taskResult = runTask(context); <START> GenericData gd = new GenericData(); <END> try { if (StringUtils.isNotBlank(buildInfoFromContext)) { gd = BuildInfoExtractorUtils.jsonStringToGeneric(buildInfoFromContext, GenericData.class); } if (buildFromTask != null) { gd.addBuild(buildFromTask); } String aggregatedBuildInfo = ""; if (gd.getBuilds() != null) { aggregatedBuildInfo = BuildInfoExtractorUtils.buildInfoToJsonString(gd); } TaskUtils.addBuildInfoToContext(context, aggregatedBuildInfo); } catch (IOException ex) { throw new TaskException("Failed to add Build Info to context.", ex); } return taskResult; }</code><technical_language>out a function</technical_language>

Target:
protected abstract TaskResult runTask(@NotNull TaskContext context) throws TaskException; protected abstract void initTask(@NotNull TaskContext context) throws TaskException; public TaskResult execute(@NotNull TaskContext context) throws TaskException { String buildInfoFromContext = ""; if (shouldRemoveBuildInfoFromContext()) { buildInfoFromContext = TaskUtils.getAndDeleteAggregatedBuildInfo(context); } initTask(context); ServerConfig server = getUsageServerConfig(); if (server != null) { reportUsage(server, getTaskUsageName(), getLog()); } TaskResult taskResult = runTask(context); if (StringUtils.isNotBlank(buildInfoFromContext) || taskBuildInfo != null) { aggregateBuildInfoAndAddToPlanContext(buildInfoFromContext, context); } return taskResult; }
Source:
<code>public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player == null) { return false; } Card card = player.getLibrary().getFromTop(game); if (card == null) { return false; } player.revealCards(source, new CardsImpl(card), game); if (card.isCreature()) { return player.moveCards(card, Zone.HAND, source, game); } <START> return player.putCardsOnBottomOfLibrary(card, game, source, false); <END> }</code><technical_language>Wrong code -- else</technical_language>

Target:
public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player == null) { return false; } Card card = player.getLibrary().getFromTop(game); if (card == null) { return false; } player.revealCards(source, new CardsImpl(card), game); if (card.isCreature()) { return player.moveCards(card, Zone.HAND, source, game); } else { return player.putCardsOnBottomOfLibrary(card, game, source, false); } }
Source:
<code><START> public boolean execute(CommandSender sender, String label, String[] args) { <END> if (args.length == 0) { sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage); return false; } final StringBuilder message = new StringBuilder("* ").append(CommandUtils.getName(sender)); Arrays.stream(args).forEach(parameter -> message.append(" ").append(parameter)); Bukkit.broadcastMessage(message.toString()); return true; }</code><technical_language>Needs a permission check here</technical_language>

Target:
public boolean execute(CommandSender sender, String label, String[] args) { if (!testPermission(sender)) return false; if (args.length == 0) { sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage); return false; } final StringBuilder message = new StringBuilder("* ").append(CommandUtils.getName(sender)); Arrays.stream(args).forEach(parameter -> message.append(" ").append(parameter)); Bukkit.broadcastMessage(message.toString()); return true; }
Source:
<code>protected void addMappingsToConcepts(List<Object> explicitItems) { <START> log("Adding mappings to Concepts"); <END> if (MetadataSharing.getInstance().isAddLocalMappings()) { ConceptPubSubService pubsubService = Context.getService(ConceptPubSubService.class); for (Object explicitItem : explicitItems) { if (explicitItem instanceof Concept) { pubsubService.addLocalMappingToConcept((Concept) explicitItem); } } } }</code><technical_language>Put if</technical_language>

Target:
protected void addMappingsToConcepts(List<Object> explicitItems) { if (MetadataSharing.getInstance().isAddLocalMappings()) { log("Adding mappings to Concepts"); ConceptPubSubService pubsubService = Context.getService(ConceptPubSubService.class); for (Object explicitItem : explicitItems) { if (explicitItem instanceof Concept) { pubsubService.addLocalMappingToConcept((Concept) explicitItem); } } } }
Source:
<code>private void handleMetadata(Versioned<LedgerMetadata> metadata, Throwable exception) { if (exception == null) { final Set<LedgerMetadataListener> listenerSet = listeners.get(ledgerId); if (null != listenerSet) { if (LOG.isDebugEnabled()) { LOG.debug("Ledger metadata is changed for : {}.", ledgerId, metadata.getValue()); } scheduler.submit(() -> { synchronized (listenerSet) { for (LedgerMetadataListener listener : listenerSet) { listener.onChanged(ledgerId, metadata); } } }); } <START> } else if (exception instanceof BKException.BKNoSuchLedgerExistsException) { <END> Set<LedgerMetadataListener> listenerSet = listeners.remove(ledgerId); if (null != listenerSet) { if (LOG.isDebugEnabled()) { LOG.debug("Removed ledger metadata listener set on ledger as its ledger is deleted : {}", ledgerId, listenerSet.size()); } } } else { LOG.warn("Failed on read ledger metadata of ledger {}", ledgerId, exception); scheduler.schedule(this, MS_CONNECT_BACKOFF_MS, TimeUnit.MILLISECONDS); } }</code><technical_language>getExceptionCode check exception code</technical_language>

Target:
private void handleMetadata(Versioned<LedgerMetadata> metadata, Throwable exception) { if (exception == null) { final Set<LedgerMetadataListener> listenerSet = listeners.get(ledgerId); if (null != listenerSet) { if (LOG.isDebugEnabled()) { LOG.debug("Ledger metadata is changed for : {}.", ledgerId, metadata.getValue()); } scheduler.submit(() -> { synchronized (listenerSet) { for (LedgerMetadataListener listener : listenerSet) { listener.onChanged(ledgerId, metadata); } } }); } } else if (BKException.getExceptionCode(exception) == BKException.Code.NoSuchLedgerExistsException) { Set<LedgerMetadataListener> listenerSet = listeners.remove(ledgerId); if (null != listenerSet) { if (LOG.isDebugEnabled()) { LOG.debug("Removed ledger metadata listener set on ledger as its ledger is deleted : {}", ledgerId, listenerSet.size()); } } } else { LOG.warn("Failed on read ledger metadata of ledger {}: {}", ledgerId, BKException.getExceptionCode(exception)); scheduler.schedule(this, MS_CONNECT_BACKOFF_MS, TimeUnit.MILLISECONDS); } }
Source:
<code>Point resizeCalculationsGTK3(long widget, int width, int height) { Point size = super.resizeCalculationsGTK3(widget, width, height); <START> if (widget == handle && GTK.GTK_VERSION >= OS.VERSION(3, 22, 0)) { <END> GtkRequisition naturalSize = new GtkRequisition(); GtkRequisition minimumSize = new GtkRequisition(); GTK.gtk_widget_get_preferred_size(handle, minimumSize, naturalSize); size.y = Math.max(size.y, minimumSize.height); } return size; }</code><technical_language>more thing, please this guard >= 3.20.0 warnings happen 3.20 well</technical_language>

Target:
Point resizeCalculationsGTK3(long widget, int width, int height) { Point size = super.resizeCalculationsGTK3(widget, width, height); if (widget == handle && GTK.GTK_VERSION >= OS.VERSION(3, 20, 0)) { GtkRequisition naturalSize = new GtkRequisition(); GtkRequisition minimumSize = new GtkRequisition(); GTK.gtk_widget_get_preferred_size(handle, minimumSize, naturalSize); size.y = Math.max(size.y, minimumSize.height); } return size; }
Source:
<code>public void updateApplicationAction() { final ActionFactory factory = new ActionFactory(Globals.getKeyPrefs()); <START> action.updateApplication(getApplicationByName(Globals.prefs.get(JabRefPreferences.PUSH_TO_APPLICATION))); <END> if (menuItem != null) { factory.configureMenuItem( action.getActionInformation(), action, menuItem); } if (toolBarButton != null) { factory.configureIconButton( action.getActionInformation(), action, toolBarButton); } }</code><technical_language>again: reuse method</technical_language>

Target:
public void updateApplicationAction() { final ActionFactory factory = new ActionFactory(Globals.getKeyPrefs()); action.updateApplication(Globals.prefs.getActivePushToApplication(this)); if (menuItem != null) { factory.configureMenuItem(action.getActionInformation(), action, menuItem); } if (toolBarButton != null) { factory.configureIconButton(action.getActionInformation(), action, toolBarButton); } }
Source:
<code>public String getToken() throws OAuthSystemException, OAuthProblemException { <START> TmcSettings settings = TmcSettingsHolder.get(); <END> OAuthClientRequest request = OAuthClientRequest .tokenLocation(settings.getOauthTokenUrl()) .setGrantType(GrantType.PASSWORD) .setClientId(settings.getOauthApplicationId()) .setClientSecret(settings.getOauthSecret()) .setUsername(settings.getUsername()) .setPassword(settings.getPassword()) .buildQueryMessage(); OAuthClient client = new OAuthClient(new URLConnectionClient()); String token = client.accessToken(request, OAuthJSONAccessTokenResponse.class) .getAccessToken(); return token; }</code><technical_language>A field in class</technical_language>

Target:
public String getToken() throws OAuthSystemException, OAuthProblemException { LOG.log(Level.INFO, "Fetching new oauth token from server"); OAuthClientRequest request = OAuthClientRequest .tokenLocation(settings.getOauthTokenUrl()) .setGrantType(GrantType.PASSWORD) .setClientId(settings.getOauthApplicationId()) .setClientSecret(settings.getOauthSecret()) .setUsername(settings.getUsername()) .setPassword(settings.getPassword()) .buildQueryMessage(); OAuthClient client = new OAuthClient(new URLConnectionClient()); String token = client.accessToken(request, OAuthJSONAccessTokenResponse.class) .getAccessToken(); return token; }
Source:
<code>private String getBeanAsJson(TestBean bean) throws Exception { <START> return new Jackson2JsonObjectMapper().toJson(bean); <END> }</code><technical_language>why</technical_language>

Target:
private String getBeanAsJson(TestBean bean) throws Exception { return JsonObjectMapperProvider.newInstance().toJson(bean); }
Source:
<code>public void retrievesOrganizations() throws Exception { final Github github = new MkGithub(); final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_OK, Json.createArrayBuilder() .add(org(1, "org1")) .add(org(2, "org2")) .add(org(3, "org3")) .build().toString() ) ).start(); try { final Organizations orgs = new RtOrganizations( github, new ApacheRequest(container.home()) ); MatcherAssert.assertThat( orgs.iterate(), <START> Matchers.<Organization>iterableWithSize(3) <END> ); MatcherAssert.assertThat( container.take().uri().toString(), Matchers.endsWith("/user/orgs") ); } finally { container.stop(); } }</code><technical_language>@cvrebert please leave Tv.THREE</technical_language>

Target:
public void retrievesOrganizations() throws Exception { final Github github = new MkGithub(); final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_OK, Json.createArrayBuilder() .add(org(1, "org1")) .add(org(2, "org2")) .add(org(3, "org3")) .build().toString() ) ).start(); try { final Organizations orgs = new RtOrganizations( github, new ApacheRequest(container.home()) ); MatcherAssert.assertThat( orgs.iterate(), Matchers.<Organization>iterableWithSize(Tv.THREE) ); MatcherAssert.assertThat( container.take().uri().toString(), Matchers.endsWith("/user/orgs") ); } finally { container.stop(); } }
Source:
<code><START> public void testsHeaderNotAvailable() throws IOException { <END> MatcherAssert.assertThat( new RsWithBody("<html></html>"), new HmRsHeader( Matchers.not( Matchers.hasEntry( "cache-control", "no-cache, no-store" ) ) ) ); }</code><technical_language>@ekondrashev here, declare Exception thrown</technical_language>

Target:
public void testsHeaderNotAvailable() throws Exception { MatcherAssert.assertThat( new RsWithBody("<html></html>"), new HmRsHeader( Matchers.not( Matchers.hasEntry( "cache-control", "no-cache, no-store" ) ) ) ); }
Source:
<code>private ElementTreeSelectionDialog createWorkspaceFolderDialog(Shell shell, String selectedFile) { ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog( shell, new WorkbenchLabelProvider(), new WorkbenchContentProvider() ); dialog.setTitle("Select an workspace folder"); dialog.setMessage("Select a workspace folder to deploy"); dialog.setInput( ResourcesPlugin.getWorkspace().getRoot() ); dialog.addFilter(new ViewerFilter() { @Override public boolean select(Viewer viewer, Object parentElement, Object element) { return element instanceof IContainer; } }); dialog.setAllowMultiple( false ); org.eclipse.core.resources.IResource res = model.getDeployProject(); if (org.apache.commons.lang.StringUtils.isNotBlank(selectedFile)) { String prefix = "${workspace_loc:"; String path = selectedFile; if (selectedFile.startsWith(prefix) && selectedFile.endsWith("}")) { path = path.substring(prefix.length(), path.length()-1); } <START> res = ResourcesPlugin.getWorkspace().getRoot().findMember(path); <END> } if (res != null) { dialog.setInitialSelection(res); } return dialog; }</code><technical_language>Maybe, if member is found, 'res' is remain model.getDeployProject()</technical_language>

Target:
private ElementTreeSelectionDialog createWorkspaceFolderDialog(Shell shell, String selectedFile) { ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog( shell, new WorkbenchLabelProvider(), new WorkbenchContentProvider() ); dialog.setTitle("Select a workspace folder"); dialog.setMessage("Select a workspace folder to deploy"); dialog.setInput( ResourcesPlugin.getWorkspace().getRoot() ); dialog.addFilter(new ViewerFilter() { @Override public boolean select(Viewer viewer, Object parentElement, Object element) { return element instanceof IContainer; } }); dialog.setAllowMultiple( false ); org.eclipse.core.resources.IResource res = model.getDeployProject(); if (org.apache.commons.lang.StringUtils.isNotBlank(selectedFile)) { String path = VariablesHelper.getWorkspacePath(selectedFile); org.eclipse.core.resources.IResource member = ResourcesPlugin.getWorkspace().getRoot().findMember(path); if (member != null) { res = member; } } if (res != null) { dialog.setInitialSelection(res); } return dialog; }
Source:
<code>public void cacheManagerStarted(GlobalComponentRegistry gcr) { BasicComponentRegistry bcr = gcr.getComponent(BasicComponentRegistry.class); ProtobufMetadataManagerImpl protobufMetadataManager = (ProtobufMetadataManagerImpl) bcr.getComponent(ProtobufMetadataManager.class).running(); <START> protobufMetadataManager.startInternalCache(); <END> GlobalConfiguration globalCfg = gcr.getGlobalConfiguration(); if (globalCfg.globalJmxStatistics().enabled()) { registerProtobufMetadataManagerMBean(protobufMetadataManager, globalCfg, bcr); } }</code><technical_language>If ProtobufMetadataManagerImpl needs cache running, start in @Start method. cacheManagerStarted is late: if a cache manager is created start=false 2 threads call getCache(X) getCache(Y), of (say starting cache X) wait for cacheManagerStarted run. other thread start cache Y waiting for protobuf metadata cache start first</technical_language>

Target:
public void cacheManagerStarted(GlobalComponentRegistry gcr) { BasicComponentRegistry bcr = gcr.getComponent(BasicComponentRegistry.class); ProtobufMetadataManagerImpl protobufMetadataManager = (ProtobufMetadataManagerImpl) bcr.getComponent(ProtobufMetadataManager.class).running(); protobufMetadataManager.getCache(); GlobalConfiguration globalCfg = gcr.getGlobalConfiguration(); if (globalCfg.globalJmxStatistics().enabled()) { registerProtobufMetadataManagerMBean(protobufMetadataManager, globalCfg, bcr); } }
Source:
<code>public void testGetPrincipalWithoutReferences() throws Exception { DocumentModel u1 = getUser("user1"); userManager.createUser(u1); DocumentModel g1 = getGroup("group1"); <START> g1.setProperty("group", "members", Arrays.asList("user1")); <END> userManager.createGroup(g1); DocumentModel g2 = getGroup("group2"); g2.setProperty("group", "members", Arrays.asList("user1")); userManager.createGroup(g2); NuxeoPrincipal principal1 = userManager.getPrincipal("user1"); assertEquals(3, principal1.getAllGroups().size()); principal1 = userManager.getPrincipal("user1", false); assertEquals(1, principal1.getAllGroups().size()); assertTrue(principal1.isMemberOf("defgr")); assertFalse(principal1.isMemberOf("group1")); }</code><technical_language>List.of(...)</technical_language>

Target:
public void testGetPrincipalWithoutReferences() throws Exception { DocumentModel u1 = getUser("user1"); userManager.createUser(u1); DocumentModel g1 = getGroup("group1"); g1.setProperty("group", "members", List.of("user1")); userManager.createGroup(g1); DocumentModel g2 = getGroup("group2"); g2.setProperty("group", "members", List.of("user1")); userManager.createGroup(g2); NuxeoPrincipal principal1 = userManager.getPrincipal("user1"); assertEquals(3, principal1.getAllGroups().size()); principal1 = userManager.getPrincipal("user1", false); assertEquals(1, principal1.getAllGroups().size()); assertTrue(principal1.isMemberOf("defgr")); assertFalse(principal1.isMemberOf("group1")); }
Source:
<code>protected boolean canAuthenticate(final WebContext context) { val grantType = context.getRequestParameter(OAuth20Constants.GRANT_TYPE); val clientId = context.getRequestParameter(OAuth20Constants.CLIENT_ID); if (clientId.isPresent() && grantType.isPresent() && OAuth20Utils.isGrantType(grantType.get(), OAuth20GrantTypes.REFRESH_TOKEN) && context.getRequestParameter(OAuth20Constants.REFRESH_TOKEN).isPresent()) { val registeredService = OAuth20Utils.getRegisteredOAuthServiceByClientId(getServicesManager(), clientId.get()); <START> if (registeredService != null && !OAuth20Utils.doesServiceNeedAuthentication(registeredService)) { <END> return true; } } return false; }</code><technical_language>Debug/Trace statements useful</technical_language>

Target:
protected boolean canAuthenticate(final WebContext context) { val grantType = context.getRequestParameter(OAuth20Constants.GRANT_TYPE); val clientId = context.getRequestParameter(OAuth20Constants.CLIENT_ID); if (clientId.isPresent() && grantType.isPresent() && OAuth20Utils.isGrantType(grantType.get(), OAuth20GrantTypes.REFRESH_TOKEN) && context.getRequestParameter(OAuth20Constants.REFRESH_TOKEN).isPresent()) { val registeredService = OAuth20Utils.getRegisteredOAuthServiceByClientId(getServicesManager(), clientId.get()); LOGGER.trace("Checking if the client is eligible for refresh token authentication", clientId.get()); if (registeredService != null && !OAuth20Utils.doesServiceNeedAuthentication(registeredService)) { return true; } } return false; }
Source:
<code>public ICPPEvaluation resolveFunction(ICPPEvaluation[] args, IASTNode point) { LookupData data; ICPPFunction[] functions = null; if (fFunctionSet == null) { data = new LookupData(fName, null, point); } else { functions = fFunctionSet.getBindings(); data = new LookupData(functions[0].getNameCharArray(), fFunctionSet.getTemplateArguments(), point); data.foundItems = functions; } data.setFunctionArguments(false, args); if (fImpliedObjectType != null) data.setImpliedObjectType(fImpliedObjectType); try { if (fImpliedObjectType == null && !data.hasTypeOrMemberFunctionOrVariableResult()) { CPPSemantics.doKoenigLookup(data); Object[] foundItems = (Object[]) data.foundItems; if (foundItems != null && (functions == null || foundItems.length > functions.length)) { functions = Arrays.copyOf(foundItems, foundItems.length, ICPPFunction[].class); <START> functions = new HashSet<ICPPFunction>(Arrays.asList(functions)).toArray(EMPTY_FUNCTION_ARRAY); <END> } } IBinding binding = CPPSemantics.resolveFunction(data, functions, true); if (binding instanceof ICPPFunction && !(binding instanceof ICPPUnknownBinding)) return new EvalBinding(binding, null, getTemplateDefinition()); } catch (DOMException e) { CCorePlugin.log(e); } return this; }</code><technical_language>added ArrayUtils.removeDuplicate method hide ugliness</technical_language>

Target:
public ICPPEvaluation resolveFunction(ICPPEvaluation[] args, IASTNode point) { LookupData data; ICPPFunction[] functions = null; if (fFunctionSet == null) { data = new LookupData(fName, null, point); } else { functions = fFunctionSet.getBindings(); data = new LookupData(functions[0].getNameCharArray(), fFunctionSet.getTemplateArguments(), point); data.foundItems = functions; } data.setFunctionArguments(false, args); if (fImpliedObjectType != null) data.setImpliedObjectType(fImpliedObjectType); try { if (fImpliedObjectType == null && !data.hasTypeOrMemberFunctionOrVariableResult()) { CPPSemantics.doKoenigLookup(data); Object[] foundItems = (Object[]) data.foundItems; if (foundItems != null && (functions == null || foundItems.length > functions.length)) { functions = Arrays.copyOf(foundItems, foundItems.length, ICPPFunction[].class); functions = ArrayUtil.removeDuplicates(functions); } } IBinding binding = CPPSemantics.resolveFunction(data, functions, true); if (binding instanceof ICPPFunction && !(binding instanceof ICPPUnknownBinding)) return new EvalBinding(binding, null, getTemplateDefinition()); } catch (DOMException e) { CCorePlugin.log(e); } return this; }