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
void onCreateMsg(PenMsg msg);
void onCreateMsg(PenMsg msg);
/** * On create message. * * @param msg the pen message */
On create message
onCreateMsg
{ "repo_name": "NeoSmartpen/AndroidSDK2.0", "path": "NASDK2.0_Studio/app/src/main/java/kr/neolab/sdk/pen/bluetooth/IConnectedThread.java", "license": "gpl-3.0", "size": 1458 }
[ "kr.neolab.sdk.pen.penmsg.PenMsg" ]
import kr.neolab.sdk.pen.penmsg.PenMsg;
import kr.neolab.sdk.pen.penmsg.*;
[ "kr.neolab.sdk" ]
kr.neolab.sdk;
2,331,908
public Collection<Module> createGuiceModules() { return Collections.emptyList(); }
Collection<Module> function() { return Collections.emptyList(); }
/** * Node level guice modules. */
Node level guice modules
createGuiceModules
{ "repo_name": "zkidkid/elasticsearch", "path": "core/src/main/java/org/elasticsearch/plugins/Plugin.java", "license": "apache-2.0", "size": 6159 }
[ "java.util.Collection", "java.util.Collections", "org.elasticsearch.common.inject.Module" ]
import java.util.Collection; import java.util.Collections; import org.elasticsearch.common.inject.Module;
import java.util.*; import org.elasticsearch.common.inject.*;
[ "java.util", "org.elasticsearch.common" ]
java.util; org.elasticsearch.common;
588,550
public static void setParameters(Query query, Object... params) { if (params != null) { int i = 0; for (Object param : params) { query.setParameter(i++, param); } } } private ResultSpecificationHelper() { }
static void function(Query query, Object... params) { if (params != null) { int i = 0; for (Object param : params) { query.setParameter(i++, param); } } } private ResultSpecificationHelper() { }
/** * Set the parameters in the query * * @param query * The query object with the parameters * @param params * The parameters to set */
Set the parameters in the query
setParameters
{ "repo_name": "Communote/communote-server", "path": "communote/core/src/main/java/com/communote/server/persistence/helper/dao/ResultSpecificationHelper.java", "license": "apache-2.0", "size": 2711 }
[ "org.hibernate.Query" ]
import org.hibernate.Query;
import org.hibernate.*;
[ "org.hibernate" ]
org.hibernate;
2,681,938
@ThreadConfined(UI) public void recreateReactContextInBackground() { Assertions.assertCondition( mHasStartedCreatingInitialContext, "recreateReactContextInBackground should only be called after the initial " + "createReactContextInBackground call."); recreateReactContextInBackgroundInner(); }
@ThreadConfined(UI) void function() { Assertions.assertCondition( mHasStartedCreatingInitialContext, STR + STR); recreateReactContextInBackgroundInner(); }
/** * Recreate the react application and context. This should be called if configuration has * changed or the developer has requested the app to be reloaded. It should only be called after * an initial call to createReactContextInBackground. * * Called from UI thread. */
Recreate the react application and context. This should be called if configuration has changed or the developer has requested the app to be reloaded. It should only be called after an initial call to createReactContextInBackground. Called from UI thread
recreateReactContextInBackground
{ "repo_name": "ndejesus1227/react-native", "path": "ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java", "license": "bsd-3-clause", "size": 40005 }
[ "com.facebook.infer.annotation.Assertions", "com.facebook.infer.annotation.ThreadConfined" ]
import com.facebook.infer.annotation.Assertions; import com.facebook.infer.annotation.ThreadConfined;
import com.facebook.infer.annotation.*;
[ "com.facebook.infer" ]
com.facebook.infer;
598,181
public ChatColor getValue() { return this.value; }
ChatColor function() { return this.value; }
/** * Returns the Bukkit color object associated with this marker. * * @return never null. */
Returns the Bukkit color object associated with this marker
getValue
{ "repo_name": "rjenkinsjr/slf4bukkit", "path": "src/main/java/info/ronjenkins/slf4bukkit/ColorMarker.java", "license": "gpl-3.0", "size": 3515 }
[ "org.bukkit.ChatColor" ]
import org.bukkit.ChatColor;
import org.bukkit.*;
[ "org.bukkit" ]
org.bukkit;
2,417,012
private static List<ErrorInfo> getChildrenErrorsForCycle( SkyKey parent, Iterable<SkyKey> children, int childrenSize, NodeEntry entryForDebugging, ParallelEvaluatorContext evaluatorContext) throws InterruptedException { List<ErrorInfo> allErrors = new ArrayList<>(); boolean foundCycle = false; Map<SkyKey, ? extends NodeEntry> childMap = getAndCheckDoneBatchForCycle(parent, children, evaluatorContext); if (childMap.size() < childrenSize) { Set<SkyKey> missingChildren = Sets.difference(ImmutableSet.copyOf(children), childMap.keySet()); evaluatorContext .getGraphInconsistencyReceiver() .noteInconsistencyAndMaybeThrow( parent, missingChildren, Inconsistency.ALREADY_DECLARED_CHILD_MISSING); } for (NodeEntry childNode : childMap.values()) { ErrorInfo errorInfo = childNode.getErrorInfo(); if (errorInfo != null) { foundCycle |= !Iterables.isEmpty(errorInfo.getCycleInfo()); allErrors.add(errorInfo); } } Preconditions.checkState( foundCycle, "Key %s with entry %s had no cycle beneath it: %s", parent, entryForDebugging, allErrors); return allErrors; }
static List<ErrorInfo> function( SkyKey parent, Iterable<SkyKey> children, int childrenSize, NodeEntry entryForDebugging, ParallelEvaluatorContext evaluatorContext) throws InterruptedException { List<ErrorInfo> allErrors = new ArrayList<>(); boolean foundCycle = false; Map<SkyKey, ? extends NodeEntry> childMap = getAndCheckDoneBatchForCycle(parent, children, evaluatorContext); if (childMap.size() < childrenSize) { Set<SkyKey> missingChildren = Sets.difference(ImmutableSet.copyOf(children), childMap.keySet()); evaluatorContext .getGraphInconsistencyReceiver() .noteInconsistencyAndMaybeThrow( parent, missingChildren, Inconsistency.ALREADY_DECLARED_CHILD_MISSING); } for (NodeEntry childNode : childMap.values()) { ErrorInfo errorInfo = childNode.getErrorInfo(); if (errorInfo != null) { foundCycle = !Iterables.isEmpty(errorInfo.getCycleInfo()); allErrors.add(errorInfo); } } Preconditions.checkState( foundCycle, STR, parent, entryForDebugging, allErrors); return allErrors; }
/** * Get all the errors of child nodes. There must be at least one cycle amongst them. * * @param children child nodes to query for errors. * @return List of ErrorInfos from all children that had errors. */
Get all the errors of child nodes. There must be at least one cycle amongst them
getChildrenErrorsForCycle
{ "repo_name": "bazelbuild/bazel", "path": "src/main/java/com/google/devtools/build/skyframe/SimpleCycleDetector.java", "license": "apache-2.0", "size": 25269 }
[ "com.google.common.base.Preconditions", "com.google.common.collect.ImmutableSet", "com.google.common.collect.Iterables", "com.google.common.collect.Sets", "com.google.devtools.build.skyframe.proto.GraphInconsistency", "java.util.ArrayList", "java.util.List", "java.util.Map", "java.util.Set" ]
import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Sets; import com.google.devtools.build.skyframe.proto.GraphInconsistency; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set;
import com.google.common.base.*; import com.google.common.collect.*; import com.google.devtools.build.skyframe.proto.*; import java.util.*;
[ "com.google.common", "com.google.devtools", "java.util" ]
com.google.common; com.google.devtools; java.util;
718,914
public void addCourse(int id, JSONObject course) { // clear the message first String name = ((JSONString) course.get("name")).stringValue(); String location = ((JSONString) course.get("location")).stringValue(); String date = ((JSONString) course.get("time")).stringValue(); CalendarItem item = new CalendarItem(name); item.setContent(location); // analyze the date and add the item. // filtered out all invalid characters String filteredDate = date.replaceAll("[^MTWHF0-9:-]", ""); Queue<Integer> day = new LinkedList<Integer>(); // begin analysis for (int i=0; i<filteredDate.length(); i++) { switch (filteredDate.charAt(i)) { // weekday case 'M': day.offer(Calendar.MONDAY); break; case 'W': day.offer(Calendar.WEDNESDAY); break; case 'F': day.offer(Calendar.FRIDAY); break; case 'T': if (i+1 < filteredDate.length() && filteredDate.charAt(i+1) == 'H') { day.offer(Calendar.THURSDAY); i++; } else { day.offer(Calendar.TUESDAY); } break; // time case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case ':': case '-': // work until the end of time int j = i+1; while (j < filteredDate.length() && (Character.isDigit(filteredDate.charAt(j)) || filteredDate.charAt(j) == ':' || filteredDate.charAt(j) == '-')) { j++; } // grab the time String time = filteredDate.substring(i, j); // check the time format if (!time.matches("^\\d{1,2}:\\d{2,2}-\\d{1,2}:\\d{2,2}")) { i = j; break; } // get the time String[] two = time.split("-"); // get the begin and end int begin = Integer.parseInt(two[0].replaceAll(":", "")); int end = Integer.parseInt(two[1].replaceAll(":", "")); // offer the calendar try { while (day.peek() != null) { int weekday = day.poll(); item.addTimeInterval(weekday, begin, end); } } catch (TimetableException e) { app_.error(ApplicationController.OOPS, e); } // done i = j; break; } } // add the item items_.put(id, item); // add to calendar calendar_.addItem(item); }
void function(int id, JSONObject course) { String name = ((JSONString) course.get("name")).stringValue(); String location = ((JSONString) course.get(STR)).stringValue(); String date = ((JSONString) course.get("time")).stringValue(); CalendarItem item = new CalendarItem(name); item.setContent(location); String filteredDate = date.replaceAll(STR, STR^\\d{1,2}:\\d{2,2}-\\d{1,2}:\\d{2,2}STR-STR:STRSTR:STR")); try { while (day.peek() != null) { int weekday = day.poll(); item.addTimeInterval(weekday, begin, end); } } catch (TimetableException e) { app_.error(ApplicationController.OOPS, e); } i = j; break; } } items_.put(id, item); calendar_.addItem(item); }
/** * Add a course to the Calendar * * @param id * @param course */
Add a course to the Calendar
addCourse
{ "repo_name": "upei/calendar-app", "path": "src/ca/upei/ic/timetable/client/CourseCalendarViewController.java", "license": "apache-2.0", "size": 4210 }
[ "com.google.gwt.json.client.JSONObject", "com.google.gwt.json.client.JSONString" ]
import com.google.gwt.json.client.JSONObject; import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.*;
[ "com.google.gwt" ]
com.google.gwt;
1,300,105
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { int id=Integer.valueOf(request.getParameter("id")); UserListDAO DAO = new UserListDAO(); Object user = DAO.query(id); request.setAttribute("user", user); request.getRequestDispatcher("/web/user/member_detail.jsp").forward(request, response); }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { int id=Integer.valueOf(request.getParameter("id")); UserListDAO DAO = new UserListDAO(); Object user = DAO.query(id); request.setAttribute("user", user); request.getRequestDispatcher(STR).forward(request, response); }
/** * The doGet method of the servlet. <br> * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */
The doGet method of the servlet. This method is called when a form has its tag value method equals to get
doGet
{ "repo_name": "zhuxiaocqu/WebStore", "path": "src/com/webstore/servlet/back/usermanager/showUserDetail.java", "license": "gpl-2.0", "size": 2110 }
[ "com.webstore.dao.UserListDAO", "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import com.webstore.dao.UserListDAO; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import com.webstore.dao.*; import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
[ "com.webstore.dao", "java.io", "javax.servlet" ]
com.webstore.dao; java.io; javax.servlet;
2,637,978
public String getDownloadFileName() { Date now = new Date(); String dateFormat = ContextUtil.getLocalizedString("org.sakaiproject.tool.assessment.bundle.EvaluationMessages","export_filename_date_format"); DateFormat df = new SimpleDateFormat(dateFormat, new ResourceLoader().getLocale()); StringBuilder fileName = new StringBuilder(ContextUtil.getLocalizedString("org.sakaiproject.tool.assessment.bundle.EvaluationMessages","assessment")); if(StringUtils.trimToNull(assessmentName) != null) { assessmentName = assessmentName.replaceAll("\\s", "_"); // replace whitespace with '_' fileName.append("-"); fileName.append(assessmentName); } fileName.append("-"); fileName.append(df.format(now)); return fileName.toString(); }
String function() { Date now = new Date(); String dateFormat = ContextUtil.getLocalizedString(STR,STR); DateFormat df = new SimpleDateFormat(dateFormat, new ResourceLoader().getLocale()); StringBuilder fileName = new StringBuilder(ContextUtil.getLocalizedString(STR,STR)); if(StringUtils.trimToNull(assessmentName) != null) { assessmentName = assessmentName.replaceAll("\\s", "_"); fileName.append("-"); fileName.append(assessmentName); } fileName.append("-"); fileName.append(df.format(now)); return fileName.toString(); }
/** * Generates a default filename (minus the extension) for a download from this Gradebook. * * @param prefix for filename * @return The appropriate filename for the export */
Generates a default filename (minus the extension) for a download from this Gradebook
getDownloadFileName
{ "repo_name": "ouit0408/sakai", "path": "samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/evaluation/ExportResponsesBean.java", "license": "apache-2.0", "size": 17425 }
[ "java.text.DateFormat", "java.text.SimpleDateFormat", "java.util.Date", "org.apache.commons.lang.StringUtils", "org.sakaiproject.tool.assessment.ui.listener.util.ContextUtil", "org.sakaiproject.util.ResourceLoader" ]
import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import org.apache.commons.lang.StringUtils; import org.sakaiproject.tool.assessment.ui.listener.util.ContextUtil; import org.sakaiproject.util.ResourceLoader;
import java.text.*; import java.util.*; import org.apache.commons.lang.*; import org.sakaiproject.tool.assessment.ui.listener.util.*; import org.sakaiproject.util.*;
[ "java.text", "java.util", "org.apache.commons", "org.sakaiproject.tool", "org.sakaiproject.util" ]
java.text; java.util; org.apache.commons; org.sakaiproject.tool; org.sakaiproject.util;
1,821,849
public Type getIdentifierType() { return identifierType; } // Configurable implementation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Type function() { return identifierType; }
/** * Getter for property 'identifierType'. * * @return Value for property 'identifierType'. */
Getter for property 'identifierType'
getIdentifierType
{ "repo_name": "1fechner/FeatureExtractor", "path": "sources/FeatureExtractor/lib/hibernate-release-5.1.0.Final/project/hibernate-core/src/main/java/org/hibernate/id/enhanced/SequenceStyleGenerator.java", "license": "lgpl-2.1", "size": 16265 }
[ "org.hibernate.type.Type" ]
import org.hibernate.type.Type;
import org.hibernate.type.*;
[ "org.hibernate.type" ]
org.hibernate.type;
8,084
CommandLineConfig setDefine(List<String> define) { this.define.clear(); this.define.addAll(define); return this; } private final List<String> tweak = Lists.newArrayList();
CommandLineConfig setDefine(List<String> define) { this.define.clear(); this.define.addAll(define); return this; } private final List<String> tweak = Lists.newArrayList();
/** * Override the value of a variable annotated @define. * The format is <name>[=<val>], where <name> is the name of a @define * variable and <val> is a boolean, number, or a single-quoted string * that contains no single quotes. If [=<val>] is omitted, * the variable is marked true */
Override the value of a variable annotated @define. The format is [=], where is the name of a @define variable and is a boolean, number, or a single-quoted string that contains no single quotes. If [=] is omitted, the variable is marked true
setDefine
{ "repo_name": "h4ck3rm1k3/javascript-closure-compiler-git", "path": "src/com/google/javascript/jscomp/AbstractCommandLineRunner.java", "license": "apache-2.0", "size": 67882 }
[ "com.google.common.collect.Lists", "java.util.List" ]
import com.google.common.collect.Lists; import java.util.List;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
1,564,654
public MigrationResult migrateSingleThreadCSV() throws MigrationException { log.info(generalMessage + " Mode: migrateSingleThreadCSV"); long startTimeMigration = System.currentTimeMillis(); String delimiter = FileFormat.getCsvDelimiter(); try { restPipe = Pipe.INSTANCE .createAndGetFullName(this.getClass().getName() + "_fromREST_" + getObjectFrom()); scidbPipe = Pipe.INSTANCE.createAndGetFullName( this.getClass().getName() + "_toSciDB_" + getObjectTo()); String typesPattern = SciDBHandler .getTypePatternFromObjectMetaData(fromObjectMetaData); List<Callable<Object>> tasks = new ArrayList<>(); ExportREST exportREST = new ExportREST(); exportREST.setExportTo(restPipe); exportREST.setMigrationInfo(migrationInfo); tasks.add(exportREST); tasks.add(new TransformFromCsvToSciDBExecutor(typesPattern, restPipe, delimiter, scidbPipe, BigDawgConfigProperties.INSTANCE.getScidbBinPath())); tasks.add(new LoadSciDB(migrationInfo, scidbPipe, new RESTHandler((RESTConnectionInfo)migrationInfo.getConnectionFrom()))); executor = Executors.newFixedThreadPool(tasks.size()); List<Future<Object>> results = TaskExecutor.execute(executor, tasks); Long countExtractedElements = (Long) results.get(EXPORT_INDEX) .get(); Long shellScriptReturnCode = (Long) results .get(TRANSFORMATION_INDEX).get(); Long countLoadedElements = (Long) results.get(LOAD_INDEX).get(); log.debug("Extracted elements from REST: " + countExtractedElements); if (shellScriptReturnCode != 0L) { throw new MigrationException( "Error while transforming data from CSV format to" + " scidb dense format."); } if (countLoadedElements != null) { throw new MigrationException( "SciDB does not return any information about " + "loading / " + "export but there was an unkown data " + "returned."); } long endTimeMigration = System.currentTimeMillis(); long durationMsec = endTimeMigration - startTimeMigration; MigrationResult migrationResult = new MigrationResult( countExtractedElements, null, durationMsec, startTimeMigration, endTimeMigration); String message = "Migration was executed correctly."; return summary(migrationResult, migrationInfo, message); } catch (Exception exception) { throw handleException(exception, "Migration failed."); } finally { cleanResources(); } }
MigrationResult function() throws MigrationException { log.info(generalMessage + STR); long startTimeMigration = System.currentTimeMillis(); String delimiter = FileFormat.getCsvDelimiter(); try { restPipe = Pipe.INSTANCE .createAndGetFullName(this.getClass().getName() + STR + getObjectFrom()); scidbPipe = Pipe.INSTANCE.createAndGetFullName( this.getClass().getName() + STR + getObjectTo()); String typesPattern = SciDBHandler .getTypePatternFromObjectMetaData(fromObjectMetaData); List<Callable<Object>> tasks = new ArrayList<>(); ExportREST exportREST = new ExportREST(); exportREST.setExportTo(restPipe); exportREST.setMigrationInfo(migrationInfo); tasks.add(exportREST); tasks.add(new TransformFromCsvToSciDBExecutor(typesPattern, restPipe, delimiter, scidbPipe, BigDawgConfigProperties.INSTANCE.getScidbBinPath())); tasks.add(new LoadSciDB(migrationInfo, scidbPipe, new RESTHandler((RESTConnectionInfo)migrationInfo.getConnectionFrom()))); executor = Executors.newFixedThreadPool(tasks.size()); List<Future<Object>> results = TaskExecutor.execute(executor, tasks); Long countExtractedElements = (Long) results.get(EXPORT_INDEX) .get(); Long shellScriptReturnCode = (Long) results .get(TRANSFORMATION_INDEX).get(); Long countLoadedElements = (Long) results.get(LOAD_INDEX).get(); log.debug(STR + countExtractedElements); if (shellScriptReturnCode != 0L) { throw new MigrationException( STR + STR); } if (countLoadedElements != null) { throw new MigrationException( STR + STR + STR + STR); } long endTimeMigration = System.currentTimeMillis(); long durationMsec = endTimeMigration - startTimeMigration; MigrationResult migrationResult = new MigrationResult( countExtractedElements, null, durationMsec, startTimeMigration, endTimeMigration); String message = STR; return summary(migrationResult, migrationInfo, message); } catch (Exception exception) { throw handleException(exception, STR); } finally { cleanResources(); } }
/** * This is migration from PostgreSQL to SciDB based on CSV format and * carried out in a single thread. * * * * @return MigrationRestult information about the executed migration * @throws SQLException * @throws MigrationException * @throws LocalQueryExecutionException */
This is migration from PostgreSQL to SciDB based on CSV format and carried out in a single thread
migrateSingleThreadCSV
{ "repo_name": "bigdawg-istc/bigdawg", "path": "src/main/java/istc/bigdawg/migration/FromRESTToSciDB.java", "license": "bsd-3-clause", "size": 19437 }
[ "java.util.ArrayList", "java.util.List", "java.util.concurrent.Callable", "java.util.concurrent.Executors", "java.util.concurrent.Future" ]
import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.Executors; import java.util.concurrent.Future;
import java.util.*; import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,634,547
@Override protected String doInBackground(Void... params) { try { String token = fetchToken(); if (token != null) { // Insert the good stuff here. // Use the token to access the user's Google data. mTokenText = token; } } catch (IOException e) { // The fetchToken() method handles Google-specific exceptions, // so this indicates something went wrong at a higher level. // TIP: Check for network connectivity before starting the AsyncTask. Log.e(TAG, e.getMessage(), e); } return null; }
String function(Void... params) { try { String token = fetchToken(); if (token != null) { mTokenText = token; } } catch (IOException e) { Log.e(TAG, e.getMessage(), e); } return null; }
/** * Executes the asynchronous job. This runs when you call execute() * on the AsyncTask instance. */
Executes the asynchronous job. This runs when you call execute() on the AsyncTask instance
doInBackground
{ "repo_name": "sschendel/SyncManagerAndroid-DemoGoogleTasks", "path": "src/com/rogansoft/tasksdemo/MainActivity.java", "license": "mit", "size": 13848 }
[ "android.util.Log", "java.io.IOException" ]
import android.util.Log; import java.io.IOException;
import android.util.*; import java.io.*;
[ "android.util", "java.io" ]
android.util; java.io;
2,707,005
private void processJournal() throws IOException { deleteIfExists(journalFileTmp); for (final Iterator<Entry> i = lruEntries.values().iterator(); i.hasNext();) { final Entry entry = i.next(); if (entry.currentEditor == null) { for (int t = 0; t < valueCount; t++) { size += entry.lengths[t]; } } else { entry.currentEditor = null; for (int t = 0; t < valueCount; t++) { deleteIfExists(entry.getCleanFile(t)); deleteIfExists(entry.getDirtyFile(t)); } i.remove(); } } }
void function() throws IOException { deleteIfExists(journalFileTmp); for (final Iterator<Entry> i = lruEntries.values().iterator(); i.hasNext();) { final Entry entry = i.next(); if (entry.currentEditor == null) { for (int t = 0; t < valueCount; t++) { size += entry.lengths[t]; } } else { entry.currentEditor = null; for (int t = 0; t < valueCount; t++) { deleteIfExists(entry.getCleanFile(t)); deleteIfExists(entry.getDirtyFile(t)); } i.remove(); } } }
/** * Computes the initial size and collects garbage as a part of opening the * cache. Dirty entries are assumed to be inconsistent and will be deleted. */
Computes the initial size and collects garbage as a part of opening the cache. Dirty entries are assumed to be inconsistent and will be deleted
processJournal
{ "repo_name": "fighter0511/ctv.download", "path": "apollo/src/com/andrew/apollo/cache/DiskLruCache.java", "license": "gpl-3.0", "size": 34610 }
[ "java.io.IOException", "java.util.Iterator" ]
import java.io.IOException; import java.util.Iterator;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
386,191
public Idioma[] listIdioma(String cedula){ String sql_select; sql_select="SELECT lenguaje, nivelLee, nivelEscribe, nivelHabla, pathArchivo, estado FROM Idioma WHERE cedula = '"+cedula+"';"; System.out.println("Idioma select : " + sql_select); try{ System.out.println("consultando en la bd"); Statement sentence = conn.createStatement(); ResultSet table = sentence.executeQuery(sql_select); int numRows=0; while(table.next()){ numRows++; } ResultSet table2= sentence.executeQuery(sql_select); System.out.println("num : "+numRows); Idioma form[]= new Idioma[numRows]; for(int i=0; i<numRows; i++){ form[i]=new Idioma(); } int j=0; while(table2.next()){ System.out.println("ini"); form[j].setLenguaje(table2.getString(1)); form[j].setNivellee(table2.getString(2)); form[j].setNivelescribe(table2.getString(3)); form[j].setNivelhabla(table2.getString(4)); form[j].setPatharchivo(table2.getString(5)); form[j].setState(table2.getBoolean(6)); j++; System.out.println("ok"); } return form; } catch(SQLException e){ System.out.println(e); } catch(Exception e){ System.out.println(e); } return null; }
Idioma[] function(String cedula){ String sql_select; sql_select=STR+cedula+"';"; System.out.println(STR + sql_select); try{ System.out.println(STR); Statement sentence = conn.createStatement(); ResultSet table = sentence.executeQuery(sql_select); int numRows=0; while(table.next()){ numRows++; } ResultSet table2= sentence.executeQuery(sql_select); System.out.println(STR+numRows); Idioma form[]= new Idioma[numRows]; for(int i=0; i<numRows; i++){ form[i]=new Idioma(); } int j=0; while(table2.next()){ System.out.println("ini"); form[j].setLenguaje(table2.getString(1)); form[j].setNivellee(table2.getString(2)); form[j].setNivelescribe(table2.getString(3)); form[j].setNivelhabla(table2.getString(4)); form[j].setPatharchivo(table2.getString(5)); form[j].setState(table2.getBoolean(6)); j++; System.out.println("ok"); } return form; } catch(SQLException e){ System.out.println(e); } catch(Exception e){ System.out.println(e); } return null; }
/** * Metodo que permite listar los registros en la tabla Idioma de un aspirante * @param cedula: identificacion del aspirante al cual se listaran sus registros de formadortic * @return arreglo de objetos Idioma que contiene la informacion almacenada en la base de datos */
Metodo que permite listar los registros en la tabla Idioma de un aspirante
listIdioma
{ "repo_name": "danielcb29/SISCONDOC", "path": "SISCONDOC/src/almacenamiento/accesodatos/DAOIdioma.java", "license": "gpl-2.0", "size": 8852 }
[ "java.sql.ResultSet", "java.sql.SQLException", "java.sql.Statement" ]
import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,526,641
void setValue(String value) throws IOException;
void setValue(String value) throws IOException;
/** * Sets the value of this HttpData. */
Sets the value of this HttpData
setValue
{ "repo_name": "menacher/netty", "path": "codec-http/src/main/java/io/netty/handler/codec/http/multipart/Attribute.java", "license": "apache-2.0", "size": 1129 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
56,518
@Override public void run(Timeout t) { if (isStopped()) { return; } if (context.mastershipService().isLocalMaster(device.id())) { log.trace("Sending probes from {}", device.id()); ports.forEach(this::sendProbes); } if (!isStopped()) { timeout = Timer.getTimer().newTimeout(this, context.probeRate(), MILLISECONDS); } }
void function(Timeout t) { if (isStopped()) { return; } if (context.mastershipService().isLocalMaster(device.id())) { log.trace(STR, device.id()); ports.forEach(this::sendProbes); } if (!isStopped()) { timeout = Timer.getTimer().newTimeout(this, context.probeRate(), MILLISECONDS); } }
/** * Execute this method every t milliseconds. Loops over all ports * labeled as fast and sends out an LLDP. Send out an LLDP on a single slow * port. * * @param t timeout */
Execute this method every t milliseconds. Loops over all ports labeled as fast and sends out an LLDP. Send out an LLDP on a single slow port
run
{ "repo_name": "sonu283304/onos", "path": "providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscovery.java", "license": "apache-2.0", "size": 10235 }
[ "org.jboss.netty.util.Timeout", "org.onlab.util.Timer" ]
import org.jboss.netty.util.Timeout; import org.onlab.util.Timer;
import org.jboss.netty.util.*; import org.onlab.util.*;
[ "org.jboss.netty", "org.onlab.util" ]
org.jboss.netty; org.onlab.util;
1,402,593
public void setVersions(Cluster cluster) { // set the repository version for the component this command is for - // always use the current desired version String serviceName = executionCommand.getServiceName(); try { RepositoryVersionEntity repositoryVersion = null; if (!StringUtils.isEmpty(serviceName)) { Service service = cluster.getService(serviceName); if (null != service) { repositoryVersion = service.getDesiredRepositoryVersion(); String componentName = executionCommand.getComponentName(); if (!StringUtils.isEmpty(componentName)) { ServiceComponent serviceComponent = service.getServiceComponent(componentName); if (null != serviceComponent) { repositoryVersion = serviceComponent.getDesiredRepositoryVersion(); } } } } Map<String, String> commandParams = executionCommand.getCommandParams(); Map<String, String> hostParams = executionCommand.getHostLevelParams(); if (null != repositoryVersion) { // only set the version if it's not set and this is NOT an install // command // Some stack scripts use version for path purposes. Sending unresolved version first (for // blueprints) and then resolved one would result in various issues: duplicate directories // (/hdp/apps/2.6.3.0 + /hdp/apps/2.6.3.0-235), parent directory not found, and file not // found, etc. Hence requiring repositoryVersion to be resolved. if (!commandParams.containsKey(VERSION) && repositoryVersion.isResolved() && executionCommand.getRoleCommand() != RoleCommand.INSTALL) { commandParams.put(VERSION, repositoryVersion.getVersion()); } // !!! although not used anymore since the cluster has more than 1 version, this // property might be needed by legacy mpacks or extension services, so // continue to include it for backward compatibility if (repositoryVersion.isResolved()) { hostParams.put(KeyNames.CURRENT_VERSION, repositoryVersion.getVersion()); } StackId stackId = repositoryVersion.getStackId(); StackInfo stackInfo = ambariMetaInfo.getStack(stackId.getStackName(), stackId.getStackVersion()); if (!commandParams.containsKey(HOOKS_FOLDER)) { commandParams.put(HOOKS_FOLDER, stackInfo.getStackHooksFolder()); } if (!commandParams.containsKey(SERVICE_PACKAGE_FOLDER)) { if (!StringUtils.isEmpty(serviceName)) { ServiceInfo serviceInfo = ambariMetaInfo.getService(stackId.getStackName(), stackId.getStackVersion(), serviceName); commandParams.put(SERVICE_PACKAGE_FOLDER, serviceInfo.getServicePackageFolder()); } } } // set the desired versions of versionable components. This is safe even during an upgrade because // we are "loading-late": components that have not yet upgraded in an EU will have the correct versions. executionCommand.setComponentVersions(cluster); } catch (ServiceNotFoundException serviceNotFoundException) { // it's possible that there are commands specified for a service where // the service doesn't exist yet LOG.warn( "The service {} is not installed in the cluster. No repository version will be sent for this command.", serviceName); } catch (AmbariException e) { throw new RuntimeException(e); } }
void function(Cluster cluster) { String serviceName = executionCommand.getServiceName(); try { RepositoryVersionEntity repositoryVersion = null; if (!StringUtils.isEmpty(serviceName)) { Service service = cluster.getService(serviceName); if (null != service) { repositoryVersion = service.getDesiredRepositoryVersion(); String componentName = executionCommand.getComponentName(); if (!StringUtils.isEmpty(componentName)) { ServiceComponent serviceComponent = service.getServiceComponent(componentName); if (null != serviceComponent) { repositoryVersion = serviceComponent.getDesiredRepositoryVersion(); } } } } Map<String, String> commandParams = executionCommand.getCommandParams(); Map<String, String> hostParams = executionCommand.getHostLevelParams(); if (null != repositoryVersion) { if (!commandParams.containsKey(VERSION) && repositoryVersion.isResolved() && executionCommand.getRoleCommand() != RoleCommand.INSTALL) { commandParams.put(VERSION, repositoryVersion.getVersion()); } if (repositoryVersion.isResolved()) { hostParams.put(KeyNames.CURRENT_VERSION, repositoryVersion.getVersion()); } StackId stackId = repositoryVersion.getStackId(); StackInfo stackInfo = ambariMetaInfo.getStack(stackId.getStackName(), stackId.getStackVersion()); if (!commandParams.containsKey(HOOKS_FOLDER)) { commandParams.put(HOOKS_FOLDER, stackInfo.getStackHooksFolder()); } if (!commandParams.containsKey(SERVICE_PACKAGE_FOLDER)) { if (!StringUtils.isEmpty(serviceName)) { ServiceInfo serviceInfo = ambariMetaInfo.getService(stackId.getStackName(), stackId.getStackVersion(), serviceName); commandParams.put(SERVICE_PACKAGE_FOLDER, serviceInfo.getServicePackageFolder()); } } } executionCommand.setComponentVersions(cluster); } catch (ServiceNotFoundException serviceNotFoundException) { LOG.warn( STR, serviceName); } catch (AmbariException e) { throw new RuntimeException(e); } }
/** * Sets the repository version and hooks information on the execution command. * * @param cluster * the cluster (not {@code null}). */
Sets the repository version and hooks information on the execution command
setVersions
{ "repo_name": "arenadata/ambari", "path": "ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ExecutionCommandWrapper.java", "license": "apache-2.0", "size": 17316 }
[ "java.util.Map", "org.apache.ambari.server.AmbariException", "org.apache.ambari.server.RoleCommand", "org.apache.ambari.server.ServiceNotFoundException", "org.apache.ambari.server.agent.ExecutionCommand", "org.apache.ambari.server.orm.entities.RepositoryVersionEntity", "org.apache.ambari.server.state.Cluster", "org.apache.ambari.server.state.Service", "org.apache.ambari.server.state.ServiceComponent", "org.apache.ambari.server.state.ServiceInfo", "org.apache.ambari.server.state.StackId", "org.apache.ambari.server.state.StackInfo", "org.apache.commons.lang.StringUtils" ]
import java.util.Map; import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.RoleCommand; import org.apache.ambari.server.ServiceNotFoundException; import org.apache.ambari.server.agent.ExecutionCommand; import org.apache.ambari.server.orm.entities.RepositoryVersionEntity; import org.apache.ambari.server.state.Cluster; import org.apache.ambari.server.state.Service; import org.apache.ambari.server.state.ServiceComponent; import org.apache.ambari.server.state.ServiceInfo; import org.apache.ambari.server.state.StackId; import org.apache.ambari.server.state.StackInfo; import org.apache.commons.lang.StringUtils;
import java.util.*; import org.apache.ambari.server.*; import org.apache.ambari.server.agent.*; import org.apache.ambari.server.orm.entities.*; import org.apache.ambari.server.state.*; import org.apache.commons.lang.*;
[ "java.util", "org.apache.ambari", "org.apache.commons" ]
java.util; org.apache.ambari; org.apache.commons;
2,064,390
public void setDefaultDate(Map<R, Integer> defaultValues) { setDefaultDate(getDate(defaultValues)); }
void function(Map<R, Integer> defaultValues) { setDefaultDate(getDate(defaultValues)); }
/** * Set the default date using a map with date values. * * @see #setCurrentDate(Map) * @param defaultValues * @since 8.1.2 */
Set the default date using a map with date values
setDefaultDate
{ "repo_name": "Darsstar/framework", "path": "client/src/main/java/com/vaadin/client/ui/VDateField.java", "license": "apache-2.0", "size": 9585 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
88,837
public static ims.core.clinical.domain.objects.PatientProblem extractPatientProblem(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.PatientProblemForRelevantPMHVo valueObject) { return extractPatientProblem(domainFactory, valueObject, new HashMap()); }
static ims.core.clinical.domain.objects.PatientProblem function(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.PatientProblemForRelevantPMHVo valueObject) { return extractPatientProblem(domainFactory, valueObject, new HashMap()); }
/** * Create the domain object from the value object. * @param domainFactory - used to create existing (persistent) domain objects. * @param valueObject - extract the domain object fields from this. */
Create the domain object from the value object
extractPatientProblem
{ "repo_name": "open-health-hub/openmaxims-linux", "path": "openmaxims_workspace/ValueObjects/src/ims/emergency/vo/domain/PatientProblemForRelevantPMHVoAssembler.java", "license": "agpl-3.0", "size": 16863 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,503,611
public void removeCredentials(HomeserverConnectionConfig config) { if (null != config && config.getCredentials() != null) { Log.d(LOG_TAG, "Removing account: " + config.getCredentials().userId); SharedPreferences prefs = mContext.getSharedPreferences(PREFS_LOGIN, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); ArrayList<HomeserverConnectionConfig> configs = getCredentialsList(); ArrayList<JSONObject> serialized = new ArrayList<JSONObject>(configs.size()); boolean found = false; try { for (HomeserverConnectionConfig c : configs) { if (c.getCredentials().userId.equals(config.getCredentials().userId)) { found = true; } else { serialized.add(c.toJson()); } } } catch (JSONException e) { throw new RuntimeException("Failed to serialize connection config"); } if (!found) return; String ser = new JSONArray(serialized).toString(); Log.d(LOG_TAG, "Storing " + serialized.size() + " credentials"); editor.putString(PREFS_KEY_CONNECTION_CONFIGS, ser); editor.commit(); } }
void function(HomeserverConnectionConfig config) { if (null != config && config.getCredentials() != null) { Log.d(LOG_TAG, STR + config.getCredentials().userId); SharedPreferences prefs = mContext.getSharedPreferences(PREFS_LOGIN, Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); ArrayList<HomeserverConnectionConfig> configs = getCredentialsList(); ArrayList<JSONObject> serialized = new ArrayList<JSONObject>(configs.size()); boolean found = false; try { for (HomeserverConnectionConfig c : configs) { if (c.getCredentials().userId.equals(config.getCredentials().userId)) { found = true; } else { serialized.add(c.toJson()); } } } catch (JSONException e) { throw new RuntimeException(STR); } if (!found) return; String ser = new JSONArray(serialized).toString(); Log.d(LOG_TAG, STR + serialized.size() + STR); editor.putString(PREFS_KEY_CONNECTION_CONFIGS, ser); editor.commit(); } }
/** * Remove the credentials from credentials list * @param config the credentials to remove */
Remove the credentials from credentials list
removeCredentials
{ "repo_name": "matrix-org/matrix-android-console", "path": "console/src/main/java/org/matrix/console/store/LoginStorage.java", "license": "apache-2.0", "size": 8639 }
[ "android.content.Context", "android.content.SharedPreferences", "android.util.Log", "java.util.ArrayList", "org.json.JSONArray", "org.json.JSONException", "org.json.JSONObject", "org.matrix.androidsdk.HomeserverConnectionConfig" ]
import android.content.Context; import android.content.SharedPreferences; import android.util.Log; import java.util.ArrayList; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.matrix.androidsdk.HomeserverConnectionConfig;
import android.content.*; import android.util.*; import java.util.*; import org.json.*; import org.matrix.androidsdk.*;
[ "android.content", "android.util", "java.util", "org.json", "org.matrix.androidsdk" ]
android.content; android.util; java.util; org.json; org.matrix.androidsdk;
519,178
private void paintMarker(Graphics2D g2, AbstractVisualizationInfo visualizationInfo) { final int radius = MARKER_RADIUS; final int padding = PADDING; final int baseline = this.getSize().height / 2; // Calculate marker position. int markerX = (int)(this.getSize().width * visualizationInfo.getTimelineOffset()); int markerY = baseline; // Calculate name label position. FontMetrics nameMetrics = g2.getFontMetrics(g2.getFont()); Rectangle2D nameRect = nameMetrics.getStringBounds(visualizationInfo.getName(), g2); int nameX = markerX - (int)(nameRect.getWidth() / 2); int nameY = -(int)nameRect.getY(); // Calculate year label position. String year; if (visualizationInfo.getYear() >= 0) { year = new Integer(visualizationInfo.getYear()).toString(); } else { year = String.format(i18n.tr("{0} B.C.", Math.abs(visualizationInfo.getYear()))); } FontMetrics yearMetrics = g2.getFontMetrics(g2.getFont()); Rectangle2D yearRect = yearMetrics.getStringBounds(year, g2); int yearX = markerX - (int)(yearRect.getWidth() / 2); int yearY = baseline + radius + padding - (int)yearRect.getY(); // Draw name label. g2.setColor(LABEL_STROKE_COLOR); g2.setStroke(new BasicStroke(LABEL_STROKE_WIDTH)); g2.drawLine(markerX, markerY - radius - padding, markerX, nameY + (int)nameRect.getHeight() + (int)nameRect.getY() + padding); g2.setColor(NAME_TEXT_COLOR); g2.drawString(visualizationInfo.getName(), nameX, nameY); // Draw year label. g2.setColor(YEAR_TEXT_COLOR); g2.drawString(year, yearX, yearY); g2.setColor(visualizationInfo.getDifficultyColor()); g2.fillOval(markerX - radius, markerY - radius, radius * 2, radius * 2); g2.setColor(TIMELINE_STROKE_COLOR); g2.setStroke(new BasicStroke(TIMELINE_STROKE_WIDTH)); g2.drawOval(markerX - radius, markerY - radius, radius * 2, radius * 2); }
void function(Graphics2D g2, AbstractVisualizationInfo visualizationInfo) { final int radius = MARKER_RADIUS; final int padding = PADDING; final int baseline = this.getSize().height / 2; int markerX = (int)(this.getSize().width * visualizationInfo.getTimelineOffset()); int markerY = baseline; FontMetrics nameMetrics = g2.getFontMetrics(g2.getFont()); Rectangle2D nameRect = nameMetrics.getStringBounds(visualizationInfo.getName(), g2); int nameX = markerX - (int)(nameRect.getWidth() / 2); int nameY = -(int)nameRect.getY(); String year; if (visualizationInfo.getYear() >= 0) { year = new Integer(visualizationInfo.getYear()).toString(); } else { year = String.format(i18n.tr(STR, Math.abs(visualizationInfo.getYear()))); } FontMetrics yearMetrics = g2.getFontMetrics(g2.getFont()); Rectangle2D yearRect = yearMetrics.getStringBounds(year, g2); int yearX = markerX - (int)(yearRect.getWidth() / 2); int yearY = baseline + radius + padding - (int)yearRect.getY(); g2.setColor(LABEL_STROKE_COLOR); g2.setStroke(new BasicStroke(LABEL_STROKE_WIDTH)); g2.drawLine(markerX, markerY - radius - padding, markerX, nameY + (int)nameRect.getHeight() + (int)nameRect.getY() + padding); g2.setColor(NAME_TEXT_COLOR); g2.drawString(visualizationInfo.getName(), nameX, nameY); g2.setColor(YEAR_TEXT_COLOR); g2.drawString(year, yearX, yearY); g2.setColor(visualizationInfo.getDifficultyColor()); g2.fillOval(markerX - radius, markerY - radius, radius * 2, radius * 2); g2.setColor(TIMELINE_STROKE_COLOR); g2.setStroke(new BasicStroke(TIMELINE_STROKE_WIDTH)); g2.drawOval(markerX - radius, markerY - radius, radius * 2, radius * 2); }
/** * Paints the markers and the related labels. * @param g2 The graphics context * @param visualizationInfo The visualization info that is represented by the marker */
Paints the markers and the related labels
paintMarker
{ "repo_name": "matthiasplappert/Cryptographics", "path": "cg_implementierung/src/edu/kit/iks/Cryptographics/TimelineView.java", "license": "mit", "size": 8889 }
[ "edu.kit.iks.CryptographicsLib", "java.awt.BasicStroke", "java.awt.FontMetrics", "java.awt.Graphics2D", "java.awt.geom.Rectangle2D" ]
import edu.kit.iks.CryptographicsLib; import java.awt.BasicStroke; import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D;
import edu.kit.iks.*; import java.awt.*; import java.awt.geom.*;
[ "edu.kit.iks", "java.awt" ]
edu.kit.iks; java.awt;
733,054
public void draw(Graphics2D g2, Rectangle2D area) { area = trimMargin(area); drawBorder(g2, area); area = trimBorder(area); area = trimPadding(area); this.container.draw(g2, area); }
void function(Graphics2D g2, Rectangle2D area) { area = trimMargin(area); drawBorder(g2, area); area = trimBorder(area); area = trimPadding(area); this.container.draw(g2, area); }
/** * Draws the title on a Java 2D graphics device (such as the screen or a * printer). * * @param g2 the graphics device. * @param area the area allocated for the title. */
Draws the title on a Java 2D graphics device (such as the screen or a printer)
draw
{ "repo_name": "raedle/univis", "path": "lib/jfreechart-1.0.1/src/org/jfree/chart/title/CompositeTitle.java", "license": "lgpl-2.1", "size": 5813 }
[ "java.awt.Graphics2D", "java.awt.geom.Rectangle2D" ]
import java.awt.Graphics2D; import java.awt.geom.Rectangle2D;
import java.awt.*; import java.awt.geom.*;
[ "java.awt" ]
java.awt;
2,804,804
void verifyRMHeartbeatResponseForNodeLabels(NodeHeartbeatResponse response); }
void verifyRMHeartbeatResponseForNodeLabels(NodeHeartbeatResponse response); }
/** * check whether if updated labels sent to RM was accepted or not * @param response */
check whether if updated labels sent to RM was accepted or not
verifyRMHeartbeatResponseForNodeLabels
{ "repo_name": "aliyun-beta/aliyun-oss-hadoop-fs", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java", "license": "apache-2.0", "size": 44479 }
[ "org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatResponse" ]
import org.apache.hadoop.yarn.server.api.protocolrecords.NodeHeartbeatResponse;
import org.apache.hadoop.yarn.server.api.protocolrecords.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,506,916
public void doOperation(List<Individual> operands) { Fitness[] fA=rankPopulation(operands); int cnt = 0; while(cnt < this.size && cnt < operands.size()){ //Avoid duplicates if(!this.selectedPopulation.contains(fA[cnt].getIndividual()) && fA[cnt].getIndividual().isValid()) { Individual ind = fA[cnt].getIndividual().clone(); // System.out.println("org:\t"+fA[cnt].getIndividual().getGenotype().hashCode()); // System.out.println("new:\t"+ind.getGenotype().hashCode()); //Set individual as valid if(!this.evaluate_elites) { ind.setEvaluated(fA[cnt].getIndividual().isEvaluated()); ind.setValid(fA[cnt].getIndividual().isValid()); ind.setAge(fA[cnt].getIndividual().getAge()); ((GEIndividual)ind).setMapped(((GEIndividual)(fA[cnt].getIndividual())).isMapped()); ((GEIndividual)ind).setUsedCodons(((GEIndividual)(fA[cnt].getIndividual())).getUsedCodons()); } this.selectedPopulation.add(ind); } cnt++; } //System.out.println("E:"+this.selectedPopulation); }
void function(List<Individual> operands) { Fitness[] fA=rankPopulation(operands); int cnt = 0; while(cnt < this.size && cnt < operands.size()){ if(!this.selectedPopulation.contains(fA[cnt].getIndividual()) && fA[cnt].getIndividual().isValid()) { Individual ind = fA[cnt].getIndividual().clone(); if(!this.evaluate_elites) { ind.setEvaluated(fA[cnt].getIndividual().isEvaluated()); ind.setValid(fA[cnt].getIndividual().isValid()); ind.setAge(fA[cnt].getIndividual().getAge()); ((GEIndividual)ind).setMapped(((GEIndividual)(fA[cnt].getIndividual())).isMapped()); ((GEIndividual)ind).setUsedCodons(((GEIndividual)(fA[cnt].getIndividual())).getUsedCodons()); } this.selectedPopulation.add(ind); } cnt++; } }
/** * Ranks the population. Takes out size number of individuals and adds * to the selectedPopulation. * @param operands Individuals to select from **/
Ranks the population. Takes out size number of individuals and adds to the selectedPopulation
doOperation
{ "repo_name": "geronimo-iia/geva", "path": "GEVA/src/Operator/Operations/EliteOperationSelection.java", "license": "gpl-3.0", "size": 4658 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,635,599
public double lastIndexOf(BigInteger number) { return this.data.lastIndexOf(number); }
double function(BigInteger number) { return this.data.lastIndexOf(number); }
/** * Returns the index of the last occurrence of the specified element in this * list, or -1 if this list does not contain the element. * @param int the index * @return the index of the last occurrence */
Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element
lastIndexOf
{ "repo_name": "jessemull/MicroFlex", "path": "src/main/java/com/github/jessemull/microflex/bigintegerflex/plate/WellBigInteger.java", "license": "apache-2.0", "size": 25563 }
[ "java.math.BigInteger" ]
import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
2,379,236
protected Launcher createLauncher(BuildListener listener) throws IOException, InterruptedException { Launcher l = getCurrentNode().createLauncher(listener); if (project instanceof BuildableItemWithBuildWrappers) { BuildableItemWithBuildWrappers biwbw = (BuildableItemWithBuildWrappers) project; for (BuildWrapper bw : biwbw.getBuildWrappersList()) l = bw.decorateLauncher(AbstractBuild.this,l,listener); } buildEnvironments = new ArrayList<Environment>(); for (RunListener rl: RunListener.all()) { Environment environment = rl.setUpEnvironment(AbstractBuild.this, l, listener); if (environment != null) { buildEnvironments.add(environment); } } for (NodeProperty nodeProperty: Jenkins.getInstance().getGlobalNodeProperties()) { Environment environment = nodeProperty.setUp(AbstractBuild.this, l, listener); if (environment != null) { buildEnvironments.add(environment); } } for (NodeProperty nodeProperty: Computer.currentComputer().getNode().getNodeProperties()) { Environment environment = nodeProperty.setUp(AbstractBuild.this, l, listener); if (environment != null) { buildEnvironments.add(environment); } } return l; }
Launcher function(BuildListener listener) throws IOException, InterruptedException { Launcher l = getCurrentNode().createLauncher(listener); if (project instanceof BuildableItemWithBuildWrappers) { BuildableItemWithBuildWrappers biwbw = (BuildableItemWithBuildWrappers) project; for (BuildWrapper bw : biwbw.getBuildWrappersList()) l = bw.decorateLauncher(AbstractBuild.this,l,listener); } buildEnvironments = new ArrayList<Environment>(); for (RunListener rl: RunListener.all()) { Environment environment = rl.setUpEnvironment(AbstractBuild.this, l, listener); if (environment != null) { buildEnvironments.add(environment); } } for (NodeProperty nodeProperty: Jenkins.getInstance().getGlobalNodeProperties()) { Environment environment = nodeProperty.setUp(AbstractBuild.this, l, listener); if (environment != null) { buildEnvironments.add(environment); } } for (NodeProperty nodeProperty: Computer.currentComputer().getNode().getNodeProperties()) { Environment environment = nodeProperty.setUp(AbstractBuild.this, l, listener); if (environment != null) { buildEnvironments.add(environment); } } return l; }
/** * Creates a {@link Launcher} that this build will use. This can be overridden by derived types * to decorate the resulting {@link Launcher}. * * @param listener * Always non-null. Connected to the main build output. */
Creates a <code>Launcher</code> that this build will use. This can be overridden by derived types to decorate the resulting <code>Launcher</code>
createLauncher
{ "repo_name": "rwaldron/jenkins", "path": "core/src/main/java/hudson/model/AbstractBuild.java", "license": "mit", "size": 46957 }
[ "hudson.model.listeners.RunListener", "hudson.slaves.NodeProperty", "hudson.tasks.BuildWrapper", "java.io.IOException", "java.util.ArrayList" ]
import hudson.model.listeners.RunListener; import hudson.slaves.NodeProperty; import hudson.tasks.BuildWrapper; import java.io.IOException; import java.util.ArrayList;
import hudson.model.listeners.*; import hudson.slaves.*; import hudson.tasks.*; import java.io.*; import java.util.*;
[ "hudson.model.listeners", "hudson.slaves", "hudson.tasks", "java.io", "java.util" ]
hudson.model.listeners; hudson.slaves; hudson.tasks; java.io; java.util;
648,075
@Test public void testT1RV5D2_T1LV7D2() { test_id = getTestId("T1RV5D2", "T1LV7D2", "94"); String src = selectTRVD("T1RV5D2"); String dest = selectTLVD("T1LV7D2"); String result = "."; try { result = TRVD_TLVD_Action(src, dest); } catch (RecognitionException e) { e.printStackTrace(); } catch (TokenStreamException e) { e.printStackTrace(); } assertTrue(Success, checkResult_Success(src, dest, result)); GraphicalEditor editor = getActiveEditor(); if (editor != null) { validateOrGenerateResults(editor, generateResults); } } // TODO FIXME: This test must pass when CQ issue // dts0100650072 is resolved. // // public void testT1RV5D2_T1LV7D3() { // test_id = getTestId("T1RV5D2", "T1LV7D3", "95"); // // String src = selectTRVD("T1RV5D2"); // // String dest = selectTLVD("T1LV7D3"); // // String result = "."; // try { // result = TRVD_TLVD_Action(src, dest); // } catch (RecognitionException e) { // e.printStackTrace(); // } catch (TokenStreamException e) { // e.printStackTrace(); // } // assertTrue(ParamFailure4, checkResult_ParamFailure4(src, dest, result)); // // GraphicalEditor editor = getActiveEditor(); // if (editor != null) { // validateOrGenerateResults(editor, generateResults); // } // }
void function() { test_id = getTestId(STR, STR, "94"); String src = selectTRVD(STR); String dest = selectTLVD(STR); String result = "."; try { result = TRVD_TLVD_Action(src, dest); } catch (RecognitionException e) { e.printStackTrace(); } catch (TokenStreamException e) { e.printStackTrace(); } assertTrue(Success, checkResult_Success(src, dest, result)); GraphicalEditor editor = getActiveEditor(); if (editor != null) { validateOrGenerateResults(editor, generateResults); } }
/** * Perform the test for the given matrix column (T1RV5D2) and row (T1LV7D2). * */
Perform the test for the given matrix column (T1RV5D2) and row (T1LV7D2)
testT1RV5D2_T1LV7D2
{ "repo_name": "jason-rhodes/bridgepoint", "path": "src/org.xtuml.bp.als.oal.test/src/org/xtuml/bp/als/oal/test/SingleDimensionFixedArrayAssigmentTest_10_Generics.java", "license": "apache-2.0", "size": 160978 }
[ "org.xtuml.bp.ui.graphics.editor.GraphicalEditor" ]
import org.xtuml.bp.ui.graphics.editor.GraphicalEditor;
import org.xtuml.bp.ui.graphics.editor.*;
[ "org.xtuml.bp" ]
org.xtuml.bp;
1,761,745
@Test public void getDisplayCountries_negative() { String name = bean.getDisplayCountries().get("non-existing"); assertEquals("non-existing", name); }
void function() { String name = bean.getDisplayCountries().get(STR); assertEquals(STR, name); }
/** * The ISO country code is returned in case no localized name exists */
The ISO country code is returned in case no localized name exists
getDisplayCountries_negative
{ "repo_name": "opetrovski/development", "path": "oscm-portal-unittests/javasrc/org/oscm/ui/beans/CountryBeanTest.java", "license": "apache-2.0", "size": 1744 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,122,165
public void putOperand(int i, Operand op) { if (op == null) { ops[i] = null; } else { // TODO: Replace this silly copying code with an assertion that operands // are not shared between instructions and force people to be // more careful! if (op.instruction != null) { op = outOfLineCopy(op); } op.instruction = this; ops[i] = op; if (op instanceof MemoryOperand) { MemoryOperand mOp = op.asMemory(); op = mOp.loc; if (op != null) op.instruction = this; op = mOp.guard; if (op != null) op.instruction = this; op = mOp.base; if (op != null) op.instruction = this; op = mOp.index; if (op != null) op.instruction = this; } } }
void function(int i, Operand op) { if (op == null) { ops[i] = null; } else { if (op.instruction != null) { op = outOfLineCopy(op); } op.instruction = this; ops[i] = op; if (op instanceof MemoryOperand) { MemoryOperand mOp = op.asMemory(); op = mOp.loc; if (op != null) op.instruction = this; op = mOp.guard; if (op != null) op.instruction = this; op = mOp.base; if (op != null) op.instruction = this; op = mOp.index; if (op != null) op.instruction = this; } } }
/** * NOTE: It is incorrect to use putOperand with a constant argument * outside of the automatically generated code in Operators. * The only approved direct use of getOperand is in a loop over * some subset of an instruction's operands (all of them, all uses, all defs). * * @param i which operand to set * @param op the operand to set it to */
outside of the automatically generated code in Operators. The only approved direct use of getOperand is in a loop over some subset of an instruction's operands (all of them, all uses, all defs)
putOperand
{ "repo_name": "ut-osa/laminar", "path": "jikesrvm-3.0.0/rvm/src/org/jikesrvm/compilers/opt/ir/Instruction.java", "license": "bsd-3-clause", "size": 63005 }
[ "org.jikesrvm.compilers.opt.ir.operand.MemoryOperand", "org.jikesrvm.compilers.opt.ir.operand.Operand" ]
import org.jikesrvm.compilers.opt.ir.operand.MemoryOperand; import org.jikesrvm.compilers.opt.ir.operand.Operand;
import org.jikesrvm.compilers.opt.ir.operand.*;
[ "org.jikesrvm.compilers" ]
org.jikesrvm.compilers;
2,340,971
public void setBlockedTiles(Set<Integer> blocked);
void function(Set<Integer> blocked);
/** * Set the CIDs that are blocked from movement. * * @param blocked A set of blocked CIDs */
Set the CIDs that are blocked from movement
setBlockedTiles
{ "repo_name": "codylieu/oogasalad_OOGALoompas", "path": "src/main/java/engine/objects/monster/jgpathfinder/JGTileMapInterface.java", "license": "mit", "size": 1236 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,265,839
public NetworkAttachmentDao getNetworkAttachmentDao() { return getDao(NetworkAttachmentDao.class); }
NetworkAttachmentDao function() { return getDao(NetworkAttachmentDao.class); }
/** * Returns the singleton instance of {@link NetworkAttachmentDao}. * * @return the dao */
Returns the singleton instance of <code>NetworkAttachmentDao</code>
getNetworkAttachmentDao
{ "repo_name": "jtux270/translate", "path": "ovirt/3.6_source/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/DbFacade.java", "license": "gpl-3.0", "size": 42484 }
[ "org.ovirt.engine.core.dao.network.NetworkAttachmentDao" ]
import org.ovirt.engine.core.dao.network.NetworkAttachmentDao;
import org.ovirt.engine.core.dao.network.*;
[ "org.ovirt.engine" ]
org.ovirt.engine;
2,876,222
public ServiceCall<Void> addPetUsingByteArrayAsync(final ServiceCallback<Void> serviceCallback) { return ServiceCall.create(addPetUsingByteArrayWithServiceResponseAsync(), serviceCallback); }
ServiceCall<Void> function(final ServiceCallback<Void> serviceCallback) { return ServiceCall.create(addPetUsingByteArrayWithServiceResponseAsync(), serviceCallback); }
/** * Fake endpoint to test byte array in body parameter for adding a new pet to the store. * * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */
Fake endpoint to test byte array in body parameter for adding a new pet to the store
addPetUsingByteArrayAsync
{ "repo_name": "yugangw-msft/autorest", "path": "Samples/petstore/Java/implementation/SwaggerPetstoreImpl.java", "license": "mit", "size": 99949 }
[ "com.microsoft.rest.ServiceCall", "com.microsoft.rest.ServiceCallback" ]
import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,094,065
void deleteOrder(Order order);
void deleteOrder(Order order);
/** * Deletes an existing order. */
Deletes an existing order
deleteOrder
{ "repo_name": "joaoandremartins/gfx", "path": "services/order/src/main/java/com/google/gfx/order/OrderService.java", "license": "apache-2.0", "size": 2827 }
[ "com.google.gfx.Order" ]
import com.google.gfx.Order;
import com.google.gfx.*;
[ "com.google.gfx" ]
com.google.gfx;
743,379
private void fireMenuKeyPressed(MenuKeyEvent event) { Object[] listeners = listenerList.getListenerList(); for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==MenuKeyListener.class) { ((MenuKeyListener)listeners[i+1]).menuKeyPressed(event); } } }
void function(MenuKeyEvent event) { Object[] listeners = listenerList.getListenerList(); for (int i = listeners.length-2; i>=0; i-=2) { if (listeners[i]==MenuKeyListener.class) { ((MenuKeyListener)listeners[i+1]).menuKeyPressed(event); } } }
/** * Notifies all listeners that have registered interest for * notification on this event type. * * @param event a <code>MenuKeyEvent</code> * @see EventListenerList */
Notifies all listeners that have registered interest for notification on this event type
fireMenuKeyPressed
{ "repo_name": "mirkosertic/Bytecoder", "path": "classlib/java.desktop/src/main/resources/META-INF/modules/java.desktop/classes/javax/swing/JPopupMenu.java", "license": "apache-2.0", "size": 53892 }
[ "javax.swing.event.MenuKeyEvent", "javax.swing.event.MenuKeyListener" ]
import javax.swing.event.MenuKeyEvent; import javax.swing.event.MenuKeyListener;
import javax.swing.event.*;
[ "javax.swing" ]
javax.swing;
2,135,163
@Test @OperateOnDeployment(DEPLOYMENT) public void testEmptyUserExistPassword(@ArquillianResource URL webAppURL) throws Exception { assertAuthenticationFailed(webAppURL, EMPTY_USER, CORRECT_PASSWORD); }
@OperateOnDeployment(DEPLOYMENT) void function(@ArquillianResource URL webAppURL) throws Exception { assertAuthenticationFailed(webAppURL, EMPTY_USER, CORRECT_PASSWORD); }
/** * When user with empty username with exist password tries to authenticate, <br> * then authentication should fail. */
When user with empty username with exist password tries to authenticate, then authentication should fail
testEmptyUserExistPassword
{ "repo_name": "xasx/wildfly", "path": "testsuite/integration/elytron/src/test/java/org/wildfly/test/integration/elytron/realm/LdapRealmTestCase.java", "license": "lgpl-2.1", "size": 16937 }
[ "org.jboss.arquillian.container.test.api.OperateOnDeployment", "org.jboss.arquillian.test.api.ArquillianResource" ]
import org.jboss.arquillian.container.test.api.OperateOnDeployment; import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.arquillian.container.test.api.*; import org.jboss.arquillian.test.api.*;
[ "org.jboss.arquillian" ]
org.jboss.arquillian;
2,379,898
static PointerType wordNetRelationToPointerType( WordNetRelation relation) throws WordNetException { switch( relation) { case SYNONYM: return null; // Synonyms are the only relation that returns null case ANTONYM: return PointerType.ANTONYM; case REGION: return (PointerType.REGION); case USAGE : return (PointerType.USAGE); // Nouns and Verbs case HYPERNYM: return (PointerType.HYPERNYM); case HYPONYM : return (PointerType.HYPONYM); case DERIVATIONALLY_RELATED : return (PointerType.NOMINALIZATION); case INSTANCE_HYPERNYM: return (PointerType.INSTANCE_HYPERNYM); case INSTANCE_HYPONYM : return (PointerType.INSTANCES_HYPONYM); // Nouns and Adjectives case ATTRIBUTE : return (PointerType.ATTRIBUTE); case SEE_ALSO: return (PointerType.SEE_ALSO); // Nouns case MEMBER_HOLONYM : return (PointerType.MEMBER_HOLONYM); case SUBSTANCE_HOLONYM: return (PointerType.SUBSTANCE_HOLONYM); case PART_HOLONYM : return (PointerType.PART_HOLONYM); case MEMBER_MERONYM: return (PointerType.MEMBER_MERONYM); case SUBSTANCE_MERONYM: return (PointerType.SUBSTANCE_MERONYM); case PART_MERONYM: return (PointerType.PART_MERONYM); case CATEGORY_MEMBER: throw new WordNetException("CATEGORY_MEMBER is not implemented."); // return null; // not implemented case REGION_MEMBER: return (PointerType.REGION_MEMBER); case USAGE_MEMBER: return (PointerType.USAGE_MEMBER); // Verbs case ENTAILMENT : return (PointerType.ENTAILMENT); case CAUSE: return (PointerType.CAUSE); case VERB_GROUP: return (PointerType.VERB_GROUP); case TROPONYM: throw new WordNetException("TROPONYM is not implemented."); // return null; // not implemented // Adjectives case SIMILAR_TO : return (PointerType.SIMILAR_TO); case PARTICIPLE_OF: return (PointerType.PARTICIPLE_OF); case PERTAINYM: return (PointerType.PERTAINYM); // Adverbs case DERIVED: throw new WordNetException("DERIVED is not implemented."); // return null; // not implemented default: throw new WordNetException("Internal bug: this method lacks a clause for this WordNetRelation: " + relation); } }
static PointerType wordNetRelationToPointerType( WordNetRelation relation) throws WordNetException { switch( relation) { case SYNONYM: return null; case ANTONYM: return PointerType.ANTONYM; case REGION: return (PointerType.REGION); case USAGE : return (PointerType.USAGE); case HYPERNYM: return (PointerType.HYPERNYM); case HYPONYM : return (PointerType.HYPONYM); case DERIVATIONALLY_RELATED : return (PointerType.NOMINALIZATION); case INSTANCE_HYPERNYM: return (PointerType.INSTANCE_HYPERNYM); case INSTANCE_HYPONYM : return (PointerType.INSTANCES_HYPONYM); case ATTRIBUTE : return (PointerType.ATTRIBUTE); case SEE_ALSO: return (PointerType.SEE_ALSO); case MEMBER_HOLONYM : return (PointerType.MEMBER_HOLONYM); case SUBSTANCE_HOLONYM: return (PointerType.SUBSTANCE_HOLONYM); case PART_HOLONYM : return (PointerType.PART_HOLONYM); case MEMBER_MERONYM: return (PointerType.MEMBER_MERONYM); case SUBSTANCE_MERONYM: return (PointerType.SUBSTANCE_MERONYM); case PART_MERONYM: return (PointerType.PART_MERONYM); case CATEGORY_MEMBER: throw new WordNetException(STR); case REGION_MEMBER: return (PointerType.REGION_MEMBER); case USAGE_MEMBER: return (PointerType.USAGE_MEMBER); case ENTAILMENT : return (PointerType.ENTAILMENT); case CAUSE: return (PointerType.CAUSE); case VERB_GROUP: return (PointerType.VERB_GROUP); case TROPONYM: throw new WordNetException(STR); case SIMILAR_TO : return (PointerType.SIMILAR_TO); case PARTICIPLE_OF: return (PointerType.PARTICIPLE_OF); case PERTAINYM: return (PointerType.PERTAINYM); case DERIVED: throw new WordNetException(STR); default: throw new WordNetException(STR + relation); } }
/** * Return the Jwnl {@link PointerType} matching the given {@link WordNetRelation}. Notice that some {@link WordNetRelation}s have no implementation in Jwnl, and return * null. * * @param relation * @return * @throws WordNetException */
Return the Jwnl <code>PointerType</code> matching the given <code>WordNetRelation</code>. Notice that some <code>WordNetRelation</code>s have no implementation in Jwnl, and return null
wordNetRelationToPointerType
{ "repo_name": "madhumita-git/Excitement-Open-Platform", "path": "core/src/main/java/eu/excitementproject/eop/core/utilities/dictionary/wordnet/jwnl/JwnlUtils.java", "license": "gpl-3.0", "size": 3764 }
[ "eu.excitementproject.eop.core.utilities.dictionary.wordnet.WordNetException", "eu.excitementproject.eop.core.utilities.dictionary.wordnet.WordNetRelation", "net.didion.jwnl.data.PointerType" ]
import eu.excitementproject.eop.core.utilities.dictionary.wordnet.WordNetException; import eu.excitementproject.eop.core.utilities.dictionary.wordnet.WordNetRelation; import net.didion.jwnl.data.PointerType;
import eu.excitementproject.eop.core.utilities.dictionary.wordnet.*; import net.didion.jwnl.data.*;
[ "eu.excitementproject.eop", "net.didion.jwnl" ]
eu.excitementproject.eop; net.didion.jwnl;
2,714,508
public Set<Component> getActiveViews(); }
Set<Component> function(); }
/** * Get any "active" views, such as those being moved by the * user. The layout will treat these specially and avoid * changing their row, to keep the object that a user is * manipulating from bouncing around. * @return the set of actively-manipulated components */
Get any "active" views, such as those being moved by the user. The layout will treat these specially and avoid changing their row, to keep the object that a user is manipulating from bouncing around
getActiveViews
{ "repo_name": "nasa/MCT-Plugins", "path": "scenario/src/main/java/gov/nasa/arc/mct/scenario/view/TimelineLayout.java", "license": "apache-2.0", "size": 12392 }
[ "java.awt.Component", "java.util.Set" ]
import java.awt.Component; import java.util.Set;
import java.awt.*; import java.util.*;
[ "java.awt", "java.util" ]
java.awt; java.util;
133,530
public void addInterval(JRMeterInterval interval) { intervals.add(interval); getEventSupport().fireCollectionElementAddedEvent(PROPERTY_INTERVALS, interval, intervals.size() - 1); }
void function(JRMeterInterval interval) { intervals.add(interval); getEventSupport().fireCollectionElementAddedEvent(PROPERTY_INTERVALS, interval, intervals.size() - 1); }
/** * Adds an interval to the meter. An interval is used to indicate a * section of the meter. * * @param interval the interval to add to the meter */
Adds an interval to the meter. An interval is used to indicate a section of the meter
addInterval
{ "repo_name": "MHTaleb/Encologim", "path": "lib/JasperReport/src/net/sf/jasperreports/charts/design/JRDesignMeterPlot.java", "license": "gpl-3.0", "size": 8283 }
[ "net.sf.jasperreports.charts.util.JRMeterInterval" ]
import net.sf.jasperreports.charts.util.JRMeterInterval;
import net.sf.jasperreports.charts.util.*;
[ "net.sf.jasperreports" ]
net.sf.jasperreports;
1,495,276
public final void setMyScope(final Scope scope) { setParentScope(scope); for (FormalParameter parameter : parameters) { parameter.setMyScope(this); } }
final void function(final Scope scope) { setParentScope(scope); for (FormalParameter parameter : parameters) { parameter.setMyScope(this); } }
/** * Sets the scope of the formal parameter list. * * @param scope * the scope to be set * */
Sets the scope of the formal parameter list
setMyScope
{ "repo_name": "eroslevi/titan.EclipsePlug-ins", "path": "org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/FormalParameterList.java", "license": "epl-1.0", "size": 41340 }
[ "org.eclipse.titan.designer.AST" ]
import org.eclipse.titan.designer.AST;
import org.eclipse.titan.designer.*;
[ "org.eclipse.titan" ]
org.eclipse.titan;
933,158
public boolean execute(CommandSender originalSender, String alias, String[] args){ List<SudeCommand> cmdList; cmdList = Commands.getCommands(); String listString = "/" + Commands.longPrefix; for (int i = 0; i < cmdList.size(); i++){ listString += ", /" + cmdList.get(i).getFullName(); } originalSender.sendMessage(listString); return true; }
boolean function(CommandSender originalSender, String alias, String[] args){ List<SudeCommand> cmdList; cmdList = Commands.getCommands(); String listString = "/" + Commands.longPrefix; for (int i = 0; i < cmdList.size(); i++){ listString += STR + cmdList.get(i).getFullName(); } originalSender.sendMessage(listString); return true; }
/** * Executes command with given arguments. * @param originalSender The original sender of the commnand * @param alias Who the command acts for * @return True if succesful, false if there was an error */
Executes command with given arguments
execute
{ "repo_name": "NicolasKiely/Sude", "path": "src/metal/sude/commands/CmdCommand.java", "license": "mit", "size": 1872 }
[ "java.util.List", "org.bukkit.command.CommandSender" ]
import java.util.List; import org.bukkit.command.CommandSender;
import java.util.*; import org.bukkit.command.*;
[ "java.util", "org.bukkit.command" ]
java.util; org.bukkit.command;
2,388,104
private static OutputInfo getOutputInfo(Lop node, boolean cellModeOverride) throws LopsException { if ( (node.getDataType() == DataType.SCALAR && node.getExecType() == ExecType.CP) || node instanceof FunctionCallCP ) return null; OutputInfo oinfo = null; OutputParameters oparams = node.getOutputParameters(); if (oparams.isBlocked()) { if ( !cellModeOverride ) oinfo = OutputInfo.BinaryBlockOutputInfo; else { // output format is overridden, for example, due to recordReaderInstructions in the job oinfo = OutputInfo.BinaryCellOutputInfo; // record decision of overriding in lop's outputParameters so that // subsequent jobs that use this lop's output know the correct format. // TODO: ideally, this should be done by having a member variable in Lop // which stores the outputInfo. try { oparams.setDimensions(oparams.getNumRows(), oparams.getNumCols(), -1, -1, oparams.getNnz(), oparams.getUpdateType()); } catch(HopsException e) { throw new LopsException(node.printErrorLocation() + "error in getOutputInfo in Dag ", e); } } } else { if (oparams.getFormat() == Format.TEXT || oparams.getFormat() == Format.MM) oinfo = OutputInfo.TextCellOutputInfo; else if ( oparams.getFormat() == Format.CSV ) { oinfo = OutputInfo.CSVOutputInfo; } else { oinfo = OutputInfo.BinaryCellOutputInfo; } } if (node.getType() == Type.SortKeys && node.getExecType() == ExecType.MR) { if( ((SortKeys)node).getOpType() == SortKeys.OperationTypes.Indexes) oinfo = OutputInfo.BinaryBlockOutputInfo; else oinfo = OutputInfo.OutputInfoForSortOutput; } else if (node.getType() == Type.CombineBinary) { // Output format of CombineBinary (CB) depends on how the output is consumed CombineBinary combine = (CombineBinary) node; if ( combine.getOperation() == org.apache.sysml.lops.CombineBinary.OperationTypes.PreSort ) { oinfo = OutputInfo.OutputInfoForSortInput; } else if ( combine.getOperation() == org.apache.sysml.lops.CombineBinary.OperationTypes.PreCentralMoment || combine.getOperation() == org.apache.sysml.lops.CombineBinary.OperationTypes.PreCovUnweighted || combine.getOperation() == org.apache.sysml.lops.CombineBinary.OperationTypes.PreGroupedAggUnweighted ) { oinfo = OutputInfo.WeightedPairOutputInfo; } } else if ( node.getType() == Type.CombineTernary) { oinfo = OutputInfo.WeightedPairOutputInfo; } else if (node.getType() == Type.CentralMoment || node.getType() == Type.CoVariance ) { // CMMR always operate in "cell mode", // and the output is always in cell format oinfo = OutputInfo.BinaryCellOutputInfo; } return oinfo; }
static OutputInfo function(Lop node, boolean cellModeOverride) throws LopsException { if ( (node.getDataType() == DataType.SCALAR && node.getExecType() == ExecType.CP) node instanceof FunctionCallCP ) return null; OutputInfo oinfo = null; OutputParameters oparams = node.getOutputParameters(); if (oparams.isBlocked()) { if ( !cellModeOverride ) oinfo = OutputInfo.BinaryBlockOutputInfo; else { oinfo = OutputInfo.BinaryCellOutputInfo; try { oparams.setDimensions(oparams.getNumRows(), oparams.getNumCols(), -1, -1, oparams.getNnz(), oparams.getUpdateType()); } catch(HopsException e) { throw new LopsException(node.printErrorLocation() + STR, e); } } } else { if (oparams.getFormat() == Format.TEXT oparams.getFormat() == Format.MM) oinfo = OutputInfo.TextCellOutputInfo; else if ( oparams.getFormat() == Format.CSV ) { oinfo = OutputInfo.CSVOutputInfo; } else { oinfo = OutputInfo.BinaryCellOutputInfo; } } if (node.getType() == Type.SortKeys && node.getExecType() == ExecType.MR) { if( ((SortKeys)node).getOpType() == SortKeys.OperationTypes.Indexes) oinfo = OutputInfo.BinaryBlockOutputInfo; else oinfo = OutputInfo.OutputInfoForSortOutput; } else if (node.getType() == Type.CombineBinary) { CombineBinary combine = (CombineBinary) node; if ( combine.getOperation() == org.apache.sysml.lops.CombineBinary.OperationTypes.PreSort ) { oinfo = OutputInfo.OutputInfoForSortInput; } else if ( combine.getOperation() == org.apache.sysml.lops.CombineBinary.OperationTypes.PreCentralMoment combine.getOperation() == org.apache.sysml.lops.CombineBinary.OperationTypes.PreCovUnweighted combine.getOperation() == org.apache.sysml.lops.CombineBinary.OperationTypes.PreGroupedAggUnweighted ) { oinfo = OutputInfo.WeightedPairOutputInfo; } } else if ( node.getType() == Type.CombineTernary) { oinfo = OutputInfo.WeightedPairOutputInfo; } else if (node.getType() == Type.CentralMoment node.getType() == Type.CoVariance ) { oinfo = OutputInfo.BinaryCellOutputInfo; } return oinfo; }
/** * Method that determines the output format for a given node. * * @param node low-level operator * @param cellModeOverride override mode * @return output info * @throws LopsException if LopsException occurs */
Method that determines the output format for a given node
getOutputInfo
{ "repo_name": "akchinSTC/systemml", "path": "src/main/java/org/apache/sysml/lops/compile/Dag.java", "license": "apache-2.0", "size": 140926 }
[ "org.apache.sysml.hops.HopsException", "org.apache.sysml.lops.CombineBinary", "org.apache.sysml.lops.Data", "org.apache.sysml.lops.FunctionCallCP", "org.apache.sysml.lops.Lop", "org.apache.sysml.lops.LopProperties", "org.apache.sysml.lops.LopsException", "org.apache.sysml.lops.OutputParameters", "org.apache.sysml.lops.SortKeys", "org.apache.sysml.parser.Expression", "org.apache.sysml.runtime.matrix.data.OutputInfo" ]
import org.apache.sysml.hops.HopsException; import org.apache.sysml.lops.CombineBinary; import org.apache.sysml.lops.Data; import org.apache.sysml.lops.FunctionCallCP; import org.apache.sysml.lops.Lop; import org.apache.sysml.lops.LopProperties; import org.apache.sysml.lops.LopsException; import org.apache.sysml.lops.OutputParameters; import org.apache.sysml.lops.SortKeys; import org.apache.sysml.parser.Expression; import org.apache.sysml.runtime.matrix.data.OutputInfo;
import org.apache.sysml.hops.*; import org.apache.sysml.lops.*; import org.apache.sysml.parser.*; import org.apache.sysml.runtime.matrix.data.*;
[ "org.apache.sysml" ]
org.apache.sysml;
2,419,399
@Test public void testGetWorkBookNames() { System.out.println("GetWorkBookNames"); String name = "test_book1.xls"; String storage = ""; String folder = ""; try { NamesResponse result = cellsApi.GetWorkBookNames(name, storage, folder); } catch (Exception apiException) { System.out.println("exp:" + apiException.getMessage()); assertNull(apiException); } }
void function() { System.out.println(STR); String name = STR; String storage = STRSTRexp:" + apiException.getMessage()); assertNull(apiException); } }
/** * Test of GetWorkBookNames method, of class CellsApi. */
Test of GetWorkBookNames method, of class CellsApi
testGetWorkBookNames
{ "repo_name": "aspose-cells/Aspose.Cells-for-Cloud", "path": "SDKs/Aspose.Cells-Cloud-SDK-for-Android/Aspose.Cells-Cloud-SDK-Android/src/test/java/com/aspose/cells/api/CellsApiTest.java", "license": "mit", "size": 91749 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
239,878
public static <F1,F2,F3,F4,T> TagProtocol<T> tag(QName qname, Protocol<XMLEvent,F1> p1, Protocol<XMLEvent,F2> p2, Protocol<XMLEvent,F3> p3, Protocol<XMLEvent,F4> p4, Function4<F1,F2,F3,F4,T> f, Function1<T,F1> g1, Function1<T,F2> g2, Function1<T,F3> g3, Function1<T,F4> g4) { return new TagProtocol<>(Option.of(qname), Vector.of(p1, p2, p3, p4), args -> f.apply((F1) args.get(0), (F2) args.get(1), (F3) args.get(2), (F4) args.get(3)), Vector.of(g1, g2, g3, g4)); }
static <F1,F2,F3,F4,T> TagProtocol<T> function(QName qname, Protocol<XMLEvent,F1> p1, Protocol<XMLEvent,F2> p2, Protocol<XMLEvent,F3> p3, Protocol<XMLEvent,F4> p4, Function4<F1,F2,F3,F4,T> f, Function1<T,F1> g1, Function1<T,F2> g2, Function1<T,F3> g3, Function1<T,F4> g4) { return new TagProtocol<>(Option.of(qname), Vector.of(p1, p2, p3, p4), args -> f.apply((F1) args.get(0), (F2) args.get(1), (F3) args.get(2), (F4) args.get(3)), Vector.of(g1, g2, g3, g4)); }
/** * Reads and writes a tag and child elements (tag or attribute) using [p*], using [f] to create the result on reading, getting values using [g*] for writing. */
Reads and writes a tag and child elements (tag or attribute) using [p*], using [f] to create the result on reading, getting values using [g*] for writing
tag
{ "repo_name": "Tradeshift/ts-reaktive", "path": "ts-reaktive-marshal/src/main/java/com/tradeshift/reaktive/xml/XMLProtocol.java", "license": "mit", "size": 22485 }
[ "com.tradeshift.reaktive.marshal.Protocol", "io.vavr.Function1", "io.vavr.Function4", "io.vavr.collection.Vector", "io.vavr.control.Option", "javax.xml.namespace.QName", "javax.xml.stream.events.XMLEvent" ]
import com.tradeshift.reaktive.marshal.Protocol; import io.vavr.Function1; import io.vavr.Function4; import io.vavr.collection.Vector; import io.vavr.control.Option; import javax.xml.namespace.QName; import javax.xml.stream.events.XMLEvent;
import com.tradeshift.reaktive.marshal.*; import io.vavr.*; import io.vavr.collection.*; import io.vavr.control.*; import javax.xml.namespace.*; import javax.xml.stream.events.*;
[ "com.tradeshift.reaktive", "io.vavr", "io.vavr.collection", "io.vavr.control", "javax.xml" ]
com.tradeshift.reaktive; io.vavr; io.vavr.collection; io.vavr.control; javax.xml;
785,594
public void assertBindingFailure(Module module, String... msgs) { try { List<Element> elements = Elements.getElements(module); StringBuilder s = new StringBuilder(); for (Element element : elements) { s.append(element).append("\n"); } fail("Expected exception from configuring module. Found these bindings:\n" + s); } catch (IllegalArgumentException e) { for (String msg : msgs) { assertTrue(e.getMessage() + " didn't contain: " + msg, e.getMessage().contains(msg)); } } }
void function(Module module, String... msgs) { try { List<Element> elements = Elements.getElements(module); StringBuilder s = new StringBuilder(); for (Element element : elements) { s.append(element).append("\n"); } fail(STR + s); } catch (IllegalArgumentException e) { for (String msg : msgs) { assertTrue(e.getMessage() + STR + msg, e.getMessage().contains(msg)); } } }
/** * Attempts to configure the module, and asserts an {@link IllegalArgumentException} is * caught, containing the given messages */
Attempts to configure the module, and asserts an <code>IllegalArgumentException</code> is caught, containing the given messages
assertBindingFailure
{ "repo_name": "jimczi/elasticsearch", "path": "test/framework/src/main/java/org/elasticsearch/common/inject/ModuleTestCase.java", "license": "apache-2.0", "size": 12291 }
[ "java.util.List", "org.elasticsearch.common.inject.spi.Element", "org.elasticsearch.common.inject.spi.Elements" ]
import java.util.List; import org.elasticsearch.common.inject.spi.Element; import org.elasticsearch.common.inject.spi.Elements;
import java.util.*; import org.elasticsearch.common.inject.spi.*;
[ "java.util", "org.elasticsearch.common" ]
java.util; org.elasticsearch.common;
352,666
@Override public Vector2f getBounds() {return null;}
public Vector2f getBounds() {return null;}
/** * Unused method in this class. */
Unused method in this class
getPositionY
{ "repo_name": "bwyap/java-engine-lwjgl", "path": "src/com/bwyap/engine/gui/element/base/AbstractGUIElement.java", "license": "mit", "size": 3235 }
[ "org.joml.Vector2f" ]
import org.joml.Vector2f;
import org.joml.*;
[ "org.joml" ]
org.joml;
2,527,151
public void setUnitXPaint(Paint paint) { unitXPaint = paint; unitYPaint = paint; }
void function(Paint paint) { unitXPaint = paint; unitYPaint = paint; }
/** * Set which paint the unit lines on the x-axis should be painted with. * * @param paint * {@code Paint} to paint the unit lines on the x-axis with. */
Set which paint the unit lines on the x-axis should be painted with
setUnitXPaint
{ "repo_name": "andern/jcoolib", "path": "src/cartesian/coordinate/CCSystem.java", "license": "gpl-3.0", "size": 37342 }
[ "java.awt.Paint" ]
import java.awt.Paint;
import java.awt.*;
[ "java.awt" ]
java.awt;
148,142
public static Mac getInitializedMac(final String algorithm, final byte[] key) { if (key == null) { throw new IllegalArgumentException("Null key"); } try { final SecretKeySpec keySpec = new SecretKeySpec(key, algorithm); final Mac mac = Mac.getInstance(algorithm); mac.init(keySpec); return mac; } catch (final NoSuchAlgorithmException e) { throw new IllegalArgumentException(e); } catch (final InvalidKeyException e) { throw new IllegalArgumentException(e); } } // hmacMd5
static Mac function(final String algorithm, final byte[] key) { if (key == null) { throw new IllegalArgumentException(STR); } try { final SecretKeySpec keySpec = new SecretKeySpec(key, algorithm); final Mac mac = Mac.getInstance(algorithm); mac.init(keySpec); return mac; } catch (final NoSuchAlgorithmException e) { throw new IllegalArgumentException(e); } catch (final InvalidKeyException e) { throw new IllegalArgumentException(e); } }
/** * Returns an initialized <code>Mac</code> for the given <code>algorithm</code>. * * @param algorithm * the name of the algorithm requested. See <a href= * "http://docs.oracle.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html#AppA" >Appendix * A in the Java Cryptography Architecture Reference Guide</a> for information about standard algorithm * names. * @param key * They key for the keyed digest (must not be null) * @return A Mac instance initialized with the given key. * @see Mac#getInstance(String) * @see Mac#init(Key) * @throws IllegalArgumentException * when a {@link NoSuchAlgorithmException} is caught or key is null or key is invalid. */
Returns an initialized <code>Mac</code> for the given <code>algorithm</code>
getInitializedMac
{ "repo_name": "MaxCDN/java-maxcdn", "path": "src/org/apache/commons/codec/digest/HmacUtils.java", "license": "mit", "size": 34353 }
[ "java.security.InvalidKeyException", "java.security.NoSuchAlgorithmException", "javax.crypto.Mac", "javax.crypto.spec.SecretKeySpec" ]
import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec;
import java.security.*; import javax.crypto.*; import javax.crypto.spec.*;
[ "java.security", "javax.crypto" ]
java.security; javax.crypto;
2,269,658
assertEquals(CategoryAnchor.START, CategoryAnchor.START); assertEquals(CategoryAnchor.MIDDLE, CategoryAnchor.MIDDLE); assertEquals(CategoryAnchor.END, CategoryAnchor.END); assertFalse(CategoryAnchor.START.equals(CategoryAnchor.END)); assertFalse(CategoryAnchor.MIDDLE.equals(CategoryAnchor.END)); }
assertEquals(CategoryAnchor.START, CategoryAnchor.START); assertEquals(CategoryAnchor.MIDDLE, CategoryAnchor.MIDDLE); assertEquals(CategoryAnchor.END, CategoryAnchor.END); assertFalse(CategoryAnchor.START.equals(CategoryAnchor.END)); assertFalse(CategoryAnchor.MIDDLE.equals(CategoryAnchor.END)); }
/** * Check that the equals() method distinguishes known instances. */
Check that the equals() method distinguishes known instances
testEquals
{ "repo_name": "akardapolov/ASH-Viewer", "path": "jfreechart-fse/src/test/java/org/jfree/chart/axis/CategoryAnchorTest.java", "license": "gpl-3.0", "size": 3600 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
861,664
public static String getResponseFromHttpUrl(URL url) throws IOException { HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); try { InputStream in = urlConnection.getInputStream(); Scanner scanner = new Scanner(in); scanner.useDelimiter("\\A"); boolean hasInput = scanner.hasNext(); if (hasInput) { return scanner.next(); } else { return null; } } finally { urlConnection.disconnect(); } }
static String function(URL url) throws IOException { HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); try { InputStream in = urlConnection.getInputStream(); Scanner scanner = new Scanner(in); scanner.useDelimiter("\\A"); boolean hasInput = scanner.hasNext(); if (hasInput) { return scanner.next(); } else { return null; } } finally { urlConnection.disconnect(); } }
/** * This method returns the entire result from the HTTP response. * * @param url The URL to fetch the HTTP response from. * @return The contents of the HTTP response. * @throws IOException Related to network and stream reading */
This method returns the entire result from the HTTP response
getResponseFromHttpUrl
{ "repo_name": "gentlemanZ/ud851-Exercises-student", "path": "Lesson02-GitHub-Repo-Search/T02.02-Solution-AddMenu/app/src/main/java/com/example/android/datafrominternet/utilities/NetworkUtils.java", "license": "apache-2.0", "size": 2431 }
[ "java.io.IOException", "java.io.InputStream", "java.net.HttpURLConnection", "java.util.Scanner" ]
import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.util.Scanner;
import java.io.*; import java.net.*; import java.util.*;
[ "java.io", "java.net", "java.util" ]
java.io; java.net; java.util;
1,275,304
if (jrElement == null) { // here put a wizard jrElement = new PieSerie().createSerie(); } }
if (jrElement == null) { jrElement = new PieSerie().createSerie(); } }
/** * Creates the object. */
Creates the object
createObject
{ "repo_name": "OpenSoftwareSolutions/PDFReporter-Studio", "path": "com.jaspersoft.studio.components/src/com/jaspersoft/studio/components/chart/model/series/pie/command/CreatePieSeriesCommand.java", "license": "lgpl-3.0", "size": 2630 }
[ "com.jaspersoft.studio.components.chart.wizard.fragments.data.series.PieSerie" ]
import com.jaspersoft.studio.components.chart.wizard.fragments.data.series.PieSerie;
import com.jaspersoft.studio.components.chart.wizard.fragments.data.series.*;
[ "com.jaspersoft.studio" ]
com.jaspersoft.studio;
1,025,164
public void recreateReactContextInBackground() { Assertions.assertCondition( mHasStartedCreatingInitialContext, "recreateReactContextInBackground should only be called after the initial " + "createReactContextInBackground call."); recreateReactContextInBackgroundInner(); }
void function() { Assertions.assertCondition( mHasStartedCreatingInitialContext, STR + STR); recreateReactContextInBackgroundInner(); }
/** * Recreate the react application and context. This should be called if configuration has * changed or the developer has requested the app to be reloaded. It should only be called after * an initial call to createReactContextInBackground. * * Called from UI thread. */
Recreate the react application and context. This should be called if configuration has changed or the developer has requested the app to be reloaded. It should only be called after an initial call to createReactContextInBackground. Called from UI thread
recreateReactContextInBackground
{ "repo_name": "nathanajah/react-native", "path": "ReactAndroid/src/main/java/com/facebook/react/XReactInstanceManagerImpl.java", "license": "bsd-3-clause", "size": 36860 }
[ "com.facebook.infer.annotation.Assertions" ]
import com.facebook.infer.annotation.Assertions;
import com.facebook.infer.annotation.*;
[ "com.facebook.infer" ]
com.facebook.infer;
2,539,663
public OperationsClient getOperations() { return this.operations; } OpenEnergyPlatformManagementServiceAPIsImpl( HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; this.apiVersion = "2021-06-01-preview"; this.locations = new LocationsClientImpl(this); this.energyServices = new EnergyServicesClientImpl(this); this.operations = new OperationsClientImpl(this); }
OperationsClient function() { return this.operations; } OpenEnergyPlatformManagementServiceAPIsImpl( HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; this.apiVersion = STR; this.locations = new LocationsClientImpl(this); this.energyServices = new EnergyServicesClientImpl(this); this.operations = new OperationsClientImpl(this); }
/** * Gets the OperationsClient object to access its operations. * * @return the OperationsClient object. */
Gets the OperationsClient object to access its operations
getOperations
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/oep/azure-resourcemanager-oep/src/main/java/com/azure/resourcemanager/oep/implementation/OpenEnergyPlatformManagementServiceAPIsImpl.java", "license": "mit", "size": 11260 }
[ "com.azure.core.http.HttpPipeline", "com.azure.core.management.AzureEnvironment", "com.azure.core.util.serializer.SerializerAdapter", "com.azure.resourcemanager.oep.fluent.OperationsClient", "java.time.Duration" ]
import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.resourcemanager.oep.fluent.OperationsClient; import java.time.Duration;
import com.azure.core.http.*; import com.azure.core.management.*; import com.azure.core.util.serializer.*; import com.azure.resourcemanager.oep.fluent.*; import java.time.*;
[ "com.azure.core", "com.azure.resourcemanager", "java.time" ]
com.azure.core; com.azure.resourcemanager; java.time;
2,375,871
private void configHttpServer(Server cenoHttpServer) { // Create a collection of ContextHandlers for the server ContextHandlerCollection handlers = new ContextHandlerCollection(); // Add a ServerConnector for the BundlerInserter agent ServerConnector bundleInserterConnector = new ServerConnector(cenoHttpServer); bundleInserterConnector.setName("bundleInserter"); bundleInserterConnector.setHost("localhost"); bundleInserterConnector.setPort(bundleInserterPort); // Add the connector to the server cenoHttpServer.addConnector(bundleInserterConnector); // Configure ContextHandlers to listen to a specific port // and upon request call the appropriate CENOJettyHandler subclass ContextHandler cacheInsertCtxHandler = new ContextHandler(); cacheInsertCtxHandler.setMaxFormContentSize(2000000); cacheInsertCtxHandler.setHandler(new BundleInserterHandler()); //cacheInsertCtxHandler.setVirtualHosts(new String[]{"@cacheInsert"}); // Add the configured ContextHandler to the server handlers.addHandler(cacheInsertCtxHandler); //Uncomment the following block if you need a lookup handler in the bridge side cenoHttpServer.setHandler(handlers); }
void function(Server cenoHttpServer) { ContextHandlerCollection handlers = new ContextHandlerCollection(); ServerConnector bundleInserterConnector = new ServerConnector(cenoHttpServer); bundleInserterConnector.setName(STR); bundleInserterConnector.setHost(STR); bundleInserterConnector.setPort(bundleInserterPort); cenoHttpServer.addConnector(bundleInserterConnector); ContextHandler cacheInsertCtxHandler = new ContextHandler(); cacheInsertCtxHandler.setMaxFormContentSize(2000000); cacheInsertCtxHandler.setHandler(new BundleInserterHandler()); handlers.addHandler(cacheInsertCtxHandler); cenoHttpServer.setHandler(handlers); }
/** * Configure CENO's embedded server * * @param cenoHttpServer the jetty server to be configured */
Configure CENO's embedded server
configHttpServer
{ "repo_name": "misaakidis/ceno", "path": "ceno-freenet/src/plugins/CENO/Bridge/CENOBridge.java", "license": "agpl-3.0", "size": 9881 }
[ "org.eclipse.jetty.server.Server", "org.eclipse.jetty.server.ServerConnector", "org.eclipse.jetty.server.handler.ContextHandler", "org.eclipse.jetty.server.handler.ContextHandlerCollection" ]
import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.eclipse.jetty.server.*; import org.eclipse.jetty.server.handler.*;
[ "org.eclipse.jetty" ]
org.eclipse.jetty;
2,281,221
public IdentitySet<Property> getProperties() { return properties; }
IdentitySet<Property> function() { return properties; }
/** * Returns a set that contains all properties of the dolphin bean * @return a set that contains all properties of the dolphin bean */
Returns a set that contains all properties of the dolphin bean
getProperties
{ "repo_name": "canoo/dolphin-platform", "path": "platform/dolphin-platform-remoting-server/src/main/java/com/canoo/dp/impl/server/gc/Instance.java", "license": "apache-2.0", "size": 3588 }
[ "com.canoo.dp.impl.platform.core.IdentitySet", "com.canoo.platform.remoting.Property" ]
import com.canoo.dp.impl.platform.core.IdentitySet; import com.canoo.platform.remoting.Property;
import com.canoo.dp.impl.platform.core.*; import com.canoo.platform.remoting.*;
[ "com.canoo.dp", "com.canoo.platform" ]
com.canoo.dp; com.canoo.platform;
2,038,250
public void setBorderLeftStyle(BorderStyles borderLeftStyle) { this.borderLeftStyle = borderLeftStyle; }
void function(BorderStyles borderLeftStyle) { this.borderLeftStyle = borderLeftStyle; }
/** * Sets the border style * * @param borderLeftStyle */
Sets the border style
setBorderLeftStyle
{ "repo_name": "GedMarc/JWebSwing", "path": "src/main/java/com/jwebmp/core/htmlbuilder/css/borders/BorderLeftCSSImpl.java", "license": "gpl-3.0", "size": 3852 }
[ "com.jwebmp.core.htmlbuilder.css.enumarations.BorderStyles" ]
import com.jwebmp.core.htmlbuilder.css.enumarations.BorderStyles;
import com.jwebmp.core.htmlbuilder.css.enumarations.*;
[ "com.jwebmp.core" ]
com.jwebmp.core;
2,547,967
public String toString() { StringBuffer s = new StringBuffer(); s.append("<DoublyLinkedList:"); Iterator li = iterator(); while (li.hasNext()) { s.append(" "+li.next()); } s.append(">"); return s.toString(); }
String function() { StringBuffer s = new StringBuffer(); s.append(STR); Iterator li = iterator(); while (li.hasNext()) { s.append(" "+li.next()); } s.append(">"); return s.toString(); }
/** * Construct a string representation of list. * * @post returns a string representing list * * @return A string representing elements of list. */
Construct a string representation of list
toString
{ "repo_name": "echalkpad/t4f-data", "path": "structure/core/src/main/java/io/datalayer/data/structure5/DoublyLinkedList.java", "license": "apache-2.0", "size": 14344 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
284,276
public StaticLibrary linkStatically(CompiledResources compiled) { try { final Path outPath = workingDirectory.resolve("lib.apk"); final Path rTxt = workingDirectory.resolve("R.txt"); final Path sourceJar = workingDirectory.resolve("r.srcjar"); Path javaSourceDirectory = workingDirectory.resolve("java"); profiler.startTask("linkstatic"); final Collection<String> pathsToLinkAgainst = StaticLibrary.toPathStrings(linkAgainst); logger.finer( new AaptCommandBuilder(aapt2) .forBuildToolsVersion(buildToolsVersion) .forVariantType(VariantType.LIBRARY) .add("link") .when(outputAsProto) // Used for testing: aapt2 does not output static libraries in // proto format. .thenAdd("--proto-format") .when(!outputAsProto) .thenAdd("--static-lib") .add("--manifest", compiled.getManifest()) .add("--no-static-lib-packages") .add("--custom-package", customPackage) .whenVersionIsAtLeast(new Revision(23)) .thenAdd("--no-version-vectors") .addParameterableRepeated( "-R", compiledResourcesToPaths(compiled, IS_FLAT_FILE), workingDirectory) .addRepeated("-I", pathsToLinkAgainst) .add("--auto-add-overlay") .add("-o", outPath) .when(linkAgainst.size() == 1) // If using all compiled resources, generates sources .thenAdd("--java", javaSourceDirectory) .when(linkAgainst.size() == 1) // If using all compiled resources, generates R.txt .thenAdd("--output-text-symbols", rTxt) .execute(String.format("Statically linking %s", compiled))); profiler.recordEndOf("linkstatic"); // working around aapt2 not producing transitive R.txt and R.java if (linkAgainst.size() > 1) { profiler.startTask("rfix"); logger.finer( new AaptCommandBuilder(aapt2) .forBuildToolsVersion(buildToolsVersion) .forVariantType(VariantType.LIBRARY) .add("link") .add("--manifest", compiled.getManifest()) .add("--no-static-lib-packages") .whenVersionIsAtLeast(new Revision(23)) .thenAdd("--no-version-vectors") .when(outputAsProto) .thenAdd("--proto-format") // only link against jars .addRepeated("-I", pathsToLinkAgainst.stream().filter(IS_JAR).collect(toList())) .add("-R", outPath) // only include non-jars .addRepeated( "-R", pathsToLinkAgainst.stream().filter(IS_JAR.negate()).collect(toList())) .add("--auto-add-overlay") .add("-o", outPath.resolveSibling("transitive.apk")) .add("--java", javaSourceDirectory) .add("--output-text-symbols", rTxt) .execute(String.format("Generating R files %s", compiled))); profiler.recordEndOf("rfix"); } profiler.startTask("sourcejar"); AndroidResourceOutputs.createSrcJar(javaSourceDirectory, sourceJar, true); profiler.recordEndOf("sourcejar"); return StaticLibrary.from(outPath, rTxt, ImmutableList.of(), sourceJar); } catch (IOException e) { throw LinkError.of(e); } }
StaticLibrary function(CompiledResources compiled) { try { final Path outPath = workingDirectory.resolve(STR); final Path rTxt = workingDirectory.resolve("R.txt"); final Path sourceJar = workingDirectory.resolve(STR); Path javaSourceDirectory = workingDirectory.resolve("java"); profiler.startTask(STR); final Collection<String> pathsToLinkAgainst = StaticLibrary.toPathStrings(linkAgainst); logger.finer( new AaptCommandBuilder(aapt2) .forBuildToolsVersion(buildToolsVersion) .forVariantType(VariantType.LIBRARY) .add("link") .when(outputAsProto) .thenAdd(STR) .when(!outputAsProto) .thenAdd(STR) .add(STR, compiled.getManifest()) .add(STR) .add(STR, customPackage) .whenVersionIsAtLeast(new Revision(23)) .thenAdd(STR) .addParameterableRepeated( "-R", compiledResourcesToPaths(compiled, IS_FLAT_FILE), workingDirectory) .addRepeated("-I", pathsToLinkAgainst) .add(STR) .add("-o", outPath) .when(linkAgainst.size() == 1) .thenAdd(STR, javaSourceDirectory) .when(linkAgainst.size() == 1) .thenAdd(STR, rTxt) .execute(String.format(STR, compiled))); profiler.recordEndOf(STR); if (linkAgainst.size() > 1) { profiler.startTask("rfix"); logger.finer( new AaptCommandBuilder(aapt2) .forBuildToolsVersion(buildToolsVersion) .forVariantType(VariantType.LIBRARY) .add("link") .add(STR, compiled.getManifest()) .add(STR) .whenVersionIsAtLeast(new Revision(23)) .thenAdd(STR) .when(outputAsProto) .thenAdd(STR) .addRepeated("-I", pathsToLinkAgainst.stream().filter(IS_JAR).collect(toList())) .add("-R", outPath) .addRepeated( "-R", pathsToLinkAgainst.stream().filter(IS_JAR.negate()).collect(toList())) .add(STR) .add("-o", outPath.resolveSibling(STR)) .add(STR, javaSourceDirectory) .add(STR, rTxt) .execute(String.format(STR, compiled))); profiler.recordEndOf("rfix"); } profiler.startTask(STR); AndroidResourceOutputs.createSrcJar(javaSourceDirectory, sourceJar, true); profiler.recordEndOf(STR); return StaticLibrary.from(outPath, rTxt, ImmutableList.of(), sourceJar); } catch (IOException e) { throw LinkError.of(e); } }
/** * Statically links the {@link CompiledResources} with the dependencies to produce a {@link * StaticLibrary}. */
Statically links the <code>CompiledResources</code> with the dependencies to produce a <code>StaticLibrary</code>
linkStatically
{ "repo_name": "ButterflyNetwork/bazel", "path": "src/tools/android/java/com/google/devtools/build/android/aapt2/ResourceLinker.java", "license": "apache-2.0", "size": 24841 }
[ "com.android.builder.core.VariantType", "com.android.repository.Revision", "com.google.common.collect.ImmutableList", "com.google.devtools.build.android.AaptCommandBuilder", "com.google.devtools.build.android.AndroidResourceOutputs", "java.io.IOException", "java.nio.file.Path", "java.util.Collection" ]
import com.android.builder.core.VariantType; import com.android.repository.Revision; import com.google.common.collect.ImmutableList; import com.google.devtools.build.android.AaptCommandBuilder; import com.google.devtools.build.android.AndroidResourceOutputs; import java.io.IOException; import java.nio.file.Path; import java.util.Collection;
import com.android.builder.core.*; import com.android.repository.*; import com.google.common.collect.*; import com.google.devtools.build.android.*; import java.io.*; import java.nio.file.*; import java.util.*;
[ "com.android.builder", "com.android.repository", "com.google.common", "com.google.devtools", "java.io", "java.nio", "java.util" ]
com.android.builder; com.android.repository; com.google.common; com.google.devtools; java.io; java.nio; java.util;
922,133
Map<CmsPropertyName, String> getProperties(String path) throws CmsException;
Map<CmsPropertyName, String> getProperties(String path) throws CmsException;
/** * Gets the properties for the given path. * * @param path the path * @return the properties for the path * * @throws CmsException if something goes wrong */
Gets the properties for the given path
getProperties
{ "repo_name": "alkacon/opencms-core", "path": "src/org/opencms/repository/I_CmsRepositorySession.java", "license": "lgpl-2.1", "size": 5937 }
[ "java.util.Map", "org.opencms.main.CmsException" ]
import java.util.Map; import org.opencms.main.CmsException;
import java.util.*; import org.opencms.main.*;
[ "java.util", "org.opencms.main" ]
java.util; org.opencms.main;
163,748
@Override public void setUniqueId(UniqueId uniqueId) { this._uniqueId = uniqueId; }
void function(UniqueId uniqueId) { this._uniqueId = uniqueId; }
/** * Sets the historical time-series unique identifier. This field is managed by the master but must be set for updates. * @param uniqueId the new value of the property */
Sets the historical time-series unique identifier. This field is managed by the master but must be set for updates
setUniqueId
{ "repo_name": "McLeodMoores/starling", "path": "projects/master/src/main/java/com/opengamma/master/historicaltimeseries/ManageableHistoricalTimeSeriesInfo.java", "license": "apache-2.0", "size": 24956 }
[ "com.opengamma.id.UniqueId" ]
import com.opengamma.id.UniqueId;
import com.opengamma.id.*;
[ "com.opengamma.id" ]
com.opengamma.id;
857,360
List<String> getPojoNames();
List<String> getPojoNames();
/** * A list of the POJO configuration names. * * @return a list of the names */
A list of the POJO configuration names
getPojoNames
{ "repo_name": "lbtc-xxx/jboss-logmanager", "path": "src/main/java/org/jboss/logmanager/config/LogContextConfiguration.java", "license": "lgpl-2.1", "size": 6086 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,116,522
List<THistoryTransactionBean> loadByItemAndFieldsSince(Integer itemID, List<Integer> fieldIDs, Date since);
List<THistoryTransactionBean> loadByItemAndFieldsSince(Integer itemID, List<Integer> fieldIDs, Date since);
/** * Loads the HistoryTransactions by itemID and fields changed since * @param itemID * @param fieldIDs * @param since * @return */
Loads the HistoryTransactions by itemID and fields changed since
loadByItemAndFieldsSince
{ "repo_name": "trackplus/Genji", "path": "src/main/java/com/aurel/track/dao/HistoryTransactionDAO.java", "license": "gpl-3.0", "size": 6382 }
[ "com.aurel.track.beans.THistoryTransactionBean", "java.util.Date", "java.util.List" ]
import com.aurel.track.beans.THistoryTransactionBean; import java.util.Date; import java.util.List;
import com.aurel.track.beans.*; import java.util.*;
[ "com.aurel.track", "java.util" ]
com.aurel.track; java.util;
1,518,447
public static Options getOptions() { Options allOptions = new Options(); for(BatchProfilerCLIOptions o : BatchProfilerCLIOptions.values()) { allOptions.addOption(o.option); } return allOptions; }
static Options function() { Options allOptions = new Options(); for(BatchProfilerCLIOptions o : BatchProfilerCLIOptions.values()) { allOptions.addOption(o.option); } return allOptions; }
/** * Returns all valid CLI options. */
Returns all valid CLI options
getOptions
{ "repo_name": "JonZeolla/metron", "path": "metron-analytics/metron-profiler-spark/src/main/java/org/apache/metron/profiler/spark/cli/BatchProfilerCLIOptions.java", "license": "apache-2.0", "size": 4856 }
[ "org.apache.commons.cli.Options" ]
import org.apache.commons.cli.Options;
import org.apache.commons.cli.*;
[ "org.apache.commons" ]
org.apache.commons;
2,659,374
private void init() { computeBoardHeight(); setOrientation(LinearLayout.VERTICAL); setBackgroundColor(Color.parseColor("#f4f4f6")); ViewPager viewPager = createVIewpager(); addView(viewPager); ViewGroup container = createPointLinearlayout(); List<EmojiView> datas = new ArrayList<EmojiView>(); int lens = People.DATA.length; int pages = lens / PAGE_SIZE; // 总共pages个页面 for (int i = 0; i < pages; i++) { EmojiBean[] blocks = new EmojiBean[PAGE_SIZE + 1]; System.arraycopy(People.DATA, i * PAGE_SIZE, blocks, 0, blocks.length - 1); blocks[PAGE_SIZE] = EmojiBean.fromChars(DELETE_KEY); datas.add(new EmojiView(getContext(), blocks)); // the last is // delete icon } // add remain emoji view if (pages * PAGE_SIZE < lens) { EmojiBean[] blocks = new EmojiBean[lens - pages * PAGE_SIZE]; System.arraycopy(People.DATA, pages * PAGE_SIZE, blocks, 0, blocks.length); datas.add(new EmojiView(getContext(), blocks)); } // add indicator for (int i = 0; i < datas.size(); i++) { ImageView indicatorView = createIndicator(); mIndicators.add(indicatorView); container.addView(indicatorView); } addView(container); size=datas.size(); // set cache view count viewPager.setOffscreenPageLimit(datas.size()); // 默认选中第一项 mIndicators.get(mLastSelectViewPos).setImageDrawable(ResFinder.getDrawable(mSelectIcon)); mAdapter = new EmojiPagerAdapter(getContext(), datas); viewPager.setAdapter(mAdapter); viewPager.setOnPageChangeListener(this); }
void function() { computeBoardHeight(); setOrientation(LinearLayout.VERTICAL); setBackgroundColor(Color.parseColor(STR)); ViewPager viewPager = createVIewpager(); addView(viewPager); ViewGroup container = createPointLinearlayout(); List<EmojiView> datas = new ArrayList<EmojiView>(); int lens = People.DATA.length; int pages = lens / PAGE_SIZE; for (int i = 0; i < pages; i++) { EmojiBean[] blocks = new EmojiBean[PAGE_SIZE + 1]; System.arraycopy(People.DATA, i * PAGE_SIZE, blocks, 0, blocks.length - 1); blocks[PAGE_SIZE] = EmojiBean.fromChars(DELETE_KEY); datas.add(new EmojiView(getContext(), blocks)); } if (pages * PAGE_SIZE < lens) { EmojiBean[] blocks = new EmojiBean[lens - pages * PAGE_SIZE]; System.arraycopy(People.DATA, pages * PAGE_SIZE, blocks, 0, blocks.length); datas.add(new EmojiView(getContext(), blocks)); } for (int i = 0; i < datas.size(); i++) { ImageView indicatorView = createIndicator(); mIndicators.add(indicatorView); container.addView(indicatorView); } addView(container); size=datas.size(); viewPager.setOffscreenPageLimit(datas.size()); mIndicators.get(mLastSelectViewPos).setImageDrawable(ResFinder.getDrawable(mSelectIcon)); mAdapter = new EmojiPagerAdapter(getContext(), datas); viewPager.setAdapter(mAdapter); viewPager.setOnPageChangeListener(this); }
/** * init. Set params and add show emoji views</br> */
init. Set params and add show emoji views
init
{ "repo_name": "pengwei1024/AndroidGank", "path": "umeng_libs/src/main/java/com/umeng/comm/ui/emoji/EmojiBorad.java", "license": "apache-2.0", "size": 9165 }
[ "android.graphics.Color", "android.support.v4.view.ViewPager", "android.view.ViewGroup", "android.widget.ImageView", "android.widget.LinearLayout", "com.umeng.comm.core.utils.ResFinder", "java.util.ArrayList", "java.util.List" ]
import android.graphics.Color; import android.support.v4.view.ViewPager; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import com.umeng.comm.core.utils.ResFinder; import java.util.ArrayList; import java.util.List;
import android.graphics.*; import android.support.v4.view.*; import android.view.*; import android.widget.*; import com.umeng.comm.core.utils.*; import java.util.*;
[ "android.graphics", "android.support", "android.view", "android.widget", "com.umeng.comm", "java.util" ]
android.graphics; android.support; android.view; android.widget; com.umeng.comm; java.util;
2,827,402
@Override public FileObject resolveFile(final String name, final FileSystemOptions fileSystemOptions) throws FileSystemException { return manager.resolveFile(name, fileSystemOptions); }
FileObject function(final String name, final FileSystemOptions fileSystemOptions) throws FileSystemException { return manager.resolveFile(name, fileSystemOptions); }
/** * Locate a file by name. */
Locate a file by name
resolveFile
{ "repo_name": "distribuitech/datos", "path": "datos-vfs/src/main/java/com/datos/vfs/impl/DefaultVfsComponentContext.java", "license": "apache-2.0", "size": 3129 }
[ "com.datos.vfs.FileObject", "com.datos.vfs.FileSystemException", "com.datos.vfs.FileSystemOptions" ]
import com.datos.vfs.FileObject; import com.datos.vfs.FileSystemException; import com.datos.vfs.FileSystemOptions;
import com.datos.vfs.*;
[ "com.datos.vfs" ]
com.datos.vfs;
1,238,901
ExtensionResultStatusType manageRemove(PersistencePackage persistencePackage, Product product) throws ServiceException;
ExtensionResultStatusType manageRemove(PersistencePackage persistencePackage, Product product) throws ServiceException;
/** * Perform any special handling for the remove * * @param product * @return */
Perform any special handling for the remove
manageRemove
{ "repo_name": "TouK/BroadleafCommerce", "path": "admin/broadleaf-admin-module/src/main/java/org/broadleafcommerce/admin/server/service/extension/ProductCustomPersistenceHandlerExtensionHandler.java", "license": "apache-2.0", "size": 2555 }
[ "org.broadleafcommerce.common.exception.ServiceException", "org.broadleafcommerce.common.extension.ExtensionResultStatusType", "org.broadleafcommerce.core.catalog.domain.Product", "org.broadleafcommerce.openadmin.dto.PersistencePackage" ]
import org.broadleafcommerce.common.exception.ServiceException; import org.broadleafcommerce.common.extension.ExtensionResultStatusType; import org.broadleafcommerce.core.catalog.domain.Product; import org.broadleafcommerce.openadmin.dto.PersistencePackage;
import org.broadleafcommerce.common.exception.*; import org.broadleafcommerce.common.extension.*; import org.broadleafcommerce.core.catalog.domain.*; import org.broadleafcommerce.openadmin.dto.*;
[ "org.broadleafcommerce.common", "org.broadleafcommerce.core", "org.broadleafcommerce.openadmin" ]
org.broadleafcommerce.common; org.broadleafcommerce.core; org.broadleafcommerce.openadmin;
2,445,091
@Override public void resolve(AbsoluteTableIdentifier absoluteTableIdentifier) throws FilterUnsupportedException, IOException { FilterResolverMetadata metadata = new FilterResolverMetadata(); metadata.setTableIdentifier(absoluteTableIdentifier); if ((!isExpressionResolve) && exp instanceof BinaryConditionalExpression) { BinaryConditionalExpression binaryConditionalExpression = (BinaryConditionalExpression) exp; Expression leftExp = binaryConditionalExpression.getLeft(); Expression rightExp = binaryConditionalExpression.getRight(); if (leftExp instanceof ColumnExpression) { ColumnExpression columnExpression = (ColumnExpression) leftExp; metadata.setColumnExpression(columnExpression); metadata.setExpression(rightExp); metadata.setIncludeFilter(isIncludeFilter); // If imei=imei comes in filter condition then we need to // skip processing of right expression. // This flow has reached here assuming that this is a single // column expression. // we need to check if the other expression contains column // expression or not in depth. if (FilterUtil.checkIfExpressionContainsColumn(rightExp) || FilterUtil.isExpressionNeedsToResolved(rightExp, isIncludeFilter) && (( (null != columnExpression.getDimension()) && (columnExpression.getDimension() .hasEncoding(Encoding.DICTIONARY) && !columnExpression.getDimension() .hasEncoding(Encoding.DIRECT_DICTIONARY))))) { isExpressionResolve = true; } else { //Visitor pattern is been used in this scenario inorder to populate the // dimColResolvedFilterInfo //visitable object with filter member values based on the visitor type, currently there //3 types of visitors custom,direct and no dictionary, all types of visitor populate //the visitable instance as per its buisness logic which is different for all the // visitors. if (columnExpression.isMeasure()) { msrColResolvedFilterInfo.setMeasure(columnExpression.getMeasure()); msrColResolvedFilterInfo.populateFilterInfoBasedOnColumnType( FilterInfoTypeVisitorFactory.getResolvedFilterInfoVisitor(columnExpression, exp), metadata); } else { dimColResolvedFilterInfo.populateFilterInfoBasedOnColumnType( FilterInfoTypeVisitorFactory.getResolvedFilterInfoVisitor(columnExpression, exp), metadata); } } } else if (rightExp instanceof ColumnExpression) { ColumnExpression columnExpression = (ColumnExpression) rightExp; metadata.setColumnExpression(columnExpression); metadata.setExpression(leftExp); metadata.setIncludeFilter(isIncludeFilter); if (columnExpression.getDataType().equals(DataTypes.TIMESTAMP) || columnExpression.getDataType().equals(DataTypes.DATE)) { isExpressionResolve = true; } else { // if imei=imei comes in filter condition then we need to // skip processing of right expression. // This flow has reached here assuming that this is a single // column expression. // we need to check if the other expression contains column // expression or not in depth. if (FilterUtil.checkIfExpressionContainsColumn(leftExp)) { isExpressionResolve = true; } else { if (columnExpression.isMeasure()) { msrColResolvedFilterInfo.populateFilterInfoBasedOnColumnType( FilterInfoTypeVisitorFactory.getResolvedFilterInfoVisitor(columnExpression, exp), metadata); } else { dimColResolvedFilterInfo.populateFilterInfoBasedOnColumnType( FilterInfoTypeVisitorFactory.getResolvedFilterInfoVisitor(columnExpression, exp), metadata); } } } } else { isExpressionResolve = true; } } if (isExpressionResolve && exp instanceof ConditionalExpression) { ConditionalExpression conditionalExpression = (ConditionalExpression) exp; List<ColumnExpression> columnList = conditionalExpression.getColumnList(); metadata.setColumnExpression(columnList.get(0)); metadata.setExpression(exp); metadata.setIncludeFilter(isIncludeFilter); if ((null != columnList.get(0).getDimension()) && ( !columnList.get(0).getDimension().hasEncoding(Encoding.DICTIONARY) || columnList.get(0) .getDimension().hasEncoding(Encoding.DIRECT_DICTIONARY)) || (exp instanceof RangeExpression)) { dimColResolvedFilterInfo.populateFilterInfoBasedOnColumnType( FilterInfoTypeVisitorFactory.getResolvedFilterInfoVisitor(columnList.get(0), exp), metadata); } else if ((null != columnList.get(0).getDimension()) && ( columnList.get(0).getDimension().hasEncoding(Encoding.DICTIONARY) && ! columnList.get(0).getDimension().getDataType().isComplexType())) { dimColResolvedFilterInfo.setFilterValues(FilterUtil .getFilterListForAllValues(absoluteTableIdentifier, exp, columnList.get(0), isIncludeFilter, isExpressionResolve)); dimColResolvedFilterInfo.setColumnIndex(columnList.get(0).getDimension().getOrdinal()); dimColResolvedFilterInfo.setDimension(columnList.get(0).getDimension()); } else if (columnList.get(0).isMeasure()) { msrColResolvedFilterInfo.setMeasure(columnList.get(0).getMeasure()); msrColResolvedFilterInfo.populateFilterInfoBasedOnColumnType( FilterInfoTypeVisitorFactory.getResolvedFilterInfoVisitor(columnList.get(0), exp), metadata); msrColResolvedFilterInfo.setCarbonColumn(columnList.get(0).getCarbonColumn()); msrColResolvedFilterInfo.setColumnIndex(columnList.get(0).getCarbonColumn().getOrdinal()); msrColResolvedFilterInfo.setType(columnList.get(0).getCarbonColumn().getDataType()); } } }
@Override void function(AbsoluteTableIdentifier absoluteTableIdentifier) throws FilterUnsupportedException, IOException { FilterResolverMetadata metadata = new FilterResolverMetadata(); metadata.setTableIdentifier(absoluteTableIdentifier); if ((!isExpressionResolve) && exp instanceof BinaryConditionalExpression) { BinaryConditionalExpression binaryConditionalExpression = (BinaryConditionalExpression) exp; Expression leftExp = binaryConditionalExpression.getLeft(); Expression rightExp = binaryConditionalExpression.getRight(); if (leftExp instanceof ColumnExpression) { ColumnExpression columnExpression = (ColumnExpression) leftExp; metadata.setColumnExpression(columnExpression); metadata.setExpression(rightExp); metadata.setIncludeFilter(isIncludeFilter); if (FilterUtil.checkIfExpressionContainsColumn(rightExp) FilterUtil.isExpressionNeedsToResolved(rightExp, isIncludeFilter) && (( (null != columnExpression.getDimension()) && (columnExpression.getDimension() .hasEncoding(Encoding.DICTIONARY) && !columnExpression.getDimension() .hasEncoding(Encoding.DIRECT_DICTIONARY))))) { isExpressionResolve = true; } else { if (columnExpression.isMeasure()) { msrColResolvedFilterInfo.setMeasure(columnExpression.getMeasure()); msrColResolvedFilterInfo.populateFilterInfoBasedOnColumnType( FilterInfoTypeVisitorFactory.getResolvedFilterInfoVisitor(columnExpression, exp), metadata); } else { dimColResolvedFilterInfo.populateFilterInfoBasedOnColumnType( FilterInfoTypeVisitorFactory.getResolvedFilterInfoVisitor(columnExpression, exp), metadata); } } } else if (rightExp instanceof ColumnExpression) { ColumnExpression columnExpression = (ColumnExpression) rightExp; metadata.setColumnExpression(columnExpression); metadata.setExpression(leftExp); metadata.setIncludeFilter(isIncludeFilter); if (columnExpression.getDataType().equals(DataTypes.TIMESTAMP) columnExpression.getDataType().equals(DataTypes.DATE)) { isExpressionResolve = true; } else { if (FilterUtil.checkIfExpressionContainsColumn(leftExp)) { isExpressionResolve = true; } else { if (columnExpression.isMeasure()) { msrColResolvedFilterInfo.populateFilterInfoBasedOnColumnType( FilterInfoTypeVisitorFactory.getResolvedFilterInfoVisitor(columnExpression, exp), metadata); } else { dimColResolvedFilterInfo.populateFilterInfoBasedOnColumnType( FilterInfoTypeVisitorFactory.getResolvedFilterInfoVisitor(columnExpression, exp), metadata); } } } } else { isExpressionResolve = true; } } if (isExpressionResolve && exp instanceof ConditionalExpression) { ConditionalExpression conditionalExpression = (ConditionalExpression) exp; List<ColumnExpression> columnList = conditionalExpression.getColumnList(); metadata.setColumnExpression(columnList.get(0)); metadata.setExpression(exp); metadata.setIncludeFilter(isIncludeFilter); if ((null != columnList.get(0).getDimension()) && ( !columnList.get(0).getDimension().hasEncoding(Encoding.DICTIONARY) columnList.get(0) .getDimension().hasEncoding(Encoding.DIRECT_DICTIONARY)) (exp instanceof RangeExpression)) { dimColResolvedFilterInfo.populateFilterInfoBasedOnColumnType( FilterInfoTypeVisitorFactory.getResolvedFilterInfoVisitor(columnList.get(0), exp), metadata); } else if ((null != columnList.get(0).getDimension()) && ( columnList.get(0).getDimension().hasEncoding(Encoding.DICTIONARY) && ! columnList.get(0).getDimension().getDataType().isComplexType())) { dimColResolvedFilterInfo.setFilterValues(FilterUtil .getFilterListForAllValues(absoluteTableIdentifier, exp, columnList.get(0), isIncludeFilter, isExpressionResolve)); dimColResolvedFilterInfo.setColumnIndex(columnList.get(0).getDimension().getOrdinal()); dimColResolvedFilterInfo.setDimension(columnList.get(0).getDimension()); } else if (columnList.get(0).isMeasure()) { msrColResolvedFilterInfo.setMeasure(columnList.get(0).getMeasure()); msrColResolvedFilterInfo.populateFilterInfoBasedOnColumnType( FilterInfoTypeVisitorFactory.getResolvedFilterInfoVisitor(columnList.get(0), exp), metadata); msrColResolvedFilterInfo.setCarbonColumn(columnList.get(0).getCarbonColumn()); msrColResolvedFilterInfo.setColumnIndex(columnList.get(0).getCarbonColumn().getOrdinal()); msrColResolvedFilterInfo.setType(columnList.get(0).getCarbonColumn().getDataType()); } } }
/** * This API will resolve the filter expression and generates the * dictionaries for executing/evaluating the filter expressions in the * executer layer. * * @throws FilterUnsupportedException */
This API will resolve the filter expression and generates the dictionaries for executing/evaluating the filter expressions in the executer layer
resolve
{ "repo_name": "sgururajshetty/carbondata", "path": "core/src/main/java/org/apache/carbondata/core/scan/filter/resolver/ConditionalFilterResolverImpl.java", "license": "apache-2.0", "size": 13884 }
[ "java.io.IOException", "java.util.List", "org.apache.carbondata.core.metadata.AbsoluteTableIdentifier", "org.apache.carbondata.core.metadata.datatype.DataTypes", "org.apache.carbondata.core.metadata.encoder.Encoding", "org.apache.carbondata.core.scan.expression.ColumnExpression", "org.apache.carbondata.core.scan.expression.Expression", "org.apache.carbondata.core.scan.expression.conditional.BinaryConditionalExpression", "org.apache.carbondata.core.scan.expression.conditional.ConditionalExpression", "org.apache.carbondata.core.scan.expression.exception.FilterUnsupportedException", "org.apache.carbondata.core.scan.expression.logical.RangeExpression", "org.apache.carbondata.core.scan.filter.FilterUtil", "org.apache.carbondata.core.scan.filter.resolver.metadata.FilterResolverMetadata", "org.apache.carbondata.core.scan.filter.resolver.resolverinfo.visitor.FilterInfoTypeVisitorFactory" ]
import java.io.IOException; import java.util.List; import org.apache.carbondata.core.metadata.AbsoluteTableIdentifier; import org.apache.carbondata.core.metadata.datatype.DataTypes; import org.apache.carbondata.core.metadata.encoder.Encoding; import org.apache.carbondata.core.scan.expression.ColumnExpression; import org.apache.carbondata.core.scan.expression.Expression; import org.apache.carbondata.core.scan.expression.conditional.BinaryConditionalExpression; import org.apache.carbondata.core.scan.expression.conditional.ConditionalExpression; import org.apache.carbondata.core.scan.expression.exception.FilterUnsupportedException; import org.apache.carbondata.core.scan.expression.logical.RangeExpression; import org.apache.carbondata.core.scan.filter.FilterUtil; import org.apache.carbondata.core.scan.filter.resolver.metadata.FilterResolverMetadata; import org.apache.carbondata.core.scan.filter.resolver.resolverinfo.visitor.FilterInfoTypeVisitorFactory;
import java.io.*; import java.util.*; import org.apache.carbondata.core.metadata.*; import org.apache.carbondata.core.metadata.datatype.*; import org.apache.carbondata.core.metadata.encoder.*; import org.apache.carbondata.core.scan.expression.*; import org.apache.carbondata.core.scan.expression.conditional.*; import org.apache.carbondata.core.scan.expression.exception.*; import org.apache.carbondata.core.scan.expression.logical.*; import org.apache.carbondata.core.scan.filter.*; import org.apache.carbondata.core.scan.filter.resolver.metadata.*; import org.apache.carbondata.core.scan.filter.resolver.resolverinfo.visitor.*;
[ "java.io", "java.util", "org.apache.carbondata" ]
java.io; java.util; org.apache.carbondata;
1,345,888
return name; } private static final Map<String, Attribute> attributes; static { final Map<String, Attribute> map = new HashMap<String, Attribute>(64); for (Attribute attribute : values()) { final String name = attribute.getLocalName(); if (name != null) { map.put(name, attribute); } } attributes = map; }
return name; } private static final Map<String, Attribute> attributes; static { final Map<String, Attribute> map = new HashMap<String, Attribute>(64); for (Attribute attribute : values()) { final String name = attribute.getLocalName(); if (name != null) { map.put(name, attribute); } } attributes = map; }
/** * Get the local name of this element. * * @return the local name */
Get the local name of this element
getLocalName
{ "repo_name": "danberindei/infinispan-cachestore-jpa", "path": "src/main/java/org/infinispan/loaders/jpa/configuration/Attribute.java", "license": "apache-2.0", "size": 1230 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,583,604
if (document instanceof DocumentWindow) { final Document delegate = ((DocumentWindow)document).getDelegate(); final MarkupModelEx baseMarkupModel = (MarkupModelEx)forDocument(delegate, project, true); return new MarkupModelWindow(baseMarkupModel, (DocumentWindow) document); } if (project == null) { MarkupModelEx markupModel = document.getUserData(MARKUP_MODEL_KEY); if (create && markupModel == null) { MarkupModelEx newModel = new MarkupModelImpl((DocumentEx)document); if ((markupModel = ((UserDataHolderEx)document).putUserDataIfAbsent(MARKUP_MODEL_KEY, newModel)) != newModel) { newModel.dispose(); } } return markupModel; } final DocumentMarkupModelManager documentMarkupModelManager = project.isDisposed() ? null : DocumentMarkupModelManager.getInstance(project); if (documentMarkupModelManager == null || documentMarkupModelManager.isDisposed() || project.isDisposed()) { return new EmptyMarkupModel(document); } ConcurrentMap<Project, MarkupModelImpl> markupModelMap = getMarkupModelMap(document); MarkupModelImpl model = markupModelMap.get(project); if (create && model == null) { MarkupModelImpl newModel = new MarkupModelImpl((DocumentEx)document); if ((model = ConcurrencyUtil.cacheOrGet(markupModelMap, project, newModel)) == newModel) { documentMarkupModelManager.registerDocument((DocumentImpl)document); } else { newModel.dispose(); } } return model; }
if (document instanceof DocumentWindow) { final Document delegate = ((DocumentWindow)document).getDelegate(); final MarkupModelEx baseMarkupModel = (MarkupModelEx)forDocument(delegate, project, true); return new MarkupModelWindow(baseMarkupModel, (DocumentWindow) document); } if (project == null) { MarkupModelEx markupModel = document.getUserData(MARKUP_MODEL_KEY); if (create && markupModel == null) { MarkupModelEx newModel = new MarkupModelImpl((DocumentEx)document); if ((markupModel = ((UserDataHolderEx)document).putUserDataIfAbsent(MARKUP_MODEL_KEY, newModel)) != newModel) { newModel.dispose(); } } return markupModel; } final DocumentMarkupModelManager documentMarkupModelManager = project.isDisposed() ? null : DocumentMarkupModelManager.getInstance(project); if (documentMarkupModelManager == null documentMarkupModelManager.isDisposed() project.isDisposed()) { return new EmptyMarkupModel(document); } ConcurrentMap<Project, MarkupModelImpl> markupModelMap = getMarkupModelMap(document); MarkupModelImpl model = markupModelMap.get(project); if (create && model == null) { MarkupModelImpl newModel = new MarkupModelImpl((DocumentEx)document); if ((model = ConcurrencyUtil.cacheOrGet(markupModelMap, project, newModel)) == newModel) { documentMarkupModelManager.registerDocument((DocumentImpl)document); } else { newModel.dispose(); } } return model; }
/** * Returns the markup model for the specified project. A document can have multiple markup * models for different projects if the file to which it corresponds belongs to multiple projects * opened in different IDEA frames at the same time. * * @param document the document for which the markup model is requested. * @param project the project for which the markup model is requested, or null if the default markup * model is requested. * @return the markup model instance. * @see com.intellij.openapi.editor.Editor#getMarkupModel() */
Returns the markup model for the specified project. A document can have multiple markup models for different projects if the file to which it corresponds belongs to multiple projects opened in different IDEA frames at the same time
forDocument
{ "repo_name": "IllusionRom-deprecated/android_platform_tools_idea", "path": "platform/editor-ui-ex/src/com/intellij/openapi/editor/impl/DocumentMarkupModel.java", "license": "apache-2.0", "size": 4695 }
[ "com.intellij.injected.editor.DocumentWindow", "com.intellij.injected.editor.MarkupModelWindow", "com.intellij.openapi.editor.Document", "com.intellij.openapi.editor.ex.DocumentEx", "com.intellij.openapi.editor.ex.MarkupModelEx", "com.intellij.openapi.project.Project", "com.intellij.openapi.util.UserDataHolderEx", "com.intellij.util.ConcurrencyUtil", "java.util.concurrent.ConcurrentMap" ]
import com.intellij.injected.editor.DocumentWindow; import com.intellij.injected.editor.MarkupModelWindow; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.ex.DocumentEx; import com.intellij.openapi.editor.ex.MarkupModelEx; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.UserDataHolderEx; import com.intellij.util.ConcurrencyUtil; import java.util.concurrent.ConcurrentMap;
import com.intellij.injected.editor.*; import com.intellij.openapi.editor.*; import com.intellij.openapi.editor.ex.*; import com.intellij.openapi.project.*; import com.intellij.openapi.util.*; import com.intellij.util.*; import java.util.concurrent.*;
[ "com.intellij.injected", "com.intellij.openapi", "com.intellij.util", "java.util" ]
com.intellij.injected; com.intellij.openapi; com.intellij.util; java.util;
834,825
public static double distanceInf(Vector3D v1, Vector3D v2) { final double dx = FastMath.abs(v2.x - v1.x); final double dy = FastMath.abs(v2.y - v1.y); final double dz = FastMath.abs(v2.z - v1.z); return FastMath.max(FastMath.max(dx, dy), dz); }
static double function(Vector3D v1, Vector3D v2) { final double dx = FastMath.abs(v2.x - v1.x); final double dy = FastMath.abs(v2.y - v1.y); final double dz = FastMath.abs(v2.z - v1.z); return FastMath.max(FastMath.max(dx, dy), dz); }
/** Compute the distance between two vectors according to the L<sub>&infin;</sub> norm. * <p>Calling this method is equivalent to calling: * <code>v1.subtract(v2).getNormInf()</code> except that no intermediate * vector is built</p> * @param v1 first vector * @param v2 second vector * @return the distance between v1 and v2 according to the L<sub>&infin;</sub> norm */
Compute the distance between two vectors according to the L&infin; norm. Calling this method is equivalent to calling: <code>v1.subtract(v2).getNormInf()</code> except that no intermediate vector is built
distanceInf
{ "repo_name": "martingwhite/astor", "path": "examples/math_63/src/main/java/org/apache/commons/math/geometry/Vector3D.java", "license": "gpl-2.0", "size": 17821 }
[ "org.apache.commons.math.util.FastMath" ]
import org.apache.commons.math.util.FastMath;
import org.apache.commons.math.util.*;
[ "org.apache.commons" ]
org.apache.commons;
714,156
public Sample getSample(int swAccession);
Sample function(int swAccession);
/** * Get sample by swa * * @param swAccession * @return */
Get sample by swa
getSample
{ "repo_name": "joansmith/seqware", "path": "seqware-common/src/main/java/net/sourceforge/seqware/common/metadata/Metadata.java", "license": "gpl-3.0", "size": 37180 }
[ "net.sourceforge.seqware.common.model.Sample" ]
import net.sourceforge.seqware.common.model.Sample;
import net.sourceforge.seqware.common.model.*;
[ "net.sourceforge.seqware" ]
net.sourceforge.seqware;
2,131,965
void generateLeafNodeBases() { for (BaseLargeTreeGenerator.FoliageCoordinates worldgenbigtree$foliagecoordinates : this.foliageCoords) { int i = worldgenbigtree$foliagecoordinates.getBranchBase(); BlockPos blockpos = new BlockPos(this.basePos.getX(), i, this.basePos.getZ()); if (!blockpos.equals(worldgenbigtree$foliagecoordinates) && this.leafNodeNeedsBase(i - this.basePos.getY())) { this.limb(blockpos, worldgenbigtree$foliagecoordinates, log); } } }
void generateLeafNodeBases() { for (BaseLargeTreeGenerator.FoliageCoordinates worldgenbigtree$foliagecoordinates : this.foliageCoords) { int i = worldgenbigtree$foliagecoordinates.getBranchBase(); BlockPos blockpos = new BlockPos(this.basePos.getX(), i, this.basePos.getZ()); if (!blockpos.equals(worldgenbigtree$foliagecoordinates) && this.leafNodeNeedsBase(i - this.basePos.getY())) { this.limb(blockpos, worldgenbigtree$foliagecoordinates, log); } } }
/** * Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade. */
Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade
generateLeafNodeBases
{ "repo_name": "kenijey/harshencastle", "path": "src/main/java/kenijey/harshenuniverse/base/BaseLargeTreeGenerator.java", "license": "epl-1.0", "size": 12678 }
[ "net.minecraft.util.math.BlockPos" ]
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.*;
[ "net.minecraft.util" ]
net.minecraft.util;
883,256
public void setStartValue(double value) { this.startValue = value; notifyListeners(new MarkerChangeEvent(this)); }
void function(double value) { this.startValue = value; notifyListeners(new MarkerChangeEvent(this)); }
/** * Sets the start value for the marker and sends a * {@link MarkerChangeEvent} to all registered listeners. * * @param value the value. * * @since 1.0.3 */
Sets the start value for the marker and sends a <code>MarkerChangeEvent</code> to all registered listeners
setStartValue
{ "repo_name": "simon04/jfreechart", "path": "src/main/java/org/jfree/chart/plot/IntervalMarker.java", "license": "lgpl-2.1", "size": 7500 }
[ "org.jfree.chart.event.MarkerChangeEvent" ]
import org.jfree.chart.event.MarkerChangeEvent;
import org.jfree.chart.event.*;
[ "org.jfree.chart" ]
org.jfree.chart;
2,453,753
@Message(id = 53, value = "Cannot register submodels with a null PathElement") IllegalArgumentException cannotRegisterSubmodelWithNullPath(); // // @Message(id = 54, value = "Cannot register non-runtime-only submodels with a runtime-only parent") // IllegalArgumentException cannotRegisterSubmodel();
@Message(id = 53, value = STR) IllegalArgumentException cannotRegisterSubmodelWithNullPath();
/** * Creates an exception indicating a submodel cannot be registered with a {@code null} path. * * @return an {@link IllegalArgumentException} for the error. */
Creates an exception indicating a submodel cannot be registered with a null path
cannotRegisterSubmodelWithNullPath
{ "repo_name": "aloubyansky/wildfly-core", "path": "controller/src/main/java/org/jboss/as/controller/logging/ControllerLogger.java", "license": "lgpl-2.1", "size": 164970 }
[ "org.jboss.logging.annotations.Message" ]
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.*;
[ "org.jboss.logging" ]
org.jboss.logging;
79,058
public X509Credential createCredential(X509Certificate[] certs, PrivateKey privateKey, int bits, int lifetime, GSIConstants.CertificateType certType) throws GeneralSecurityException { return createCredential(certs, privateKey, bits, lifetime, certType, (X509Extensions) null, null); }
X509Credential function(X509Certificate[] certs, PrivateKey privateKey, int bits, int lifetime, GSIConstants.CertificateType certType) throws GeneralSecurityException { return createCredential(certs, privateKey, bits, lifetime, certType, (X509Extensions) null, null); }
/** * Creates a new proxy credential from the specified certificate chain and a private key. * * @see #createCredential(X509Certificate[], PrivateKey, int, int, GSIConstants.CertificateType, Extensions, String) * createCredential */
Creates a new proxy credential from the specified certificate chain and a private key
createCredential
{ "repo_name": "jrevillard/JGlobus", "path": "ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java", "license": "apache-2.0", "size": 34526 }
[ "java.security.GeneralSecurityException", "java.security.PrivateKey", "java.security.cert.X509Certificate", "org.bouncycastle.asn1.x509.X509Extensions", "org.globus.gsi.GSIConstants", "org.globus.gsi.X509Credential" ]
import java.security.GeneralSecurityException; import java.security.PrivateKey; import java.security.cert.X509Certificate; import org.bouncycastle.asn1.x509.X509Extensions; import org.globus.gsi.GSIConstants; import org.globus.gsi.X509Credential;
import java.security.*; import java.security.cert.*; import org.bouncycastle.asn1.x509.*; import org.globus.gsi.*;
[ "java.security", "org.bouncycastle.asn1", "org.globus.gsi" ]
java.security; org.bouncycastle.asn1; org.globus.gsi;
838,878
EClass getMedication();
EClass getMedication();
/** * Returns the meta object for class '{@link org.openhealthtools.mdht.uml.cda.hitsp.Medication <em>Medication</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Medication</em>'. * @see org.openhealthtools.mdht.uml.cda.hitsp.Medication * @generated */
Returns the meta object for class '<code>org.openhealthtools.mdht.uml.cda.hitsp.Medication Medication</code>'.
getMedication
{ "repo_name": "drbgfc/mdht", "path": "cda/deprecated/org.openhealthtools.mdht.uml.cda.hitsp/src/org/openhealthtools/mdht/uml/cda/hitsp/HITSPPackage.java", "license": "epl-1.0", "size": 366422 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
271,881
public static <T> T findEnclosingNode(TreePath path, Class<T> klass) { path = findPathFromEnclosingNodeToTopLevel(path, klass); return (path == null) ? null : klass.cast(path.getLeaf()); }
static <T> T function(TreePath path, Class<T> klass) { path = findPathFromEnclosingNodeToTopLevel(path, klass); return (path == null) ? null : klass.cast(path.getLeaf()); }
/** * Given a TreePath, walks up the tree until it finds a node of the given type. */
Given a TreePath, walks up the tree until it finds a node of the given type
findEnclosingNode
{ "repo_name": "davidzchen/error-prone", "path": "core/src/main/java/com/google/errorprone/util/ASTHelpers.java", "license": "apache-2.0", "size": 22661 }
[ "com.sun.source.util.TreePath" ]
import com.sun.source.util.TreePath;
import com.sun.source.util.*;
[ "com.sun.source" ]
com.sun.source;
121,881
public void setParserPool(ParserPool pool) { parser = pool; }
void function(ParserPool pool) { parser = pool; }
/** * Sets the pool of parsers to use to parse XML. * * @param pool pool of parsers to use to parse XML */
Sets the pool of parsers to use to parse XML
setParserPool
{ "repo_name": "lamsfoundation/lams", "path": "3rdParty_sources/opensaml/org/opensaml/saml2/metadata/provider/AbstractMetadataProvider.java", "license": "gpl-2.0", "size": 24923 }
[ "org.opensaml.xml.parse.ParserPool" ]
import org.opensaml.xml.parse.ParserPool;
import org.opensaml.xml.parse.*;
[ "org.opensaml.xml" ]
org.opensaml.xml;
1,072,162
public int generate(Graph graph, int expectedNumEdges) { return generate(graph,graph.getVertices(),expectedNumEdges); }
int function(Graph graph, int expectedNumEdges) { return generate(graph,graph.getVertices(),expectedNumEdges); }
/** * Generates a synthetic network connecting all vertices in the provided graph with the expected number * of edges. * * @param graph * @param expectedNumEdges * @return The number of generated edges. Not that this number may not be equal to the expected number of edges */
Generates a synthetic network connecting all vertices in the provided graph with the expected number of edges
generate
{ "repo_name": "qiuqiyuan/titan", "path": "titan-test/src/main/java/com/tinkerpop/furnace/alpha/generators/DistributionGenerator.java", "license": "apache-2.0", "size": 5700 }
[ "com.tinkerpop.blueprints.Graph" ]
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.*;
[ "com.tinkerpop.blueprints" ]
com.tinkerpop.blueprints;
279,109
public List<COSObject> getObjectsByType(COSName type) throws IOException { List<COSObject> retval = new ArrayList<COSObject>(); for (COSObject object : objectPool.values()) { COSBase realObject = object.getObject(); if (realObject instanceof COSDictionary) { try { COSDictionary dic = (COSDictionary) realObject; COSName objectType = (COSName) dic.getItem(COSName.TYPE); if ((objectType != null) && objectType.equals(type)) { retval.add(object); } } catch (ClassCastException e) { LOG.warn(e, e); } } } return retval; }
List<COSObject> function(COSName type) throws IOException { List<COSObject> retval = new ArrayList<COSObject>(); for (COSObject object : objectPool.values()) { COSBase realObject = object.getObject(); if (realObject instanceof COSDictionary) { try { COSDictionary dic = (COSDictionary) realObject; COSName objectType = (COSName) dic.getItem(COSName.TYPE); if ((objectType != null) && objectType.equals(type)) { retval.add(object); } } catch (ClassCastException e) { LOG.warn(e, e); } } } return retval; }
/** * This will get a dictionary object by type. * * @param type The type of the object. * * @return This will return an object with the specified type. * @throws IOException If there is an error getting the object */
This will get a dictionary object by type
getObjectsByType
{ "repo_name": "sencko/NALB", "path": "nalb2013/src/org/apache/pdfbox/cos/COSDocument.java", "license": "gpl-2.0", "size": 20245 }
[ "java.io.IOException", "java.util.ArrayList", "java.util.List" ]
import java.io.IOException; import java.util.ArrayList; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,462,593
void flush() throws IOException;
void flush() throws IOException;
/** * Flushes any resources opened for output by this file manager * directly or indirectly. Flushing a closed file manager has no * effect. * * @throws IOException if an I/O error occurred * @see #close */
Flushes any resources opened for output by this file manager directly or indirectly. Flushing a closed file manager has no effect
flush
{ "repo_name": "shun634501730/java_source_cn", "path": "src_en/javax/tools/JavaFileManager.java", "license": "apache-2.0", "size": 16600 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,685,607
public org.LexGrid.LexBIG.iso21090.DataModel.Collections.AssociationList getHierarchyLevelNext(org.LexGrid.LexBIG.iso21090.DataModel.cagrid.HierarchyResolutionPolicy hierarchyResolutionPolicy,org.LexGrid.LexBIG.iso21090.DataModel.cagrid.CodingSchemeIdentification codingSchemeIdentification,org.LexGrid.LexBIG.iso21090.DataModel.Core.CodingSchemeVersionOrTag versionOrTag) throws RemoteException, org.LexGrid.LexBIG.cagrid.LexEVSGridService.stubs.types.InvalidServiceContextAccess, org.LexGrid.LexBIG.cagrid.LexEVSGridService.stubs.types.LBException ;
org.LexGrid.LexBIG.iso21090.DataModel.Collections.AssociationList function(org.LexGrid.LexBIG.iso21090.DataModel.cagrid.HierarchyResolutionPolicy hierarchyResolutionPolicy,org.LexGrid.LexBIG.iso21090.DataModel.cagrid.CodingSchemeIdentification codingSchemeIdentification,org.LexGrid.LexBIG.iso21090.DataModel.Core.CodingSchemeVersionOrTag versionOrTag) throws RemoteException, org.LexGrid.LexBIG.cagrid.LexEVSGridService.stubs.types.InvalidServiceContextAccess, org.LexGrid.LexBIG.cagrid.LexEVSGridService.stubs.types.LBException ;
/** * Return a representation of associations between a concept and its immediate decendents. The resolved association list represents the next branch of the hierarchy when visualized in a top (root) to bottom (leaf) representation. * * @param hierarchyResolutionPolicy * @param codingSchemeIdentification * @param versionOrTag * @throws InvalidServiceContextAccess * * @throws LBException * */
Return a representation of associations between a concept and its immediate decendents. The resolved association list represents the next branch of the hierarchy when visualized in a top (root) to bottom (leaf) representation
getHierarchyLevelNext
{ "repo_name": "NCIP/lexevs-grid", "path": "LexEVSAnalyiticalService/src/org/LexGrid/LexBIG/cagrid/LexEVSGridService/LexBIGServiceConvenienceMethods/common/LexBIGServiceConvenienceMethodsI.java", "license": "bsd-3-clause", "size": 18479 }
[ "java.rmi.RemoteException" ]
import java.rmi.RemoteException;
import java.rmi.*;
[ "java.rmi" ]
java.rmi;
2,029,301
@JsonProperty( "max_simult_tcp_sessions_per_host" ) public void setMaxSimultTcpSessionsPerHost( String maxSimultTcpSessionsPerHost ) { this.maxSimultTcpSessionsPerHost = maxSimultTcpSessionsPerHost; }
@JsonProperty( STR ) void function( String maxSimultTcpSessionsPerHost ) { this.maxSimultTcpSessionsPerHost = maxSimultTcpSessionsPerHost; }
/** * Sets max simult tcp sessions per host. * * @param maxSimultTcpSessionsPerHost the max simult tcp sessions per host */
Sets max simult tcp sessions per host
setMaxSimultTcpSessionsPerHost
{ "repo_name": "tenable/Tenable.io-SDK-for-Java", "path": "src/main/java/com/tenable/io/api/policies/models/PolicySettings.java", "license": "mit", "size": 90382 }
[ "com.fasterxml.jackson.annotation.JsonProperty" ]
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.*;
[ "com.fasterxml.jackson" ]
com.fasterxml.jackson;
1,164,851
public void requestRemoveNodesStart() { this.enqueue(new RemoveNodeMessageClass().doRequestStart(true)); }
void function() { this.enqueue(new RemoveNodeMessageClass().doRequestStart(true)); }
/** * Puts the controller into exclusion mode to remove new nodes * */
Puts the controller into exclusion mode to remove new nodes
requestRemoveNodesStart
{ "repo_name": "mickey4u/new_mart", "path": "addons/binding/org.openhab.binding.zwave/src/main/java/org/openhab/binding/zwave/internal/protocol/ZWaveController.java", "license": "epl-1.0", "size": 56021 }
[ "org.openhab.binding.zwave.internal.protocol.serialmessage.RemoveNodeMessageClass" ]
import org.openhab.binding.zwave.internal.protocol.serialmessage.RemoveNodeMessageClass;
import org.openhab.binding.zwave.internal.protocol.serialmessage.*;
[ "org.openhab.binding" ]
org.openhab.binding;
238,597
@Test public void testGetValue () { assertEquals(Integer.valueOf(2), season.getValue()); }
void function () { assertEquals(Integer.valueOf(2), season.getValue()); }
/** * Test method for {@link Parameter#getValue()}. */
Test method for <code>Parameter#getValue()</code>
testGetValue
{ "repo_name": "AlexRNL/jSeries", "path": "src/test/java/com/alexrnl/jseries/request/parameters/SeasonTest.java", "license": "bsd-3-clause", "size": 696 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,121,173
public boolean startDrag(int position, View floatView, int dragFlags, int deltaX, int deltaY) { if (mDragState != IDLE || !mInTouchEvent || mFloatView != null || floatView == null || !mDragEnabled) { return false; } if (getParent() != null) { getParent().requestDisallowInterceptTouchEvent(true); } int pos = position + getHeaderViewsCount(); mFirstExpPos = pos; mSecondExpPos = pos; mSrcPos = pos; mFloatPos = pos; mDragState = DRAGGING; mDragFlags = 0; mDragFlags |= dragFlags; mFloatView = floatView; measureFloatView(); // sets mFloatViewHeight mDragDeltaX = deltaX; mDragDeltaY = deltaY; mFloatLoc.x = mX - mDragDeltaX; mFloatLoc.y = mY - mDragDeltaY; // set src item invisible final View srcItem = getChildAt(mSrcPos - getFirstVisiblePosition()); if (srcItem != null) { srcItem.setVisibility(View.INVISIBLE); } if (mTrackDragSort) { mDragSortTracker.startTracking(); } // once float view is created, events are no longer passed // to ListView switch (mCancelMethod) { case ON_TOUCH_EVENT: super.onTouchEvent(mCancelEvent); break; case ON_INTERCEPT_TOUCH_EVENT: super.onInterceptTouchEvent(mCancelEvent); break; } requestLayout(); if (mLiftAnimator != null) { mLiftAnimator.start(); } return true; }
boolean function(int position, View floatView, int dragFlags, int deltaX, int deltaY) { if (mDragState != IDLE !mInTouchEvent mFloatView != null floatView == null !mDragEnabled) { return false; } if (getParent() != null) { getParent().requestDisallowInterceptTouchEvent(true); } int pos = position + getHeaderViewsCount(); mFirstExpPos = pos; mSecondExpPos = pos; mSrcPos = pos; mFloatPos = pos; mDragState = DRAGGING; mDragFlags = 0; mDragFlags = dragFlags; mFloatView = floatView; measureFloatView(); mDragDeltaX = deltaX; mDragDeltaY = deltaY; mFloatLoc.x = mX - mDragDeltaX; mFloatLoc.y = mY - mDragDeltaY; final View srcItem = getChildAt(mSrcPos - getFirstVisiblePosition()); if (srcItem != null) { srcItem.setVisibility(View.INVISIBLE); } if (mTrackDragSort) { mDragSortTracker.startTracking(); } switch (mCancelMethod) { case ON_TOUCH_EVENT: super.onTouchEvent(mCancelEvent); break; case ON_INTERCEPT_TOUCH_EVENT: super.onInterceptTouchEvent(mCancelEvent); break; } requestLayout(); if (mLiftAnimator != null) { mLiftAnimator.start(); } return true; }
/** * Start a drag of item at <code>position</code> without using * a FloatViewManager. * * @param position Item to drag. * @param floatView Floating View. * @param dragFlags Flags that restrict some movements of the * floating View. For example, set <code>dragFlags |= * ~{@link #DRAG_NEG_X}</code> to allow dragging the floating * View in all directions except off the screen to the left. * @param deltaX Offset in x of the touch coordinate from the * left edge of the floating View (i.e. touch-x minus float View * left). * @param deltaY Offset in y of the touch coordinate from the * top edge of the floating View (i.e. touch-y minus float View * top). * * @return True if the drag was started, false otherwise. This * <code>startDrag</code> will fail if we are not currently in * a touch event, <code>floatView</code> is null, or there is * a drag in progress. */
Start a drag of item at <code>position</code> without using a FloatViewManager
startDrag
{ "repo_name": "HamishONE/trackbus", "path": "src/drag_sort_list/src/com/mobeta/android/dslv/DragSortListView.java", "license": "gpl-3.0", "size": 97945 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
174,537
public void testConcurrentRenameDeleteDestinationRemote() throws Exception { for (int i = 0; i < REPEAT_CNT; i++) { final CyclicBarrier barrier = new CyclicBarrier(2); create(igfsSecondary, paths(DIR, SUBDIR, DIR_NEW), paths());
void function() throws Exception { for (int i = 0; i < REPEAT_CNT; i++) { final CyclicBarrier barrier = new CyclicBarrier(2); create(igfsSecondary, paths(DIR, SUBDIR, DIR_NEW), paths());
/** * Ensure that in case we rename the folder A to B and delete B at the same time, FS consistency is not compromised. * Initially file system entries are created only in the secondary file system. * * @throws Exception If failed. */
Ensure that in case we rename the folder A to B and delete B at the same time, FS consistency is not compromised. Initially file system entries are created only in the secondary file system
testConcurrentRenameDeleteDestinationRemote
{ "repo_name": "leveyj/ignite", "path": "modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsDualAbstractSelfTest.java", "license": "apache-2.0", "size": 57049 }
[ "java.util.concurrent.CyclicBarrier" ]
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,117,103
public static SharedPreferences readPreferences(Context context){ return PreferenceManager.getDefaultSharedPreferences(context); }
static SharedPreferences function(Context context){ return PreferenceManager.getDefaultSharedPreferences(context); }
/** * Gets a SharedPreferences instance that points to the default file that is used by the preference framework in the given context * @param context * @return SharedPreferences instance that can be used to retrieve and listen to values of the preferences */
Gets a SharedPreferences instance that points to the default file that is used by the preference framework in the given context
readPreferences
{ "repo_name": "vanla/WalkishAndroidApp", "path": "app/src/main/java/dv606/eo222fw/walkish/Utils.java", "license": "mit", "size": 9207 }
[ "android.content.Context", "android.content.SharedPreferences", "android.preference.PreferenceManager" ]
import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager;
import android.content.*; import android.preference.*;
[ "android.content", "android.preference" ]
android.content; android.preference;
165,434
public void initializeBoxes() { nBox.add(lblParameterN); nBox.add(Box.createVerticalStrut(10)); nBox.add(tfParameterN); mBox.add(lblParameterM); mBox.add(Box.createVerticalStrut(10)); mBox.add(tfParameterM); parametersBox.add(nBox); parametersBox.add(Box.createHorizontalStrut(20)); parametersBox.add(mBox); buttonBox.add(btnOK); buttonBox.add(Box.createHorizontalStrut(20)); buttonBox.add(btnCancel); }
void function() { nBox.add(lblParameterN); nBox.add(Box.createVerticalStrut(10)); nBox.add(tfParameterN); mBox.add(lblParameterM); mBox.add(Box.createVerticalStrut(10)); mBox.add(tfParameterM); parametersBox.add(nBox); parametersBox.add(Box.createHorizontalStrut(20)); parametersBox.add(mBox); buttonBox.add(btnOK); buttonBox.add(Box.createHorizontalStrut(20)); buttonBox.add(btnCancel); }
/** * Metoda inicijalizuje i popunjava sve Box kontejnere koji se nalaze na * prozoru. */
Metoda inicijalizuje i popunjava sve Box kontejnere koji se nalaze na prozoru
initializeBoxes
{ "repo_name": "delicb/ExGerm", "path": "GraphGenerator/tk/exgerm/graphgenerator/GraphGenerator.java", "license": "apache-2.0", "size": 12089 }
[ "javax.swing.Box" ]
import javax.swing.Box;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
1,063,909
public static List<ColumnChange> createAddUpdateDeleteColumnChange(){ ColumnChange add = new ColumnChange(); add.setOldColumnId(null); add.setNewColumnId("111"); ColumnChange update = new ColumnChange(); update.setOldColumnId("222"); update.setNewColumnId("333"); ColumnChange delete = new ColumnChange(); delete.setOldColumnId("444"); delete.setNewColumnId(null); return Lists.newArrayList(add, update, delete); }
static List<ColumnChange> function(){ ColumnChange add = new ColumnChange(); add.setOldColumnId(null); add.setNewColumnId("111"); ColumnChange update = new ColumnChange(); update.setOldColumnId("222"); update.setNewColumnId("333"); ColumnChange delete = new ColumnChange(); delete.setOldColumnId("444"); delete.setNewColumnId(null); return Lists.newArrayList(add, update, delete); }
/** * Create a column change request that includes and add, update, and delete. * * @return */
Create a column change request that includes and add, update, and delete
createAddUpdateDeleteColumnChange
{ "repo_name": "xschildw/Synapse-Repository-Services", "path": "lib/lib-test/src/main/java/org/sagebionetworks/repo/model/dbo/dao/table/TableModelTestUtils.java", "license": "apache-2.0", "size": 21582 }
[ "com.google.common.collect.Lists", "java.util.List", "org.sagebionetworks.repo.model.table.ColumnChange" ]
import com.google.common.collect.Lists; import java.util.List; import org.sagebionetworks.repo.model.table.ColumnChange;
import com.google.common.collect.*; import java.util.*; import org.sagebionetworks.repo.model.table.*;
[ "com.google.common", "java.util", "org.sagebionetworks.repo" ]
com.google.common; java.util; org.sagebionetworks.repo;
1,116,707
public static MetadataSnapshot readMetadataSnapshot(Path indexLocation, ShardId shardId, NodeEnvironment.ShardLocker shardLocker, Logger logger) throws IOException { try (ShardLock lock = shardLocker.lock(shardId, TimeUnit.SECONDS.toMillis(5)); Directory dir = new SimpleFSDirectory(indexLocation)) { failIfCorrupted(dir, shardId); return new MetadataSnapshot(null, dir, logger); } catch (IndexNotFoundException ex) { // that's fine - happens all the time no need to log } catch (FileNotFoundException | NoSuchFileException ex) { logger.info("Failed to open / find files while reading metadata snapshot"); } catch (ShardLockObtainFailedException ex) { logger.info((Supplier<?>) () -> new ParameterizedMessage("{}: failed to obtain shard lock", shardId), ex); } return MetadataSnapshot.EMPTY; }
static MetadataSnapshot function(Path indexLocation, ShardId shardId, NodeEnvironment.ShardLocker shardLocker, Logger logger) throws IOException { try (ShardLock lock = shardLocker.lock(shardId, TimeUnit.SECONDS.toMillis(5)); Directory dir = new SimpleFSDirectory(indexLocation)) { failIfCorrupted(dir, shardId); return new MetadataSnapshot(null, dir, logger); } catch (IndexNotFoundException ex) { } catch (FileNotFoundException NoSuchFileException ex) { logger.info(STR); } catch (ShardLockObtainFailedException ex) { logger.info((Supplier<?>) () -> new ParameterizedMessage(STR, shardId), ex); } return MetadataSnapshot.EMPTY; }
/** * Reads a MetadataSnapshot from the given index locations or returns an empty snapshot if it can't be read. * * @throws IOException if the index we try to read is corrupted */
Reads a MetadataSnapshot from the given index locations or returns an empty snapshot if it can't be read
readMetadataSnapshot
{ "repo_name": "liweinan0423/elasticsearch", "path": "core/src/main/java/org/elasticsearch/index/store/Store.java", "license": "apache-2.0", "size": 64369 }
[ "java.io.FileNotFoundException", "java.io.IOException", "java.nio.file.NoSuchFileException", "java.nio.file.Path", "java.util.concurrent.TimeUnit", "org.apache.logging.log4j.Logger", "org.apache.logging.log4j.message.ParameterizedMessage", "org.apache.logging.log4j.util.Supplier", "org.apache.lucene.index.IndexNotFoundException", "org.apache.lucene.store.Directory", "org.apache.lucene.store.SimpleFSDirectory", "org.elasticsearch.env.NodeEnvironment", "org.elasticsearch.env.ShardLock", "org.elasticsearch.env.ShardLockObtainFailedException", "org.elasticsearch.index.shard.ShardId" ]
import java.io.FileNotFoundException; import java.io.IOException; import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.util.concurrent.TimeUnit; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.logging.log4j.util.Supplier; import org.apache.lucene.index.IndexNotFoundException; import org.apache.lucene.store.Directory; import org.apache.lucene.store.SimpleFSDirectory; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.ShardLock; import org.elasticsearch.env.ShardLockObtainFailedException; import org.elasticsearch.index.shard.ShardId;
import java.io.*; import java.nio.file.*; import java.util.concurrent.*; import org.apache.logging.log4j.*; import org.apache.logging.log4j.message.*; import org.apache.logging.log4j.util.*; import org.apache.lucene.index.*; import org.apache.lucene.store.*; import org.elasticsearch.env.*; import org.elasticsearch.index.shard.*;
[ "java.io", "java.nio", "java.util", "org.apache.logging", "org.apache.lucene", "org.elasticsearch.env", "org.elasticsearch.index" ]
java.io; java.nio; java.util; org.apache.logging; org.apache.lucene; org.elasticsearch.env; org.elasticsearch.index;
212,526
public void openTray(DialogTray tray) throws IllegalStateException, UnsupportedOperationException { if (tray == null) { throw new NullPointerException("Tray was null"); //$NON-NLS-1$ } if (getTray() != null) { throw new IllegalStateException("Tray was already open"); //$NON-NLS-1$ } if (!isCompatibleLayout(getShell().getLayout())) { throw new UnsupportedOperationException("Trays not supported with custom layouts"); //$NON-NLS-1$ } final Shell shell = getShell(); Control focusControl = shell.getDisplay().getFocusControl(); if (focusControl != null && isContained(shell, focusControl)) { nonTrayFocusControl = focusControl; }
void function(DialogTray tray) throws IllegalStateException, UnsupportedOperationException { if (tray == null) { throw new NullPointerException(STR); } if (getTray() != null) { throw new IllegalStateException(STR); } if (!isCompatibleLayout(getShell().getLayout())) { throw new UnsupportedOperationException(STR); } final Shell shell = getShell(); Control focusControl = shell.getDisplay().getFocusControl(); if (focusControl != null && isContained(shell, focusControl)) { nonTrayFocusControl = focusControl; }
/** * Constructs the tray's widgets and displays the tray in this dialog. The * dialog's size will be adjusted to accommodate the tray. * * @param tray the tray to show in this dialog * @throws IllegalStateException if the dialog already has a tray open * @throws UnsupportedOperationException if the dialog does not support trays, * for example if it uses a custom layout. */
Constructs the tray's widgets and displays the tray in this dialog. The dialog's size will be adjusted to accommodate the tray
openTray
{ "repo_name": "AntoineDelacroix/NewSuperProject-", "path": "org.eclipse.jface/src/org/eclipse/jface/dialogs/TrayDialog.java", "license": "gpl-2.0", "size": 16588 }
[ "org.eclipse.swt.widgets.Control", "org.eclipse.swt.widgets.Shell" ]
import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
2,358,693
public static Iterable<PathFragment> j2objcSourceHeaderSearchPaths(RuleContext ruleContext, PathFragment objcFileRootExecPath, Iterable<Artifact> sourcesToTranslate) { PathFragment genRoot = ruleContext.getConfiguration().getGenfilesFragment(); ImmutableList.Builder<PathFragment> headerSearchPaths = ImmutableList.builder(); headerSearchPaths.add(objcFileRootExecPath); // We add another header search path with gen root if we have generated sources to translate. for (Artifact sourceToTranslate : sourcesToTranslate) { if (!sourceToTranslate.isSourceArtifact()) { headerSearchPaths.add(objcFileRootExecPath.getRelative(genRoot)); return headerSearchPaths.build(); } } return headerSearchPaths.build(); }
static Iterable<PathFragment> function(RuleContext ruleContext, PathFragment objcFileRootExecPath, Iterable<Artifact> sourcesToTranslate) { PathFragment genRoot = ruleContext.getConfiguration().getGenfilesFragment(); ImmutableList.Builder<PathFragment> headerSearchPaths = ImmutableList.builder(); headerSearchPaths.add(objcFileRootExecPath); for (Artifact sourceToTranslate : sourcesToTranslate) { if (!sourceToTranslate.isSourceArtifact()) { headerSearchPaths.add(objcFileRootExecPath.getRelative(genRoot)); return headerSearchPaths.build(); } } return headerSearchPaths.build(); }
/** * Returns header search paths necessary to compile the J2ObjC-generated code from a single * target. * * @param ruleContext the rule context * @param objcFileRootExecPath the exec path under which all J2ObjC-generated file resides * @param sourcesToTranslate the source files to be translated by J2ObjC in a single target */
Returns header search paths necessary to compile the J2ObjC-generated code from a single target
j2objcSourceHeaderSearchPaths
{ "repo_name": "aehlig/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/objc/J2ObjcLibrary.java", "license": "apache-2.0", "size": 8777 }
[ "com.google.common.collect.ImmutableList", "com.google.devtools.build.lib.actions.Artifact", "com.google.devtools.build.lib.analysis.RuleContext", "com.google.devtools.build.lib.vfs.PathFragment" ]
import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.common.collect.*; import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.vfs.*;
[ "com.google.common", "com.google.devtools" ]
com.google.common; com.google.devtools;
967,656
public boolean contains (Position p) { double lat = p.getLatitude(); if (lat > _maxLat || lat < _minLat) return false; double lon = AngleUtilities.intoRangeDegrees(_centerLon, p.getLongitude()); if (lon > _maxLon || lon < _minLon) return false; return true; }
boolean function (Position p) { double lat = p.getLatitude(); if (lat > _maxLat lat < _minLat) return false; double lon = AngleUtilities.intoRangeDegrees(_centerLon, p.getLongitude()); if (lon > _maxLon lon < _minLon) return false; return true; }
/** * Indicates if this rectangle contains the given position. Elevation is * ignored for containment purposes (perhaps TODO could be to allow for * elevation min and max, if needed). */
Indicates if this rectangle contains the given position. Elevation is ignored for containment purposes (perhaps TODO could be to allow for elevation min and max, if needed)
contains
{ "repo_name": "unchartedsoftware/ensemble-clustering", "path": "ensemble-clustering/src/main/java/com/oculusinfo/geometry/geodesic/WrappingRectangle.java", "license": "mit", "size": 5344 }
[ "com.oculusinfo.math.algebra.AngleUtilities" ]
import com.oculusinfo.math.algebra.AngleUtilities;
import com.oculusinfo.math.algebra.*;
[ "com.oculusinfo.math" ]
com.oculusinfo.math;
2,279,018
Context getContext();
Context getContext();
/** * Returns the context, which is used by the tab switcher. * * @return The context, which is used by the tab switcher, as an instance of the class {@link * Context}. The context may not be null */
Returns the context, which is used by the tab switcher
getContext
{ "repo_name": "michael-rapp/ChromeLikeTabSwitcher", "path": "library/src/main/java/de/mrapp/android/tabswitcher/model/Model.java", "license": "apache-2.0", "size": 56796 }
[ "android.content.Context" ]
import android.content.Context;
import android.content.*;
[ "android.content" ]
android.content;
1,966,182
pos = 0; return DbConstants.DB_MULTIPLE; }
pos = 0; return DbConstants.DB_MULTIPLE; }
/** * Return the bulk retrieval flag and reset the entry position so that the * next set of key/data can be returned. */
Return the bulk retrieval flag and reset the entry position so that the next set of key/data can be returned
getMultiFlag
{ "repo_name": "racker/omnibus", "path": "source/db-5.0.26.NC/java/src/com/sleepycat/db/MultipleDataEntry.java", "license": "apache-2.0", "size": 4766 }
[ "com.sleepycat.db.internal.DbConstants" ]
import com.sleepycat.db.internal.DbConstants;
import com.sleepycat.db.internal.*;
[ "com.sleepycat.db" ]
com.sleepycat.db;
860,358
public ModelAndView displayLookupWorkgroups(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String view = "LookupWorkgroups"; LOG.debug("remoteUser: "+request.getRemoteUser()); Map<String, Object> model = new HashMap<String, Object>(); return new ModelAndView(view, model); } /** * This method retrieves the NotificationMessageDelivery given an HttpServletRequest which * may contain EITHER a message delivery id or a workflow doc id. Therefore, this is a * "special case" for handling the workflow deliverer. * @param request the incoming {@link HttpServletRequest}
ModelAndView function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String view = STR; LOG.debug(STR+request.getRemoteUser()); Map<String, Object> model = new HashMap<String, Object>(); return new ModelAndView(view, model); } /** * This method retrieves the NotificationMessageDelivery given an HttpServletRequest which * may contain EITHER a message delivery id or a workflow doc id. Therefore, this is a * STR for handling the workflow deliverer. * @param request the incoming {@link HttpServletRequest}
/** * This method displays the workgroup lookup screen. * @param request * @param response * @return * @throws ServletException * @throws IOException */
This method displays the workgroup lookup screen
displayLookupWorkgroups
{ "repo_name": "bhutchinson/rice", "path": "rice-middleware/impl/src/main/java/org/kuali/rice/ken/web/spring/NotificationController.java", "license": "apache-2.0", "size": 18459 }
[ "java.io.IOException", "java.util.HashMap", "java.util.Map", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.kuali.rice.ken.bo.NotificationMessageDelivery", "org.springframework.web.servlet.ModelAndView" ]
import java.io.IOException; import java.util.HashMap; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.kuali.rice.ken.bo.NotificationMessageDelivery; import org.springframework.web.servlet.ModelAndView;
import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import org.kuali.rice.ken.bo.*; import org.springframework.web.servlet.*;
[ "java.io", "java.util", "javax.servlet", "org.kuali.rice", "org.springframework.web" ]
java.io; java.util; javax.servlet; org.kuali.rice; org.springframework.web;
2,696,382
Set<String> allNames();
Set<String> allNames();
/** * Returns all of the name strings that this checker should respect as part of a * {@code @SuppressWarnings} annotation. */
Returns all of the name strings that this checker should respect as part of a @SuppressWarnings annotation
allNames
{ "repo_name": "Anish2/error-prone", "path": "core/src/main/java/com/google/errorprone/matchers/Suppressible.java", "license": "apache-2.0", "size": 1455 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,751,113
public Properties toProperties(String name) { return toProperties(name, new Properties()); }
Properties function(String name) { return toProperties(name, new Properties()); }
/** * Convert a section of the config to a Properties object. * * @param name * @return */
Convert a section of the config to a Properties object
toProperties
{ "repo_name": "fredrik-rambris/rambris-commons", "path": "src/main/java/com/rambris/Config.java", "license": "apache-2.0", "size": 2905 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
2,362,032
EClass getClosureDeclaration();
EClass getClosureDeclaration();
/** * Returns the meta object for class '{@link org.eclectic.frontend.core.ClosureDeclaration <em>Closure Declaration</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Closure Declaration</em>'. * @see org.eclectic.frontend.core.ClosureDeclaration * @generated */
Returns the meta object for class '<code>org.eclectic.frontend.core.ClosureDeclaration Closure Declaration</code>'.
getClosureDeclaration
{ "repo_name": "jesusc/eclectic", "path": "plugins/org.eclectic.frontend.asm/src-gen/org/eclectic/frontend/core/CorePackage.java", "license": "gpl-3.0", "size": 187193 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,635,904