_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q3200
ParallelClient.preparePing
train
public ParallelTaskBuilder preparePing() { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.setProtocol(RequestProtocol.PING); return cb; }
java
{ "resource": "" }
q3201
ParallelClient.prepareTcp
train
public ParallelTaskBuilder prepareTcp(String command) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.setProtocol(RequestProtocol.TCP); cb.getTcpMeta().setCommand(command); return cb; }
java
{ "resource": "" }
q3202
ParallelClient.prepareUdp
train
public ParallelTaskBuilder prepareUdp(String command) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.setProtocol(RequestProtocol.UDP); cb.getUdpMeta().setCommand(command); return cb; }
java
{ "resource": "" }
q3203
ParallelClient.prepareHttpGet
train
public ParallelTaskBuilder prepareHttpGet(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.GET); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
java
{ "resource": "" }
q3204
ParallelClient.prepareHttpPost
train
public ParallelTaskBuilder prepareHttpPost(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.POST); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
java
{ "resource": "" }
q3205
ParallelClient.prepareHttpDelete
train
public ParallelTaskBuilder prepareHttpDelete(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.DELETE); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
java
{ "resource": "" }
q3206
ParallelClient.prepareHttpPut
train
public ParallelTaskBuilder prepareHttpPut(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.PUT); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
java
{ "resource": "" }
q3207
ParallelClient.prepareHttpHead
train
public ParallelTaskBuilder prepareHttpHead(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.HEAD); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
java
{ "resource": "" }
q3208
ParallelClient.prepareHttpOptions
train
public ParallelTaskBuilder prepareHttpOptions(String url) { reinitIfClosed(); ParallelTaskBuilder cb = new ParallelTaskBuilder(); cb.getHttpMeta().setHttpMethod(HttpMethod.OPTIONS); cb.getHttpMeta().setRequestUrlPostfix(url); return cb; }
java
{ "resource": "" }
q3209
ExecutionManager.cancelRequestAndWorkers
train
@SuppressWarnings("deprecation") private void cancelRequestAndWorkers() { for (ActorRef worker : workers.values()) { if (worker != null && !worker.isTerminated()) { worker.tell(OperationWorkerMsgType.CANCEL, getSelf()); } } logger.info("ExecutionMana...
java
{ "resource": "" }
q3210
ExecutionManager.cancelRequestAndWorkerOnHost
train
@SuppressWarnings("deprecation") private void cancelRequestAndWorkerOnHost(List<String> targetHosts) { List<String> validTargetHosts = new ArrayList<String>(workers.keySet()); validTargetHosts.retainAll(targetHosts); logger.info("targetHosts for cancel: Total: {}" + " Valid ...
java
{ "resource": "" }
q3211
SshProvider.startSshSessionAndObtainSession
train
public Session startSshSessionAndObtainSession() { Session session = null; try { JSch jsch = new JSch(); if (sshMeta.getSshLoginType() == SshLoginType.KEY) { String workingDir = System.getProperty("user.dir"); String privKeyAbsPath = workingDir ...
java
{ "resource": "" }
q3212
SshProvider.sessionConnectGenerateChannel
train
public Channel sessionConnectGenerateChannel(Session session) throws JSchException { // set timeout session.connect(sshMeta.getSshConnectionTimeoutMillis()); ChannelExec channel = (ChannelExec) session.openChannel("exec"); channel.setCommand(sshMeta.getCommandLine()); ...
java
{ "resource": "" }
q3213
SshProvider.genErrorResponse
train
public ResponseOnSingeRequest genErrorResponse(Exception t) { ResponseOnSingeRequest sshResponse = new ResponseOnSingeRequest(); String displayError = PcErrorMsgUtils.replaceErrorMsg(t.toString()); sshResponse.setStackTrace(PcStringUtils.printStackTrace(t)); sshResponse.setErrorMessage(...
java
{ "resource": "" }
q3214
InternalDataProvider.genNodeDataMap
train
public void genNodeDataMap(ParallelTask task) { TargetHostMeta targetHostMeta = task.getTargetHostMeta(); HttpMeta httpMeta = task.getHttpMeta(); String entityBody = httpMeta.getEntityBody(); String requestContent = HttpMeta .replaceDefaultFullRequestContent(entityBody)...
java
{ "resource": "" }
q3215
InternalDataProvider.filterUnsafeOrUnnecessaryRequest
train
public void filterUnsafeOrUnnecessaryRequest( Map<String, NodeReqResponse> nodeDataMapValidSource, Map<String, NodeReqResponse> nodeDataMapValidSafe) { for (Entry<String, NodeReqResponse> entry : nodeDataMapValidSource .entrySet()) { String hostName = entry....
java
{ "resource": "" }
q3216
TcpWorker.bootStrapTcpClient
train
public ClientBootstrap bootStrapTcpClient() throws HttpRequestCreateException { ClientBootstrap tcpClient = null; try { // Configure the client. tcpClient = new ClientBootstrap(tcpMeta.getChannelFactory()); // Configure the pipeline factory. ...
java
{ "resource": "" }
q3217
TcpWorker.reply
train
private void reply(final String response, final boolean error, final String errorMessage, final String stackTrace, final String statusCode, final int statusCodeInt) { if (!sentReply) { //must update sentReply first to avoid duplicated msg. s...
java
{ "resource": "" }
q3218
FilterRegex.stringMatcherByPattern
train
public static String stringMatcherByPattern(String input, String patternStr) { String output = PcConstants.SYSTEM_FAIL_MATCH_REGEX; // 20140105: fix the NPE issue if (patternStr == null) { logger.error("patternStr is NULL! (Expected when the aggregation rule is not defined at " ...
java
{ "resource": "" }
q3219
ParallelTaskManager.initTaskSchedulerIfNot
train
public synchronized void initTaskSchedulerIfNot() { if (scheduler == null) { scheduler = Executors .newSingleThreadScheduledExecutor(DaemonThreadFactory .getInstance()); CapacityAwareTaskScheduler runner = new CapacityAwareTaskScheduler();...
java
{ "resource": "" }
q3220
ParallelTaskManager.shutdownTaskScheduler
train
public synchronized void shutdownTaskScheduler(){ if (scheduler != null && !scheduler.isShutdown()) { scheduler.shutdown(); logger.info("shutdowned the task scheduler. No longer accepting new tasks"); scheduler = null; } }
java
{ "resource": "" }
q3221
ParallelTaskManager.getTaskFromInProgressMap
train
public ParallelTask getTaskFromInProgressMap(String jobId) { if (!inprogressTaskMap.containsKey(jobId)) return null; return inprogressTaskMap.get(jobId); }
java
{ "resource": "" }
q3222
ParallelTaskManager.getTotalUsedCapacity
train
public int getTotalUsedCapacity() { int totalCapacity = 0; for (Entry<String, ParallelTask> entry : inprogressTaskMap.entrySet()) { ParallelTask task = entry.getValue(); if (task != null) totalCapacity += task.capacityUsed(); } return totalCapacit...
java
{ "resource": "" }
q3223
ParallelTaskManager.cleanWaitTaskQueue
train
public synchronized void cleanWaitTaskQueue() { for (ParallelTask task : waitQ) { task.setState(ParallelTaskState.COMPLETED_WITH_ERROR); task.getTaskErrorMetas().add( new TaskErrorMeta(TaskErrorType.USER_CANCELED, "NA")); logger.info( ...
java
{ "resource": "" }
q3224
ParallelTaskManager.removeTaskFromWaitQ
train
public synchronized boolean removeTaskFromWaitQ(ParallelTask taskTobeRemoved) { boolean removed = false; for (ParallelTask task : waitQ) { if (task.getTaskId() == taskTobeRemoved.getTaskId()) { task.setState(ParallelTaskState.COMPLETED_WITH_ERROR); task.getTa...
java
{ "resource": "" }
q3225
ParallelTaskManager.generateUpdateExecuteTask
train
public ResponseFromManager generateUpdateExecuteTask(ParallelTask task) { // add to map now; as can only pass final ParallelTaskManager.getInstance().addTaskToInProgressMap( task.getTaskId(), task); logger.info("Added task {} to the running inprogress map...", ta...
java
{ "resource": "" }
q3226
ParallelTaskManager.sendTaskToExecutionManager
train
@SuppressWarnings("deprecation") public ResponseFromManager sendTaskToExecutionManager(ParallelTask task) { ResponseFromManager commandResponseFromManager = null; ActorRef executionManager = null; try { // Start new job logger.info("!!STARTED sendAgentCommandToManage...
java
{ "resource": "" }
q3227
PcFileNetworkIoUtils.isFileExist
train
public static boolean isFileExist(String filePath) { File f = new File(filePath); return f.exists() && !f.isDirectory(); }
java
{ "resource": "" }
q3228
PcFileNetworkIoUtils.readFileContentToString
train
public static String readFileContentToString(String filePath) throws IOException { String content = ""; content = Files.toString(new File(filePath), Charsets.UTF_8); return content; }
java
{ "resource": "" }
q3229
PcFileNetworkIoUtils.readStringFromUrlGeneric
train
public static String readStringFromUrlGeneric(String url) throws IOException { InputStream is = null; URL urlObj = null; String responseString = PcConstants.NA; try { urlObj = new URL(url); URLConnection con = urlObj.openConnection(); con....
java
{ "resource": "" }
q3230
VarReplacementProvider.updateRequestByAddingReplaceVarPair
train
public void updateRequestByAddingReplaceVarPair( ParallelTask task, String replaceVarKey, String replaceVarValue) { Map<String, NodeReqResponse> taskResult = task.getParallelTaskResult(); for (Entry<String, NodeReqResponse> entry : taskResult.entrySet()) { NodeReqResponse nodeR...
java
{ "resource": "" }
q3231
ActorConfig.createAndGetActorSystem
train
public static ActorSystem createAndGetActorSystem() { if (actorSystem == null || actorSystem.isTerminated()) { actorSystem = ActorSystem.create(PcConstants.ACTOR_SYSTEM, conf); } return actorSystem; }
java
{ "resource": "" }
q3232
ActorConfig.shutDownActorSystemForce
train
public static void shutDownActorSystemForce() { if (!actorSystem.isTerminated()) { logger.info("shutting down actor system..."); actorSystem.shutdown(); actorSystem.awaitTermination(timeOutDuration); logger.info("Actor system has been shut down."); } else ...
java
{ "resource": "" }
q3233
TcpUdpSshPingResourceStore.init
train
public synchronized void init() { channelFactory = new NioClientSocketChannelFactory( Executors.newCachedThreadPool(), Executors.newCachedThreadPool()); datagramChannelFactory = new NioDatagramChannelFactory( Executors.newCachedThreadPool()); tim...
java
{ "resource": "" }
q3234
PcErrorMsgUtils.replaceErrorMsg
train
public static String replaceErrorMsg(String origMsg) { String replaceMsg = origMsg; for (ERROR_TYPE errorType : ERROR_TYPE.values()) { if (origMsg == null) { replaceMsg = PcConstants.NA; return replaceMsg; } if (origMsg.contains(erro...
java
{ "resource": "" }
q3235
AsyncHttpClientFactoryEmbed.disableCertificateVerification
train
private void disableCertificateVerification() throws KeyManagementException, NoSuchAlgorithmException { // Create a trust manager that does not validate certificate chains final TrustManager[] trustAllCerts = new TrustManager[] { new CustomTrustManager() }; // Install the all-trusti...
java
{ "resource": "" }
q3236
HttpMeta.replaceFullRequestContent
train
public static String replaceFullRequestContent( String requestContentTemplate, String replacementString) { return (requestContentTemplate.replace( PcConstants.COMMAND_VAR_DEFAULT_REQUEST_CONTENT, replacementString)); }
java
{ "resource": "" }
q3237
ProblemSummary.addFile
train
public void addFile(String description, FileModel fileModel) { Map<FileModel, ProblemFileSummary> files = addDescription(description); if (files.containsKey(fileModel)) { files.get(fileModel).addOccurrence(); } else { files.put(fileModel, new ProblemFileSumma...
java
{ "resource": "" }
q3238
ClassFilePreDecompilationScan.shouldIgnore
train
private boolean shouldIgnore(String typeReference) { typeReference = typeReference.replace('/', '.').replace('\\', '.'); return JavaClassIgnoreResolver.singletonInstance().matches(typeReference); }
java
{ "resource": "" }
q3239
Classification.resolvePayload
train
@Override public FileModel resolvePayload(GraphRewrite event, EvaluationContext context, WindupVertexFrame payload) { checkVariableName(event, context); if (payload instanceof FileReferenceModel) { return ((FileReferenceModel) payload).getFile(); } if (payload...
java
{ "resource": "" }
q3240
FreeMarkerOperation.create
train
public static FreeMarkerOperation create(Furnace furnace, String templatePath, String outputFilename, String... varNames) { return new FreeMarkerOperation(furnace, templatePath, outputFilename, varNames); }
java
{ "resource": "" }
q3241
UnzipArchiveToOutputFolder.recurseAndAddFiles
train
private void recurseAndAddFiles(GraphRewrite event, EvaluationContext context, Path tempFolder, FileService fileService, ArchiveModel archiveModel, FileModel parentFileModel, boolean subArchivesOnly) { checkCancelled(event); int numberAdded = 0; ...
java
{ "resource": "" }
q3242
RenderLinkDirective.renderAsLI
train
private void renderAsLI(Writer writer, ProjectModel project, Iterator<Link> links, boolean wrap) throws IOException { if (!links.hasNext()) return; if (wrap) writer.append("<ul>"); while (links.hasNext()) { Link link = links.next(); wr...
java
{ "resource": "" }
q3243
CreateApplicationReportIndexRuleProvider.createApplicationReportIndex
train
private ApplicationReportIndexModel createApplicationReportIndex(GraphContext context, ProjectModel applicationProjectModel) { ApplicationReportIndexService applicationReportIndexService = new ApplicationReportIndexService(context); ApplicationReportIndexModel index = applicationRepo...
java
{ "resource": "" }
q3244
CreateApplicationReportIndexRuleProvider.addAllProjectModels
train
private void addAllProjectModels(ApplicationReportIndexModel navIdx, ProjectModel projectModel) { navIdx.addProjectModel(projectModel); for (ProjectModel childProject : projectModel.getChildProjects()) { if (!Iterators.asSet(navIdx.getProjectModels()).contains(childProject)) ...
java
{ "resource": "" }
q3245
ProgressEstimate.getTimeRemainingInMillis
train
public long getTimeRemainingInMillis() { long batchTime = System.currentTimeMillis() - startTime; double timePerIteration = (double) batchTime / (double) worked.get(); return (long) (timePerIteration * (total - worked.get())); }
java
{ "resource": "" }
q3246
ArchiveService.getChildFile
train
public FileModel getChildFile(ArchiveModel archiveModel, String filePath) { filePath = FilenameUtils.separatorsToUnix(filePath); StringTokenizer stk = new StringTokenizer(filePath, "/"); FileModel currentFileModel = archiveModel; while (stk.hasMoreTokens() && currentFileModel != nul...
java
{ "resource": "" }
q3247
RuleProviderSorter.sort
train
private void sort() { DefaultDirectedWeightedGraph<RuleProvider, DefaultEdge> graph = new DefaultDirectedWeightedGraph<>( DefaultEdge.class); for (RuleProvider provider : providers) { graph.addVertex(provider); } addProviderRelationships(grap...
java
{ "resource": "" }
q3248
RuleProviderSorter.checkForCycles
train
private void checkForCycles(DefaultDirectedWeightedGraph<RuleProvider, DefaultEdge> graph) { CycleDetector<RuleProvider, DefaultEdge> cycleDetector = new CycleDetector<>(graph); if (cycleDetector.detectCycles()) { // if we have cycles, then try to throw an exception with some us...
java
{ "resource": "" }
q3249
RecurseDirectoryAndAddFiles.recurseAndAddFiles
train
private void recurseAndAddFiles(GraphRewrite event, FileService fileService, WindupJavaConfigurationService javaConfigurationService, FileModel file) { if (javaConfigurationService.checkIfIgnored(event, file)) return; String filePath = file.getFilePath(); File fileReference = ne...
java
{ "resource": "" }
q3250
Checks.checkFileOrDirectoryToBeRead
train
public static void checkFileOrDirectoryToBeRead(File fileOrDir, String fileDesc) { if (fileOrDir == null) throw new IllegalArgumentException(fileDesc + " must not be null."); if (!fileOrDir.exists()) throw new IllegalArgumentException(fileDesc + " does not exist: " + fileOrDi...
java
{ "resource": "" }
q3251
FurnaceClasspathScanner.scan
train
public List<URL> scan(Predicate<String> filter) { List<URL> discoveredURLs = new ArrayList<>(128); // For each Forge addon... for (Addon addon : furnace.getAddonRegistry().getAddons(AddonFilters.allStarted())) { List<String> filteredResourcePaths = filterAddonResources(a...
java
{ "resource": "" }
q3252
FurnaceClasspathScanner.scanClasses
train
public List<Class<?>> scanClasses(Predicate<String> filter) { List<Class<?>> discoveredClasses = new ArrayList<>(128); // For each Forge addon... for (Addon addon : furnace.getAddonRegistry().getAddons(AddonFilters.allStarted())) { List<String> discoveredFileNames = filt...
java
{ "resource": "" }
q3253
FurnaceClasspathScanner.filterAddonResources
train
public List<String> filterAddonResources(Addon addon, Predicate<String> filter) { List<String> discoveredFileNames = new ArrayList<>(); List<File> addonResources = addon.getRepository().getAddonResources(addon.getId()); for (File addonFile : addonResources) { if (addonFil...
java
{ "resource": "" }
q3254
FurnaceClasspathScanner.handleArchiveByFile
train
private void handleArchiveByFile(Predicate<String> filter, File archive, List<String> discoveredFiles) { try { try (ZipFile zip = new ZipFile(archive)) { Enumeration<? extends ZipEntry> entries = zip.entries(); while (entries.h...
java
{ "resource": "" }
q3255
FurnaceClasspathScanner.handleDirectory
train
private void handleDirectory(final Predicate<String> filter, final File rootDir, final List<String> discoveredFiles) { try { new DirectoryWalker<String>() { private Path startDir; public void walk() throws IOException { ...
java
{ "resource": "" }
q3256
Project.dependsOnArtifact
train
public static Project dependsOnArtifact(Artifact artifact) { Project project = new Project(); project.artifact = artifact; return project; }
java
{ "resource": "" }
q3257
Util.getSingle
train
public static final <T> T getSingle( Iterable<T> it ) { if( ! it.iterator().hasNext() ) return null; final Iterator<T> iterator = it.iterator(); T o = iterator.next(); if(iterator.hasNext()) throw new IllegalStateException("Found multiple items in iterator over "...
java
{ "resource": "" }
q3258
XSLTTransformation.perform
train
@Override public void perform(GraphRewrite event, EvaluationContext context) { checkVariableName(event, context); WindupVertexFrame payload = resolveVariable(event, getVariableName()); if (payload instanceof FileReferenceModel) { FileModel file = ((FileReferenceModel)...
java
{ "resource": "" }
q3259
ProjectFrom.dependsOnArtifact
train
public Project dependsOnArtifact(Artifact artifact) { Project project = new Project(); project.setArtifact(artifact); project.setInputVariablesName(inputVarName); return project; }
java
{ "resource": "" }
q3260
JmsDestinationService.getTypeFromClass
train
public static JmsDestinationType getTypeFromClass(String aClass) { if (StringUtils.equals(aClass, "javax.jms.Queue") || StringUtils.equals(aClass, "javax.jms.QueueConnectionFactory")) { return JmsDestinationType.QUEUE; } else if (StringUtils.equals(aClass, "javax.jms.Topi...
java
{ "resource": "" }
q3261
AbstractIterationOperation.checkVariableName
train
protected void checkVariableName(GraphRewrite event, EvaluationContext context) { if (variableName == null) { setVariableName(Iteration.getPayloadVariableName(event, context)); } }
java
{ "resource": "" }
q3262
ASTProcessor.analyze
train
public static List<ClassReference> analyze(WildcardImportResolver importResolver, Set<String> libraryPaths, Set<String> sourcePaths, Path sourceFile) { ASTParser parser = ASTParser.newParser(AST.JLS11); parser.setEnvironment(libraryPaths.toArray(new String[libraryPaths.size()]), sour...
java
{ "resource": "" }
q3263
GraphUtil.vertexAsString
train
public static final String vertexAsString(Vertex vertex, int depth, String withEdgesOfLabel) { StringBuilder sb = new StringBuilder(); vertexAsString(vertex, depth, withEdgesOfLabel, sb, 0, new HashSet<>()); return sb.toString(); }
java
{ "resource": "" }
q3264
MavenizationService.normalizeDirName
train
private static String normalizeDirName(String name) { if(name == null) return null; return name.toLowerCase().replaceAll("[^a-zA-Z0-9]", "-"); }
java
{ "resource": "" }
q3265
MavenizationService.guessPackaging
train
private static String guessPackaging(ProjectModel projectModel) { String projectType = projectModel.getProjectType(); if (projectType != null) return projectType; LOG.warning("WINDUP-983 getProjectType() returned null for: " + projectModel.getRootFileModel().getPrettyPath()); ...
java
{ "resource": "" }
q3266
XmlUtil.xpathExists
train
public static boolean xpathExists(Node document, String xpathExpression, Map<String, String> namespaceMapping) throws XPathException, MarshallingException { Boolean result = (Boolean) executeXPath(document, xpathExpression, namespaceMapping, XPathConstants.BOOLEAN); return result != ...
java
{ "resource": "" }
q3267
XmlUtil.executeXPath
train
public static Object executeXPath(Node document, String xpathExpression, Map<String, String> namespaceMapping, QName result) throws XPathException, MarshallingException { NamespaceMapContext mapContext = new NamespaceMapContext(namespaceMapping); try { XPathFactor...
java
{ "resource": "" }
q3268
ModuleAnalysisHelper.deriveGroupIdFromPackages
train
String deriveGroupIdFromPackages(ProjectModel projectModel) { Map<Object, Long> pkgsMap = new HashMap<>(); Set<String> pkgs = new HashSet<>(1000); GraphTraversal<Vertex, Vertex> pipeline = new GraphTraversalSource(graphContext.getGraph()).V(projectModel); pkgsMap = pipeline.out(Pro...
java
{ "resource": "" }
q3269
JavaClass.at
train
@Override public JavaClassBuilderAt at(TypeReferenceLocation... locations) { if (locations != null) this.locations = Arrays.asList(locations); return this; }
java
{ "resource": "" }
q3270
JavaClass.as
train
@Override public ConditionBuilder as(String variable) { Assert.notNull(variable, "Variable name must not be null."); this.setOutputVariablesName(variable); return this; }
java
{ "resource": "" }
q3271
GraphCondition.setResults
train
protected void setResults(GraphRewrite event, String variable, Iterable<? extends WindupVertexFrame> results) { Variables variables = Variables.instance(event); Iterable<? extends WindupVertexFrame> existingVariables = variables.findVariable(variable, 1); if (existingVariables != null) ...
java
{ "resource": "" }
q3272
RulePhaseFinder.loadPhases
train
private Map<String, Class<? extends RulePhase>> loadPhases() { Map<String, Class<? extends RulePhase>> phases; phases = new HashMap<>(); Furnace furnace = FurnaceHolder.getFurnace(); for (RulePhase phase : furnace.getAddonRegistry().getServices(RulePhase.class)) { ...
java
{ "resource": "" }
q3273
FileContent.allInput
train
private void allInput(List<FileModel> vertices, GraphRewrite event, ParameterStore store) { if (StringUtils.isBlank(getInputVariablesName()) && this.filenamePattern == null) { FileService fileModelService = new FileService(event.getGraphContext()); for (FileModel fileModel : ...
java
{ "resource": "" }
q3274
GraphService.getById
train
@Override public T getById(Object id) { return context.getFramed().getFramedVertex(this.type, id); }
java
{ "resource": "" }
q3275
GraphService.addTypeToModel
train
public static <T extends WindupVertexFrame> T addTypeToModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type) { Vertex vertex = frame.getElement(); graphContext.getGraphTypeManager().addTypeToElement(type, vertex); return graphContext.getFramed().frameElement(vertex, type);...
java
{ "resource": "" }
q3276
GraphService.removeTypeFromModel
train
public static <T extends WindupVertexFrame> WindupVertexFrame removeTypeFromModel(GraphContext graphContext, WindupVertexFrame frame, Class<T> type) { Vertex vertex = frame.getElement(); graphContext.getGraphTypeManager().removeTypeFromElement(type, vertex); return graphContext.getFramed().f...
java
{ "resource": "" }
q3277
ClassificationServiceCache.getCache
train
@SuppressWarnings("unchecked") private static synchronized Map<String, Boolean> getCache(GraphRewrite event) { Map<String, Boolean> result = (Map<String, Boolean>)event.getRewriteContext().get(ClassificationServiceCache.class); if (result == null) { result = Collections.synch...
java
{ "resource": "" }
q3278
EffortReportService.getEffortLevelDescription
train
public static String getEffortLevelDescription(Verbosity verbosity, int points) { EffortLevel level = EffortLevel.forPoints(points); switch (verbosity) { case ID: return level.name(); case VERBOSE: return level.getVerboseDescription(); case SH...
java
{ "resource": "" }
q3279
WindupConfiguration.setOptionValue
train
public WindupConfiguration setOptionValue(String name, Object value) { configurationOptions.put(name, value); return this; }
java
{ "resource": "" }
q3280
WindupConfiguration.getOptionValue
train
@SuppressWarnings("unchecked") public <T> T getOptionValue(String name) { return (T) configurationOptions.get(name); }
java
{ "resource": "" }
q3281
RuleSubset.logTimeTakenByRuleProvider
train
private void logTimeTakenByRuleProvider(GraphContext graphContext, Context context, int ruleIndex, int timeTaken) { AbstractRuleProvider ruleProvider = (AbstractRuleProvider) context.get(RuleMetadataType.RULE_PROVIDER); if (ruleProvider == null) return; if (!timeTakenByProvider....
java
{ "resource": "" }
q3282
RuleSubset.logTimeTakenByPhase
train
private void logTimeTakenByPhase(GraphContext graphContext, Class<? extends RulePhase> phase, int timeTaken) { if (!timeTakenByPhase.containsKey(phase)) { RulePhaseExecutionStatisticsModel model = new GraphService<>(graphContext, RulePhaseExecutionStatisticsModel....
java
{ "resource": "" }
q3283
XmlFileXPathTransformer.transformXPath
train
public static String transformXPath(String originalXPath) { // use a list to maintain the multiple joined xqueries (if there are multiple queries joined with the "|" operator) List<StringBuilder> compiledXPaths = new ArrayList<>(1); int frameIdx = -1; boolean inQuote = false; ...
java
{ "resource": "" }
q3284
Compiler.accept
train
@Override public void accept(IBinaryType binaryType, PackageBinding packageBinding, AccessRestriction accessRestriction) { if (this.options.verbose) { this.out.println( Messages.bind(Messages.compilation_loadBinary, new String(binaryType.getName()))); // new Exception("TRACE BI...
java
{ "resource": "" }
q3285
Compiler.accept
train
@Override public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) { // Switch the current policy and compilation result for this unit to the requested one. CompilationResult unitResult = new CompilationResult(sourceUnit, this.totalUnits, this.totalUnits, this...
java
{ "resource": "" }
q3286
Compiler.accept
train
@Override public void accept(ISourceType[] sourceTypes, PackageBinding packageBinding, AccessRestriction accessRestriction) { this.problemReporter.abortDueToInternalError( Messages.bind(Messages.abort_againstSourceModel, new String[] { String.valueOf(sourceTypes[0].getName()), String.valueOf(sou...
java
{ "resource": "" }
q3287
Compiler.reportProgress
train
protected void reportProgress(String taskDecription) { if (this.progress != null) { if (this.progress.isCanceled()) { // Only AbortCompilation can stop the compiler cleanly. // We check cancellation again following the call to compile. throw new AbortC...
java
{ "resource": "" }
q3288
Compiler.reportWorked
train
protected void reportWorked(int workIncrement, int currentUnitIndex) { if (this.progress != null) { if (this.progress.isCanceled()) { // Only AbortCompilation can stop the compiler cleanly. // We check cancellation again following the call to compile. ...
java
{ "resource": "" }
q3289
Compiler.compile
train
private void compile(ICompilationUnit[] sourceUnits, boolean lastRound) { this.stats.startTime = System.currentTimeMillis(); try { // build and record parsed units reportProgress(Messages.compilation_beginningToCompile); if (this.options.complianceLevel >= ClassFileC...
java
{ "resource": "" }
q3290
Compiler.process
train
public void process(CompilationUnitDeclaration unit, int i) { this.lookupEnvironment.unitBeingCompleted = unit; long parseStart = System.currentTimeMillis(); this.parser.getMethodBodies(unit); long resolveStart = System.currentTimeMillis(); this.stats.parseTime += resolveStart ...
java
{ "resource": "" }
q3291
TagServiceHolder.loadTagDefinitions
train
@PostConstruct public void loadTagDefinitions() { Map<Addon, List<URL>> addonToResourcesMap = scanner.scanForAddonMap(new FileExtensionFilter("tags.xml")); for (Map.Entry<Addon, List<URL>> entry : addonToResourcesMap.entrySet()) { for (URL resource : entry.getValue()) ...
java
{ "resource": "" }
q3292
BatchASTProcessor.analyze
train
public static BatchASTFuture analyze(final BatchASTListener listener, final WildcardImportResolver importResolver, final Set<String> libraryPaths, final Set<String> sourcePaths, Set<Path> sourceFiles) { final String[] encodings = null; final String[] bindingKeys = ne...
java
{ "resource": "" }
q3293
AnnotationTypeCondition.addCondition
train
public AnnotationTypeCondition addCondition(String element, AnnotationCondition condition) { this.conditions.put(element, condition); return this; }
java
{ "resource": "" }
q3294
ProcyonDecompiler.decompileClassFile
train
@Override public DecompilationResult decompileClassFile(Path rootDir, Path classFilePath, Path outputDir) throws DecompilationException { Checks.checkDirectoryToBeRead(rootDir.toFile(), "Classes root dir"); File classFile = classFilePath.toFile(); Checks.checkFileToBeRead...
java
{ "resource": "" }
q3295
ProcyonDecompiler.refreshMetadataCache
train
private void refreshMetadataCache(final Queue<WindupMetadataSystem> metadataSystemCache, final DecompilerSettings settings) { metadataSystemCache.clear(); for (int i = 0; i < this.getNumberOfThreads(); i++) { metadataSystemCache.add(new NoRetryMetadataSystem(settings.getTypeLoade...
java
{ "resource": "" }
q3296
ProcyonDecompiler.decompileType
train
private File decompileType(final DecompilerSettings settings, final WindupMetadataSystem metadataSystem, final String typeName) throws IOException { log.fine("Decompiling " + typeName); final TypeReference type; // Hack to get around classes whose descriptors clash with primitive types. ...
java
{ "resource": "" }
q3297
ProcyonDecompiler.getDefaultSettings
train
private DecompilerSettings getDefaultSettings(File outputDir) { DecompilerSettings settings = new DecompilerSettings(); procyonConf.setDecompilerSettings(settings); settings.setOutputDirectory(outputDir.getPath()); settings.setShowSyntheticMembers(false); settings.setForceExp...
java
{ "resource": "" }
q3298
ProcyonDecompiler.loadJar
train
private JarFile loadJar(File archive) throws DecompilationException { try { return new JarFile(archive); } catch (IOException ex) { throw new DecompilationException("Can't load .jar: " + archive.getPath(), ex); } }
java
{ "resource": "" }
q3299
ProcyonDecompiler.createFileWriter
train
private static synchronized FileOutputWriter createFileWriter(final TypeDefinition type, final DecompilerSettings settings) throws IOException { final String outputDirectory = settings.getOutputDirectory(); final String fileName = type.getName() + settings.getLanguage().getFileExten...
java
{ "resource": "" }