method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public void testInClassFileWithoutSource() throws JavaModelException { IClassFile cu = getClassFile("Resolve", "p4.jar", "p4", "X.class"); String selection = "Object"; int start = 34; int length = selection.length(); IJavaElement[] elements = cu.codeSelect(start, length); assertElementsEqual( "Unexpected elements", "", elements ); }
void function() throws JavaModelException { IClassFile cu = getClassFile(STR, STR, "p4", STR); String selection = STR; int start = 34; int length = selection.length(); IJavaElement[] elements = cu.codeSelect(start, length); assertElementsEqual( STR, "", elements ); }
/** * Tests code resolve on a class file without attached source. */
Tests code resolve on a class file without attached source
testInClassFileWithoutSource
{ "repo_name": "maxeler/eclipse", "path": "eclipse.jdt.core/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests.java", "license": "epl-1.0", "size": 92379 }
[ "org.eclipse.jdt.core.IClassFile", "org.eclipse.jdt.core.IJavaElement", "org.eclipse.jdt.core.JavaModelException" ]
import org.eclipse.jdt.core.IClassFile; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.*;
[ "org.eclipse.jdt" ]
org.eclipse.jdt;
738,056
private JLabel getLblPass4() { if (lblPass4 == null) { lblPass4 = new JLabel("Password: "); lblPass4.setFont(new Font("Tahoma", Font.PLAIN, 13)); } return lblPass4; }
JLabel function() { if (lblPass4 == null) { lblPass4 = new JLabel(STR); lblPass4.setFont(new Font(STR, Font.PLAIN, 13)); } return lblPass4; }
/** * Devuelve el valor de lblPass4 * * @return lblPass4 */
Devuelve el valor de lblPass4
getLblPass4
{ "repo_name": "Arquisoft/Trivial5a", "path": "game/src/main/java/es/uniovi/asw/gui/ConfigurarPartida.java", "license": "gpl-2.0", "size": 26710 }
[ "java.awt.Font", "javax.swing.JLabel" ]
import java.awt.Font; import javax.swing.JLabel;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
1,310,846
public void testCycleDateStartTimerEvent() throws Exception { Clock previousClock = processEngineConfiguration.getClock(); Clock testClock = new DefaultClockImpl(); processEngineConfiguration.setClock(testClock); Calendar calendar = Calendar.getInstance(); calendar.set(2025, Calendar.DECEMBER, 10, 0, 0, 0); testClock.setCurrentTime(calendar.getTime()); // deploy the process repositoryService.createDeployment().addClasspathResource("org/activiti/engine/test/bpmn/event/timer/StartTimerEventRepeatWithoutEndDateTest.testCycleDateStartTimerEvent.bpmn20.xml").deploy(); assertThat(repositoryService.createProcessDefinitionQuery().count()).isEqualTo(1); // AFTER DEPLOYMENT // when the process is deployed there will be created a timerStartEvent job which will wait to be executed. List<Job> jobs = managementService.createTimerJobQuery().list(); assertThat(jobs).hasSize(1); // dueDate should be after 24 hours from the process deployment Calendar dueDateCalendar = Calendar.getInstance(); dueDateCalendar.set(2025, Calendar.DECEMBER, 11, 0, 0, 0); // check the due date is inside the 2 seconds range assertThat(Math.abs(dueDateCalendar.getTime().getTime() - jobs.get(0).getDuedate().getTime()) < 2000).isEqualTo(true); // No process instances List<ProcessInstance> processInstances = runtimeService.createProcessInstanceQuery().list(); assertThat(processInstances).hasSize(0); // No tasks List<Task> tasks = taskService.createTaskQuery().list(); assertThat(tasks).hasSize(0); // ADVANCE THE CLOCK // advance the clock after 9 days from starting the process -> // the system will execute the pending job and will create a new one (day by day) moveByMinutes(9 * 60 * 24); executeJobExecutorForTime(10000, 200); // there must be a pending job because the endDate is not reached yet jobs = managementService.createTimerJobQuery().list(); assertThat(jobs).hasSize(1); // After time advanced 9 days there should be 9 process instance started processInstances = runtimeService.createProcessInstanceQuery().list(); assertThat(processInstances).hasSize(9); // 9 task to be executed (the userTask "Task A") tasks = taskService.createTaskQuery().list(); assertThat(tasks).hasSize(9); // one new job will be created (and the old one will be deleted after execution) jobs = managementService.createTimerJobQuery().list(); assertThat(jobs).hasSize(1); // check if the last job to be executed has the dueDate set correctly // (10'th repeat after 10 dec. => dueDate must have DueDate = 20 dec.) dueDateCalendar = Calendar.getInstance(); dueDateCalendar.set(2025, Calendar.DECEMBER, 20, 0, 0, 0); assertThat(Math.abs(dueDateCalendar.getTime().getTime() - jobs.get(0).getDuedate().getTime()) < 2000).isEqualTo(true); // ADVANCE THE CLOCK SO that all 10 repeats to be executed (last execution) moveByMinutes(60 * 24); try { waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(2000, 200); } catch (Exception e) { fail("Because the maximum number of repeats is reached it will not be executed other jobs"); } // After the 10nth startEvent Execution should have 10 process instances started // (since the first one was not completed) processInstances = runtimeService.createProcessInstanceQuery().list(); assertThat(processInstances).hasSize(10); // the current job will be deleted after execution and a new one will // not be created. (all 10 has already executed) jobs = managementService.createJobQuery().list(); assertThat(jobs).hasSize(0); // 10 tasks to be executed (the userTask "Task A") // one task for each process instance tasks = taskService.createTaskQuery().list(); assertThat(tasks).hasSize(10); // FINAL CHECK // count "timer fired" events int timerFiredCount = 0; List<ActivitiEvent> eventsReceived = listener.getEventsReceived(); for (ActivitiEvent eventReceived : eventsReceived) { if (ActivitiEventType.TIMER_FIRED.equals(eventReceived.getType())) { timerFiredCount++; } } // count "entity created" events int eventCreatedCount = 0; for (ActivitiEvent eventReceived : eventsReceived) { if (ActivitiEventType.ENTITY_CREATED.equals(eventReceived.getType())) { eventCreatedCount++; } } // count "entity deleted" events int eventDeletedCount = 0; for (ActivitiEvent eventReceived : eventsReceived) { if (ActivitiEventType.ENTITY_DELETED.equals(eventReceived.getType())) { eventDeletedCount++; } } assertThat(timerFiredCount).isEqualTo(10); // 10 timers fired assertThat(eventCreatedCount).isEqualTo(20); // 20 job entities created, 2 per job (timer and executable job) assertThat(eventDeletedCount).isEqualTo(20); // 20 jobs entities deleted, 2 per job (timer and executable job) // for each processInstance // let's complete the userTasks where the process is hanging in order to complete the processes. for (ProcessInstance processInstance : processInstances) { tasks = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).list(); Task task = tasks.get(0); assertThat(task.getName()).isEqualTo("Task A"); assertThat(tasks).hasSize(1); taskService.complete(task.getId()); } // now All the process instances should be completed processInstances = runtimeService.createProcessInstanceQuery().list(); assertThat(processInstances).hasSize(0); // no jobs jobs = managementService.createJobQuery().list(); assertThat(jobs).hasSize(0); jobs = managementService.createTimerJobQuery().list(); assertThat(jobs).hasSize(0); // no tasks tasks = taskService.createTaskQuery().list(); assertThat(tasks).hasSize(0); listener.clearEventsReceived(); processEngineConfiguration.setClock(previousClock); repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true); }
void function() throws Exception { Clock previousClock = processEngineConfiguration.getClock(); Clock testClock = new DefaultClockImpl(); processEngineConfiguration.setClock(testClock); Calendar calendar = Calendar.getInstance(); calendar.set(2025, Calendar.DECEMBER, 10, 0, 0, 0); testClock.setCurrentTime(calendar.getTime()); repositoryService.createDeployment().addClasspathResource(STR).deploy(); assertThat(repositoryService.createProcessDefinitionQuery().count()).isEqualTo(1); List<Job> jobs = managementService.createTimerJobQuery().list(); assertThat(jobs).hasSize(1); Calendar dueDateCalendar = Calendar.getInstance(); dueDateCalendar.set(2025, Calendar.DECEMBER, 11, 0, 0, 0); assertThat(Math.abs(dueDateCalendar.getTime().getTime() - jobs.get(0).getDuedate().getTime()) < 2000).isEqualTo(true); List<ProcessInstance> processInstances = runtimeService.createProcessInstanceQuery().list(); assertThat(processInstances).hasSize(0); List<Task> tasks = taskService.createTaskQuery().list(); assertThat(tasks).hasSize(0); moveByMinutes(9 * 60 * 24); executeJobExecutorForTime(10000, 200); jobs = managementService.createTimerJobQuery().list(); assertThat(jobs).hasSize(1); processInstances = runtimeService.createProcessInstanceQuery().list(); assertThat(processInstances).hasSize(9); tasks = taskService.createTaskQuery().list(); assertThat(tasks).hasSize(9); jobs = managementService.createTimerJobQuery().list(); assertThat(jobs).hasSize(1); dueDateCalendar = Calendar.getInstance(); dueDateCalendar.set(2025, Calendar.DECEMBER, 20, 0, 0, 0); assertThat(Math.abs(dueDateCalendar.getTime().getTime() - jobs.get(0).getDuedate().getTime()) < 2000).isEqualTo(true); moveByMinutes(60 * 24); try { waitForJobExecutorToProcessAllJobsAndExecutableTimerJobs(2000, 200); } catch (Exception e) { fail(STR); } processInstances = runtimeService.createProcessInstanceQuery().list(); assertThat(processInstances).hasSize(10); jobs = managementService.createJobQuery().list(); assertThat(jobs).hasSize(0); tasks = taskService.createTaskQuery().list(); assertThat(tasks).hasSize(10); int timerFiredCount = 0; List<ActivitiEvent> eventsReceived = listener.getEventsReceived(); for (ActivitiEvent eventReceived : eventsReceived) { if (ActivitiEventType.TIMER_FIRED.equals(eventReceived.getType())) { timerFiredCount++; } } int eventCreatedCount = 0; for (ActivitiEvent eventReceived : eventsReceived) { if (ActivitiEventType.ENTITY_CREATED.equals(eventReceived.getType())) { eventCreatedCount++; } } int eventDeletedCount = 0; for (ActivitiEvent eventReceived : eventsReceived) { if (ActivitiEventType.ENTITY_DELETED.equals(eventReceived.getType())) { eventDeletedCount++; } } assertThat(timerFiredCount).isEqualTo(10); assertThat(eventCreatedCount).isEqualTo(20); assertThat(eventDeletedCount).isEqualTo(20); for (ProcessInstance processInstance : processInstances) { tasks = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).list(); Task task = tasks.get(0); assertThat(task.getName()).isEqualTo(STR); assertThat(tasks).hasSize(1); taskService.complete(task.getId()); } processInstances = runtimeService.createProcessInstanceQuery().list(); assertThat(processInstances).hasSize(0); jobs = managementService.createJobQuery().list(); assertThat(jobs).hasSize(0); jobs = managementService.createTimerJobQuery().list(); assertThat(jobs).hasSize(0); tasks = taskService.createTaskQuery().list(); assertThat(tasks).hasSize(0); listener.clearEventsReceived(); processEngineConfiguration.setClock(previousClock); repositoryService.deleteDeployment(repositoryService.createDeploymentQuery().singleResult().getId(), true); }
/** * Timer repetition */
Timer repetition
testCycleDateStartTimerEvent
{ "repo_name": "Activiti/Activiti", "path": "activiti-core/activiti-engine/src/test/java/org/activiti/engine/test/bpmn/event/timer/compatibility/StartTimerEventRepeatCompatibilityTest.java", "license": "apache-2.0", "size": 7980 }
[ "java.util.Calendar", "java.util.List", "org.activiti.engine.delegate.event.ActivitiEvent", "org.activiti.engine.delegate.event.ActivitiEventType", "org.activiti.engine.impl.util.DefaultClockImpl", "org.activiti.engine.runtime.Clock", "org.activiti.engine.runtime.Job", "org.activiti.engine.runtime.ProcessInstance", "org.activiti.engine.task.Task", "org.assertj.core.api.Assertions" ]
import java.util.Calendar; import java.util.List; import org.activiti.engine.delegate.event.ActivitiEvent; import org.activiti.engine.delegate.event.ActivitiEventType; import org.activiti.engine.impl.util.DefaultClockImpl; import org.activiti.engine.runtime.Clock; import org.activiti.engine.runtime.Job; import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.task.Task; import org.assertj.core.api.Assertions;
import java.util.*; import org.activiti.engine.delegate.event.*; import org.activiti.engine.impl.util.*; import org.activiti.engine.runtime.*; import org.activiti.engine.task.*; import org.assertj.core.api.*;
[ "java.util", "org.activiti.engine", "org.assertj.core" ]
java.util; org.activiti.engine; org.assertj.core;
1,101,361
public void cleanup() throws RepositoryException { repo.getConnection().clear(); }
void function() throws RepositoryException { repo.getConnection().clear(); }
/** * Removes all data from the repository. * * @throws RepositoryException * If cleanup fails. */
Removes all data from the repository
cleanup
{ "repo_name": "chrpin/rodi", "path": "src/com/fluidops/rdb2rdfbench/db/rdf/SesameAdapter.java", "license": "mit", "size": 12175 }
[ "org.openrdf.repository.RepositoryException" ]
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.*;
[ "org.openrdf.repository" ]
org.openrdf.repository;
1,088,906
public static void matchesPattern(final CharSequence input, final String pattern) { // TODO when breaking BC, consider returning input if (Pattern.matches(pattern, input) == false) { throw new IllegalArgumentException(String.format(DEFAULT_MATCHES_PATTERN_EX, input, pattern)); } }
static void function(final CharSequence input, final String pattern) { if (Pattern.matches(pattern, input) == false) { throw new IllegalArgumentException(String.format(DEFAULT_MATCHES_PATTERN_EX, input, pattern)); } }
/** * <p>Validate that the specified argument character sequence matches the specified regular * expression pattern; otherwise throwing an exception.</p> * * <pre>Validate.matchesPattern("hi", "[a-z]*");</pre> * * <p>The syntax of the pattern is the one used in the {@link Pattern} class.</p> * * @param input the character sequence to validate, not null * @param pattern the regular expression pattern, not null * @throws IllegalArgumentException if the character sequence does not match the pattern * @see #matchesPattern(CharSequence, String, String, Object...) * * @since 3.0 */
Validate that the specified argument character sequence matches the specified regular expression pattern; otherwise throwing an exception. <code>Validate.matchesPattern("hi", "[a-z]*");</code> The syntax of the pattern is the one used in the <code>Pattern</code> class
matchesPattern
{ "repo_name": "longestname1/commonslang", "path": "src/main/java/org/apache/commons/lang3/Validate.java", "license": "apache-2.0", "size": 57184 }
[ "java.util.regex.Pattern" ]
import java.util.regex.Pattern;
import java.util.regex.*;
[ "java.util" ]
java.util;
1,178,196
public static void logTapShortWordSeen( boolean wasSearchContentViewSeen, boolean isTapOnShortWord) { if (!isTapOnShortWord) return; // We just record CTR of short words. RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchTapShortWordSeen", wasSearchContentViewSeen ? Results.SEEN : Results.NOT_SEEN, Results.NUM_ENTRIES); }
static void function( boolean wasSearchContentViewSeen, boolean isTapOnShortWord) { if (!isTapOnShortWord) return; RecordHistogram.recordEnumeratedHistogram(STR, wasSearchContentViewSeen ? Results.SEEN : Results.NOT_SEEN, Results.NUM_ENTRIES); }
/** * Log whether results were seen due to a Tap on a short word. * @param wasSearchContentViewSeen If the panel was opened. * @param isTapOnShortWord Whether this tap was on a "short" word. */
Log whether results were seen due to a Tap on a short word
logTapShortWordSeen
{ "repo_name": "chromium/chromium", "path": "chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java", "license": "bsd-3-clause", "size": 83424 }
[ "org.chromium.base.metrics.RecordHistogram" ]
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.metrics.*;
[ "org.chromium.base" ]
org.chromium.base;
369,139
public final SocketFactory getSocketFactory() { return socketFactory; }
final SocketFactory function() { return socketFactory; }
/** * Gets the socket factory. * * @return The socket factory. */
Gets the socket factory
getSocketFactory
{ "repo_name": "jeozey/XmppServerTester", "path": "xmpp-core-client/src/main/java/rocks/xmpp/core/session/TcpConnectionConfiguration.java", "license": "mit", "size": 6001 }
[ "javax.net.SocketFactory" ]
import javax.net.SocketFactory;
import javax.net.*;
[ "javax.net" ]
javax.net;
1,535,614
private static File getExternalCacheDir(Context context) { // TODO: This needs to be moved to a background thread to ensure no disk access on the // main/UI thread as unfortunately getExternalCacheDir() calls mkdirs() for us (even // though the Volley library will later try and call mkdirs() as well from a background // thread). return context.getExternalCacheDir(); }
static File function(Context context) { return context.getExternalCacheDir(); }
/** * Get the external app cache directory. * * @param context The context to use * @return The external cache dir */
Get the external app cache directory
getExternalCacheDir
{ "repo_name": "shaojie519/google-io-2013-eclipse", "path": "google-io-2013/src/com/google/android/apps/iosched/util/ImageLoader.java", "license": "apache-2.0", "size": 13009 }
[ "android.content.Context", "java.io.File" ]
import android.content.Context; import java.io.File;
import android.content.*; import java.io.*;
[ "android.content", "java.io" ]
android.content; java.io;
2,714,703
@Generated @Selector("typingAttributes") public native NSDictionary<String, ?> typingAttributes();
@Selector(STR) native NSDictionary<String, ?> function();
/** * automatically resets when the selection changes */
automatically resets when the selection changes
typingAttributes
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/uikit/UITextField.java", "license": "apache-2.0", "size": 46138 }
[ "org.moe.natj.objc.ann.Selector" ]
import org.moe.natj.objc.ann.Selector;
import org.moe.natj.objc.ann.*;
[ "org.moe.natj" ]
org.moe.natj;
2,335,822
void endVisitEarComponent(IVirtualComponent component) throws CoreException;
void endVisitEarComponent(IVirtualComponent component) throws CoreException;
/** * Post process EAR resource. * * @param component * EAR component to process * @throws CoreException */
Post process EAR resource
endVisitEarComponent
{ "repo_name": "bengalaviz/JettyWTPPlugin", "path": "org.eclipse.jst.server.jetty.core/src/org/eclipse/jst/server/jetty/core/internal/wst/IModuleVisitor.java", "license": "epl-1.0", "size": 3134 }
[ "org.eclipse.core.runtime.CoreException", "org.eclipse.wst.common.componentcore.resources.IVirtualComponent" ]
import org.eclipse.core.runtime.CoreException; import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.core.runtime.*; import org.eclipse.wst.common.componentcore.resources.*;
[ "org.eclipse.core", "org.eclipse.wst" ]
org.eclipse.core; org.eclipse.wst;
1,714,140
public boolean showRecs(int numrecs) { int tcprecs = fmt.getNumberOfTCPRecords(); // Display the wait cursor ((Component) l).setCursor(new Cursor(Cursor.WAIT_CURSOR)); if(page==0) { // If we are supposed to view a new page if(oper==OPEN || oper==OPENRMT) { // We are reading the data in from a stream int end = recsdisp+numrecs; if(end>ifsrecs) { msg.setText(recsdisp + "-" + ifsrecs + " " + ResourceBundleLoader_ct.getText("of") + " " + ifsrecs + " " + ResourceBundleLoader_ct.getText("possible")); } else { msg.setText(recsdisp + "-" + (recsdisp+numrecs) + " " + ResourceBundleLoader_ct.getText("of") + " " + ifsrecs + " " + ResourceBundleLoader_ct.getText("possible")); } recsdisp = end; if(lastPage.equals("")) { // Save the page we are currently viewing lastPage = formattrace.getText(); } else { slastPage = lastPage; lastPage = formattrace.getText(); } formattrace.setText(null); // Clear the TextArea for(int i=0;i<numrecs;i++) { String rec=null; if((rec = fmt.getRecFromFile())!=null) { formattrace.append(rec); } else { // No more records to display so send an error back // Display the default cursor ((Component) l).setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); return false; } } } else { // Set the message of the text label that says where in the // trace we are int end = recsdisp+numrecs; // If the user requested to view records past the end of what // we have set the limit to the last record if(end>tcprecs) { msg.setText(recsdisp + "-" + (tcprecs) + " " + ResourceBundleLoader_ct.getText("of") + " " + tcprecs); } else { msg.setText(recsdisp + "-" + (end) + " " + ResourceBundleLoader_ct.getText("of") + " " + tcprecs); } recsdisp = end; if(lastPage.equals("")) { // Save the page we are currently viewing lastPage = formattrace.getText(); } else { slastPage = lastPage; lastPage = formattrace.getText(); } formattrace.setText(null); // Clear the TextArea for(int i=0;i<numrecs;i++) { String rec=null; if((rec = fmt.getRecFromFile())!=null) { formattrace.append(rec); } else { // No more records to display so send an error back // Display the default cursor ((Component) l).setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); return false; } } } } else if(page==1) { // The user wants to view the current page formattrace.setText(currPage); // If the user is reading a file of the disk set the message // correctly if(tcprecs==0) { // User is reading past the end of the available records if(recsdisp>ifsrecs) { msg.setText(recsdisp + "-" + ifsrecs + " " + ResourceBundleLoader_ct.getText("of") + " " + ifsrecs + " " + ResourceBundleLoader_ct.getText("possible")); } else { msg.setText(recsdisp-numrecs + "-" + (recsdisp) + " " + ResourceBundleLoader_ct.getText("of") + " " + ifsrecs + " " + ResourceBundleLoader_ct.getText("possible")); } if(recsdisp>=ifsrecs) { // Display the default cursor ((Component) l).setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); page=0; // User is viewing current page return false; } } else { // User is attempting to view past the end of the available // number of records if(recsdisp>tcprecs) { msg.setText(recsdisp + "-" + (tcprecs) + " " + ResourceBundleLoader_ct.getText("of") + " " + tcprecs); } else { msg.setText(recsdisp-numrecs + "-" + (recsdisp) + " " + ResourceBundleLoader_ct.getText("of") + " " + tcprecs); } if(recsdisp>=tcprecs) { // Display the default cursor ((Component) l).setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); page=0; // User is viewing current page return false; } } page=0; // User is viewing current page } else if(page==2) { // The user wants to view the 2nd to last page formattrace.setText(lastPage); msg.setText(ResourceBundleLoader_ct.getText("PreviousPage")); page=1; // User is viewing 2nd to last page } // Display the default cursor ((Component) l).setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); return true; }
boolean function(int numrecs) { int tcprecs = fmt.getNumberOfTCPRecords(); ((Component) l).setCursor(new Cursor(Cursor.WAIT_CURSOR)); if(page==0) { if(oper==OPEN oper==OPENRMT) { int end = recsdisp+numrecs; if(end>ifsrecs) { msg.setText(recsdisp + "-STR STRofSTR STR " + ResourceBundleLoader_ct.getText(STR)); } else { msg.setText(recsdisp + "-" + (recsdisp+numrecs) + " STRofSTR STR " + ResourceBundleLoader_ct.getText(STR)); } recsdisp = end; if(lastPage.equals(STR-STR STRofSTR STR-STR STRofSTR STRSTR-STR STRofSTR STR " + ResourceBundleLoader_ct.getText(STR)); } else { msg.setText(recsdisp-numrecs + "-STR STRofSTR STR " + ResourceBundleLoader_ct.getText(STR)); } if(recsdisp>=ifsrecs) { ((Component) l).setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); page=0; return false; } } else { if(recsdisp>tcprecs) { msg.setText(recsdisp + "-STR STRofSTR STR-STR STRofSTR STRPreviousPage")); page=1; } ((Component) l).setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); return true; }
/** * Displays numrecs in the TextArea. * @param numrecs the number of records to show. * @return returns false when there are no more records to display. */
Displays numrecs in the TextArea
showRecs
{ "repo_name": "devjunix/libjt400-java", "path": "src/com/ibm/as400/util/commtrace/FormatDisplay.java", "license": "epl-1.0", "size": 27927 }
[ "java.awt.Component", "java.awt.Cursor" ]
import java.awt.Component; import java.awt.Cursor;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,634,768
private ClassLoader buildWebAppClassLoader(Map startupArgs, ClassLoader parentClassLoader, String webRoot, List classPathFileList) { List urlList = new ArrayList(); try { // Web-inf folder File webInfFolder = new File(webRoot, WEB_INF); // Classes folder File classesFolder = new File(webInfFolder, CLASSES); if (classesFolder.exists()) { Logger.log(Logger.DEBUG, Launcher.RESOURCES, "WebAppConfig.WebAppClasses"); String classesFolderURL = classesFolder.getCanonicalFile().toURL().toString(); urlList.add(new URL(classesFolderURL.endsWith("/") ? classesFolderURL : classesFolderURL + "/")); classPathFileList.add(classesFolder); } else { Logger.log(Logger.WARNING, Launcher.RESOURCES, "WebAppConfig.NoWebAppClasses", classesFolder.toString()); } // Lib folder's jar files File libFolder = new File(webInfFolder, LIB); if (libFolder.exists()) { File jars[] = libFolder.listFiles(); for (int n = 0; n < jars.length; n++) { String jarName = jars[n].getName().toLowerCase(); if (jarName.endsWith(".jar") || jarName.endsWith(".zip")) { Logger.log(Logger.DEBUG, Launcher.RESOURCES, "WebAppConfig.WebAppLib", jars[n].getName()); urlList.add(jars[n].toURL()); classPathFileList.add(jars[n]); } } } else { Logger.log(Logger.WARNING, Launcher.RESOURCES, "WebAppConfig.NoWebAppLib", libFolder .toString()); } } catch (MalformedURLException err) { throw new WinstoneException(Launcher.RESOURCES .getString("WebAppConfig.BadURL"), err); } catch (IOException err) { throw new WinstoneException(Launcher.RESOURCES .getString("WebAppConfig.IOException"), err); } URL jarURLs[] = (URL []) urlList.toArray(new URL[urlList.size()]); String preferredClassLoader = stringArg(startupArgs, "preferredClassLoader", WEBAPP_CL_CLASS); if (booleanArg(startupArgs, "useServletReloading", false) && stringArg(startupArgs, "preferredClassLoader", "").equals("")) { preferredClassLoader = RELOADING_CL_CLASS; } // Try to set up the preferred class loader, and if we fail, use the normal one ClassLoader outputCL = null; if (!preferredClassLoader.equals("")) { try { Class preferredCL = Class.forName(preferredClassLoader, true, parentClassLoader); Constructor reloadConstr = preferredCL.getConstructor(new Class[] { URL[].class, ClassLoader.class}); outputCL = (ClassLoader) reloadConstr.newInstance(new Object[] { jarURLs, parentClassLoader}); } catch (Throwable err) { if (!stringArg(startupArgs, "preferredClassLoader", "").equals("") || !preferredClassLoader.equals(WEBAPP_CL_CLASS)) { Logger.log(Logger.ERROR, Launcher.RESOURCES, "WebAppConfig.CLError", err); } } } if (outputCL == null) { outputCL = new URLClassLoader(jarURLs, parentClassLoader); } Logger.log(Logger.MAX, Launcher.RESOURCES, "WebAppConfig.WebInfClassLoader", outputCL.toString()); return outputCL; }
ClassLoader function(Map startupArgs, ClassLoader parentClassLoader, String webRoot, List classPathFileList) { List urlList = new ArrayList(); try { File webInfFolder = new File(webRoot, WEB_INF); File classesFolder = new File(webInfFolder, CLASSES); if (classesFolder.exists()) { Logger.log(Logger.DEBUG, Launcher.RESOURCES, STR); String classesFolderURL = classesFolder.getCanonicalFile().toURL().toString(); urlList.add(new URL(classesFolderURL.endsWith("/") ? classesFolderURL : classesFolderURL + "/")); classPathFileList.add(classesFolder); } else { Logger.log(Logger.WARNING, Launcher.RESOURCES, STR, classesFolder.toString()); } File libFolder = new File(webInfFolder, LIB); if (libFolder.exists()) { File jars[] = libFolder.listFiles(); for (int n = 0; n < jars.length; n++) { String jarName = jars[n].getName().toLowerCase(); if (jarName.endsWith(".jar") jarName.endsWith(".zip")) { Logger.log(Logger.DEBUG, Launcher.RESOURCES, STR, jars[n].getName()); urlList.add(jars[n].toURL()); classPathFileList.add(jars[n]); } } } else { Logger.log(Logger.WARNING, Launcher.RESOURCES, STR, libFolder .toString()); } } catch (MalformedURLException err) { throw new WinstoneException(Launcher.RESOURCES .getString(STR), err); } catch (IOException err) { throw new WinstoneException(Launcher.RESOURCES .getString(STR), err); } URL jarURLs[] = (URL []) urlList.toArray(new URL[urlList.size()]); String preferredClassLoader = stringArg(startupArgs, STR, WEBAPP_CL_CLASS); if (booleanArg(startupArgs, STR, false) && stringArg(startupArgs, STR, STRSTR")) { try { Class preferredCL = Class.forName(preferredClassLoader, true, parentClassLoader); Constructor reloadConstr = preferredCL.getConstructor(new Class[] { URL[].class, ClassLoader.class}); outputCL = (ClassLoader) reloadConstr.newInstance(new Object[] { jarURLs, parentClassLoader}); } catch (Throwable err) { if (!stringArg(startupArgs, STR, STRSTRWebAppConfig.CLErrorSTRWebAppConfig.WebInfClassLoader", outputCL.toString()); return outputCL; }
/** * Build the web-app classloader. This tries to load the preferred classloader first, * but if it fails, falls back to a simple URLClassLoader. */
Build the web-app classloader. This tries to load the preferred classloader first, but if it fails, falls back to a simple URLClassLoader
buildWebAppClassLoader
{ "repo_name": "cdauth/winstone", "path": "src/java/winstone/WebAppConfiguration.java", "license": "lgpl-2.1", "size": 86541 }
[ "java.io.File", "java.io.IOException", "java.lang.reflect.Constructor", "java.net.MalformedURLException", "java.util.ArrayList", "java.util.List", "java.util.Map" ]
import java.io.File; import java.io.IOException; import java.lang.reflect.Constructor; import java.net.MalformedURLException; import java.util.ArrayList; import java.util.List; import java.util.Map;
import java.io.*; import java.lang.reflect.*; import java.net.*; import java.util.*;
[ "java.io", "java.lang", "java.net", "java.util" ]
java.io; java.lang; java.net; java.util;
2,805,698
public void setMode(@NonNull PorterDuff.Mode mode) { mMode = mode; update(); }
void function(@NonNull PorterDuff.Mode mode) { mMode = mode; update(); }
/** * Specifies the Porter-Duff mode to use when compositing this color * filter's color with the source pixel at draw time. * * @see PorterDuff * @see #getMode() * @see #getColor() * * @hide */
Specifies the Porter-Duff mode to use when compositing this color filter's color with the source pixel at draw time
setMode
{ "repo_name": "syslover33/ctank", "path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/android/graphics/PorterDuffColorFilter.java", "license": "gpl-3.0", "size": 3545 }
[ "android.annotation.NonNull" ]
import android.annotation.NonNull;
import android.annotation.*;
[ "android.annotation" ]
android.annotation;
813,547
public Iterator<WebSpacesListResponse.WebSpace> iterator() { return this.getWebSpaces().iterator(); } public static class WebSpace { private WebSpaceAvailabilityState availabilityState;
Iterator<WebSpacesListResponse.WebSpace> function() { return this.getWebSpaces().iterator(); } public static class WebSpace { private WebSpaceAvailabilityState availabilityState;
/** * Gets the sequence of WebSpaces. * */
Gets the sequence of WebSpaces
iterator
{ "repo_name": "flydream2046/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-websites/src/main/java/com/microsoft/windowsazure/management/websites/models/WebSpacesListResponse.java", "license": "apache-2.0", "size": 8423 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,440,734
public int findModuleVersion(ModuleVersion moduleVersion) { for (int i = 0; i < this.listReference.size(); i++) { ModuleVersion moduleVersion2; moduleVersion2 = this.listReference.get(i).getModuleVersion(); if ( (moduleVersion2 != null) && (moduleVersion2.getNodePath().equals(moduleVersion.getNodePath())) && ((moduleVersion.getVersion() == null) || (moduleVersion2.getVersion().equals(moduleVersion.getVersion())))) { return i; } } return -1; }
int function(ModuleVersion moduleVersion) { for (int i = 0; i < this.listReference.size(); i++) { ModuleVersion moduleVersion2; moduleVersion2 = this.listReference.get(i).getModuleVersion(); if ( (moduleVersion2 != null) && (moduleVersion2.getNodePath().equals(moduleVersion.getNodePath())) && ((moduleVersion.getVersion() == null) (moduleVersion2.getVersion().equals(moduleVersion.getVersion())))) { return i; } } return -1; }
/** * Finds a {@link ModuleVersion}. * * @param moduleVersion ModuleVersion. The {@link Version} can be null in which * case only the {@link NodePath}'s of the {@link Module}'s are considered. * @return Index of the ModuleVersion if found. -1 if the ModuleVersion is not * found. */
Finds a <code>ModuleVersion</code>
findModuleVersion
{ "repo_name": "azyva/dragom-api", "path": "src/main/java/org/azyva/dragom/reference/ReferencePath.java", "license": "agpl-3.0", "size": 7527 }
[ "org.azyva.dragom.model.ModuleVersion" ]
import org.azyva.dragom.model.ModuleVersion;
import org.azyva.dragom.model.*;
[ "org.azyva.dragom" ]
org.azyva.dragom;
1,611,195
@ServiceMethod(returns = ReturnType.SINGLE) PrivateLinkResourceListResultDescriptionInner listByService(String resourceGroupName, String resourceName);
@ServiceMethod(returns = ReturnType.SINGLE) PrivateLinkResourceListResultDescriptionInner listByService(String resourceGroupName, String resourceName);
/** * Gets the private link resources that need to be created for a service. * * @param resourceGroupName The name of the resource group that contains the service instance. * @param resourceName The name of the service instance. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the private link resources that need to be created for a service. */
Gets the private link resources that need to be created for a service
listByService
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/healthcareapis/azure-resourcemanager-healthcareapis/src/main/java/com/azure/resourcemanager/healthcareapis/fluent/PrivateLinkResourcesClient.java", "license": "mit", "size": 4318 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.healthcareapis.fluent.models.PrivateLinkResourceListResultDescriptionInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.healthcareapis.fluent.models.PrivateLinkResourceListResultDescriptionInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.healthcareapis.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,846,481
public void writeField (Object object, String fieldName, String jsonName, Class elementType) { Class type = object.getClass(); ObjectMap<String, FieldMetadata> fields = typeToFields.get(type); if (fields == null) fields = cacheFields(type); FieldMetadata metadata = fields.get(fieldName); if (metadata == null) throw new SerializationException("Field not found: " + fieldName + " (" + type.getName() + ")"); Field field = metadata.field; if (elementType == null) elementType = metadata.elementType; try { if (debug) System.out.println("Writing field: " + field.getName() + " (" + type.getName() + ")"); writer.name(jsonName); writeValue(field.get(object), field.getType(), elementType); } catch (ReflectionException ex) { throw new SerializationException("Error accessing field: " + field.getName() + " (" + type.getName() + ")", ex); } catch (SerializationException ex) { ex.addTrace(field + " (" + type.getName() + ")"); throw ex; } catch (Exception runtimeEx) { SerializationException ex = new SerializationException(runtimeEx); ex.addTrace(field + " (" + type.getName() + ")"); throw ex; } }
void function (Object object, String fieldName, String jsonName, Class elementType) { Class type = object.getClass(); ObjectMap<String, FieldMetadata> fields = typeToFields.get(type); if (fields == null) fields = cacheFields(type); FieldMetadata metadata = fields.get(fieldName); if (metadata == null) throw new SerializationException(STR + fieldName + STR + type.getName() + ")"); Field field = metadata.field; if (elementType == null) elementType = metadata.elementType; try { if (debug) System.out.println(STR + field.getName() + STR + type.getName() + ")"); writer.name(jsonName); writeValue(field.get(object), field.getType(), elementType); } catch (ReflectionException ex) { throw new SerializationException(STR + field.getName() + STR + type.getName() + ")", ex); } catch (SerializationException ex) { ex.addTrace(field + STR + type.getName() + ")"); throw ex; } catch (Exception runtimeEx) { SerializationException ex = new SerializationException(runtimeEx); ex.addTrace(field + STR + type.getName() + ")"); throw ex; } }
/** Writes the specified field to the current JSON object. * @param elementType May be null if the type is unknown. */
Writes the specified field to the current JSON object
writeField
{ "repo_name": "genura/libgdx", "path": "gdx/src/com/badlogic/gdx/utils/Json.java", "license": "apache-2.0", "size": 39194 }
[ "com.badlogic.gdx.utils.reflect.Field", "com.badlogic.gdx.utils.reflect.ReflectionException" ]
import com.badlogic.gdx.utils.reflect.Field; import com.badlogic.gdx.utils.reflect.ReflectionException;
import com.badlogic.gdx.utils.reflect.*;
[ "com.badlogic.gdx" ]
com.badlogic.gdx;
2,232,216
public UnsafeSorterIterator getSortedIterator() { int offset = 0; long start = System.nanoTime(); if (sortComparator != null) { if (this.radixSortSupport != null) { offset = RadixSort.sortKeyPrefixArray( array, nullBoundaryPos, (pos - nullBoundaryPos) / 2L, 0, 7, radixSortSupport.sortDescending(), radixSortSupport.sortSigned()); } else { MemoryBlock unused = new MemoryBlock( array.getBaseObject(), array.getBaseOffset() + pos * 8L, (array.size() - pos) * 8L); LongArray buffer = new LongArray(unused); Sorter<RecordPointerAndKeyPrefix, LongArray> sorter = new Sorter<>(new UnsafeSortDataFormat(buffer)); sorter.sort(array, 0, pos / 2, sortComparator); } } totalSortTimeNanos += System.nanoTime() - start; if (nullBoundaryPos > 0) { assert radixSortSupport != null : "Nulls are only stored separately with radix sort"; LinkedList<UnsafeSorterIterator> queue = new LinkedList<>(); // The null order is either LAST or FIRST, regardless of sorting direction (ASC|DESC) if (radixSortSupport.nullsFirst()) { queue.add(new SortedIterator(nullBoundaryPos / 2, 0)); queue.add(new SortedIterator((pos - nullBoundaryPos) / 2, offset)); } else { queue.add(new SortedIterator((pos - nullBoundaryPos) / 2, offset)); queue.add(new SortedIterator(nullBoundaryPos / 2, 0)); } return new UnsafeExternalSorter.ChainedIterator(queue); } else { return new SortedIterator(pos / 2, offset); } }
UnsafeSorterIterator function() { int offset = 0; long start = System.nanoTime(); if (sortComparator != null) { if (this.radixSortSupport != null) { offset = RadixSort.sortKeyPrefixArray( array, nullBoundaryPos, (pos - nullBoundaryPos) / 2L, 0, 7, radixSortSupport.sortDescending(), radixSortSupport.sortSigned()); } else { MemoryBlock unused = new MemoryBlock( array.getBaseObject(), array.getBaseOffset() + pos * 8L, (array.size() - pos) * 8L); LongArray buffer = new LongArray(unused); Sorter<RecordPointerAndKeyPrefix, LongArray> sorter = new Sorter<>(new UnsafeSortDataFormat(buffer)); sorter.sort(array, 0, pos / 2, sortComparator); } } totalSortTimeNanos += System.nanoTime() - start; if (nullBoundaryPos > 0) { assert radixSortSupport != null : STR; LinkedList<UnsafeSorterIterator> queue = new LinkedList<>(); if (radixSortSupport.nullsFirst()) { queue.add(new SortedIterator(nullBoundaryPos / 2, 0)); queue.add(new SortedIterator((pos - nullBoundaryPos) / 2, offset)); } else { queue.add(new SortedIterator((pos - nullBoundaryPos) / 2, offset)); queue.add(new SortedIterator(nullBoundaryPos / 2, 0)); } return new UnsafeExternalSorter.ChainedIterator(queue); } else { return new SortedIterator(pos / 2, offset); } }
/** * Return an iterator over record pointers in sorted order. For efficiency, all calls to * {@code next()} will return the same mutable object. */
Return an iterator over record pointers in sorted order. For efficiency, all calls to next() will return the same mutable object
getSortedIterator
{ "repo_name": "spark0001/spark2.1.1", "path": "core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java", "license": "apache-2.0", "size": 13044 }
[ "java.util.LinkedList", "org.apache.spark.unsafe.array.LongArray", "org.apache.spark.unsafe.memory.MemoryBlock", "org.apache.spark.util.collection.Sorter" ]
import java.util.LinkedList; import org.apache.spark.unsafe.array.LongArray; import org.apache.spark.unsafe.memory.MemoryBlock; import org.apache.spark.util.collection.Sorter;
import java.util.*; import org.apache.spark.unsafe.array.*; import org.apache.spark.unsafe.memory.*; import org.apache.spark.util.collection.*;
[ "java.util", "org.apache.spark" ]
java.util; org.apache.spark;
2,569,420
ServiceBusNamespaceDescriptionResponse getNamespaceDescription(String namespaceName) throws IOException, ServiceException, ParserConfigurationException, SAXException;
ServiceBusNamespaceDescriptionResponse getNamespaceDescription(String namespaceName) throws IOException, ServiceException, ParserConfigurationException, SAXException;
/** * The namespace description is an XML AtomPub document that defines the * desired semantics for a service namespace. The namespace description * contains the following properties. (see * http://msdn.microsoft.com/en-us/library/windowsazure/jj873988.aspx for * more information) * * @param namespaceName Required. The namespace name. * @throws IOException Signals that an I/O exception of some sort has * occurred. This class is the general class of exceptions produced by * failed or interrupted I/O operations. * @throws ServiceException Thrown if an unexpected response is found. * @throws ParserConfigurationException Thrown if there was a serious * configuration error with the document parser. * @throws SAXException Thrown if there was an error parsing the XML * response. * @return A response to a request for a list of namespaces. */
The namespace description is an XML AtomPub document that defines the desired semantics for a service namespace. The namespace description contains the following properties. (see HREF for more information)
getNamespaceDescription
{ "repo_name": "southworkscom/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-servicebus/src/main/java/com/microsoft/windowsazure/management/servicebus/NamespaceOperations.java", "license": "apache-2.0", "size": 20585 }
[ "com.microsoft.windowsazure.exception.ServiceException", "com.microsoft.windowsazure.management.servicebus.models.ServiceBusNamespaceDescriptionResponse", "java.io.IOException", "javax.xml.parsers.ParserConfigurationException", "org.xml.sax.SAXException" ]
import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.management.servicebus.models.ServiceBusNamespaceDescriptionResponse; import java.io.IOException; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.SAXException;
import com.microsoft.windowsazure.exception.*; import com.microsoft.windowsazure.management.servicebus.models.*; import java.io.*; import javax.xml.parsers.*; import org.xml.sax.*;
[ "com.microsoft.windowsazure", "java.io", "javax.xml", "org.xml.sax" ]
com.microsoft.windowsazure; java.io; javax.xml; org.xml.sax;
1,111,189
public List<String> parse(Tweet tweet) { String text = tweet.getOrigText(); List<String> tok = EuroLangTwokenizer.tokenize(text); List<String> poss = fgen.getPostagger().tag(tok); String posstr = ""; for (int i = 0; i < poss.size(); i++) posstr += poss.get(i); List<String> matches = new ArrayList<String>(); for (int j = 0; j < stpattern.length; j++) { streetpospattern = Pattern.compile(stpattern[j]); Matcher stmatcher = streetpospattern.matcher(posstr); while (stmatcher.find()) { if (ParserUtils.isStreetSuffix(tok.get(stmatcher.end() - 1))) { String temp = ""; for (int i = stmatcher.start(); i < stmatcher.end(); i++) temp += tok.get(i) + " "; matches.add("st{" + temp.trim() + "}st"); } } } Matcher bdmatcher = buildingpospattern.matcher(posstr); while (bdmatcher.find()) { if (ParserUtils.isBuildingSuffix(tok.get(bdmatcher.end() - 1))) { String temp = ""; for (int i = bdmatcher.start(); i < bdmatcher.end(); i++) temp += tok.get(i) + " "; matches.add("bd{" + temp.trim() + "}bd"); } } return matches; }
List<String> function(Tweet tweet) { String text = tweet.getOrigText(); List<String> tok = EuroLangTwokenizer.tokenize(text); List<String> poss = fgen.getPostagger().tag(tok); String posstr = STRSTR STRst{STR}stSTRSTR STRbd{STR}bd"); } } return matches; }
/** * Find streets by street suffixes * * @param tweetMatches * @param tweet */
Find streets by street suffixes
parse
{ "repo_name": "weizh/geolocator-1.0", "path": "geo-locator/src/edu/cmu/geoparser/parser/english/EnglishRuleSTBDParser.java", "license": "apache-2.0", "size": 4506 }
[ "edu.cmu.geoparser.model.Tweet", "edu.cmu.geoparser.nlp.tokenizer.EuroLangTwokenizer", "java.util.List" ]
import edu.cmu.geoparser.model.Tweet; import edu.cmu.geoparser.nlp.tokenizer.EuroLangTwokenizer; import java.util.List;
import edu.cmu.geoparser.model.*; import edu.cmu.geoparser.nlp.tokenizer.*; import java.util.*;
[ "edu.cmu.geoparser", "java.util" ]
edu.cmu.geoparser; java.util;
1,441,584
boolean addAll( Collection<? extends Long> collection );
boolean addAll( Collection<? extends Long> collection );
/** * Adds all of the elements in <tt>collection</tt> to the set. * * @param collection a <code>Collection</code> value * @return true if the set was modified by the add all operation. */
Adds all of the elements in collection to the set
addAll
{ "repo_name": "GenomeView/genomeview", "path": "src/gnu/trove/set/TLongSet.java", "license": "gpl-3.0", "size": 10360 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
866,143
public EntryFromFileCreator getEntryCreator(File file) { if ((file == null) || !file.exists()) { return null; } for (EntryFromFileCreator creator : entryCreators) { if (creator.accept(file)) { return creator; } } return null; }
EntryFromFileCreator function(File file) { if ((file == null) !file.exists()) { return null; } for (EntryFromFileCreator creator : entryCreators) { if (creator.accept(file)) { return creator; } } return null; }
/** * Returns a EntryFromFileCreator object that is capable of creating a * BibEntry for the given File. * * @param file the pdf file * @return null if there is no EntryFromFileCreator for this File. */
Returns a EntryFromFileCreator object that is capable of creating a BibEntry for the given File
getEntryCreator
{ "repo_name": "motokito/jabref", "path": "src/main/java/net/sf/jabref/gui/importer/EntryFromFileCreatorManager.java", "license": "mit", "size": 8933 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
541,461
private void format2text(Book book) { //mTextScanIsbn; //at present only focus on below info: //ISBN, title and subtitle, author, publisher, price. StringBuffer scanResult = new StringBuffer(); //isbn scanResult.append(book.getISBN()); scanResult.append("\n"); //title scanResult.append(book.getTitle()); scanResult.append("\n"); //subtitle //Log.e(this, "getSubTitle = " + book.getSubTitle().isEmpty() ); if (book.getSubTitle() != null && !book.getSubTitle().isEmpty()) { //Log.e(this, "====here======"); scanResult.append(book.getSubTitle()); scanResult.append("\n"); } //author scanResult.append(book.getAuthor()); scanResult.append("\n"); //publisher scanResult.append(book.getPublisher()); scanResult.append("\n"); //publish date scanResult.append(book.getPrice()); Log.e(this, "RESULT: " + scanResult.toString() + "\n\n"); mTextScanIsbn.setText(scanResult.toString()); }
void function(Book book) { StringBuffer scanResult = new StringBuffer(); scanResult.append(book.getISBN()); scanResult.append("\n"); scanResult.append(book.getTitle()); scanResult.append("\n"); if (book.getSubTitle() != null && !book.getSubTitle().isEmpty()) { scanResult.append(book.getSubTitle()); scanResult.append("\n"); } scanResult.append(book.getAuthor()); scanResult.append("\n"); scanResult.append(book.getPublisher()); scanResult.append("\n"); scanResult.append(book.getPrice()); Log.e(this, STR + scanResult.toString() + "\n\n"); mTextScanIsbn.setText(scanResult.toString()); }
/** * only for showing base info to user * @param book */
only for showing base info to user
format2text
{ "repo_name": "tancolo/wosaosao", "path": "Wosaosao/app/src/main/java/com/ckt/shrimp/wosaosao/BooksPutIn.java", "license": "gpl-3.0", "size": 18348 }
[ "com.ckt.shrimp.utils.Book", "com.ckt.shrimp.utils.Log" ]
import com.ckt.shrimp.utils.Book; import com.ckt.shrimp.utils.Log;
import com.ckt.shrimp.utils.*;
[ "com.ckt.shrimp" ]
com.ckt.shrimp;
2,086,136
public synchronized void writeFormat(PrintWriter output) { super.writeFormat(output); if (_reuseDatasets) { output.println("<reuseDatasets/>"); } StringBuffer defaults = new StringBuffer(); if (!_connected) { defaults.append(" connected=\"no\""); } switch (_marks) { case 1: defaults.append(" marks=\"points\""); break; case 2: defaults.append(" marks=\"dots\""); break; case 3: defaults.append(" marks=\"various\""); break; case 4: defaults.append(" marks=\"pixels\""); break; case 15: defaults.append(" marks=\"crosses\""); break; } // Write the defaults for formats that can be controlled by dataset if (_impulses) { defaults.append(" stems=\"yes\""); } if (defaults.length() > 0) { output.println("<default" + defaults.toString() + "/>"); } if (_bars) { output.println("<barGraph width=\"" + barWidth + "\" offset=\"" + _barOffset + "\"/>"); } } /////////////////////////////////////////////////////////////////// //// protected methods ////
synchronized void function(PrintWriter output) { super.writeFormat(output); if (_reuseDatasets) { output.println(STR); } StringBuffer defaults = new StringBuffer(); if (!_connected) { defaults.append(STRno\STR marks=\STRSTR marks=\"dots\"STR marks=\STRSTR marks=\STRSTR marks=\STRSTR stems=\"yes\"STR<defaultSTR/>STR<barGraph width=\STR\STRSTR\"/>"); } }
/** Write plot format information to the specified output stream in * PlotML, an XML scheme. * @param output A buffered print writer. */
Write plot format information to the specified output stream in PlotML, an XML scheme
writeFormat
{ "repo_name": "Thomashuet/Biocham", "path": "gui/customComponents/Plot.java", "license": "gpl-2.0", "size": 94046 }
[ "java.io.PrintWriter" ]
import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
1,280,117
public static void generate(final NiFiProperties properties, final ExtensionManager extensionManager, final ExtensionMapping extensionMapping) { final File explodedNiFiDocsDir = properties.getComponentDocumentationWorkingDirectory(); logger.debug("Generating documentation for: " + extensionMapping.size() + " components in: " + explodedNiFiDocsDir); documentConfigurableComponent(extensionManager.getExtensions(Processor.class), explodedNiFiDocsDir, extensionManager); documentConfigurableComponent(extensionManager.getExtensions(ControllerService.class), explodedNiFiDocsDir, extensionManager); documentConfigurableComponent(extensionManager.getExtensions(ReportingTask.class), explodedNiFiDocsDir, extensionManager); }
static void function(final NiFiProperties properties, final ExtensionManager extensionManager, final ExtensionMapping extensionMapping) { final File explodedNiFiDocsDir = properties.getComponentDocumentationWorkingDirectory(); logger.debug(STR + extensionMapping.size() + STR + explodedNiFiDocsDir); documentConfigurableComponent(extensionManager.getExtensions(Processor.class), explodedNiFiDocsDir, extensionManager); documentConfigurableComponent(extensionManager.getExtensions(ControllerService.class), explodedNiFiDocsDir, extensionManager); documentConfigurableComponent(extensionManager.getExtensions(ReportingTask.class), explodedNiFiDocsDir, extensionManager); }
/** * Generates documentation into the work/docs dir specified by * NiFiProperties. * * @param properties to lookup nifi properties * @param extensionMapping extension mapping */
Generates documentation into the work/docs dir specified by NiFiProperties
generate
{ "repo_name": "MikeThomsen/nifi", "path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/DocGenerator.java", "license": "apache-2.0", "size": 8757 }
[ "java.io.File", "org.apache.nifi.controller.ControllerService", "org.apache.nifi.nar.ExtensionManager", "org.apache.nifi.nar.ExtensionMapping", "org.apache.nifi.processor.Processor", "org.apache.nifi.reporting.ReportingTask", "org.apache.nifi.util.NiFiProperties" ]
import java.io.File; import org.apache.nifi.controller.ControllerService; import org.apache.nifi.nar.ExtensionManager; import org.apache.nifi.nar.ExtensionMapping; import org.apache.nifi.processor.Processor; import org.apache.nifi.reporting.ReportingTask; import org.apache.nifi.util.NiFiProperties;
import java.io.*; import org.apache.nifi.controller.*; import org.apache.nifi.nar.*; import org.apache.nifi.processor.*; import org.apache.nifi.reporting.*; import org.apache.nifi.util.*;
[ "java.io", "org.apache.nifi" ]
java.io; org.apache.nifi;
1,521,801
public ContourToolTipGenerator getToolTipGenerator() { return this.toolTipGenerator; }
ContourToolTipGenerator function() { return this.toolTipGenerator; }
/** * Returns the tool tip generator. * * @return The tool tip generator (possibly null). */
Returns the tool tip generator
getToolTipGenerator
{ "repo_name": "apetresc/JFreeChart", "path": "src/main/java/org/jfree/chart/plot/ContourPlot.java", "license": "lgpl-2.1", "size": 61516 }
[ "org.jfree.chart.labels.ContourToolTipGenerator" ]
import org.jfree.chart.labels.ContourToolTipGenerator;
import org.jfree.chart.labels.*;
[ "org.jfree.chart" ]
org.jfree.chart;
402,016
public void getParts(Collection<? super String> outParts) { getPartsFromCanonicalForm(canonicalForm, isMultiPart, outParts); }
void function(Collection<? super String> outParts) { getPartsFromCanonicalForm(canonicalForm, isMultiPart, outParts); }
/** * Appends dataverse name parts into a given output collection */
Appends dataverse name parts into a given output collection
getParts
{ "repo_name": "apache/incubator-asterixdb", "path": "asterixdb/asterix-common/src/main/java/org/apache/asterix/common/metadata/DataverseName.java", "license": "apache-2.0", "size": 14859 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,450,278
public ServiceFuture<Void> post202Retry200Async(final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(), serviceCallback); }
ServiceFuture<Void> function(final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(), serviceCallback); }
/** * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. * * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success
post202Retry200Async
{ "repo_name": "lmazuel/autorest", "path": "src/generator/AutoRest.Java.Azure.Tests/src/main/java/fixtures/lro/implementation/LRORetrysImpl.java", "license": "mit", "size": 88420 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,222,914
private static void wrapSetterMethod(ClassNode classNode, boolean bindable, PropertyNode propertyNode) { String getterName = propertyNode.getGetterNameOrDefault(); String propertyName = propertyNode.getName(); MethodNode setter = classNode.getSetterMethod(propertyNode.getSetterNameOrDefault()); if (setter != null) { // Get the existing code block Statement code = setter.getCode(); Expression oldValue = localVarX("$oldValue"); Expression newValue = localVarX("$newValue"); Expression proposedValue = varX(setter.getParameters()[0].getName()); BlockStatement block = new BlockStatement(); // create a local variable to hold the old value from the getter block.addStatement(declS(oldValue, callThisX(getterName))); // add the fireVetoableChange method call block.addStatement(stmt(callThisX("fireVetoableChange", args( constX(propertyName), oldValue, proposedValue)))); // call the existing block, which will presumably set the value properly block.addStatement(code); if (bindable) { // get the new value to emit in the event block.addStatement(declS(newValue, callThisX(getterName))); // add the firePropertyChange method call block.addStatement(stmt(callThisX("firePropertyChange", args(constX(propertyName), oldValue, newValue)))); } // replace the existing code block with our new one setter.setCode(block); } }
static void function(ClassNode classNode, boolean bindable, PropertyNode propertyNode) { String getterName = propertyNode.getGetterNameOrDefault(); String propertyName = propertyNode.getName(); MethodNode setter = classNode.getSetterMethod(propertyNode.getSetterNameOrDefault()); if (setter != null) { Statement code = setter.getCode(); Expression oldValue = localVarX(STR); Expression newValue = localVarX(STR); Expression proposedValue = varX(setter.getParameters()[0].getName()); BlockStatement block = new BlockStatement(); block.addStatement(declS(oldValue, callThisX(getterName))); block.addStatement(stmt(callThisX(STR, args( constX(propertyName), oldValue, proposedValue)))); block.addStatement(code); if (bindable) { block.addStatement(declS(newValue, callThisX(getterName))); block.addStatement(stmt(callThisX(STR, args(constX(propertyName), oldValue, newValue)))); } setter.setCode(block); } }
/** * Wrap an existing setter. */
Wrap an existing setter
wrapSetterMethod
{ "repo_name": "apache/groovy", "path": "src/main/java/groovy/beans/VetoableASTTransformation.java", "license": "apache-2.0", "size": 20556 }
[ "org.codehaus.groovy.ast.ClassNode", "org.codehaus.groovy.ast.MethodNode", "org.codehaus.groovy.ast.PropertyNode", "org.codehaus.groovy.ast.expr.Expression", "org.codehaus.groovy.ast.stmt.BlockStatement", "org.codehaus.groovy.ast.stmt.Statement", "org.codehaus.groovy.ast.tools.GeneralUtils" ]
import org.codehaus.groovy.ast.ClassNode; import org.codehaus.groovy.ast.MethodNode; import org.codehaus.groovy.ast.PropertyNode; import org.codehaus.groovy.ast.expr.Expression; import org.codehaus.groovy.ast.stmt.BlockStatement; import org.codehaus.groovy.ast.stmt.Statement; import org.codehaus.groovy.ast.tools.GeneralUtils;
import org.codehaus.groovy.ast.*; import org.codehaus.groovy.ast.expr.*; import org.codehaus.groovy.ast.stmt.*; import org.codehaus.groovy.ast.tools.*;
[ "org.codehaus.groovy" ]
org.codehaus.groovy;
548,503
// [TARGET write(Iterable, WriteOption...)] // [VARIABLE "my_log_name"] public void write(String logName) { // [START write] List<LogEntry> entries = new ArrayList<>(); entries.add(LogEntry.of(StringPayload.of("Entry payload"))); Map<String, Object> jsonMap = new HashMap<>(); jsonMap.put("key", "value"); entries.add(LogEntry.of(JsonPayload.of(jsonMap))); logging.write( entries, WriteOption.logName(logName), WriteOption.resource(MonitoredResource.newBuilder("global").build())); // [END write] }
void function(String logName) { List<LogEntry> entries = new ArrayList<>(); entries.add(LogEntry.of(StringPayload.of(STR))); Map<String, Object> jsonMap = new HashMap<>(); jsonMap.put("key", "value"); entries.add(LogEntry.of(JsonPayload.of(jsonMap))); logging.write( entries, WriteOption.logName(logName), WriteOption.resource(MonitoredResource.newBuilder(STR).build())); }
/** * Example of writing log entries and providing a default log name and monitored * resource. * Logging writes are asynchronous by default. * {@link Logging#setWriteSynchronicity(Synchronicity)} can be used to update the synchronicity. */
Example of writing log entries and providing a default log name and monitored resource. Logging writes are asynchronous by default. <code>Logging#setWriteSynchronicity(Synchronicity)</code> can be used to update the synchronicity
write
{ "repo_name": "mbrukman/gcloud-java", "path": "google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/LoggingSnippets.java", "license": "apache-2.0", "size": 15856 }
[ "com.google.cloud.MonitoredResource", "com.google.cloud.logging.LogEntry", "com.google.cloud.logging.Logging", "com.google.cloud.logging.Payload", "java.util.ArrayList", "java.util.HashMap", "java.util.List", "java.util.Map" ]
import com.google.cloud.MonitoredResource; import com.google.cloud.logging.LogEntry; import com.google.cloud.logging.Logging; import com.google.cloud.logging.Payload; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;
import com.google.cloud.*; import com.google.cloud.logging.*; import java.util.*;
[ "com.google.cloud", "java.util" ]
com.google.cloud; java.util;
2,447,285
public void setSpellCastState(SpellCastState state) { this.state = state; stateChanged = true; }
void function(SpellCastState state) { this.state = state; stateChanged = true; }
/** * Changes the spell cast state. * @param state the new spell cast state */
Changes the spell cast state
setSpellCastState
{ "repo_name": "TheComputerGeek2/MagicSpells", "path": "core/src/main/java/com/nisovin/magicspells/events/SpellCastEvent.java", "license": "gpl-3.0", "size": 4194 }
[ "com.nisovin.magicspells.Spell" ]
import com.nisovin.magicspells.Spell;
import com.nisovin.magicspells.*;
[ "com.nisovin.magicspells" ]
com.nisovin.magicspells;
969,653
public Object readObject() throws IOException, ClassNotFoundException;
Object function() throws IOException, ClassNotFoundException;
/** * Reads a <code>Serializable</code> object from the input. * * @return the object read. * * @exception java.io.IOException an error occurred * @exception ClassNotFoundException is thrown when the class of a * serialized object is not found. */
Reads a <code>Serializable</code> object from the input
readObject
{ "repo_name": "jmaassen/AetherIO", "path": "src/nl/esciencecenter/aether/io/SerializationInput.java", "license": "apache-2.0", "size": 3948 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,774,177
// ---------------------------------------------------------------------- // BinaryDataInput Multi-value Methods // ---------------------------------------------------------------------- public void readBooleans(boolean[] values, int nValues) throws EOFException, IOException { byte bytes[] = new byte[nValues]; readFully(bytes, 0, nValues); for (int i = 0; i < nValues; i++) { values[i] = (bytes[i] != 0); } }
void function(boolean[] values, int nValues) throws EOFException, IOException { byte bytes[] = new byte[nValues]; readFully(bytes, 0, nValues); for (int i = 0; i < nValues; i++) { values[i] = (bytes[i] != 0); } }
/** * Reads nValues input bytes, each one representing a boolean value, and set * each value in a boolean array to true if the corresponding byte is * nonzero, false if that byte is zero. This method is suitable for reading * the byte written by the writeBooleans method of interface * BinaryDataOutput. * <P> * * @param values * the array of values to set * @param nValues * the number of values to read * @throws EOFException * if this stream reaches the end before reading all the bytes * @throws IOException * if an I/O error occurs */
Reads nValues input bytes, each one representing a boolean value, and set each value in a boolean array to true if the corresponding byte is nonzero, false if that byte is zero. This method is suitable for reading the byte written by the writeBooleans method of interface BinaryDataOutput.
readBooleans
{ "repo_name": "skoulouzis/vlet", "path": "source/core/nl.uva.vlet.vfs.irods/irodssrc/edu/sdsc/grid/io/GeneralRandomAccessFile.java", "license": "apache-2.0", "size": 74263 }
[ "java.io.EOFException", "java.io.IOException" ]
import java.io.EOFException; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
690,308
@Test public void testReportAllocatedSlot() throws Exception { final ResourceID taskManagerId = ResourceID.generate(); final ResourceActions resourceActions = new TestingResourceActionsBuilder().build(); final TestingTaskExecutorGateway taskExecutorGateway = new TestingTaskExecutorGatewayBuilder().createTestingTaskExecutorGateway(); final TaskExecutorConnection taskExecutorConnection = new TaskExecutorConnection(taskManagerId, taskExecutorGateway); try (final SlotManagerImpl slotManager = createSlotManager(ResourceManagerId.generate(), resourceActions)) { // initially report a single slot as free final SlotID slotId = new SlotID(taskManagerId, 0); final SlotStatus initialSlotStatus = new SlotStatus(slotId, ResourceProfile.ANY); final SlotReport initialSlotReport = new SlotReport(initialSlotStatus); slotManager.registerTaskManager( taskExecutorConnection, initialSlotReport, ResourceProfile.ANY, ResourceProfile.ANY); assertThat(slotManager.getNumberRegisteredSlots(), is(equalTo(1))); // Now report this slot as allocated final SlotStatus slotStatus = new SlotStatus(slotId, ResourceProfile.ANY, new JobID(), new AllocationID()); final SlotReport slotReport = new SlotReport(slotStatus); slotManager.reportSlotStatus(taskExecutorConnection.getInstanceID(), slotReport); // this slot request should not be fulfilled final AllocationID allocationId = new AllocationID(); final SlotRequest slotRequest = new SlotRequest(new JobID(), allocationId, ResourceProfile.UNKNOWN, "foobar"); // This triggered an IllegalStateException before slotManager.registerSlotRequest(slotRequest); assertThat(slotManager.getSlotRequest(allocationId).isAssigned(), is(false)); } }
void function() throws Exception { final ResourceID taskManagerId = ResourceID.generate(); final ResourceActions resourceActions = new TestingResourceActionsBuilder().build(); final TestingTaskExecutorGateway taskExecutorGateway = new TestingTaskExecutorGatewayBuilder().createTestingTaskExecutorGateway(); final TaskExecutorConnection taskExecutorConnection = new TaskExecutorConnection(taskManagerId, taskExecutorGateway); try (final SlotManagerImpl slotManager = createSlotManager(ResourceManagerId.generate(), resourceActions)) { final SlotID slotId = new SlotID(taskManagerId, 0); final SlotStatus initialSlotStatus = new SlotStatus(slotId, ResourceProfile.ANY); final SlotReport initialSlotReport = new SlotReport(initialSlotStatus); slotManager.registerTaskManager( taskExecutorConnection, initialSlotReport, ResourceProfile.ANY, ResourceProfile.ANY); assertThat(slotManager.getNumberRegisteredSlots(), is(equalTo(1))); final SlotStatus slotStatus = new SlotStatus(slotId, ResourceProfile.ANY, new JobID(), new AllocationID()); final SlotReport slotReport = new SlotReport(slotStatus); slotManager.reportSlotStatus(taskExecutorConnection.getInstanceID(), slotReport); final AllocationID allocationId = new AllocationID(); final SlotRequest slotRequest = new SlotRequest(new JobID(), allocationId, ResourceProfile.UNKNOWN, STR); slotManager.registerSlotRequest(slotRequest); assertThat(slotManager.getSlotRequest(allocationId).isAssigned(), is(false)); } }
/** * Tests that free slots which are reported as allocated won't be considered for fulfilling * other pending slot requests. * * <p>See: FLINK-8505 */
Tests that free slots which are reported as allocated won't be considered for fulfilling other pending slot requests. See: FLINK-8505
testReportAllocatedSlot
{ "repo_name": "tillrohrmann/flink", "path": "flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManagerImplTest.java", "license": "apache-2.0", "size": 96159 }
[ "org.apache.flink.api.common.JobID", "org.apache.flink.runtime.clusterframework.types.AllocationID", "org.apache.flink.runtime.clusterframework.types.ResourceID", "org.apache.flink.runtime.clusterframework.types.ResourceProfile", "org.apache.flink.runtime.clusterframework.types.SlotID", "org.apache.flink.runtime.resourcemanager.ResourceManagerId", "org.apache.flink.runtime.resourcemanager.SlotRequest", "org.apache.flink.runtime.resourcemanager.registration.TaskExecutorConnection", "org.apache.flink.runtime.taskexecutor.SlotReport", "org.apache.flink.runtime.taskexecutor.SlotStatus", "org.apache.flink.runtime.taskexecutor.TestingTaskExecutorGateway", "org.apache.flink.runtime.taskexecutor.TestingTaskExecutorGatewayBuilder", "org.hamcrest.Matchers", "org.junit.Assert" ]
import org.apache.flink.api.common.JobID; import org.apache.flink.runtime.clusterframework.types.AllocationID; import org.apache.flink.runtime.clusterframework.types.ResourceID; import org.apache.flink.runtime.clusterframework.types.ResourceProfile; import org.apache.flink.runtime.clusterframework.types.SlotID; import org.apache.flink.runtime.resourcemanager.ResourceManagerId; import org.apache.flink.runtime.resourcemanager.SlotRequest; import org.apache.flink.runtime.resourcemanager.registration.TaskExecutorConnection; import org.apache.flink.runtime.taskexecutor.SlotReport; import org.apache.flink.runtime.taskexecutor.SlotStatus; import org.apache.flink.runtime.taskexecutor.TestingTaskExecutorGateway; import org.apache.flink.runtime.taskexecutor.TestingTaskExecutorGatewayBuilder; import org.hamcrest.Matchers; import org.junit.Assert;
import org.apache.flink.api.common.*; import org.apache.flink.runtime.clusterframework.types.*; import org.apache.flink.runtime.resourcemanager.*; import org.apache.flink.runtime.resourcemanager.registration.*; import org.apache.flink.runtime.taskexecutor.*; import org.hamcrest.*; import org.junit.*;
[ "org.apache.flink", "org.hamcrest", "org.junit" ]
org.apache.flink; org.hamcrest; org.junit;
2,532,193
Tenant getTenant ();
Tenant getTenant ();
/** * Get the current tenant * @return null if there is not a current tenant, otherwise return a tenant. */
Get the current tenant
getTenant
{ "repo_name": "lakshmi-nair/mozu-java", "path": "mozu-javaasync-core/src/main/java/com/mozu/api/ApiContext.java", "license": "mit", "size": 3108 }
[ "com.mozu.api.contracts.tenant.Tenant" ]
import com.mozu.api.contracts.tenant.Tenant;
import com.mozu.api.contracts.tenant.*;
[ "com.mozu.api" ]
com.mozu.api;
2,353,264
public static TerminalOp<Integer, Boolean> makeInt(IntPredicate predicate, MatchKind matchKind) { Objects.requireNonNull(predicate); Objects.requireNonNull(matchKind); class MatchSink extends BooleanTerminalSink<Integer> implements Sink.OfInt { MatchSink() { super(matchKind); }
static TerminalOp<Integer, Boolean> function(IntPredicate predicate, MatchKind matchKind) { Objects.requireNonNull(predicate); Objects.requireNonNull(matchKind); class MatchSink extends BooleanTerminalSink<Integer> implements Sink.OfInt { MatchSink() { super(matchKind); }
/** * Constructs a quantified predicate matcher for an {@code IntStream}. * * @param predicate the {@code Predicate} to apply to stream elements * @param matchKind the kind of quantified match (all, any, none) * @return a {@code TerminalOp} implementing the desired quantified match * criteria */
Constructs a quantified predicate matcher for an IntStream
makeInt
{ "repo_name": "shun634501730/java_source_cn", "path": "src_en/java/util/stream/MatchOps.java", "license": "apache-2.0", "size": 10360 }
[ "java.util.Objects", "java.util.function.IntPredicate" ]
import java.util.Objects; import java.util.function.IntPredicate;
import java.util.*; import java.util.function.*;
[ "java.util" ]
java.util;
1,421,442
public void removeListener(INotifyChangedListener notifyChangedListener) { changeNotifier.removeListener(notifyChangedListener); }
void function(INotifyChangedListener notifyChangedListener) { changeNotifier.removeListener(notifyChangedListener); }
/** * This removes a listener. * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */
This removes a listener.
removeListener
{ "repo_name": "edgarmueller/emfstore-rest", "path": "bundles/org.eclipse.emf.emfstore.server.model.edit/src/org/eclipse/emf/emfstore/internal/server/model/versioning/operations/semantic/provider/SemanticItemProviderAdapterFactory.java", "license": "epl-1.0", "size": 5816 }
[ "org.eclipse.emf.edit.provider.INotifyChangedListener" ]
import org.eclipse.emf.edit.provider.INotifyChangedListener;
import org.eclipse.emf.edit.provider.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,421,951
public void tryRollback(final Graph graph) { if (graph.features().graph().supportsTransactions()) graph.tx().rollback(); }
void function(final Graph graph) { if (graph.features().graph().supportsTransactions()) graph.tx().rollback(); }
/** * Utility method that rollsback if the graph supports transactions. */
Utility method that rollsback if the graph supports transactions
tryRollback
{ "repo_name": "RussellSpitzer/incubator-tinkerpop", "path": "gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/AbstractGremlinTest.java", "license": "apache-2.0", "size": 13190 }
[ "org.apache.tinkerpop.gremlin.structure.Graph" ]
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.*;
[ "org.apache.tinkerpop" ]
org.apache.tinkerpop;
2,034,096
private boolean isPrivateOrFinalOrAbstract(DetailAST ast) { // method is ok if it is private or abstract or final final DetailAST modifiers = ast.findFirstToken(TokenTypes.MODIFIERS); return modifiers.branchContains(TokenTypes.LITERAL_PRIVATE) || modifiers.branchContains(TokenTypes.ABSTRACT) || modifiers.branchContains(TokenTypes.FINAL) || modifiers.branchContains(TokenTypes.LITERAL_STATIC); }
boolean function(DetailAST ast) { final DetailAST modifiers = ast.findFirstToken(TokenTypes.MODIFIERS); return modifiers.branchContains(TokenTypes.LITERAL_PRIVATE) modifiers.branchContains(TokenTypes.ABSTRACT) modifiers.branchContains(TokenTypes.FINAL) modifiers.branchContains(TokenTypes.LITERAL_STATIC); }
/** * check for modifiers * @param ast modifier ast * @return tru in modifier is in checked ones */
check for modifiers
isPrivateOrFinalOrAbstract
{ "repo_name": "naver/checkstyle", "path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheck.java", "license": "lgpl-2.1", "size": 6335 }
[ "com.puppycrawl.tools.checkstyle.api.DetailAST", "com.puppycrawl.tools.checkstyle.api.TokenTypes" ]
import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes;
import com.puppycrawl.tools.checkstyle.api.*;
[ "com.puppycrawl.tools" ]
com.puppycrawl.tools;
2,804,298
public ImportProcessPrx createImport(final ImportContainer container) throws ServerError, IOException { checkManagedRepo(); String[] usedFiles = container.getUsedFiles(); File target = container.getFile(); if (log.isDebugEnabled()) { log.debug("Main file: " + target.getAbsolutePath()); log.debug("Used files before:"); for (String f : usedFiles) { log.debug(f); } } notifyObservers(new ImportEvent.FILESET_UPLOAD_PREPARATION( null, 0, usedFiles.length, null, null, null)); // TODO: allow looser sanitization according to server configuration final FilePathRestrictions portableRequiredRules = FilePathRestrictionInstance.getFilePathRestrictions(FilePathRestrictionInstance.WINDOWS_REQUIRED, FilePathRestrictionInstance.UNIX_REQUIRED); final ClientFilePathTransformer sanitizer = new ClientFilePathTransformer(new MakePathComponentSafe(portableRequiredRules)); final ImportSettings settings = new ImportSettings(); final Fileset fs = new FilesetI(); container.fillData(settings, fs, sanitizer, transfer); String caStr = container.getChecksumAlgorithm(); if (caStr != null) { settings.checksumAlgorithm = ChecksumAlgorithmMapper.getChecksumAlgorithm(caStr); } else { // check if the container object has ChecksumAlgorithm // present and pass it into the settings object settings.checksumAlgorithm = repo.suggestChecksumAlgorithm(availableChecksumAlgorithms); if (settings.checksumAlgorithm == null) { throw new RuntimeException("no supported checksum algorithm negotiated with server"); } } return repo.importFileset(fs, settings); }
ImportProcessPrx function(final ImportContainer container) throws ServerError, IOException { checkManagedRepo(); String[] usedFiles = container.getUsedFiles(); File target = container.getFile(); if (log.isDebugEnabled()) { log.debug(STR + target.getAbsolutePath()); log.debug(STR); for (String f : usedFiles) { log.debug(f); } } notifyObservers(new ImportEvent.FILESET_UPLOAD_PREPARATION( null, 0, usedFiles.length, null, null, null)); final FilePathRestrictions portableRequiredRules = FilePathRestrictionInstance.getFilePathRestrictions(FilePathRestrictionInstance.WINDOWS_REQUIRED, FilePathRestrictionInstance.UNIX_REQUIRED); final ClientFilePathTransformer sanitizer = new ClientFilePathTransformer(new MakePathComponentSafe(portableRequiredRules)); final ImportSettings settings = new ImportSettings(); final Fileset fs = new FilesetI(); container.fillData(settings, fs, sanitizer, transfer); String caStr = container.getChecksumAlgorithm(); if (caStr != null) { settings.checksumAlgorithm = ChecksumAlgorithmMapper.getChecksumAlgorithm(caStr); } else { settings.checksumAlgorithm = repo.suggestChecksumAlgorithm(availableChecksumAlgorithms); if (settings.checksumAlgorithm == null) { throw new RuntimeException(STR); } } return repo.importFileset(fs, settings); }
/** * Provide initial configuration to the server in order to create the * {@link ImportProcessPrx} which will manage state server-side. * @throws IOException if the used files' absolute path could not be found */
Provide initial configuration to the server in order to create the <code>ImportProcessPrx</code> which will manage state server-side
createImport
{ "repo_name": "emilroz/openmicroscopy", "path": "components/blitz/src/ome/formats/importer/ImportLibrary.java", "license": "gpl-2.0", "size": 28246 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,228,281
public AuthToken refreshToken() throws NoNetworkConnection { AuthToken authToken = readAuthToken(); if(!isInitialized){ throw new IllegalStateException("AuthHelper is not initialized, " + "please call AuthHelper.initialize()"); } if(TextUtils.isEmpty(mClientId)){ throw new IllegalStateException("Client id is missing"); } if(TextUtils.isEmpty(mClientSecret)){ throw new IllegalStateException("Client secret is missing"); } try { JsonObject tokenResult = Ion.with(mCtx, mToolsPrefs.getApiUrl() + "api/oauth2/token") .setTimeout(35000) .setBodyParameter("client_id", mClientId) .setBodyParameter("client_secret", mClientSecret) .setBodyParameter("grant_type", "refresh_token") .setBodyParameter("refresh_token", authToken.refreshToken) .asJsonObject() .get(); String accessToken = null; String refreshToken = authToken.refreshToken; int expiresIn = 0; if (tokenResult.has("error")) { // QTools.getInstance().postEvent(new NoAuthEvent()); mPrefs.edit().clear().apply(); mToken = null; return null; } if (tokenResult.has("access_token")) { accessToken = tokenResult.get("access_token").getAsString(); expiresIn = tokenResult.get("expires_in").getAsInt(); } if (tokenResult.has("refresh_token")) { refreshToken = tokenResult.get("refresh_token").getAsString(); } AuthToken at = new AuthToken(accessToken, refreshToken, System.currentTimeMillis() / 1000 + expiresIn); saveAuthToken(at); return authToken; } catch (ExecutionException ex) { if (ex.getCause() instanceof UnknownHostException || ex.getCause() instanceof TimeoutException){ throw new NoNetworkConnection(); } else { onLogCrash(ex); } } catch (Exception e) { onLogCrash(e); } return null; }
AuthToken function() throws NoNetworkConnection { AuthToken authToken = readAuthToken(); if(!isInitialized){ throw new IllegalStateException(STR + STR); } if(TextUtils.isEmpty(mClientId)){ throw new IllegalStateException(STR); } if(TextUtils.isEmpty(mClientSecret)){ throw new IllegalStateException(STR); } try { JsonObject tokenResult = Ion.with(mCtx, mToolsPrefs.getApiUrl() + STR) .setTimeout(35000) .setBodyParameter(STR, mClientId) .setBodyParameter(STR, mClientSecret) .setBodyParameter(STR, STR) .setBodyParameter(STR, authToken.refreshToken) .asJsonObject() .get(); String accessToken = null; String refreshToken = authToken.refreshToken; int expiresIn = 0; if (tokenResult.has("error")) { mPrefs.edit().clear().apply(); mToken = null; return null; } if (tokenResult.has(STR)) { accessToken = tokenResult.get(STR).getAsString(); expiresIn = tokenResult.get(STR).getAsInt(); } if (tokenResult.has(STR)) { refreshToken = tokenResult.get(STR).getAsString(); } AuthToken at = new AuthToken(accessToken, refreshToken, System.currentTimeMillis() / 1000 + expiresIn); saveAuthToken(at); return authToken; } catch (ExecutionException ex) { if (ex.getCause() instanceof UnknownHostException ex.getCause() instanceof TimeoutException){ throw new NoNetworkConnection(); } else { onLogCrash(ex); } } catch (Exception e) { onLogCrash(e); } return null; }
/** * Makes request to QuantiModo webservice * @return new AuthToken object * @throws NoNetworkConnection thrown when refresh failed because of connectivity problems * @throws IllegalStateException thrown when the AuthHelper is not initialized or * when client id or secret are missing */
Makes request to QuantiModo webservice
refreshToken
{ "repo_name": "QuantiModo/QuantiModo-SDK-Android", "path": "sdk/src/main/java/com/quantimodo/android/sdk/login/QuantimodoSDKHelper.java", "license": "gpl-2.0", "size": 9012 }
[ "android.text.TextUtils", "com.google.gson.JsonObject", "com.koushikdutta.ion.Ion", "java.net.UnknownHostException", "java.util.concurrent.ExecutionException", "java.util.concurrent.TimeoutException" ]
import android.text.TextUtils; import com.google.gson.JsonObject; import com.koushikdutta.ion.Ion; import java.net.UnknownHostException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException;
import android.text.*; import com.google.gson.*; import com.koushikdutta.ion.*; import java.net.*; import java.util.concurrent.*;
[ "android.text", "com.google.gson", "com.koushikdutta.ion", "java.net", "java.util" ]
android.text; com.google.gson; com.koushikdutta.ion; java.net; java.util;
1,535,645
@Test public void testIsNameValidRenameTestSuiteWithNotTestInTheName() throws Exception { TestProject testProject = new TestProject(); TestSuite testSuite = new TestSuite(); testSuite.setName("MySuite"); testProject.addChild(testSuite); TestCase testCase = new TestCase(); testCase.setName("HelloWorld"); TestCase testCase2 = new TestCase(); testCase2.setName("HelloBigWorld"); testSuite.addChild(testCase); testSuite.addChild(testCase2); AbstractTestStructureWizardPage page = ContextInjectionFactory.make(RenameTestSuiteWizardPage.class, getContextMock()); page.setSelectedTestStructure(testSuite); assertFalse(page.isNameValid("TestFortestting")); assertTrue(page.isNameValid("FooBarSo")); }
void function() throws Exception { TestProject testProject = new TestProject(); TestSuite testSuite = new TestSuite(); testSuite.setName(STR); testProject.addChild(testSuite); TestCase testCase = new TestCase(); testCase.setName(STR); TestCase testCase2 = new TestCase(); testCase2.setName(STR); testSuite.addChild(testCase); testSuite.addChild(testCase2); AbstractTestStructureWizardPage page = ContextInjectionFactory.make(RenameTestSuiteWizardPage.class, getContextMock()); page.setSelectedTestStructure(testSuite); assertFalse(page.isNameValid(STR)); assertTrue(page.isNameValid(STR)); }
/** * Test the IsNameValid Method in the renaming state. For testsuites there * should not the word 'Test' in the name. * * @throws Exception * for Test */
Test the IsNameValid Method in the renaming state. For testsuites there should not the word 'Test' in the name
testIsNameValidRenameTestSuiteWithNotTestInTheName
{ "repo_name": "franzbecker/test-editor", "path": "ui/org.testeditor.ui.test/src/org/testeditor/ui/wizardpages/RenameTestStructureWizardTest.java", "license": "epl-1.0", "size": 7307 }
[ "org.eclipse.e4.core.contexts.ContextInjectionFactory", "org.junit.Assert", "org.testeditor.core.model.teststructure.TestCase", "org.testeditor.core.model.teststructure.TestProject", "org.testeditor.core.model.teststructure.TestSuite" ]
import org.eclipse.e4.core.contexts.ContextInjectionFactory; import org.junit.Assert; import org.testeditor.core.model.teststructure.TestCase; import org.testeditor.core.model.teststructure.TestProject; import org.testeditor.core.model.teststructure.TestSuite;
import org.eclipse.e4.core.contexts.*; import org.junit.*; import org.testeditor.core.model.teststructure.*;
[ "org.eclipse.e4", "org.junit", "org.testeditor.core" ]
org.eclipse.e4; org.junit; org.testeditor.core;
2,543,103
public boolean isPeripheralModeSupported() { if (getState() != STATE_ON) return false; try { mServiceLock.readLock().lock(); if (mService != null) return mService.isPeripheralModeSupported(); } catch (RemoteException e) { Log.e(TAG, "failed to get peripheral mode capability: ", e); } finally { mServiceLock.readLock().unlock(); } return false; }
boolean function() { if (getState() != STATE_ON) return false; try { mServiceLock.readLock().lock(); if (mService != null) return mService.isPeripheralModeSupported(); } catch (RemoteException e) { Log.e(TAG, STR, e); } finally { mServiceLock.readLock().unlock(); } return false; }
/** * Returns whether peripheral mode is supported. * * @hide */
Returns whether peripheral mode is supported
isPeripheralModeSupported
{ "repo_name": "xorware/android_frameworks_base", "path": "core/java/android/bluetooth/BluetoothAdapter.java", "license": "apache-2.0", "size": 97550 }
[ "android.os.RemoteException", "android.util.Log" ]
import android.os.RemoteException; import android.util.Log;
import android.os.*; import android.util.*;
[ "android.os", "android.util" ]
android.os; android.util;
332,849
public static <K, V> Map<K, V> compose(Map<K, V> map, Callback callback) { return new CallbackMap<K, V>(map, callback); }
static <K, V> Map<K, V> function(Map<K, V> map, Callback callback) { return new CallbackMap<K, V>(map, callback); }
/** * Returns the composition of the given map and callback. * <p> * Note: Any changes to the original map will cause the returned * map to change and vice versa. But direct changes on the source * will not be propagated with the callback. * </p> * * @param <K> the generic key type * @param <V> the generic value type * @param map the underlying map * @param callback the custom callback * @return a map which propagates strucutural changes using the specified callback */
Returns the composition of the given map and callback. Note: Any changes to the original map will cause the returned map to change and vice versa. But direct changes on the source will not be propagated with the callback.
compose
{ "repo_name": "cosmocode/cosmocode-commons", "path": "src/main/java/de/cosmocode/collections/callback/Callbacks.java", "license": "apache-2.0", "size": 5183 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,860,296
public UByte getStaffId() { return (UByte) getValue(2); }
UByte function() { return (UByte) getValue(2); }
/** * Getter for <code>sakila.payment.staff_id</code>. */
Getter for <code>sakila.payment.staff_id</code>
getStaffId
{ "repo_name": "bjansen/ceylon-jooq-example", "path": "gen-source/gen/example/jooq/tables/records/PaymentRecord.java", "license": "mit", "size": 6958 }
[ "org.jooq.types.UByte" ]
import org.jooq.types.UByte;
import org.jooq.types.*;
[ "org.jooq.types" ]
org.jooq.types;
2,042,127
EReference getScatterSet_Datums();
EReference getScatterSet_Datums();
/** * Returns the meta object for the containment reference list '{@link info.limpet.stackedcharts.model.ScatterSet#getDatums <em>Datums</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference list '<em>Datums</em>'. * @see info.limpet.stackedcharts.model.ScatterSet#getDatums() * @see #getScatterSet() * @generated */
Returns the meta object for the containment reference list '<code>info.limpet.stackedcharts.model.ScatterSet#getDatums Datums</code>'.
getScatterSet_Datums
{ "repo_name": "pecko/limpet", "path": "info.limpet.stackedcharts.model/src/info/limpet/stackedcharts/model/StackedchartsPackage.java", "license": "epl-1.0", "size": 92511 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,004,346
public VM reset() { r0.set(0); r1.set(0); r2.set(0); r3.set(0); rs.set(0); rf.set(0); rb.set(0); rp.set(0); exit = false; if (memory != null) { rs.set(memory.getMemorySize() + memory.getStackSize() - 4); rb.set(memory.getMemorySize() - 4); } log.debug("VM Reset {}", debugAsm()); eventBus.post(new ResetEvent(this)); return this; }
VM function() { r0.set(0); r1.set(0); r2.set(0); r3.set(0); rs.set(0); rf.set(0); rb.set(0); rp.set(0); exit = false; if (memory != null) { rs.set(memory.getMemorySize() + memory.getStackSize() - 4); rb.set(memory.getMemorySize() - 4); } log.debug(STR, debugAsm()); eventBus.post(new ResetEvent(this)); return this; }
/** * Reset virtual machine state, should be this before every rerun */
Reset virtual machine state, should be this before every rerun
reset
{ "repo_name": "wenerme/bbvm", "path": "jbbvm/bbvm-core/src/main/java/me/wener/bbvm/vm/VM.java", "license": "apache-2.0", "size": 13037 }
[ "me.wener.bbvm.vm.event.ResetEvent" ]
import me.wener.bbvm.vm.event.ResetEvent;
import me.wener.bbvm.vm.event.*;
[ "me.wener.bbvm" ]
me.wener.bbvm;
2,031,275
Project resolveProject( final Path resource );
Project resolveProject( final Path resource );
/** * Given a Resource path resolve it to the containing Project Path. A Project path is the folder containing pom.xml * @param resource * @return Path to the folder containing the Project's pom.xml file or null if the resource was not in a Project */
Given a Resource path resolve it to the containing Project Path. A Project path is the folder containing pom.xml
resolveProject
{ "repo_name": "mswiderski/guvnor", "path": "guvnor-project/guvnor-project-api/src/main/java/org/guvnor/common/services/project/service/ProjectService.java", "license": "apache-2.0", "size": 3719 }
[ "org.guvnor.common.services.project.model.Project", "org.uberfire.backend.vfs.Path" ]
import org.guvnor.common.services.project.model.Project; import org.uberfire.backend.vfs.Path;
import org.guvnor.common.services.project.model.*; import org.uberfire.backend.vfs.*;
[ "org.guvnor.common", "org.uberfire.backend" ]
org.guvnor.common; org.uberfire.backend;
2,717,628
public Builder<I, O> in(Set<O> values) { checkArgument(!values.isEmpty()); return transform(new InFunction<>(values)); } /** * Performs arbitrary type transformation from {@code O} to {@code T}. * * <p>Your {@code transform} function is expected to pass-through {@code null} values as a * no-op, since it's up to {@link #required()} to block them. You might also want to consider * using a try block that rethrows exceptions as {@link FormFieldException}. * * <p>Here's an example of how you'd convert from String to Integer: * * <pre> * FormField.named("foo", String.class) * .transform(Integer.class, new Function&lt;String, Integer&gt;() { * &#064;Nullable * &#064;Override * public Integer apply(&#064;Nullable String input) { * try { * return input != null ? Integer.parseInt(input) : null; * } catch (IllegalArgumentException e) { * throw new FormFieldException("Invalid number.", e); * }
Builder<I, O> function(Set<O> values) { checkArgument(!values.isEmpty()); return transform(new InFunction<>(values)); } /** * Performs arbitrary type transformation from {@code O} to {@code T}. * * <p>Your {@code transform} function is expected to pass-through {@code null} values as a * no-op, since it's up to {@link #required()} to block them. You might also want to consider * using a try block that rethrows exceptions as {@link FormFieldException}. * * <p>Here's an example of how you'd convert from String to Integer: * * <pre> * FormField.named("foo", String.class) * .transform(Integer.class, new Function&lt;String, Integer&gt;() { * &#064;Nullable * &#064;Override * Integer apply(&#064;Nullable String functionput) { * try { * return input != null ? Integer.parseInt(input) : null; * } catch (IllegalArgumentException e) { * throw new FormFieldException(STR, e); * }
/** * Enforce value be a member of {@code values}. * * <p>{@code null} values are passed through. * * @throws IllegalArgumentException if {@code values} is empty. */
Enforce value be a member of values. null values are passed through
in
{ "repo_name": "google/nomulus", "path": "core/src/main/java/google/registry/ui/forms/FormField.java", "license": "apache-2.0", "size": 27664 }
[ "com.google.common.base.Preconditions", "java.util.Set", "java.util.function.Function", "javax.annotation.Nullable" ]
import com.google.common.base.Preconditions; import java.util.Set; import java.util.function.Function; import javax.annotation.Nullable;
import com.google.common.base.*; import java.util.*; import java.util.function.*; import javax.annotation.*;
[ "com.google.common", "java.util", "javax.annotation" ]
com.google.common; java.util; javax.annotation;
1,379,211
return status; } /** * EZSP_SUCCESS if the policy was changed, EZSP_ERROR_INVALID_ID if the NCP does not * recognize policyId. * * @param status the status to set as {@link EzspStatus}
return status; } /** * EZSP_SUCCESS if the policy was changed, EZSP_ERROR_INVALID_ID if the NCP does not * recognize policyId. * * @param status the status to set as {@link EzspStatus}
/** * EZSP_SUCCESS if the policy was changed, EZSP_ERROR_INVALID_ID if the NCP does not * recognize policyId. * <p> * EZSP type is <i>EzspStatus</i> - Java type is {@link EzspStatus} * * @return the current status as {@link EzspStatus} */
EZSP_SUCCESS if the policy was changed, EZSP_ERROR_INVALID_ID if the NCP does not recognize policyId. EZSP type is EzspStatus - Java type is <code>EzspStatus</code>
getStatus
{ "repo_name": "cschwer/com.zsmartsystems.zigbee", "path": "com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSetPolicyResponse.java", "license": "epl-1.0", "size": 2455 }
[ "com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspStatus" ]
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspStatus;
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.*;
[ "com.zsmartsystems.zigbee" ]
com.zsmartsystems.zigbee;
1,520,422
public void execute() throws MojoExecutionException, MojoFailureException { executeModel(); Set<String> components = executeComponents(); Set<String> dataformats = executeDataFormats(); Set<String> languages = executeLanguages(); Set<String> others = executeOthers(); executeDocuments(components, dataformats, languages, others); executeArchetypes(); executeXmlSchemas(); }
void function() throws MojoExecutionException, MojoFailureException { executeModel(); Set<String> components = executeComponents(); Set<String> dataformats = executeDataFormats(); Set<String> languages = executeLanguages(); Set<String> others = executeOthers(); executeDocuments(components, dataformats, languages, others); executeArchetypes(); executeXmlSchemas(); }
/** * Execute goal. * * @throws org.apache.maven.plugin.MojoExecutionException execution of the main class or one of the * threads it generated failed. * @throws org.apache.maven.plugin.MojoFailureException something bad happened... */
Execute goal
execute
{ "repo_name": "jkorab/camel", "path": "tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCatalogMojo.java", "license": "apache-2.0", "size": 66900 }
[ "java.util.Set", "org.apache.maven.plugin.MojoExecutionException", "org.apache.maven.plugin.MojoFailureException" ]
import java.util.Set; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException;
import java.util.*; import org.apache.maven.plugin.*;
[ "java.util", "org.apache.maven" ]
java.util; org.apache.maven;
1,753,772
public void browseTable() { DatabaseMeta databaseMeta = jobMeta.findDatabase( getConfig().getDatabase() ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( getShell(), SWT.NONE, databaseMeta, jobMeta.getDatabases() ); std.setSelectedSchemaAndTable( getConfig().getSchema(), getConfig().getTable() ); if ( std.open() ) { getConfig().setSchema( std.getSchemaName() ); getConfig().setTable( std.getTableName() ); } }
void function() { DatabaseMeta databaseMeta = jobMeta.findDatabase( getConfig().getDatabase() ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( getShell(), SWT.NONE, databaseMeta, jobMeta.getDatabases() ); std.setSelectedSchemaAndTable( getConfig().getSchema(), getConfig().getTable() ); if ( std.open() ) { getConfig().setSchema( std.getSchemaName() ); getConfig().setTable( std.getTableName() ); } }
/** * Show the Database Explorer Dialog for the database information provided. The provided schema and table will be * selected if already configured. Any new selection will be saved in the current configuration. */
Show the Database Explorer Dialog for the database information provided. The provided schema and table will be selected if already configured. Any new selection will be saved in the current configuration
browseTable
{ "repo_name": "stepanovdg/big-data-plugin", "path": "kettle-plugins/sqoop/src/main/java/org/pentaho/big/data/kettle/plugins/sqoop/ui/AbstractSqoopJobEntryController.java", "license": "apache-2.0", "size": 39379 }
[ "org.pentaho.di.core.database.DatabaseMeta", "org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog" ]
import org.pentaho.di.core.database.DatabaseMeta; import org.pentaho.di.ui.core.database.dialog.DatabaseExplorerDialog;
import org.pentaho.di.core.database.*; import org.pentaho.di.ui.core.database.dialog.*;
[ "org.pentaho.di" ]
org.pentaho.di;
975,299
@Override public MaterializedReplica getMaterializedReplica(ExtendedBlock block) throws ReplicaNotFoundException { File blockFile; try { ReplicaInfo r = dataset.getReplicaInfo(block); blockFile = new File(r.getBlockURI()); } catch (IOException e) { LOG.error("Block file for " + block + " does not existed:", e); throw new ReplicaNotFoundException(block); } File metaFile = FsDatasetUtil.getMetaFile( blockFile, block.getGenerationStamp()); return new FsDatasetImplMaterializedReplica(blockFile, metaFile); }
MaterializedReplica function(ExtendedBlock block) throws ReplicaNotFoundException { File blockFile; try { ReplicaInfo r = dataset.getReplicaInfo(block); blockFile = new File(r.getBlockURI()); } catch (IOException e) { LOG.error(STR + block + STR, e); throw new ReplicaNotFoundException(block); } File metaFile = FsDatasetUtil.getMetaFile( blockFile, block.getGenerationStamp()); return new FsDatasetImplMaterializedReplica(blockFile, metaFile); }
/** * Return a materialized replica from the FsDatasetImpl. */
Return a materialized replica from the FsDatasetImpl
getMaterializedReplica
{ "repo_name": "apurtell/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImplTestUtils.java", "license": "apache-2.0", "size": 17937 }
[ "java.io.File", "java.io.IOException", "org.apache.hadoop.hdfs.protocol.ExtendedBlock", "org.apache.hadoop.hdfs.server.datanode.ReplicaInfo", "org.apache.hadoop.hdfs.server.datanode.ReplicaNotFoundException" ]
import java.io.File; import java.io.IOException; import org.apache.hadoop.hdfs.protocol.ExtendedBlock; import org.apache.hadoop.hdfs.server.datanode.ReplicaInfo; import org.apache.hadoop.hdfs.server.datanode.ReplicaNotFoundException;
import java.io.*; import org.apache.hadoop.hdfs.protocol.*; import org.apache.hadoop.hdfs.server.datanode.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,475,773
public int getTabRunCount(JTabbedPane a) { int returnValue = ((TabbedPaneUI) (uis.elementAt(0))).getTabRunCount(a); for (int i = 1; i < uis.size(); i++) { ((TabbedPaneUI) (uis.elementAt(i))).getTabRunCount(a); } return returnValue; } //////////////////// // ComponentUI methods ////////////////////
int function(JTabbedPane a) { int returnValue = ((TabbedPaneUI) (uis.elementAt(0))).getTabRunCount(a); for (int i = 1; i < uis.size(); i++) { ((TabbedPaneUI) (uis.elementAt(i))).getTabRunCount(a); } return returnValue; }
/** * Invokes the <code>getTabRunCount</code> method on each UI handled by this object. * * @return the value obtained from the first UI, which is * the UI obtained from the default <code>LookAndFeel</code> */
Invokes the <code>getTabRunCount</code> method on each UI handled by this object
getTabRunCount
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk2/jdk/src/share/classes/javax/swing/plaf/multi/MultiTabbedPaneUI.java", "license": "mit", "size": 9161 }
[ "javax.swing.JTabbedPane", "javax.swing.plaf.TabbedPaneUI" ]
import javax.swing.JTabbedPane; import javax.swing.plaf.TabbedPaneUI;
import javax.swing.*; import javax.swing.plaf.*;
[ "javax.swing" ]
javax.swing;
851,565
int countPendingActivation(MemberGroup group, MemberAccountType accountType);
int countPendingActivation(MemberGroup group, MemberAccountType accountType);
/** * Returns the number of accounts which are pending activation with the given group and type */
Returns the number of accounts which are pending activation with the given group and type
countPendingActivation
{ "repo_name": "mateli/OpenCyclos", "path": "src/main/java/nl/strohalm/cyclos/services/accounts/AccountServiceLocal.java", "license": "gpl-2.0", "size": 7048 }
[ "nl.strohalm.cyclos.entities.accounts.MemberAccountType", "nl.strohalm.cyclos.entities.groups.MemberGroup" ]
import nl.strohalm.cyclos.entities.accounts.MemberAccountType; import nl.strohalm.cyclos.entities.groups.MemberGroup;
import nl.strohalm.cyclos.entities.accounts.*; import nl.strohalm.cyclos.entities.groups.*;
[ "nl.strohalm.cyclos" ]
nl.strohalm.cyclos;
1,762,392
public final Element getElement() { return this.wrappedElement; }
final Element function() { return this.wrappedElement; }
/** * Returns the Element which was constructed by the Object. * * @return the Element which was constructed by the Object. */
Returns the Element which was constructed by the Object
getElement
{ "repo_name": "md-5/jdk10", "path": "src/java.xml.crypto/share/classes/com/sun/org/apache/xml/internal/security/utils/ElementProxy.java", "license": "gpl-2.0", "size": 17777 }
[ "org.w3c.dom.Element" ]
import org.w3c.dom.Element;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,674,170
public void startup() { feedInProcess.clear(); feedQueue.clear(); executorService = newExecutorService(); if (scheduleInterval == -1) { logger.info("Disabled scheduled collects."); } else { scheduleService = Executors.newSingleThreadScheduledExecutor(); scheduleService.scheduleAtFixedRate( new Runnable() { public void run() { collectAllFeeds(); }
void function() { feedInProcess.clear(); feedQueue.clear(); executorService = newExecutorService(); if (scheduleInterval == -1) { logger.info(STR); } else { scheduleService = Executors.newSingleThreadScheduledExecutor(); scheduleService.scheduleAtFixedRate( new Runnable() { public void run() { collectAllFeeds(); }
/** * Initiate a fixed rate schedule for collecting all feeds, with an interval * of <code>scheduleInterval</code>, unless it is set to -1. */
Initiate a fixed rate schedule for collecting all feeds, with an interval of <code>scheduleInterval</code>, unless it is set to -1
startup
{ "repo_name": "rinfo/rdl", "path": "packages/java/rinfo-collector/src/main/java/se/lagrummet/rinfo/collector/AbstractCollectScheduler.java", "license": "bsd-2-clause", "size": 8089 }
[ "java.util.concurrent.Executors" ]
import java.util.concurrent.Executors;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,128,879
public static <T> T buildInstanceForMap(Class<T> clazz, Map<String, Object> values) throws InstantiationException, IllegalAccessException, IntrospectionException, IllegalArgumentException, InvocationTargetException { return buildInstanceForMap(clazz, values, new MyDefaultReflectionDifferenceHandler()); }
static <T> T function(Class<T> clazz, Map<String, Object> values) throws InstantiationException, IllegalAccessException, IntrospectionException, IllegalArgumentException, InvocationTargetException { return buildInstanceForMap(clazz, values, new MyDefaultReflectionDifferenceHandler()); }
/** * Builds a instance of the class for a map containing the values, without specifying the handler for differences * * @param clazz The class to build instance * @param values The values map * @return The instance * @throws InstantiationException Error instantiating * @throws IllegalAccessException Access error * @throws IntrospectionException Introspection error * @throws IllegalArgumentException Argument invalid * @throws InvocationTargetException Invalid target */
Builds a instance of the class for a map containing the values, without specifying the handler for differences
buildInstanceForMap
{ "repo_name": "brunocvcunha/inutils4j", "path": "src/main/java/org/brunocvcunha/inutils4j/reflection/MyReflectionUtils.java", "license": "apache-2.0", "size": 4513 }
[ "java.beans.IntrospectionException", "java.lang.reflect.InvocationTargetException", "java.util.Map" ]
import java.beans.IntrospectionException; import java.lang.reflect.InvocationTargetException; import java.util.Map;
import java.beans.*; import java.lang.reflect.*; import java.util.*;
[ "java.beans", "java.lang", "java.util" ]
java.beans; java.lang; java.util;
1,869,711
@Override public void setSliceItem(SliceItem slice, boolean isHeader, int index, SliceView.OnSliceActionListener observer) { resetView(); setSliceActionListener(observer); mRowIndex = index; mGridContent = new GridContent(getContext(), slice); populateViews(mGridContent); }
void function(SliceItem slice, boolean isHeader, int index, SliceView.OnSliceActionListener observer) { resetView(); setSliceActionListener(observer); mRowIndex = index; mGridContent = new GridContent(getContext(), slice); populateViews(mGridContent); }
/** * This is called when GridView is being used as a component in a larger template. */
This is called when GridView is being used as a component in a larger template
setSliceItem
{ "repo_name": "aosp-mirror/platform_frameworks_support", "path": "slices/view/src/main/java/androidx/slice/widget/GridRowView.java", "license": "apache-2.0", "size": 15259 }
[ "androidx.slice.SliceItem" ]
import androidx.slice.SliceItem;
import androidx.slice.*;
[ "androidx.slice" ]
androidx.slice;
33,832
public void testGetChildren() throws Exception { ExpectedStrings expectedString = new ExpectedStrings(expectedStringList); ITranslationUnit tu = CProjectHelper.findTranslationUnit(testProject, "exetest.c"); if (tu.hasChildren()) { ICElement[] elements = tu.getChildren(); for (int x = 0; x < elements.length; x++) { expectedString.foundString(elements[x].getElementName()); } } assertTrue("PR:23603 " + expectedString.getMissingString(), expectedString.gotAll()); assertTrue(expectedString.getExtraString(), !expectedString.gotExtra()); }
void function() throws Exception { ExpectedStrings expectedString = new ExpectedStrings(expectedStringList); ITranslationUnit tu = CProjectHelper.findTranslationUnit(testProject, STR); if (tu.hasChildren()) { ICElement[] elements = tu.getChildren(); for (int x = 0; x < elements.length; x++) { expectedString.foundString(elements[x].getElementName()); } } assertTrue(STR + expectedString.getMissingString(), expectedString.gotAll()); assertTrue(expectedString.getExtraString(), !expectedString.gotExtra()); }
/*************************************************************************** * Simple sanity tests to make sure TranslationUnit.getChildren seems to basically work. */
Simple sanity tests to make sure TranslationUnit.getChildren seems to basically work
testGetChildren
{ "repo_name": "Yuerr14/RepeatedFixes", "path": "RepeatedFixes/model/org/eclipse/cdt/core/model/tests/TranslationUnitTests.java", "license": "mit", "size": 7504 }
[ "org.eclipse.cdt.core.model.ICElement", "org.eclipse.cdt.core.model.ITranslationUnit", "org.eclipse.cdt.core.testplugin.CProjectHelper", "org.eclipse.cdt.core.testplugin.util.ExpectedStrings" ]
import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.cdt.core.testplugin.CProjectHelper; import org.eclipse.cdt.core.testplugin.util.ExpectedStrings;
import org.eclipse.cdt.core.model.*; import org.eclipse.cdt.core.testplugin.*; import org.eclipse.cdt.core.testplugin.util.*;
[ "org.eclipse.cdt" ]
org.eclipse.cdt;
1,582,684
public void connect(String url, String userName, String password) throws Exception { svcInstRef.setType(SVC_INST_NAME); svcInstRef.setValue(SVC_INST_NAME); vimPort = vimService.getVimPort(); Map<String, Object> ctxt = ((BindingProvider)vimPort).getRequestContext(); ctxt.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url); ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true); ctxt.put("com.sun.xml.internal.ws.request.timeout", vCenterSessionTimeout); ctxt.put("com.sun.xml.internal.ws.connect.timeout", vCenterSessionTimeout); ServiceContent serviceContent = vimPort.retrieveServiceContent(svcInstRef); // Extract a cookie. See vmware sample program com.vmware.httpfileaccess.GetVMFiles @SuppressWarnings("unchecked") Map<String, List<String>> headers = (Map<String, List<String>>)((BindingProvider)vimPort).getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS); List<String> cookies = headers.get("Set-cookie"); vimPort.login(serviceContent.getSessionManager(), userName, password, null); if (cookies == null) { // Get the cookie from the response header. See vmware sample program com.vmware.httpfileaccess.GetVMFiles @SuppressWarnings("unchecked") Map<String, List<String>> responseHeaders = (Map<String, List<String>>)((BindingProvider)vimPort).getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS); cookies = responseHeaders.get("Set-cookie"); if (cookies == null) { String msg = "Login successful, but failed to get server cookies from url :[" + url + "]"; s_logger.error(msg); throw new Exception(msg); } } String cookieValue = cookies.get(0); StringTokenizer tokenizer = new StringTokenizer(cookieValue, ";"); cookieValue = tokenizer.nextToken(); String pathData = "$" + tokenizer.nextToken(); serviceCookie = "$Version=\"1\"; " + cookieValue + "; " + pathData; isConnected = true; }
void function(String url, String userName, String password) throws Exception { svcInstRef.setType(SVC_INST_NAME); svcInstRef.setValue(SVC_INST_NAME); vimPort = vimService.getVimPort(); Map<String, Object> ctxt = ((BindingProvider)vimPort).getRequestContext(); ctxt.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url); ctxt.put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true); ctxt.put(STR, vCenterSessionTimeout); ctxt.put(STR, vCenterSessionTimeout); ServiceContent serviceContent = vimPort.retrieveServiceContent(svcInstRef); @SuppressWarnings(STR) Map<String, List<String>> headers = (Map<String, List<String>>)((BindingProvider)vimPort).getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS); List<String> cookies = headers.get(STR); vimPort.login(serviceContent.getSessionManager(), userName, password, null); if (cookies == null) { @SuppressWarnings(STR) Map<String, List<String>> responseHeaders = (Map<String, List<String>>)((BindingProvider)vimPort).getResponseContext().get(MessageContext.HTTP_RESPONSE_HEADERS); cookies = responseHeaders.get(STR); if (cookies == null) { String msg = STR + url + "]"; s_logger.error(msg); throw new Exception(msg); } } String cookieValue = cookies.get(0); StringTokenizer tokenizer = new StringTokenizer(cookieValue, ";"); cookieValue = tokenizer.nextToken(); String pathData = "$" + tokenizer.nextToken(); serviceCookie = STR1\STR + cookieValue + STR + pathData; isConnected = true; }
/** * Establishes session with the virtual center server. * * @throws Exception * the exception */
Establishes session with the virtual center server
connect
{ "repo_name": "ikoula/cloudstack", "path": "vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java", "license": "gpl-2.0", "size": 25921 }
[ "com.vmware.vim25.ServiceContent", "java.util.List", "java.util.Map", "java.util.StringTokenizer", "javax.xml.ws.BindingProvider", "javax.xml.ws.handler.MessageContext" ]
import com.vmware.vim25.ServiceContent; import java.util.List; import java.util.Map; import java.util.StringTokenizer; import javax.xml.ws.BindingProvider; import javax.xml.ws.handler.MessageContext;
import com.vmware.vim25.*; import java.util.*; import javax.xml.ws.*; import javax.xml.ws.handler.*;
[ "com.vmware.vim25", "java.util", "javax.xml" ]
com.vmware.vim25; java.util; javax.xml;
2,190,808
@Test public void testGetProfileWithEnglishText() throws InterruptedException { final ProfileOptions options = new ProfileOptions.Builder().text(text).language(Language.ENGLISH).build(); server.enqueue(jsonResponse(profile)); final Profile profile = service.getProfile(options).execute(); final RecordedRequest request = server.takeRequest(); assertEquals(PROFILE_PATH, request.getPath()); assertEquals("POST", request.getMethod()); assertEquals("en", request.getHeader(HttpHeaders.CONTENT_LANGUAGE)); assertEquals(HttpMediaType.TEXT.toString(), request.getHeader(HttpHeaders.CONTENT_TYPE)); assertEquals(text, request.getBody().readUtf8()); assertNotNull(profile); assertEquals(this.profile, profile); }
void function() throws InterruptedException { final ProfileOptions options = new ProfileOptions.Builder().text(text).language(Language.ENGLISH).build(); server.enqueue(jsonResponse(profile)); final Profile profile = service.getProfile(options).execute(); final RecordedRequest request = server.takeRequest(); assertEquals(PROFILE_PATH, request.getPath()); assertEquals("POST", request.getMethod()); assertEquals("en", request.getHeader(HttpHeaders.CONTENT_LANGUAGE)); assertEquals(HttpMediaType.TEXT.toString(), request.getHeader(HttpHeaders.CONTENT_TYPE)); assertEquals(text, request.getBody().readUtf8()); assertNotNull(profile); assertEquals(this.profile, profile); }
/** * Test get profile with english text. * * @throws InterruptedException the interrupted exception */
Test get profile with english text
testGetProfileWithEnglishText
{ "repo_name": "supunucsc/java-sdk", "path": "personality-insights/src/test/java/com/ibm/watson/developer_cloud/personality_insights/v2/PersonalityInsightsTest.java", "license": "apache-2.0", "size": 5009 }
[ "com.ibm.watson.developer_cloud.http.HttpHeaders", "com.ibm.watson.developer_cloud.http.HttpMediaType", "com.ibm.watson.developer_cloud.personality_insights.v2.model.Language", "com.ibm.watson.developer_cloud.personality_insights.v2.model.Profile", "com.ibm.watson.developer_cloud.personality_insights.v2.model.ProfileOptions", "org.junit.Assert" ]
import com.ibm.watson.developer_cloud.http.HttpHeaders; import com.ibm.watson.developer_cloud.http.HttpMediaType; import com.ibm.watson.developer_cloud.personality_insights.v2.model.Language; import com.ibm.watson.developer_cloud.personality_insights.v2.model.Profile; import com.ibm.watson.developer_cloud.personality_insights.v2.model.ProfileOptions; import org.junit.Assert;
import com.ibm.watson.developer_cloud.http.*; import com.ibm.watson.developer_cloud.personality_insights.v2.model.*; import org.junit.*;
[ "com.ibm.watson", "org.junit" ]
com.ibm.watson; org.junit;
886,992
public void mergeFrom(final FieldSet<FieldDescriptorType> other) { for (int i = 0; i < other.fields.getNumArrayEntries(); i++) { mergeFromField(other.fields.getArrayEntryAt(i)); } for (final Map.Entry<FieldDescriptorType, Object> entry : other.fields.getOverflowEntries()) { mergeFromField(entry); } }
void function(final FieldSet<FieldDescriptorType> other) { for (int i = 0; i < other.fields.getNumArrayEntries(); i++) { mergeFromField(other.fields.getArrayEntryAt(i)); } for (final Map.Entry<FieldDescriptorType, Object> entry : other.fields.getOverflowEntries()) { mergeFromField(entry); } }
/** * Like {@link Message.Builder#mergeFrom(Message)}, but merges from another * {@link FieldSet}. */
Like <code>Message.Builder#mergeFrom(Message)</code>, but merges from another <code>FieldSet</code>
mergeFrom
{ "repo_name": "legrosbuffle/kythe", "path": "third_party/proto/java/core/src/main/java/com/google/protobuf/FieldSet.java", "license": "apache-2.0", "size": 32472 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
550,957
@Test public void testWriteString() throws Exception { ByteArrayOutputStream stream = new ByteArrayOutputStream(); BasicByteWriter writer = new BasicByteWriter(stream); writer.write("test"); writer.flush(); byte[] bytes = stream.toByteArray(); byte[] stringBytes = "test".getBytes(StandardCharsets.UTF_16); byte[] expected = new byte[stringBytes.length + 2]; ArrayUtils.copyFromEnd(stringBytes, expected); expected[1] = (byte)stringBytes.length; // string length assertArrayEquals(expected, bytes); writer.close(); }
void function() throws Exception { ByteArrayOutputStream stream = new ByteArrayOutputStream(); BasicByteWriter writer = new BasicByteWriter(stream); writer.write("test"); writer.flush(); byte[] bytes = stream.toByteArray(); byte[] stringBytes = "test".getBytes(StandardCharsets.UTF_16); byte[] expected = new byte[stringBytes.length + 2]; ArrayUtils.copyFromEnd(stringBytes, expected); expected[1] = (byte)stringBytes.length; assertArrayEquals(expected, bytes); writer.close(); }
/** * Make sure {@link #writeString} works correctly. */
Make sure <code>#writeString</code> works correctly
testWriteString
{ "repo_name": "JCThePants/NucleusFramework", "path": "tests/src/com/jcwhatever/nucleus/utils/file/BasicByteWriterTest.java", "license": "mit", "size": 6407 }
[ "com.jcwhatever.nucleus.utils.ArrayUtils", "java.io.ByteArrayOutputStream", "java.nio.charset.StandardCharsets", "org.junit.Assert" ]
import com.jcwhatever.nucleus.utils.ArrayUtils; import java.io.ByteArrayOutputStream; import java.nio.charset.StandardCharsets; import org.junit.Assert;
import com.jcwhatever.nucleus.utils.*; import java.io.*; import java.nio.charset.*; import org.junit.*;
[ "com.jcwhatever.nucleus", "java.io", "java.nio", "org.junit" ]
com.jcwhatever.nucleus; java.io; java.nio; org.junit;
2,524,999
EClass getParentOf();
EClass getParentOf();
/** * Returns the meta object for class '{@link com.b2international.snowowl.snomed.ecl.ecl.ParentOf <em>Parent Of</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Parent Of</em>'. * @see com.b2international.snowowl.snomed.ecl.ecl.ParentOf * @generated */
Returns the meta object for class '<code>com.b2international.snowowl.snomed.ecl.ecl.ParentOf Parent Of</code>'.
getParentOf
{ "repo_name": "IHTSDO/snow-owl", "path": "snomed/com.b2international.snowowl.snomed.ecl/src-gen/com/b2international/snowowl/snomed/ecl/ecl/EclPackage.java", "license": "apache-2.0", "size": 121411 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
578,911
private Node[] pslcluster() { final int nnodes = samples - 1; final int[] vector = new int[nnodes]; final float[] temp = new float[nnodes]; final int[] index = new int[samples]; Node[] result = new Node[samples]; for (int i = 0; i < samples; i++) { result[i] = new Node(); result[i].setCorrelation(Float.MAX_VALUE); for (int j = 0; j < i; j++) temp[j] = similarities[i][j]; for (int j = 0; j < i; j++) { int k = vector[j]; if (result[j].getCorrelation() >= temp[j]) { if (result[j].getCorrelation() < temp[k]) temp[k] = result[j].getCorrelation(); result[j].setCorrelation(temp[j]); vector[j] = i; } else if (temp[j] < temp[k]) temp[k] = temp[j]; } for (int j = 0; j < i; j++) { if (result[j].getCorrelation() >= result[vector[j]].getCorrelation()) vector[j] = i; } } for (int i = 0; i < nnodes; i++) result[i].setLeft(i); for (int i = 0; i < samples; i++) index[i] = i; for (int i = 0; i < nnodes; i++) { int j = result[i].getLeft(); int k = vector[j]; result[i].setLeft(index[j]); result[i].setRight(index[k]); index[k] = -i - 1; } // remove last Node[] result2 = Arrays.copyOf(result, nnodes); // set cluster result in Set return result2; } /** * The palcluster routine performs clustering using pairwise average linking on the given distance matrix. * * warning: manipulates {@link #similarities}
Node[] function() { final int nnodes = samples - 1; final int[] vector = new int[nnodes]; final float[] temp = new float[nnodes]; final int[] index = new int[samples]; Node[] result = new Node[samples]; for (int i = 0; i < samples; i++) { result[i] = new Node(); result[i].setCorrelation(Float.MAX_VALUE); for (int j = 0; j < i; j++) temp[j] = similarities[i][j]; for (int j = 0; j < i; j++) { int k = vector[j]; if (result[j].getCorrelation() >= temp[j]) { if (result[j].getCorrelation() < temp[k]) temp[k] = result[j].getCorrelation(); result[j].setCorrelation(temp[j]); vector[j] = i; } else if (temp[j] < temp[k]) temp[k] = temp[j]; } for (int j = 0; j < i; j++) { if (result[j].getCorrelation() >= result[vector[j]].getCorrelation()) vector[j] = i; } } for (int i = 0; i < nnodes; i++) result[i].setLeft(i); for (int i = 0; i < samples; i++) index[i] = i; for (int i = 0; i < nnodes; i++) { int j = result[i].getLeft(); int k = vector[j]; result[i].setLeft(index[j]); result[i].setRight(index[k]); index[k] = -i - 1; } Node[] result2 = Arrays.copyOf(result, nnodes); return result2; } /** * The palcluster routine performs clustering using pairwise average linking on the given distance matrix. * * warning: manipulates {@link #similarities}
/** * The palcluster routine performs clustering using single linking on the given distance matrix. * * @param eClustererType * @return virtual array with ordered indexes */
The palcluster routine performs clustering using single linking on the given distance matrix
pslcluster
{ "repo_name": "Caleydo/caleydo", "path": "org.caleydo.core/src/org/caleydo/core/util/clusterer/algorithm/tree/TreeClusterer.java", "license": "bsd-3-clause", "size": 15787 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,732,586
protected void writeMetaData(PrintWriter pw) throws IOException { // Collect elementMetaData if (elements != null) { for (int i = 0; i < elements.size(); i++) { ElementDecl elem = (ElementDecl) elements.get(i); // String elemName = elem.getName().getLocalPart(); // String javaName = Utils.xmlNameToJava(elemName); // Changed the code to write meta data // for all of the elements in order to // support sequences. Defect 9060 // Meta data is needed if the default serializer // action cannot map the javaName back to the // element's qname. This occurs if: // - the javaName and element name local part are different. // - the javaName starts with uppercase char (this is a wierd // case and we have several problems with the mapping rules. // Seems best to gen meta data in this case.) // - the element name is qualified (has a namespace uri) // its also needed if: // - the element has the minoccurs flag set // if (!javaName.equals(elemName) || // Character.isUpperCase(javaName.charAt(0)) || // !elem.getName().getNamespaceURI().equals("") || // elem.getMinOccursIs0()) { // If we did some mangling, make sure we'll write out the XML // the correct way. if (elementMetaData == null) { elementMetaData = new Vector(); } elementMetaData.add(elem); // } } } pw.println(" // " + Messages.getMessage("typeMeta")); pw.println( " private static org.apache.axis.description.TypeDesc typeDesc ="); pw.println(" new org.apache.axis.description.TypeDesc(" + Utils.getJavaLocalName(type.getName()) + ".class, " + (this.canSearchParents ? "true" : "false") + ");"); pw.println(); pw.println(" static {"); pw.println(" typeDesc.setXmlType(" + Utils.getNewQName(type.getQName()) + ");"); // Add attribute and element field descriptors if ((attributes != null) || (elementMetaData != null)) { if (attributes != null) { boolean wroteAttrDecl = false; for (int i = 0; i < attributes.size(); i++) { ContainedAttribute attr = (ContainedAttribute) attributes.get(i); TypeEntry te = attr.getType(); QName attrName = attr.getQName(); String fieldName = getAsFieldName(attr.getName()); QName attrXmlType = te.getQName(); pw.print(" "); if (!wroteAttrDecl) { pw.print("org.apache.axis.description.AttributeDesc "); wroteAttrDecl = true; } pw.println( "attrField = new org.apache.axis.description.AttributeDesc();"); pw.println(" attrField.setFieldName(\"" + fieldName + "\");"); pw.println(" attrField.setXmlName(" + Utils.getNewQNameWithLastLocalPart(attrName) + ");"); if (attrXmlType != null) { pw.println(" attrField.setXmlType(" + Utils.getNewQName(attrXmlType) + ");"); } pw.println(" typeDesc.addFieldDesc(attrField);"); } } if (elementMetaData != null) { boolean wroteElemDecl = false; for (int i = 0; i < elementMetaData.size(); i++) { ElementDecl elem = (ElementDecl) elementMetaData.elementAt(i); if (elem.getAnyElement()) { continue; } String fieldName = getAsFieldName(elem.getName()); QName xmlName = elem.getQName(); // Some special handling for arrays. TypeEntry elemType = elem.getType(); QName xmlType = null; if ((elemType.getDimensions().length() > 1) && (elemType.getClass() == DefinedType.class)) { // If we have a DefinedType with dimensions, it must // be a SOAP array derived type. In this case, use // the refType's QName for the metadata. elemType = elemType.getRefType(); } else if (elemType.getClass() == DefinedElement.class && elemType.getRefType() != null) { // If we have a DefinedElement which references other element // (eg. <element ref="aRefEleme"/>) // use the refType's QName for the metadata (which can be anonymous type.) // see the schema of test/wsdl/axis2098 elemType = elemType.getRefType(); } else if (elemType.isSimpleType() && elemType.getRefType() != null) { // see wsdl in AXIS-2138 elemType = elemType.getRefType(); } else { // Otherwise, use the first non-Collection type we // encounter up the ref chain. while (elemType instanceof CollectionTE) { elemType = elemType.getRefType(); } } xmlType = elemType.getQName(); pw.print(" "); if (!wroteElemDecl) { pw.print("org.apache.axis.description.ElementDesc "); wroteElemDecl = true; } pw.println( "elemField = new org.apache.axis.description.ElementDesc();"); pw.println(" elemField.setFieldName(\"" + fieldName + "\");"); pw.println(" elemField.setXmlName(" + Utils.getNewQNameWithLastLocalPart(xmlName) + ");"); if (xmlType != null) { pw.println(" elemField.setXmlType(" + Utils.getNewQName(xmlType) + ");"); } if (elem.getMinOccursIs0()) { pw.println(" elemField.setMinOccurs(0);"); } if (elem.getNillable()) { pw.println(" elemField.setNillable(true);"); } else { pw.println(" elemField.setNillable(false);"); } if(elem.getMaxOccursIsUnbounded()) { pw.println(" elemField.setMaxOccursUnbounded(true);"); } QName itemQName = elem.getType().getItemQName(); if (itemQName != null) { pw.println(" elemField.setItemQName(" + Utils.getNewQName(itemQName) + ");"); } pw.println(" typeDesc.addFieldDesc(elemField);"); } } } pw.println(" }"); pw.println(); pw.println(" "); pw.println( " public static org.apache.axis.description.TypeDesc getTypeDesc() {"); pw.println(" return typeDesc;"); pw.println(" }"); pw.println(); }
void function(PrintWriter pw) throws IOException { if (elements != null) { for (int i = 0; i < elements.size(); i++) { ElementDecl elem = (ElementDecl) elements.get(i); if (elementMetaData == null) { elementMetaData = new Vector(); } elementMetaData.add(elem); } } pw.println(STR private static org.apache.axis.description.TypeDesc typeDesc =STR new org.apache.axis.description.TypeDesc(STR.class, STRtrueSTRfalseSTR);STR static {STR typeDesc.setXmlType(STR);STR STRorg.apache.axis.description.AttributeDesc STRattrField = new org.apache.axis.description.AttributeDesc();STR attrField.setFieldName(\STR\");STR attrField.setXmlName(" + Utils.getNewQNameWithLastLocalPart(attrName) + ");"); if (attrXmlType != null) { pw.println(STR + Utils.getNewQName(attrXmlType) + ");"); } pw.println(STR); } } if (elementMetaData != null) { boolean wroteElemDecl = false; for (int i = 0; i < elementMetaData.size(); i++) { ElementDecl elem = (ElementDecl) elementMetaData.elementAt(i); if (elem.getAnyElement()) { continue; } String fieldName = getAsFieldName(elem.getName()); QName xmlName = elem.getQName(); TypeEntry elemType = elem.getType(); QName xmlType = null; if ((elemType.getDimensions().length() > 1) && (elemType.getClass() == DefinedType.class)) { elemType = elemType.getRefType(); } else if (elemType.getClass() == DefinedElement.class && elemType.getRefType() != null) { elemType = elemType.getRefType(); } else if (elemType.isSimpleType() && elemType.getRefType() != null) { elemType = elemType.getRefType(); } else { while (elemType instanceof CollectionTE) { elemType = elemType.getRefType(); } } xmlType = elemType.getQName(); pw.print(" "); if (!wroteElemDecl) { pw.print(STR); wroteElemDecl = true; } pw.println( "elemField = new org.apache.axis.description.ElementDesc();STR elemField.setFieldName(\STR\");STR elemField.setXmlName(" + Utils.getNewQNameWithLastLocalPart(xmlName) + ");"); if (xmlType != null) { pw.println(STR + Utils.getNewQName(xmlType) + ");"); } if (elem.getMinOccursIs0()) { pw.println(STR); } if (elem.getNillable()) { pw.println(STR); } else { pw.println(STR); } if(elem.getMaxOccursIsUnbounded()) { pw.println(STR); } QName itemQName = elem.getType().getItemQName(); if (itemQName != null) { pw.println(STR + Utils.getNewQName(itemQName) + ");"); } pw.println(STR); } } } pw.println(" }STR "); pw.println( " public static org.apache.axis.description.TypeDesc getTypeDesc() {STR return typeDesc;STR }"); pw.println(); }
/** * write MetaData code * * @param pw * @throws IOException */
write MetaData code
writeMetaData
{ "repo_name": "apache/axis1-java", "path": "axis-codegen/src/main/java/org/apache/axis/wsdl/toJava/JavaBeanHelperWriter.java", "license": "apache-2.0", "size": 18846 }
[ "java.io.IOException", "java.io.PrintWriter", "java.util.Vector", "javax.xml.namespace.QName", "org.apache.axis.wsdl.symbolTable.CollectionTE", "org.apache.axis.wsdl.symbolTable.DefinedElement", "org.apache.axis.wsdl.symbolTable.DefinedType", "org.apache.axis.wsdl.symbolTable.ElementDecl", "org.apache.axis.wsdl.symbolTable.TypeEntry" ]
import java.io.IOException; import java.io.PrintWriter; import java.util.Vector; import javax.xml.namespace.QName; import org.apache.axis.wsdl.symbolTable.CollectionTE; import org.apache.axis.wsdl.symbolTable.DefinedElement; import org.apache.axis.wsdl.symbolTable.DefinedType; import org.apache.axis.wsdl.symbolTable.ElementDecl; import org.apache.axis.wsdl.symbolTable.TypeEntry;
import java.io.*; import java.util.*; import javax.xml.namespace.*; import org.apache.axis.wsdl.*;
[ "java.io", "java.util", "javax.xml", "org.apache.axis" ]
java.io; java.util; javax.xml; org.apache.axis;
1,418,540
private static <E> Collection<E> toCollection(Iterable<E> iterable) { return (iterable instanceof Collection) ? (Collection<E>) iterable : Lists.newArrayList(iterable.iterator()); }
static <E> Collection<E> function(Iterable<E> iterable) { return (iterable instanceof Collection) ? (Collection<E>) iterable : Lists.newArrayList(iterable.iterator()); }
/** * Converts an iterable into a collection. If the iterable is already a * collection, it is returned. Otherwise, an {@link java.util.ArrayList} is * created with the contents of the iterable in the same iteration order. */
Converts an iterable into a collection. If the iterable is already a collection, it is returned. Otherwise, an <code>java.util.ArrayList</code> is created with the contents of the iterable in the same iteration order
toCollection
{ "repo_name": "lshain-android-source/external-guava", "path": "guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/Iterables.java", "license": "apache-2.0", "size": 38623 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,385,438
public static PutRepositoryRequest putRepositoryRequest(String name) { return new PutRepositoryRequest(name); }
static PutRepositoryRequest function(String name) { return new PutRepositoryRequest(name); }
/** * Registers snapshot repository * * @param name repository name * @return repository registration request */
Registers snapshot repository
putRepositoryRequest
{ "repo_name": "zuoyebushiwo/elasticsearch1.7-study", "path": "src/main/java/org/elasticsearch/client/Requests.java", "license": "apache-2.0", "size": 24567 }
[ "org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest" ]
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest;
import org.elasticsearch.action.admin.cluster.repositories.put.*;
[ "org.elasticsearch.action" ]
org.elasticsearch.action;
415,464
public IncomingPhoneNumber create(List<NameValuePair> params) throws TwilioRestException;
IncomingPhoneNumber function(List<NameValuePair> params) throws TwilioRestException;
/** * Creates the IncomingPhoneNumber * * @param params the param list * @return the incoming phone number * @throws TwilioRestException */
Creates the IncomingPhoneNumber
create
{ "repo_name": "Forestvap/Twilio-Project", "path": "twilio-java/src/main/java/com/twilio/sdk/resource/factory/IncomingPhoneNumberFactory.java", "license": "mit", "size": 864 }
[ "com.twilio.sdk.TwilioRestException", "com.twilio.sdk.resource.instance.IncomingPhoneNumber", "java.util.List", "org.apache.http.NameValuePair" ]
import com.twilio.sdk.TwilioRestException; import com.twilio.sdk.resource.instance.IncomingPhoneNumber; import java.util.List; import org.apache.http.NameValuePair;
import com.twilio.sdk.*; import com.twilio.sdk.resource.instance.*; import java.util.*; import org.apache.http.*;
[ "com.twilio.sdk", "java.util", "org.apache.http" ]
com.twilio.sdk; java.util; org.apache.http;
943,943
public void testCertificateExpiredException03() { String msg = null; CertificateExpiredException tE = new CertificateExpiredException(msg); assertNull("getMessage() must return null.", tE.getMessage()); assertNull("getCause() must return null", tE.getCause()); }
void function() { String msg = null; CertificateExpiredException tE = new CertificateExpiredException(msg); assertNull(STR, tE.getMessage()); assertNull(STR, tE.getCause()); }
/** * Test for <code>CertificateExpiredException(String)</code> constructor * Assertion: constructs CertificateExpiredException when <code>msg</code> * is null */
Test for <code>CertificateExpiredException(String)</code> constructor Assertion: constructs CertificateExpiredException when <code>msg</code> is null
testCertificateExpiredException03
{ "repo_name": "rex-xxx/mt6572_x201", "path": "external/apache-harmony/security/src/test/api/java/org/apache/harmony/security/tests/java/security/cert/CertificateExpiredExceptionTest.java", "license": "gpl-2.0", "size": 3216 }
[ "java.security.cert.CertificateExpiredException" ]
import java.security.cert.CertificateExpiredException;
import java.security.cert.*;
[ "java.security" ]
java.security;
1,285,817
public ArrayList<String> getValues(OrganizationListHeader header) { String locator = String.format(Locators.ORGANIZATION_CELL_XPATH, header.getIndex()); List<WebElement> cells = seleniumWebDriver.findElements(By.xpath(locator)); ArrayList<String> values = new ArrayList<>(); cells.forEach( cell -> { values.add(cell.getText()); }); return values; }
ArrayList<String> function(OrganizationListHeader header) { String locator = String.format(Locators.ORGANIZATION_CELL_XPATH, header.getIndex()); List<WebElement> cells = seleniumWebDriver.findElements(By.xpath(locator)); ArrayList<String> values = new ArrayList<>(); cells.forEach( cell -> { values.add(cell.getText()); }); return values; }
/** * Returns values of the pointed column. * * @param header header * @return list of values in the cells */
Returns values of the pointed column
getValues
{ "repo_name": "sleshchenko/che", "path": "selenium/che-selenium-test/src/main/java/org/eclipse/che/selenium/pageobject/dashboard/organization/OrganizationListPage.java", "license": "epl-1.0", "size": 11440 }
[ "java.util.ArrayList", "java.util.List", "org.openqa.selenium.By", "org.openqa.selenium.WebElement" ]
import java.util.ArrayList; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebElement;
import java.util.*; import org.openqa.selenium.*;
[ "java.util", "org.openqa.selenium" ]
java.util; org.openqa.selenium;
900,134
public TCTokenResponse handleActivate(TCTokenRequest request) { final DynamicContext dynCtx = DynamicContext.getInstance(TR03112Keys.INSTANCE_KEY); boolean performChecks = TCTokenHacks.isPerformTR03112Checks(request); if (! performChecks) { logger.warn("Checks according to BSI TR03112 3.4.2, 3.4.4 (TCToken specific) and 3.4.5 are disabled."); } boolean isObjectActivation = request.getTCTokenURL() == null; if (isObjectActivation) { logger.warn("Checks according to BSI TR03112 3.4.4 (TCToken specific) are disabled."); } dynCtx.put(TR03112Keys.TCTOKEN_CHECKS, performChecks); dynCtx.put(TR03112Keys.OBJECT_ACTIVATION, isObjectActivation); dynCtx.put(TR03112Keys.TCTOKEN_SERVER_CERTIFICATES, request.getCertificates()); dynCtx.put(TR03112Keys.TCTOKEN_URL, request.getTCTokenURL()); ConnectionHandleType connectionHandle = null; TCTokenResponse response = new TCTokenResponse(); byte[] requestedContextHandle = request.getContextHandle(); String ifdName = request.getIFDName(); BigInteger requestedSlotIndex = request.getSlotIndex(); if (requestedContextHandle == null || ifdName == null || requestedSlotIndex == null) { // use dumb activation without explicitly specifying the card and terminal // see TR-03112-7 v 1.1.2 (2012-02-28) sec. 3.2 connectionHandle = getFirstHandle(request.getCardType()); } else { // we know exactly which card we want ConnectionHandleType requestedHandle = new ConnectionHandleType(); requestedHandle.setContextHandle(requestedContextHandle); requestedHandle.setIFDName(ifdName); requestedHandle.setSlotIndex(requestedSlotIndex); Set<CardStateEntry> matchingHandles = cardStates.getMatchingEntries(requestedHandle); if (! matchingHandles.isEmpty()) { connectionHandle = matchingHandles.toArray(new CardStateEntry[] {})[0].handleCopy(); } } if (connectionHandle == null) { String msg = lang.translationForKey("cancel"); logger.error(msg); response.setResult(WSHelper.makeResultError(ECardConstants.Minor.SAL.CANCELLATION_BY_USER, msg)); return response; } try { // process binding and follow redirect addresses afterwards response = processBinding(request, connectionHandle); response = determineRefreshURL(request, response); return response; } catch (IOException w) { logger.error(w.getMessage(), w); // TODO: check for better matching minor type response.setResult(WSHelper.makeResultUnknownError(w.getMessage())); return response; } catch (DispatcherException w) { logger.error(w.getMessage(), w); // TODO: check for better matching minor type response.setResult(WSHelper.makeResultError(ECardConstants.Minor.App.INCORRECT_PARM, w.getMessage())); return response; } catch (PAOSException w) { logger.error(w.getMessage(), w); Throwable innerException = w.getCause(); if (innerException instanceof WSException) { response.setResult(((WSException) innerException).getResult()); } else { // TODO: check for better matching minor type response.setResult(WSHelper.makeResultError(ECardConstants.Minor.App.INCORRECT_PARM, w.getMessage())); } return response; } }
TCTokenResponse function(TCTokenRequest request) { final DynamicContext dynCtx = DynamicContext.getInstance(TR03112Keys.INSTANCE_KEY); boolean performChecks = TCTokenHacks.isPerformTR03112Checks(request); if (! performChecks) { logger.warn(STR); } boolean isObjectActivation = request.getTCTokenURL() == null; if (isObjectActivation) { logger.warn(STR); } dynCtx.put(TR03112Keys.TCTOKEN_CHECKS, performChecks); dynCtx.put(TR03112Keys.OBJECT_ACTIVATION, isObjectActivation); dynCtx.put(TR03112Keys.TCTOKEN_SERVER_CERTIFICATES, request.getCertificates()); dynCtx.put(TR03112Keys.TCTOKEN_URL, request.getTCTokenURL()); ConnectionHandleType connectionHandle = null; TCTokenResponse response = new TCTokenResponse(); byte[] requestedContextHandle = request.getContextHandle(); String ifdName = request.getIFDName(); BigInteger requestedSlotIndex = request.getSlotIndex(); if (requestedContextHandle == null ifdName == null requestedSlotIndex == null) { connectionHandle = getFirstHandle(request.getCardType()); } else { ConnectionHandleType requestedHandle = new ConnectionHandleType(); requestedHandle.setContextHandle(requestedContextHandle); requestedHandle.setIFDName(ifdName); requestedHandle.setSlotIndex(requestedSlotIndex); Set<CardStateEntry> matchingHandles = cardStates.getMatchingEntries(requestedHandle); if (! matchingHandles.isEmpty()) { connectionHandle = matchingHandles.toArray(new CardStateEntry[] {})[0].handleCopy(); } } if (connectionHandle == null) { String msg = lang.translationForKey(STR); logger.error(msg); response.setResult(WSHelper.makeResultError(ECardConstants.Minor.SAL.CANCELLATION_BY_USER, msg)); return response; } try { response = processBinding(request, connectionHandle); response = determineRefreshURL(request, response); return response; } catch (IOException w) { logger.error(w.getMessage(), w); response.setResult(WSHelper.makeResultUnknownError(w.getMessage())); return response; } catch (DispatcherException w) { logger.error(w.getMessage(), w); response.setResult(WSHelper.makeResultError(ECardConstants.Minor.App.INCORRECT_PARM, w.getMessage())); return response; } catch (PAOSException w) { logger.error(w.getMessage(), w); Throwable innerException = w.getCause(); if (innerException instanceof WSException) { response.setResult(((WSException) innerException).getResult()); } else { response.setResult(WSHelper.makeResultError(ECardConstants.Minor.App.INCORRECT_PARM, w.getMessage())); } return response; } }
/** * Activates the client according to the received TCToken. * * @param request The activation request containing the TCToken. * @return The response containing the result of the activation process. */
Activates the client according to the received TCToken
handleActivate
{ "repo_name": "adelapie/open-ecard-IRMA", "path": "addons/tr03112/src/main/java/org/openecard/control/module/tctoken/TCTokenHandler.java", "license": "apache-2.0", "size": 19389 }
[ "java.io.IOException", "java.math.BigInteger", "java.util.Set", "org.openecard.common.DynamicContext", "org.openecard.common.ECardConstants", "org.openecard.common.WSHelper", "org.openecard.common.interfaces.DispatcherException", "org.openecard.common.sal.state.CardStateEntry", "org.openecard.transport.paos.PAOSException" ]
import java.io.IOException; import java.math.BigInteger; import java.util.Set; import org.openecard.common.DynamicContext; import org.openecard.common.ECardConstants; import org.openecard.common.WSHelper; import org.openecard.common.interfaces.DispatcherException; import org.openecard.common.sal.state.CardStateEntry; import org.openecard.transport.paos.PAOSException;
import java.io.*; import java.math.*; import java.util.*; import org.openecard.common.*; import org.openecard.common.interfaces.*; import org.openecard.common.sal.state.*; import org.openecard.transport.paos.*;
[ "java.io", "java.math", "java.util", "org.openecard.common", "org.openecard.transport" ]
java.io; java.math; java.util; org.openecard.common; org.openecard.transport;
2,788,663
protected void addInitialContextsNameListPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_PCM_MergeComponents_initialContextsNameList_feature"), getString("_UI_PropertyDescriptor_description", "_UI_PCM_MergeComponents_initialContextsNameList_feature", "_UI_PCM_MergeComponents_type"), PcmarchoptionsPackage.Literals.PCM_MERGE_COMPONENTS__INITIAL_CONTEXTS_NAME_LIST, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), PcmarchoptionsPackage.Literals.PCM_MERGE_COMPONENTS__INITIAL_CONTEXTS_NAME_LIST, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
/** * This adds a property descriptor for the Initial Contexts Name List feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Initial Contexts Name List feature.
addInitialContextsNameListPropertyDescriptor
{ "repo_name": "KAMP-Research/KAMP", "path": "bundles/Toometa/toometa.pcmarchoptions.edit/src/pcmarchoptions/provider/PCM_MergeComponentsItemProvider.java", "license": "apache-2.0", "size": 4846 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,130,489
private Latch createClientLatch(CompletableLatchUid latchUid, ClusterNode coordinator, Collection<ClusterNode> participants) { assert !serverLatches.containsKey(latchUid); assert !clientLatches.containsKey(latchUid); ClientLatch latch = new ClientLatch(latchUid, coordinator, participants); if (log.isDebugEnabled()) log.debug("Client latch is created [latch=" + latchUid + ", crd=" + coordinator + ", participantsSize=" + participants.size() + "]"); clientLatches.put(latchUid, latch); return latch; }
Latch function(CompletableLatchUid latchUid, ClusterNode coordinator, Collection<ClusterNode> participants) { assert !serverLatches.containsKey(latchUid); assert !clientLatches.containsKey(latchUid); ClientLatch latch = new ClientLatch(latchUid, coordinator, participants); if (log.isDebugEnabled()) log.debug(STR + latchUid + STR + coordinator + STR + participants.size() + "]"); clientLatches.put(latchUid, latch); return latch; }
/** * Creates client latch. If there is final ack corresponds to given {@code id} and {@code topVer}, latch will be * completed immediately. * * @param latchUid Latch uid. * @param coordinator Coordinator node. * @param participants Participant nodes. * @return Client latch instance. */
Creates client latch. If there is final ack corresponds to given id and topVer, latch will be completed immediately
createClientLatch
{ "repo_name": "samaitra/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/latch/ExchangeLatchManager.java", "license": "apache-2.0", "size": 31342 }
[ "java.util.Collection", "org.apache.ignite.cluster.ClusterNode" ]
import java.util.Collection; import org.apache.ignite.cluster.ClusterNode;
import java.util.*; import org.apache.ignite.cluster.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
330,582
int offset,i,r1,r2; Point start= this.getStartPoint(conn); conn.translateToRelative(start); Point end=this.getEndPoint(conn); conn.translateToRelative(end); IFigure source=conn.getSourceAnchor().getOwner(); IFigure target=conn.getTargetAnchor().getOwner(); Rectangle rs=source.getBounds().getCopy(); Rectangle rt=target.getBounds().getCopy(); if (start.y>=end.y) if (start.x<=end.x) offset=0; //target oben rechts von source else offset=1; //target oben links von source else if (start.x<=end.x) offset=2; //target unten rechts von source else offset=3; //target unten links von source if(rs.x+rs.width/2<=start.x) //out rechts if (rt.x+rt.width/2>=end.x)offset+=0; //in links else offset+=4; //in rechts else //out links if (rt.x+rt.width/2>=end.x)offset+=8; //in links else offset+=12; //in rechts if (Math.abs(start.x-end.x)>=20 &&Math.abs(start.y-end.y)>=20)r1=10; else r1=Math.min(Math.abs(start.x-end.x)/2,Math.abs(start.y-end.y)/2); if(Math.abs(start.y-end.y)>=20)r2=10; else r2=Math.abs((Math.abs(start.y-end.y))/2); PointList l=new PointList(); l.addPoint(start); switch (offset){ case 0: { PointList p1=leftCorner(new Point(end.x-((end.x-start.x)/2),start.y),SWT.LEFT,r1); PointList p2=rightCorner(new Point(end.x-((end.x-start.x)/2),end.y),SWT.BOTTOM,r1); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); break; } case 1: { if (source.equals(target)) { PointList p1=rightCorner(new Point(start.x+20,start.y),SWT.LEFT,10); PointList p2=rightCorner(new Point(start.x+20,rs.y+rs.height+15),SWT.TOP,10); PointList p3=rightCorner(new Point(end.x-20,rs.y+rs.height+15),SWT.RIGHT,10); PointList p4=rightCorner(new Point(end.x-20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } else { if(Math.abs(start.y-end.y)>=40) { PointList p1=leftCorner(new Point(start.x+20,start.y),SWT.LEFT,10); PointList p2=leftCorner(new Point(start.x+20,end.y-(end.y-start.y)/2),SWT.BOTTOM,10); PointList p3=rightCorner(new Point(end.x-20,end.y-(end.y-start.y)/2),SWT.RIGHT,10); PointList p4=rightCorner(new Point(end.x-20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } else { PointList p3=halfleftCircle(new Point(start.x+20,start.y),SWT.LEFT,Math.abs(start.y-end.y)/4); PointList p4=halfrightCircle(new Point(end.x-20,end.y-(end.y-start.y)/2),SWT.RIGHT,Math.abs(start.y-end.y)/4); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } } break; } case 2: { PointList p1=rightCorner(new Point(start.x+(end.x-start.x)/2,start.y),SWT.LEFT,r1); PointList p2=leftCorner(new Point(start.x+(end.x-start.x)/2,end.y),SWT.TOP,r1); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); break; } case 3: { if (Math.abs(start.y-end.y)>=40) { PointList p1=rightCorner(new Point(start.x+20,start.y),SWT.LEFT,10); PointList p2=rightCorner(new Point(start.x+20,end.y-(end.y-start.y)/2),SWT.TOP,10); PointList p3=leftCorner(new Point(end.x-20,end.y-(end.y-start.y)/2),SWT.RIGHT,10); PointList p4=leftCorner(new Point(end.x-20,end.y),SWT.TOP,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } else { PointList p3=halfrightCircle(new Point(start.x+20,start.y),SWT.LEFT,Math.abs(start.y-end.y)/4); PointList p4=halfleftCircle(new Point(end.x-20,end.y-(end.y-start.y)/2),SWT.RIGHT,Math.abs(start.y-end.y)/4); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } break; } case 4: { if (r2==10) { PointList p1=leftCorner(new Point(end.x+20,start.y),SWT.LEFT,10); PointList p2=leftCorner(new Point(end.x+20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfleftCircle(new Point(end.x+20,start.y),SWT.LEFT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 5: { if(r2==10) { PointList p1=leftCorner(new Point(start.x+20,start.y),SWT.LEFT,10); PointList p2=leftCorner(new Point(start.x+20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfleftCircle(new Point(start.x+20,start.y),SWT.LEFT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 6: { if(r2==10) { PointList p1=rightCorner(new Point(end.x+20,start.y),SWT.LEFT,10); PointList p2=rightCorner(new Point(end.x+20,end.y),SWT.TOP,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfrightCircle(new Point(end.x+20,start.y),SWT.LEFT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 7: { if(r2==10) { PointList p1=rightCorner(new Point(start.x+20,start.y),SWT.LEFT,10); PointList p2=rightCorner(new Point(start.x+20,end.y),SWT.TOP,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfrightCircle(new Point(start.x+20,start.y),SWT.LEFT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 8: { if(r2==10) { PointList p1=rightCorner(new Point(start.x-20,start.y),SWT.RIGHT,10); PointList p2=rightCorner(new Point(start.x-20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfrightCircle(new Point(start.x-20,start.y),SWT.RIGHT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 9: { if(r2==10) { PointList p1=rightCorner(new Point(end.x-20,start.y),SWT.RIGHT,10); PointList p2=rightCorner(new Point(end.x-20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfrightCircle(new Point(end.x-20,start.y),SWT.RIGHT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 10: { if(r2==10) { PointList p1=leftCorner(new Point(start.x-20,start.y),SWT.RIGHT,10); PointList p2=leftCorner(new Point(start.x-20,end.y),SWT.TOP,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfleftCircle(new Point(start.x-20,start.y),SWT.RIGHT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 11: { if(r2==10) { PointList p1=leftCorner(new Point(end.x-20,start.y),SWT.RIGHT,10); PointList p2=leftCorner(new Point(end.x-20,end.y),SWT.TOP,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfleftCircle(new Point(end.x-20,start.y),SWT.RIGHT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 12: { if (source.equals(target)) { PointList p1=leftCorner(new Point(start.x-20,start.y),SWT.RIGHT,10); PointList p2=leftCorner(new Point(start.x-20,rs.y+rs.height+15),SWT.TOP,10); PointList p3=leftCorner(new Point(end.x+20,rs.y+rs.height+15),SWT.LEFT,10); PointList p4=leftCorner(new Point(end.x+20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } else { if (Math.abs(start.y-end.y)>=40){ PointList p1=rightCorner(new Point(start.x-20,start.y),SWT.RIGHT,r2); PointList p2=rightCorner(new Point(start.x-20,end.y-(end.y-start.y)/2),SWT.BOTTOM,r2); PointList p3=leftCorner(new Point(end.x+20,end.y-(end.y-start.y)/2),SWT.LEFT,r2); PointList p4=leftCorner(new Point(end.x+20,end.y),SWT.BOTTOM,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } else{ PointList p3 =halfrightCircle(new Point(start.x-20,start.y),SWT.RIGHT,Math.abs(start.y-end.y)/4); PointList p4 =halfleftCircle(new Point(end.x+20,end.y-(end.y-start.y)/2),SWT.LEFT,Math.abs(start.y-end.y)/4); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } } break; } case 13: { PointList p1=rightCorner(new Point(start.x+(end.x-start.x)/2,start.y),SWT.RIGHT,r1); PointList p2=leftCorner(new Point(start.x+(end.x-start.x)/2,end.y),SWT.BOTTOM,r1); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); break; } case 14: { if (Math.abs(start.y-end.y)>=40){ PointList p1=leftCorner(new Point(start.x-20,start.y),SWT.RIGHT,r2); PointList p2=leftCorner(new Point(start.x-20,end.y-(end.y-start.y)/2),SWT.TOP,r2); PointList p3=rightCorner(new Point(end.x+20,end.y-(end.y-start.y)/2),SWT.LEFT,r2); PointList p4=rightCorner(new Point(end.x+20,end.y),SWT.TOP,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } else { PointList p3=halfleftCircle(new Point(start.x-20,start.y),SWT.RIGHT,Math.abs(start.y-end.y)/4); PointList p4=halfrightCircle(new Point(end.x+20,end.y-(end.y-start.y)/2),SWT.LEFT,Math.abs(start.y-end.y)/4); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } break; } case 15: { PointList p1=leftCorner(new Point(start.x+(end.x-start.x)/2,start.y),SWT.RIGHT,r1); PointList p2=rightCorner(new Point(start.x+(end.x-start.x)/2,end.y),SWT.TOP,r1); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); break; } default: } l.addPoint(end); conn.setPoints(l); conn.repaint(); }
int offset,i,r1,r2; Point start= this.getStartPoint(conn); conn.translateToRelative(start); Point end=this.getEndPoint(conn); conn.translateToRelative(end); IFigure source=conn.getSourceAnchor().getOwner(); IFigure target=conn.getTargetAnchor().getOwner(); Rectangle rs=source.getBounds().getCopy(); Rectangle rt=target.getBounds().getCopy(); if (start.y>=end.y) if (start.x<=end.x) offset=0; else offset=1; else if (start.x<=end.x) offset=2; else offset=3; if(rs.x+rs.width/2<=start.x) if (rt.x+rt.width/2>=end.x)offset+=0; else offset+=4; else if (rt.x+rt.width/2>=end.x)offset+=8; else offset+=12; if (Math.abs(start.x-end.x)>=20 &&Math.abs(start.y-end.y)>=20)r1=10; else r1=Math.min(Math.abs(start.x-end.x)/2,Math.abs(start.y-end.y)/2); if(Math.abs(start.y-end.y)>=20)r2=10; else r2=Math.abs((Math.abs(start.y-end.y))/2); PointList l=new PointList(); l.addPoint(start); switch (offset){ case 0: { PointList p1=leftCorner(new Point(end.x-((end.x-start.x)/2),start.y),SWT.LEFT,r1); PointList p2=rightCorner(new Point(end.x-((end.x-start.x)/2),end.y),SWT.BOTTOM,r1); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); break; } case 1: { if (source.equals(target)) { PointList p1=rightCorner(new Point(start.x+20,start.y),SWT.LEFT,10); PointList p2=rightCorner(new Point(start.x+20,rs.y+rs.height+15),SWT.TOP,10); PointList p3=rightCorner(new Point(end.x-20,rs.y+rs.height+15),SWT.RIGHT,10); PointList p4=rightCorner(new Point(end.x-20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } else { if(Math.abs(start.y-end.y)>=40) { PointList p1=leftCorner(new Point(start.x+20,start.y),SWT.LEFT,10); PointList p2=leftCorner(new Point(start.x+20,end.y-(end.y-start.y)/2),SWT.BOTTOM,10); PointList p3=rightCorner(new Point(end.x-20,end.y-(end.y-start.y)/2),SWT.RIGHT,10); PointList p4=rightCorner(new Point(end.x-20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } else { PointList p3=halfleftCircle(new Point(start.x+20,start.y),SWT.LEFT,Math.abs(start.y-end.y)/4); PointList p4=halfrightCircle(new Point(end.x-20,end.y-(end.y-start.y)/2),SWT.RIGHT,Math.abs(start.y-end.y)/4); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } } break; } case 2: { PointList p1=rightCorner(new Point(start.x+(end.x-start.x)/2,start.y),SWT.LEFT,r1); PointList p2=leftCorner(new Point(start.x+(end.x-start.x)/2,end.y),SWT.TOP,r1); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); break; } case 3: { if (Math.abs(start.y-end.y)>=40) { PointList p1=rightCorner(new Point(start.x+20,start.y),SWT.LEFT,10); PointList p2=rightCorner(new Point(start.x+20,end.y-(end.y-start.y)/2),SWT.TOP,10); PointList p3=leftCorner(new Point(end.x-20,end.y-(end.y-start.y)/2),SWT.RIGHT,10); PointList p4=leftCorner(new Point(end.x-20,end.y),SWT.TOP,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } else { PointList p3=halfrightCircle(new Point(start.x+20,start.y),SWT.LEFT,Math.abs(start.y-end.y)/4); PointList p4=halfleftCircle(new Point(end.x-20,end.y-(end.y-start.y)/2),SWT.RIGHT,Math.abs(start.y-end.y)/4); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } break; } case 4: { if (r2==10) { PointList p1=leftCorner(new Point(end.x+20,start.y),SWT.LEFT,10); PointList p2=leftCorner(new Point(end.x+20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfleftCircle(new Point(end.x+20,start.y),SWT.LEFT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 5: { if(r2==10) { PointList p1=leftCorner(new Point(start.x+20,start.y),SWT.LEFT,10); PointList p2=leftCorner(new Point(start.x+20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfleftCircle(new Point(start.x+20,start.y),SWT.LEFT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 6: { if(r2==10) { PointList p1=rightCorner(new Point(end.x+20,start.y),SWT.LEFT,10); PointList p2=rightCorner(new Point(end.x+20,end.y),SWT.TOP,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfrightCircle(new Point(end.x+20,start.y),SWT.LEFT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 7: { if(r2==10) { PointList p1=rightCorner(new Point(start.x+20,start.y),SWT.LEFT,10); PointList p2=rightCorner(new Point(start.x+20,end.y),SWT.TOP,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfrightCircle(new Point(start.x+20,start.y),SWT.LEFT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 8: { if(r2==10) { PointList p1=rightCorner(new Point(start.x-20,start.y),SWT.RIGHT,10); PointList p2=rightCorner(new Point(start.x-20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfrightCircle(new Point(start.x-20,start.y),SWT.RIGHT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 9: { if(r2==10) { PointList p1=rightCorner(new Point(end.x-20,start.y),SWT.RIGHT,10); PointList p2=rightCorner(new Point(end.x-20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfrightCircle(new Point(end.x-20,start.y),SWT.RIGHT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 10: { if(r2==10) { PointList p1=leftCorner(new Point(start.x-20,start.y),SWT.RIGHT,10); PointList p2=leftCorner(new Point(start.x-20,end.y),SWT.TOP,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfleftCircle(new Point(start.x-20,start.y),SWT.RIGHT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 11: { if(r2==10) { PointList p1=leftCorner(new Point(end.x-20,start.y),SWT.RIGHT,10); PointList p2=leftCorner(new Point(end.x-20,end.y),SWT.TOP,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); } else { PointList p1=halfleftCircle(new Point(end.x-20,start.y),SWT.RIGHT,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); } break; } case 12: { if (source.equals(target)) { PointList p1=leftCorner(new Point(start.x-20,start.y),SWT.RIGHT,10); PointList p2=leftCorner(new Point(start.x-20,rs.y+rs.height+15),SWT.TOP,10); PointList p3=leftCorner(new Point(end.x+20,rs.y+rs.height+15),SWT.LEFT,10); PointList p4=leftCorner(new Point(end.x+20,end.y),SWT.BOTTOM,10); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } else { if (Math.abs(start.y-end.y)>=40){ PointList p1=rightCorner(new Point(start.x-20,start.y),SWT.RIGHT,r2); PointList p2=rightCorner(new Point(start.x-20,end.y-(end.y-start.y)/2),SWT.BOTTOM,r2); PointList p3=leftCorner(new Point(end.x+20,end.y-(end.y-start.y)/2),SWT.LEFT,r2); PointList p4=leftCorner(new Point(end.x+20,end.y),SWT.BOTTOM,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } else{ PointList p3 =halfrightCircle(new Point(start.x-20,start.y),SWT.RIGHT,Math.abs(start.y-end.y)/4); PointList p4 =halfleftCircle(new Point(end.x+20,end.y-(end.y-start.y)/2),SWT.LEFT,Math.abs(start.y-end.y)/4); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } } break; } case 13: { PointList p1=rightCorner(new Point(start.x+(end.x-start.x)/2,start.y),SWT.RIGHT,r1); PointList p2=leftCorner(new Point(start.x+(end.x-start.x)/2,end.y),SWT.BOTTOM,r1); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); break; } case 14: { if (Math.abs(start.y-end.y)>=40){ PointList p1=leftCorner(new Point(start.x-20,start.y),SWT.RIGHT,r2); PointList p2=leftCorner(new Point(start.x-20,end.y-(end.y-start.y)/2),SWT.TOP,r2); PointList p3=rightCorner(new Point(end.x+20,end.y-(end.y-start.y)/2),SWT.LEFT,r2); PointList p4=rightCorner(new Point(end.x+20,end.y),SWT.TOP,r2); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } else { PointList p3=halfleftCircle(new Point(start.x-20,start.y),SWT.RIGHT,Math.abs(start.y-end.y)/4); PointList p4=halfrightCircle(new Point(end.x+20,end.y-(end.y-start.y)/2),SWT.LEFT,Math.abs(start.y-end.y)/4); for(i=0;i<p3.size();i++) l.addPoint(p3.getPoint(i)); for(i=0;i<p4.size();i++) l.addPoint(p4.getPoint(i)); } break; } case 15: { PointList p1=leftCorner(new Point(start.x+(end.x-start.x)/2,start.y),SWT.RIGHT,r1); PointList p2=rightCorner(new Point(start.x+(end.x-start.x)/2,end.y),SWT.TOP,r1); for(i=0;i<p1.size();i++) l.addPoint(p1.getPoint(i)); for(i=0;i<p2.size();i++) l.addPoint(p2.getPoint(i)); break; } default: } l.addPoint(end); conn.setPoints(l); conn.repaint(); }
/** * Routes the Connection. * @param conn The Connection to route * @see org.eclipse.draw2d.ConnectionRouter#route(org.eclipse.draw2d.Connection) */
Routes the Connection
route
{ "repo_name": "jurkov/j-algo-mod", "path": "relicts/org/jalgo/main/gfx/RoundedManhattanConnectionRouter.java", "license": "gpl-2.0", "size": 16156 }
[ "org.eclipse.draw2d.IFigure", "org.eclipse.draw2d.geometry.Point", "org.eclipse.draw2d.geometry.PointList", "org.eclipse.draw2d.geometry.Rectangle" ]
import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.geometry.Point; import org.eclipse.draw2d.geometry.PointList; import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.draw2d.*; import org.eclipse.draw2d.geometry.*;
[ "org.eclipse.draw2d" ]
org.eclipse.draw2d;
2,380,741
private static boolean prefetch( final Repository repository, final String path, final MavenPathParser mavenPathParser) throws IOException { MavenPath mavenPath = mavenPathParser.parsePath(path); Request getRequest = new Request.Builder() .action(GET) .path(path) .build(); Context context = new Context(repository, getRequest); context.getAttributes().set(MavenPath.class, mavenPath); return repository.facet(ProxyFacet.class).get(context) != null; }
static boolean function( final Repository repository, final String path, final MavenPathParser mavenPathParser) throws IOException { MavenPath mavenPath = mavenPathParser.parsePath(path); Request getRequest = new Request.Builder() .action(GET) .path(path) .build(); Context context = new Context(repository, getRequest); context.getAttributes().set(MavenPath.class, mavenPath); return repository.facet(ProxyFacet.class).get(context) != null; }
/** * Primes proxy cache with given path and return {@code true} if succeeds. Accepts only maven proxy type. */
Primes proxy cache with given path and return true if succeeds. Accepts only maven proxy type
prefetch
{ "repo_name": "sonatype/nexus-public", "path": "plugins/nexus-repository-maven/src/main/java/org/sonatype/nexus/repository/maven/internal/MavenIndexPublisher.java", "license": "epl-1.0", "size": 13477 }
[ "java.io.IOException", "org.sonatype.nexus.repository.Repository", "org.sonatype.nexus.repository.maven.MavenPath", "org.sonatype.nexus.repository.maven.MavenPathParser", "org.sonatype.nexus.repository.proxy.ProxyFacet", "org.sonatype.nexus.repository.view.Context", "org.sonatype.nexus.repository.view.Request" ]
import java.io.IOException; import org.sonatype.nexus.repository.Repository; import org.sonatype.nexus.repository.maven.MavenPath; import org.sonatype.nexus.repository.maven.MavenPathParser; import org.sonatype.nexus.repository.proxy.ProxyFacet; import org.sonatype.nexus.repository.view.Context; import org.sonatype.nexus.repository.view.Request;
import java.io.*; import org.sonatype.nexus.repository.*; import org.sonatype.nexus.repository.maven.*; import org.sonatype.nexus.repository.proxy.*; import org.sonatype.nexus.repository.view.*;
[ "java.io", "org.sonatype.nexus" ]
java.io; org.sonatype.nexus;
1,483,346
public Object invoke(Environment targetEnv, String actionName, Object[] params, String[] signature) throws MBeanException { if (actionName == null) { throw new IllegalArgumentException("actionName cannot be null"); } try { if (targetEnv != null) { if (actionName.equals(OP_CLEAN)) { int numFiles = targetEnv.cleanLog(); return new Integer(numFiles); } else if (actionName.equals(OP_EVICT)) { targetEnv.evictMemory(); return null; } else if (actionName.equals(OP_CHECKPOINT)) { CheckpointConfig config = new CheckpointConfig(); if ((params != null) && (params.length > 0)) { Boolean force = (Boolean) params[0]; config.setForce(force.booleanValue()); } targetEnv.checkpoint(config); return null; } else if (actionName.equals(OP_SYNC)) { targetEnv.sync(); return null; } else if (actionName.equals(OP_ENV_STAT)) { return targetEnv.getStats (getStatsConfig(params)).toString(); } else if (actionName.equals(OP_TXN_STAT)) { return targetEnv.getTransactionStats (getStatsConfig(params)).toString(); } else if (actionName.equals(OP_DB_NAMES)) { return targetEnv.getDatabaseNames(); } else if (actionName.equals(OP_DB_STAT)) { DatabaseStats stats = getDatabaseStats(targetEnv, params); return stats != null ? stats.toString() : null; } } return new IllegalArgumentException ("actionName: " + actionName + " is not valid"); } catch (Exception e) { throw new MBeanException(e, e.getMessage()); } }
Object function(Environment targetEnv, String actionName, Object[] params, String[] signature) throws MBeanException { if (actionName == null) { throw new IllegalArgumentException(STR); } try { if (targetEnv != null) { if (actionName.equals(OP_CLEAN)) { int numFiles = targetEnv.cleanLog(); return new Integer(numFiles); } else if (actionName.equals(OP_EVICT)) { targetEnv.evictMemory(); return null; } else if (actionName.equals(OP_CHECKPOINT)) { CheckpointConfig config = new CheckpointConfig(); if ((params != null) && (params.length > 0)) { Boolean force = (Boolean) params[0]; config.setForce(force.booleanValue()); } targetEnv.checkpoint(config); return null; } else if (actionName.equals(OP_SYNC)) { targetEnv.sync(); return null; } else if (actionName.equals(OP_ENV_STAT)) { return targetEnv.getStats (getStatsConfig(params)).toString(); } else if (actionName.equals(OP_TXN_STAT)) { return targetEnv.getTransactionStats (getStatsConfig(params)).toString(); } else if (actionName.equals(OP_DB_NAMES)) { return targetEnv.getDatabaseNames(); } else if (actionName.equals(OP_DB_STAT)) { DatabaseStats stats = getDatabaseStats(targetEnv, params); return stats != null ? stats.toString() : null; } } return new IllegalArgumentException (STR + actionName + STR); } catch (Exception e) { throw new MBeanException(e, e.getMessage()); } }
/** * Invoke an operation for the given environment. * * @param targetEnv The target JE environment. May be null if the * environment is not open. * @param actionName operation name. * @param params operation parameters. May be null. * @param signature operation signature. May be null. * @return the operation result */
Invoke an operation for the given environment
invoke
{ "repo_name": "prat0318/dbms", "path": "mini_dbms/je-5.0.103/src/com/sleepycat/je/jmx/JEMBeanHelper.java", "license": "mit", "size": 31637 }
[ "com.sleepycat.je.CheckpointConfig", "com.sleepycat.je.DatabaseStats", "com.sleepycat.je.Environment", "javax.management.MBeanException" ]
import com.sleepycat.je.CheckpointConfig; import com.sleepycat.je.DatabaseStats; import com.sleepycat.je.Environment; import javax.management.MBeanException;
import com.sleepycat.je.*; import javax.management.*;
[ "com.sleepycat.je", "javax.management" ]
com.sleepycat.je; javax.management;
885,171
public double[][] getBounds() { return TriangleUtil.copy(bounds); }
double[][] function() { return TriangleUtil.copy(bounds); }
/** * Returns all bounds. Modifying the retunred array does not affect * the internal state of this instance. */
Returns all bounds. Modifying the retunred array does not affect the internal state of this instance
getBounds
{ "repo_name": "Depter/JRLib", "path": "NetbeansProject/jrlib/src/main/java/org/jreserve/jrlib/bootstrap/util/HistogramData.java", "license": "lgpl-3.0", "size": 5513 }
[ "org.jreserve.jrlib.triangle.TriangleUtil" ]
import org.jreserve.jrlib.triangle.TriangleUtil;
import org.jreserve.jrlib.triangle.*;
[ "org.jreserve.jrlib" ]
org.jreserve.jrlib;
1,157,737
public @Nullable Double getSecondaryPriority() { return getCheck().getSecondaryPriority(this); }
@Nullable Double function() { return getCheck().getSecondaryPriority(this); }
/** * Gets a secondary priority for the result. * * @see AccessibilityHierarchyCheck#getSecondaryPriority */
Gets a secondary priority for the result
getSecondaryPriority
{ "repo_name": "google/Accessibility-Test-Framework-for-Android", "path": "src/main/java/com/google/android/apps/common/testing/accessibility/framework/AccessibilityHierarchyCheckResult.java", "license": "apache-2.0", "size": 10943 }
[ "org.checkerframework.checker.nullness.qual.Nullable" ]
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.checker.nullness.qual.*;
[ "org.checkerframework.checker" ]
org.checkerframework.checker;
268,947
public Duration getGossipInterval() { return gossipInterval; }
Duration function() { return gossipInterval; }
/** * Returns the gossip interval. * * @return the gossip interval */
Returns the gossip interval
getGossipInterval
{ "repo_name": "kuujo/copycat", "path": "protocols/gossip/src/main/java/io/atomix/protocols/gossip/CrdtProtocolConfig.java", "license": "apache-2.0", "size": 2565 }
[ "java.time.Duration" ]
import java.time.Duration;
import java.time.*;
[ "java.time" ]
java.time;
1,548,251
protected void fireTreeNodeInserted(TreeNode insertedNode) { if ( !showContents ) { // there has to be a much better way of // doing this but do it the inefficient way // for now. setRoot(root); int index = flatNodes.indexOf(insertedNode); fireTableRowsInserted(index,index); } // Guaranteed to return a non-null array Object[] ls = listeners.getListenerList(); TreeModelEvent e = null; // Process the listeners last to first, notifying // those that are interested in this event for (int i = ls.length - 2; i >= 0; i -= 2) { if (ls[i] == TreeModelListener.class) { // Lazily create the event: if (e == null) { if (insertedNode == root) { e = new TreeModelEvent(this, getPathToRoot(insertedNode.getParent()), null, null); } else { e = new TreeModelEvent(this, getPathToRoot(insertedNode.getParent()), new int[] { insertedNode.getParent().indexOf( insertedNode) }, new Object[] { insertedNode }); } } ((TreeModelListener) ls[i + 1]).treeNodesInserted(e); } } }
void function(TreeNode insertedNode) { if ( !showContents ) { setRoot(root); int index = flatNodes.indexOf(insertedNode); fireTableRowsInserted(index,index); } Object[] ls = listeners.getListenerList(); TreeModelEvent e = null; for (int i = ls.length - 2; i >= 0; i -= 2) { if (ls[i] == TreeModelListener.class) { if (e == null) { if (insertedNode == root) { e = new TreeModelEvent(this, getPathToRoot(insertedNode.getParent()), null, null); } else { e = new TreeModelEvent(this, getPathToRoot(insertedNode.getParent()), new int[] { insertedNode.getParent().indexOf( insertedNode) }, new Object[] { insertedNode }); } } ((TreeModelListener) ls[i + 1]).treeNodesInserted(e); } } }
/** * Invoked after nodes have been inserted into the tree. */
Invoked after nodes have been inserted into the tree
fireTreeNodeInserted
{ "repo_name": "belteshazzar/oors", "path": "oors/src/org/oors/ui/common/TreeTableModel.java", "license": "bsd-2-clause", "size": 17639 }
[ "javax.swing.event.TreeModelEvent", "javax.swing.event.TreeModelListener" ]
import javax.swing.event.TreeModelEvent; import javax.swing.event.TreeModelListener;
import javax.swing.event.*;
[ "javax.swing" ]
javax.swing;
725,273
public boolean isHttp10() { return protocol.equals(Protocols.HTTP_1_0); }
boolean function() { return protocol.equals(Protocols.HTTP_1_0); }
/** * Determine whether this request conforms to HTTP 1.0. * * @return {@code true} if the request protocol is equal to {@link Protocols#HTTP_1_0}, {@code false} otherwise */
Determine whether this request conforms to HTTP 1.0
isHttp10
{ "repo_name": "n1hility/undertow", "path": "core/src/main/java/io/undertow/server/HttpServerExchange.java", "license": "apache-2.0", "size": 85558 }
[ "io.undertow.util.Protocols" ]
import io.undertow.util.Protocols;
import io.undertow.util.*;
[ "io.undertow.util" ]
io.undertow.util;
2,854,845
public long getDistanceCallbackPeriod() throws TimeoutException, NotConnectedException { ByteBuffer bb = ipcon.createRequestPacket((byte)8, FUNCTION_GET_DISTANCE_CALLBACK_PERIOD, this); byte[] response = sendRequest(bb.array()); bb = ByteBuffer.wrap(response, 8, response.length - 8); bb.order(ByteOrder.LITTLE_ENDIAN); long period = IPConnection.unsignedInt(bb.getInt()); return period; }
long function() throws TimeoutException, NotConnectedException { ByteBuffer bb = ipcon.createRequestPacket((byte)8, FUNCTION_GET_DISTANCE_CALLBACK_PERIOD, this); byte[] response = sendRequest(bb.array()); bb = ByteBuffer.wrap(response, 8, response.length - 8); bb.order(ByteOrder.LITTLE_ENDIAN); long period = IPConnection.unsignedInt(bb.getInt()); return period; }
/** * Returns the period as set by {@link BrickletDistanceIR#setDistanceCallbackPeriod(long)}. */
Returns the period as set by <code>BrickletDistanceIR#setDistanceCallbackPeriod(long)</code>
getDistanceCallbackPeriod
{ "repo_name": "jaggr2/ch.bfh.fbi.mobiComp.17herz", "path": "com.tinkerforge/src/com/tinkerforge/BrickletDistanceIR.java", "license": "apache-2.0", "size": 22241 }
[ "java.nio.ByteBuffer", "java.nio.ByteOrder" ]
import java.nio.ByteBuffer; import java.nio.ByteOrder;
import java.nio.*;
[ "java.nio" ]
java.nio;
58,928
public Date getUpdateTimestamp() { return updateTimestamp; }
Date function() { return updateTimestamp; }
/** * <p> * Getter for the field <code>updateTimestamp</code>. * </p> * * @return a {@link java.util.Date} object. */
Getter for the field <code>updateTimestamp</code>.
getUpdateTimestamp
{ "repo_name": "joansmith/seqware", "path": "seqware-common/src/main/java/net/sourceforge/seqware/common/model/Registration.java", "license": "gpl-3.0", "size": 12065 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,703,545
protected void formatRegion(IXtextDocument document, int offset, int length) { try { final int startRegionOffset = document.getLineInformationOfOffset( previousSiblingChar(document, offset)).getOffset(); final IRegion endLine = document.getLineInformationOfOffset(offset + length); final int endRegionOffset = endLine.getOffset() + endLine.getLength(); final int regionLength = endRegionOffset - startRegionOffset; for (final IRegion region : document.computePartitioning(startRegionOffset, regionLength)) { this.contentFormatter.format(document, region); } } catch (BadLocationException exception) { Exceptions.sneakyThrow(exception); } }
void function(IXtextDocument document, int offset, int length) { try { final int startRegionOffset = document.getLineInformationOfOffset( previousSiblingChar(document, offset)).getOffset(); final IRegion endLine = document.getLineInformationOfOffset(offset + length); final int endRegionOffset = endLine.getOffset() + endLine.getLength(); final int regionLength = endRegionOffset - startRegionOffset; for (final IRegion region : document.computePartitioning(startRegionOffset, regionLength)) { this.contentFormatter.format(document, region); } } catch (BadLocationException exception) { Exceptions.sneakyThrow(exception); } }
/** Called for formatting a region. * * @param document the document to format. * @param offset the offset of the text to format. * @param length the length of the text. */
Called for formatting a region
formatRegion
{ "repo_name": "jgfoster/sarl", "path": "main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/editor/DocumentAutoFormatter.java", "license": "apache-2.0", "size": 5162 }
[ "org.eclipse.jface.text.BadLocationException", "org.eclipse.jface.text.IRegion", "org.eclipse.xtext.ui.editor.model.IXtextDocument", "org.eclipse.xtext.xbase.lib.Exceptions" ]
import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IRegion; import org.eclipse.xtext.ui.editor.model.IXtextDocument; import org.eclipse.xtext.xbase.lib.Exceptions;
import org.eclipse.jface.text.*; import org.eclipse.xtext.ui.editor.model.*; import org.eclipse.xtext.xbase.lib.*;
[ "org.eclipse.jface", "org.eclipse.xtext" ]
org.eclipse.jface; org.eclipse.xtext;
1,065,939
@Nullable public Chunk loadChunk(World worldIn, int x, int z) throws IOException { Object[] data = this.loadChunk__Async(worldIn, x, z); if (data != null) { Chunk chunk = (Chunk) data[0]; NBTTagCompound nbttagcompound = (NBTTagCompound) data[1]; this.loadEntities(worldIn, nbttagcompound.getCompoundTag("Level"), chunk); return chunk; } return null; }
Chunk function(World worldIn, int x, int z) throws IOException { Object[] data = this.loadChunk__Async(worldIn, x, z); if (data != null) { Chunk chunk = (Chunk) data[0]; NBTTagCompound nbttagcompound = (NBTTagCompound) data[1]; this.loadEntities(worldIn, nbttagcompound.getCompoundTag("Level"), chunk); return chunk; } return null; }
/** * Loads the specified(XZ) chunk into the specified world. */
Loads the specified(XZ) chunk into the specified world
loadChunk
{ "repo_name": "Im-Jrotica/forge_latest", "path": "build/tmp/recompileMc/sources/net/minecraft/world/chunk/storage/AnvilChunkLoader.java", "license": "lgpl-2.1", "size": 25079 }
[ "java.io.IOException", "net.minecraft.nbt.NBTTagCompound", "net.minecraft.world.World", "net.minecraft.world.chunk.Chunk" ]
import java.io.IOException; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk;
import java.io.*; import net.minecraft.nbt.*; import net.minecraft.world.*; import net.minecraft.world.chunk.*;
[ "java.io", "net.minecraft.nbt", "net.minecraft.world" ]
java.io; net.minecraft.nbt; net.minecraft.world;
1,211,722
private JCheckBox getJDeviceHTTPSendCheckBox() { if (jDeviceHTTPSendCheckBox == null) { jDeviceHTTPSendCheckBox = new JCheckBox(); jDeviceHTTPSendCheckBox.setFont(new Font("SansSerif", Font.PLAIN, 12)); jDeviceHTTPSendCheckBox.setText("Kann senden HTTP"); } return jDeviceHTTPSendCheckBox; }
JCheckBox function() { if (jDeviceHTTPSendCheckBox == null) { jDeviceHTTPSendCheckBox = new JCheckBox(); jDeviceHTTPSendCheckBox.setFont(new Font(STR, Font.PLAIN, 12)); jDeviceHTTPSendCheckBox.setText(STR); } return jDeviceHTTPSendCheckBox; }
/** * This method initializes jCheckBox3 * * @return javax.swing.JCheckBox */
This method initializes jCheckBox3
getJDeviceHTTPSendCheckBox
{ "repo_name": "fraunhoferfokus/fokus-upnp", "path": "upnp-gui/src/main/java/de/fraunhofer/fokus/upnp/gateway/examples/internet/RouterCheck.java", "license": "gpl-3.0", "size": 30031 }
[ "java.awt.Font", "javax.swing.JCheckBox" ]
import java.awt.Font; import javax.swing.JCheckBox;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
92,373
public void setReadingConstraint(Reading constraint) { Reading invertedConstraint = new Reading(constraint.start, constraint.length, TextUtil.invertKanaCase(constraint.text)); sentence.setReadingConstraint(invertedConstraint); needsAnalysis = true; }
void function(Reading constraint) { Reading invertedConstraint = new Reading(constraint.start, constraint.length, TextUtil.invertKanaCase(constraint.text)); sentence.setReadingConstraint(invertedConstraint); needsAnalysis = true; }
/** * Sets a reading constraint on the currently analysed text.<br> * Note: In contrast to constraints set directly on a Viterbi instance, * there is no need to pass the constraint in katakana; the exact reading * text supplied will appear in the analysed readings * * @param constraint */
Sets a reading constraint on the currently analysed text. Note: In contrast to constraints set directly on a Viterbi instance, there is no need to pass the constraint in katakana; the exact reading text supplied will appear in the analysed readings
setReadingConstraint
{ "repo_name": "aymkam/lucene-gosen", "path": "src/java/net/java/sen/ReadingProcessor.java", "license": "lgpl-2.1", "size": 20299 }
[ "net.java.sen.dictionary.Reading", "net.java.sen.util.TextUtil" ]
import net.java.sen.dictionary.Reading; import net.java.sen.util.TextUtil;
import net.java.sen.dictionary.*; import net.java.sen.util.*;
[ "net.java.sen" ]
net.java.sen;
879,067
public final Loader selectRootLoader( UnmarshallingContext.State state, TagName tag ) { JaxBeanInfo beanInfo = rootMap.get(tag.uri,tag.local); if(beanInfo==null) return null; return beanInfo.getLoader(this,true); }
final Loader function( UnmarshallingContext.State state, TagName tag ) { JaxBeanInfo beanInfo = rootMap.get(tag.uri,tag.local); if(beanInfo==null) return null; return beanInfo.getLoader(this,true); }
/** * Based on the tag name, determine what object to unmarshal, * and then set a new object and its loader to the current unmarshaller state. * * @return * null if the given name pair is not recognized. */
Based on the tag name, determine what object to unmarshal, and then set a new object and its loader to the current unmarshaller state
selectRootLoader
{ "repo_name": "TheTypoMaster/Scaper", "path": "openjdk/jaxws/drop_included/jaxws_src/src/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java", "license": "gpl-2.0", "size": 39022 }
[ "com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader", "com.sun.xml.internal.bind.v2.runtime.unmarshaller.TagName", "com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext" ]
import com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader; import com.sun.xml.internal.bind.v2.runtime.unmarshaller.TagName; import com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext;
import com.sun.xml.internal.bind.v2.runtime.unmarshaller.*;
[ "com.sun.xml" ]
com.sun.xml;
1,067,735
public static RequestTimeline of(final Event... events) { return new RequestTimeline(ImmutableList.copyOf(events)); }
static RequestTimeline function(final Event... events) { return new RequestTimeline(ImmutableList.copyOf(events)); }
/** * Returns a new {@link RequestTimeline} with an arbitrary number of events. * * @return a new {@link RequestTimeline} with an arbitrary number of events. */
Returns a new <code>RequestTimeline</code> with an arbitrary number of events
of
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/RequestTimeline.java", "license": "mit", "size": 7202 }
[ "com.azure.cosmos.implementation.guava25.collect.ImmutableList" ]
import com.azure.cosmos.implementation.guava25.collect.ImmutableList;
import com.azure.cosmos.implementation.guava25.collect.*;
[ "com.azure.cosmos" ]
com.azure.cosmos;
758,700
public void afterPhase(PhaseEvent event) { if(event.getPhaseId() == PhaseId.APPLY_REQUEST_VALUES || event.getPhaseId() == PhaseId.PROCESS_VALIDATIONS || event.getPhaseId() == PhaseId.UPDATE_MODEL_VALUES || event.getPhaseId() == PhaseId.INVOKE_APPLICATION) { FacesContext facesContext = event.getFacesContext(); saveMessages(facesContext); } }
void function(PhaseEvent event) { if(event.getPhaseId() == PhaseId.APPLY_REQUEST_VALUES event.getPhaseId() == PhaseId.PROCESS_VALIDATIONS event.getPhaseId() == PhaseId.UPDATE_MODEL_VALUES event.getPhaseId() == PhaseId.INVOKE_APPLICATION) { FacesContext facesContext = event.getFacesContext(); saveMessages(facesContext); } }
/** * Handle a notification that the processing for a particular phase has just * been completed. */
Handle a notification that the processing for a particular phase has just been completed
afterPhase
{ "repo_name": "hantsy/spring4-sandbox", "path": "mvc-jsf2/src/main/java/com/hantsylabs/example/spring/faces/MessageHandler.java", "license": "apache-2.0", "size": 4641 }
[ "javax.faces.context.FacesContext", "javax.faces.event.PhaseEvent", "javax.faces.event.PhaseId" ]
import javax.faces.context.FacesContext; import javax.faces.event.PhaseEvent; import javax.faces.event.PhaseId;
import javax.faces.context.*; import javax.faces.event.*;
[ "javax.faces" ]
javax.faces;
1,543,263
public static void printStackTrace(Thread thread, Throwable throwable, PrintWriter writer) { printStackTrace(thread, throwable, writer, Svetovid.LOCALE); }
static void function(Thread thread, Throwable throwable, PrintWriter writer) { printStackTrace(thread, throwable, writer, Svetovid.LOCALE); }
/** * Prints the supplied throwable and its stack trace to the specified print * writer. If the thread is supplied also, its name is printed before the * throwable. * * @param thread * the thread on which the throwable was thrown; if it is * {@code null} no thread info is printed * @param throwable * the throwable whose stack trace is to be printed * @param writer * {@code PrintWriter} to use for output */
Prints the supplied throwable and its stack trace to the specified print writer. If the thread is supplied also, its name is printed before the throwable
printStackTrace
{ "repo_name": "ivanpribela/svetovid-lib", "path": "src/org/svetovid/SvetovidException.java", "license": "apache-2.0", "size": 16386 }
[ "java.io.PrintWriter" ]
import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
2,615,215
protected VirtualFileSystemInode loadInode(String path) throws FileNotFoundException { String fullPath = fileSystemPath + path; //logger.debug("Loading inode - " + fullPath); File xmlFile = new File(fullPath); File realDirectory = null; if (xmlFile.isDirectory()) { realDirectory = xmlFile; fullPath = fullPath + separator + dirName; xmlFile = new File(fullPath); } XMLDecoder xmlDec = null; try { xmlDec = new XMLDecoder(new BufferedInputStream( new FileInputStream(fullPath))); xmlDec.setExceptionListener(new VFSExceptionListener(fullPath)); ClassLoader prevCL = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(CommonPluginUtils.getClassLoaderForObject(this)); VirtualFileSystemInode inode = (VirtualFileSystemInode) xmlDec .readObject(); Thread.currentThread().setContextClassLoader(prevCL); inode.setName(getLast(path)); if (inode.isDirectory()) { VirtualFileSystemDirectory dir = (VirtualFileSystemDirectory) inode; dir.setFiles(realDirectory.list(dirFilter)); } inode.inodeLoadCompleted(); return inode; } catch (Exception e) { logger.error("Failed to load inode fullPath - " + fullPath, e); boolean corruptedXMLFile = xmlFile.exists(); if (corruptedXMLFile) { // parsing error! Let's get rid of the offending bugger xmlFile.delete(); } // if this object is the Root object, let's create it and get outta // here if (getLast(path).equals(separator)) { return createRootDirectory(); } VirtualFileSystemDirectory parentInode = null; { VirtualFileSystemInode inode = getInodeByPath(stripLast(path)); if (inode.isDirectory()) { parentInode = (VirtualFileSystemDirectory) inode; } else { // the parent is a Directory on the REAL filesystem and // a something else on our virtual one... throw new FileNotFoundException( "You're filesystem is really messed up"); } } if (realDirectory != null && realDirectory.exists()) { // let's create the .dirProperties file from what we know since // it should be there parentInode.createDirectoryRaw(getLast(path), "drftpd", "drftpd"); return parentInode.getInodeByName(getLast(path)); } if (corruptedXMLFile) { // we already deleted the file, but we need to tell the parent // directory that it doesn't exist anymore logger .debug("Error loading " + fullPath + ", deleting file", e); parentInode.removeMissingChild(getLast(path)); } throw new FileNotFoundException(); } finally { if (xmlDec != null) { xmlDec.close(); } } }
VirtualFileSystemInode function(String path) throws FileNotFoundException { String fullPath = fileSystemPath + path; File xmlFile = new File(fullPath); File realDirectory = null; if (xmlFile.isDirectory()) { realDirectory = xmlFile; fullPath = fullPath + separator + dirName; xmlFile = new File(fullPath); } XMLDecoder xmlDec = null; try { xmlDec = new XMLDecoder(new BufferedInputStream( new FileInputStream(fullPath))); xmlDec.setExceptionListener(new VFSExceptionListener(fullPath)); ClassLoader prevCL = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(CommonPluginUtils.getClassLoaderForObject(this)); VirtualFileSystemInode inode = (VirtualFileSystemInode) xmlDec .readObject(); Thread.currentThread().setContextClassLoader(prevCL); inode.setName(getLast(path)); if (inode.isDirectory()) { VirtualFileSystemDirectory dir = (VirtualFileSystemDirectory) inode; dir.setFiles(realDirectory.list(dirFilter)); } inode.inodeLoadCompleted(); return inode; } catch (Exception e) { logger.error(STR + fullPath, e); boolean corruptedXMLFile = xmlFile.exists(); if (corruptedXMLFile) { xmlFile.delete(); } if (getLast(path).equals(separator)) { return createRootDirectory(); } VirtualFileSystemDirectory parentInode = null; { VirtualFileSystemInode inode = getInodeByPath(stripLast(path)); if (inode.isDirectory()) { parentInode = (VirtualFileSystemDirectory) inode; } else { throw new FileNotFoundException( STR); } } if (realDirectory != null && realDirectory.exists()) { parentInode.createDirectoryRaw(getLast(path), STR, STR); return parentInode.getInodeByName(getLast(path)); } if (corruptedXMLFile) { logger .debug(STR + fullPath + STR, e); parentInode.removeMissingChild(getLast(path)); } throw new FileNotFoundException(); } finally { if (xmlDec != null) { xmlDec.close(); } } }
/** * Accepts a String path that starts with "/" and unserializes the requested * Inode */
Accepts a String path that starts with "/" and unserializes the requested Inode
loadInode
{ "repo_name": "dr3plus/dr3", "path": "src/master/src/org/drftpd/vfs/VirtualFileSystem.java", "license": "gpl-2.0", "size": 14635 }
[ "java.beans.XMLDecoder", "java.io.BufferedInputStream", "java.io.File", "java.io.FileInputStream", "java.io.FileNotFoundException", "org.drftpd.util.CommonPluginUtils" ]
import java.beans.XMLDecoder; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import org.drftpd.util.CommonPluginUtils;
import java.beans.*; import java.io.*; import org.drftpd.util.*;
[ "java.beans", "java.io", "org.drftpd.util" ]
java.beans; java.io; org.drftpd.util;
2,856,371
public void printJob(PrinterJob job) { Frame frame = this.getFrame(); dialog = new PrintDialog(frame, false); dialog.pack(); if (frame != null) this.centerDialogInFrame(dialog, frame);
void function(PrinterJob job) { Frame frame = this.getFrame(); dialog = new PrintDialog(frame, false); dialog.pack(); if (frame != null) this.centerDialogInFrame(dialog, frame);
/** * Print this job. * @param job */
Print this job
printJob
{ "repo_name": "jbundle/jbundle", "path": "thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/print/ScreenPrinter.java", "license": "gpl-3.0", "size": 9142 }
[ "java.awt.Frame", "java.awt.print.PrinterJob" ]
import java.awt.Frame; import java.awt.print.PrinterJob;
import java.awt.*; import java.awt.print.*;
[ "java.awt" ]
java.awt;
763,832
public static String decodeParameter(String input) { String result = CmsStringUtil.substitute(input, ENTITY_REPLACEMENT, ENTITY_PREFIX); return CmsEncoder.decodeHtmlEntities(result, OpenCms.getSystemInfo().getDefaultEncoding()); }
static String function(String input) { String result = CmsStringUtil.substitute(input, ENTITY_REPLACEMENT, ENTITY_PREFIX); return CmsEncoder.decodeHtmlEntities(result, OpenCms.getSystemInfo().getDefaultEncoding()); }
/** * Decodes a string used as parameter in an uri in a way independent of other encodings/decodings applied before.<p> * * @param input the encoded parameter string * * @return the decoded parameter string * * @see #encodeParameter(String) */
Decodes a string used as parameter in an uri in a way independent of other encodings/decodings applied before
decodeParameter
{ "repo_name": "alkacon/opencms-core", "path": "src/org/opencms/i18n/CmsEncoder.java", "license": "lgpl-2.1", "size": 34873 }
[ "org.opencms.main.OpenCms", "org.opencms.util.CmsStringUtil" ]
import org.opencms.main.OpenCms; import org.opencms.util.CmsStringUtil;
import org.opencms.main.*; import org.opencms.util.*;
[ "org.opencms.main", "org.opencms.util" ]
org.opencms.main; org.opencms.util;
1,789,989
public void setPlayers(List<String> players) { this.players = players != null ? new ArrayList<>(players) : new ArrayList<>(); } public static class ProtocolInfo { private final int id; private final String name; public ProtocolInfo(int id, String name) { this.id = id; this.name = name; } public ProtocolInfo(ProtocolVersion version, String name) { this(version.getId(), name); }
void function(List<String> players) { this.players = players != null ? new ArrayList<>(players) : new ArrayList<>(); } public static class ProtocolInfo { private final int id; private final String name; public ProtocolInfo(int id, String name) { this.id = id; this.name = name; } public ProtocolInfo(ProtocolVersion version, String name) { this(version.getId(), name); }
/** * Sets player list * @param players player list */
Sets player list
setPlayers
{ "repo_name": "ProtocolSupport/ProtocolSupport", "path": "src/protocolsupport/api/events/ServerPingResponseEvent.java", "license": "agpl-3.0", "size": 4705 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,717,705
@Required public void setSessionFactory(final SessionFactory _factory) { this.factory = _factory; }
void function(final SessionFactory _factory) { this.factory = _factory; }
/** * Setter for session factory. Spring will use this to inject the session * factory into the dao. * * @param _factory * hibernate session factory */
Setter for session factory. Spring will use this to inject the session factory into the dao
setSessionFactory
{ "repo_name": "AlienQueen/alienlabs-skeleton-for-wicket-spring-hibernate", "path": "src/main/java/org/alienlabs/amazon/persistence/dao/AmazonDaoImpl.java", "license": "agpl-3.0", "size": 2851 }
[ "org.hibernate.SessionFactory" ]
import org.hibernate.SessionFactory;
import org.hibernate.*;
[ "org.hibernate" ]
org.hibernate;
1,912,607
public void doHelp_items(RunData data) { SessionState state = ((JetspeedRunData) data) .getPortletSessionState(((JetspeedRunData) data).getJs_peid()); ParameterParser params = data.getParameters(); TaggingManager taggingManager = (TaggingManager) ComponentManager .get("org.sakaiproject.taggable.api.TaggingManager"); TaggingProvider provider = taggingManager.findProviderById(params .getString(PROVIDER_ID)); String activityRef = params.getString(ACTIVITY_REF); TaggingHelperInfo helperInfo = provider .getItemsHelperInfo(activityRef); // get into helper mode with this helper tool startHelper(data.getRequest(), helperInfo.getHelperId()); Map<String, ? extends Object> helperParms = helperInfo .getParameterMap(); for (Map.Entry<String, ? extends Object> entry : helperParms.entrySet()) { state.setAttribute(entry.getKey(), entry.getValue()); } } // doHelp_items
void function(RunData data) { SessionState state = ((JetspeedRunData) data) .getPortletSessionState(((JetspeedRunData) data).getJs_peid()); ParameterParser params = data.getParameters(); TaggingManager taggingManager = (TaggingManager) ComponentManager .get(STR); TaggingProvider provider = taggingManager.findProviderById(params .getString(PROVIDER_ID)); String activityRef = params.getString(ACTIVITY_REF); TaggingHelperInfo helperInfo = provider .getItemsHelperInfo(activityRef); startHelper(data.getRequest(), helperInfo.getHelperId()); Map<String, ? extends Object> helperParms = helperInfo .getParameterMap(); for (Map.Entry<String, ? extends Object> entry : helperParms.entrySet()) { state.setAttribute(entry.getKey(), entry.getValue()); } }
/** * Action is to tag items via an items tagging helper */
Action is to tag items via an items tagging helper
doHelp_items
{ "repo_name": "eemirtekin/Sakai-10.6-TR", "path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java", "license": "apache-2.0", "size": 631432 }
[ "java.util.Map", "org.sakaiproject.cheftool.JetspeedRunData", "org.sakaiproject.cheftool.RunData", "org.sakaiproject.component.cover.ComponentManager", "org.sakaiproject.event.api.SessionState", "org.sakaiproject.taggable.api.TaggingHelperInfo", "org.sakaiproject.taggable.api.TaggingManager", "org.sakaiproject.taggable.api.TaggingProvider", "org.sakaiproject.util.ParameterParser" ]
import java.util.Map; import org.sakaiproject.cheftool.JetspeedRunData; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.component.cover.ComponentManager; import org.sakaiproject.event.api.SessionState; import org.sakaiproject.taggable.api.TaggingHelperInfo; import org.sakaiproject.taggable.api.TaggingManager; import org.sakaiproject.taggable.api.TaggingProvider; import org.sakaiproject.util.ParameterParser;
import java.util.*; import org.sakaiproject.cheftool.*; import org.sakaiproject.component.cover.*; import org.sakaiproject.event.api.*; import org.sakaiproject.taggable.api.*; import org.sakaiproject.util.*;
[ "java.util", "org.sakaiproject.cheftool", "org.sakaiproject.component", "org.sakaiproject.event", "org.sakaiproject.taggable", "org.sakaiproject.util" ]
java.util; org.sakaiproject.cheftool; org.sakaiproject.component; org.sakaiproject.event; org.sakaiproject.taggable; org.sakaiproject.util;
683,239
public static Iterable<String> toRootRelativePaths(Iterable<Artifact> artifacts) { return Iterables.transform( Iterables.filter(artifacts, MIDDLEMAN_FILTER), artifact -> artifact.getRootRelativePath().getPathString()); }
static Iterable<String> function(Iterable<Artifact> artifacts) { return Iterables.transform( Iterables.filter(artifacts, MIDDLEMAN_FILTER), artifact -> artifact.getRootRelativePath().getPathString()); }
/** * Lazily converts artifacts into root-relative path strings. Middleman artifacts are ignored by * this method. */
Lazily converts artifacts into root-relative path strings. Middleman artifacts are ignored by this method
toRootRelativePaths
{ "repo_name": "twitter-forks/bazel", "path": "src/main/java/com/google/devtools/build/lib/actions/Artifact.java", "license": "apache-2.0", "size": 61163 }
[ "com.google.common.collect.Iterables" ]
import com.google.common.collect.Iterables;
import com.google.common.collect.*;
[ "com.google.common" ]
com.google.common;
2,106,650